Commit 49915a54 authored by Axel Lin's avatar Axel Lin Committed by Mark Brown

ASoC: Convert kirkwood-t5325 to use snd_soc_register_card()

Use snd_soc_register_card() instead of creating a "soc-audio" platform device.
Signed-off-by: default avatarAxel Lin <axel.lin@gmail.com>
Signed-off-by: default avatarMark Brown <broonie@opensource.wolfsonmicro.com>
parent dc9c7454
...@@ -106,6 +106,11 @@ static struct platform_device hp_t5325_button_device = { ...@@ -106,6 +106,11 @@ static struct platform_device hp_t5325_button_device = {
} }
}; };
static struct platform_device hp_t5325_audio_device = {
.name = "t5325-audio",
.id = -1,
};
static unsigned int hp_t5325_mpp_config[] __initdata = { static unsigned int hp_t5325_mpp_config[] __initdata = {
MPP0_NF_IO2, MPP0_NF_IO2,
MPP1_SPI_MOSI, MPP1_SPI_MOSI,
...@@ -179,6 +184,7 @@ static void __init hp_t5325_init(void) ...@@ -179,6 +184,7 @@ static void __init hp_t5325_init(void)
kirkwood_sata_init(&hp_t5325_sata_data); kirkwood_sata_init(&hp_t5325_sata_data);
kirkwood_ehci_init(); kirkwood_ehci_init();
platform_device_register(&hp_t5325_button_device); platform_device_register(&hp_t5325_button_device);
platform_device_register(&hp_t5325_audio_device);
i2c_register_board_info(0, i2c_board_info, ARRAY_SIZE(i2c_board_info)); i2c_register_board_info(0, i2c_board_info, ARRAY_SIZE(i2c_board_info));
kirkwood_audio_init(); kirkwood_audio_init();
......
...@@ -80,7 +80,6 @@ static struct snd_soc_dai_link t5325_dai[] = { ...@@ -80,7 +80,6 @@ static struct snd_soc_dai_link t5325_dai[] = {
}, },
}; };
static struct snd_soc_card t5325 = { static struct snd_soc_card t5325 = {
.name = "t5325", .name = "t5325",
.owner = THIS_MODULE, .owner = THIS_MODULE,
...@@ -93,38 +92,40 @@ static struct snd_soc_card t5325 = { ...@@ -93,38 +92,40 @@ static struct snd_soc_card t5325 = {
.num_dapm_routes = ARRAY_SIZE(t5325_route), .num_dapm_routes = ARRAY_SIZE(t5325_route),
}; };
static struct platform_device *t5325_snd_device; static int __devinit t5325_probe(struct platform_device *pdev)
static int __init t5325_init(void)
{ {
struct snd_soc_card *card = &t5325;
int ret; int ret;
if (!machine_is_t5325()) card->dev = &pdev->dev;
return 0;
t5325_snd_device = platform_device_alloc("soc-audio", -1);
if (!t5325_snd_device)
return -ENOMEM;
platform_set_drvdata(t5325_snd_device,
&t5325);
ret = platform_device_add(t5325_snd_device);
if (ret) {
printk(KERN_ERR "%s: platform_device_add failed\n", __func__);
platform_device_put(t5325_snd_device);
}
ret = snd_soc_register_card(card);
if (ret)
dev_err(&pdev->dev, "snd_soc_register_card() failed: %d\n",
ret);
return ret; return ret;
} }
module_init(t5325_init);
static void __exit t5325_exit(void) static int __devexit t5325_remove(struct platform_device *pdev)
{ {
platform_device_unregister(t5325_snd_device); struct snd_soc_card *card = platform_get_drvdata(pdev);
snd_soc_unregister_card(card);
return 0;
} }
module_exit(t5325_exit);
static struct platform_driver t5325_driver = {
.driver = {
.name = "t5325-audio",
.owner = THIS_MODULE,
},
.probe = t5325_probe,
.remove = __devexit_p(t5325_remove),
};
module_platform_driver(t5325_driver);
MODULE_AUTHOR("Arnaud Patard <arnaud.patard@rtp-net.org>"); MODULE_AUTHOR("Arnaud Patard <arnaud.patard@rtp-net.org>");
MODULE_DESCRIPTION("ALSA SoC t5325 audio client"); MODULE_DESCRIPTION("ALSA SoC t5325 audio client");
MODULE_LICENSE("GPL"); MODULE_LICENSE("GPL");
MODULE_ALIAS("platform:t5325-audio");
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment