diff options
author | Ricardo Neri <ricardo.neri@ti.com> | 2011-07-24 21:00:11 +0100 |
---|---|---|
committer | Andy Green <andy.green@linaro.org> | 2011-08-25 07:38:15 +0100 |
commit | 85dbee2e1cb8acfb074731a49de4fd22139484de (patch) | |
tree | ba802fefb247559b8851b748a0c4957dec50b57c /sound | |
parent | b8f9cf4e08b15d43f88ae6726fb0f891ab649273 (diff) |
ASoC: OMAP4: Add Machine driver for HDMI for SDP and Panda
Add machine driver for HDMI on OMAP4 for SDP and Panda boards.
Signed-off-by: Ricardo Neri <ricardo.neri@ti.com>
Diffstat (limited to 'sound')
-rw-r--r-- | sound/soc/omap/omap4-hdmi-card.c | 47 |
1 files changed, 38 insertions, 9 deletions
diff --git a/sound/soc/omap/omap4-hdmi-card.c b/sound/soc/omap/omap4-hdmi-card.c index 9f32615b81f..221a9652e28 100644 --- a/sound/soc/omap/omap4-hdmi-card.c +++ b/sound/soc/omap/omap4-hdmi-card.c @@ -71,8 +71,10 @@ static struct snd_soc_dai_link omap4_hdmi_dai = { .ops = &omap4_hdmi_dai_ops, }; +/* Audio machine driver */ static struct snd_soc_card snd_soc_omap4_hdmi = { - .name = "OMAP4HDMI", + .name = "SDP4430HDMI", + .long_name = "TI OMAP4 HDMI Board", .dai_link = &omap4_hdmi_dai, .num_links = 1, }; @@ -111,19 +113,46 @@ static struct platform_driver omap4_hdmi_driver = { .remove = __devexit_p(omap4_hdmi_remove), }; -static int __init omap4_hdmi_init(void) +static struct platform_device *omap4_hdmi_snd_device; + +static int __init omap4_hdmi_soc_init(void) { - return platform_driver_register(&omap4_hdmi_driver); + int ret; + + if (!(machine_is_omap_4430sdp() || machine_is_omap4_panda())) + return -ENODEV; + printk(KERN_INFO "OMAP4 HDMI audio SoC init\n"); + + if (machine_is_omap4_panda()) + snd_soc_omap4_hdmi.name = "PandaHDMI"; + + omap4_hdmi_snd_device = platform_device_alloc("soc-audio", + OMAP4_HDMI_SND_DEV_ID); + if (!omap4_hdmi_snd_device) { + printk(KERN_ERR "Platform device allocation failed\n"); + return -ENOMEM; + } + + platform_set_drvdata(omap4_hdmi_snd_device, &snd_soc_omap4_hdmi); + + ret = platform_device_add(omap4_hdmi_snd_device); + if (ret) + goto err; + + return 0; +err: + printk(KERN_ERR "Unable to add platform device\n"); + platform_device_put(omap4_hdmi_snd_device); + return ret; } -module_init(omap4_hdmi_init); +module_init(omap4_hdmi_soc_init); -static void __exit omap4_hdmi_exit(void) +static void __exit omap4_hdmi_soc_exit(void) { - platform_driver_unregister(&omap4_hdmi_driver); + platform_device_unregister(omap4_hdmi_snd_device); } -module_exit(omap4_hdmi_exit); +module_exit(omap4_hdmi_soc_exit); MODULE_AUTHOR("Ricardo Neri <ricardo.neri@ti.com>"); -MODULE_DESCRIPTION("OMAP4 HDMI machine ASoC driver"); +MODULE_DESCRIPTION("ALSA SoC OMAP4 HDMI AUDIO"); MODULE_LICENSE("GPL"); -MODULE_ALIAS("platform:" DRV_NAME); |