summaryrefslogtreecommitdiff
path: root/arch/arm/mach-omap2/twl-common.c
diff options
context:
space:
mode:
authorPeter Ujfalusi <peter.ujfalusi@ti.com>2012-08-14 09:07:57 (GMT)
committerMark Brown <broonie@opensource.wolfsonmicro.com>2012-08-15 16:10:00 (GMT)
commit552d9dc316cfedd134ee882cd1ae24ca6934ffc0 (patch)
tree5fac0a6b7b4027b09a07b8dc67906a35dfb9b9d0 /arch/arm/mach-omap2/twl-common.c
parentfff8491c8b8cce5fc9190e025d1a665f2ee71a4f (diff)
downloadlinux-fsl-qoriq-552d9dc316cfedd134ee882cd1ae24ca6934ffc0.tar.xz
ARM: OMAP: twl-common: Add helper function to register the omap-twl4030 audio driver
Since several OMAP3 based boards will be using the unified simple audio driver it is better to not have duplicated code in the board files for this purpose. Board files can call omap_twl4030_audio_init(); to set up the needed device for the audio support. For example: omap_twl4030_audio_init("omap3beagle", 26000000); Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com> Acked-by: Tony Lindgren <tony@atomide.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'arch/arm/mach-omap2/twl-common.c')
-rw-r--r--arch/arm/mach-omap2/twl-common.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/arch/arm/mach-omap2/twl-common.c b/arch/arm/mach-omap2/twl-common.c
index de47f17..0606f23 100644
--- a/arch/arm/mach-omap2/twl-common.c
+++ b/arch/arm/mach-omap2/twl-common.c
@@ -537,3 +537,30 @@ void __init omap4_pmic_get_config(struct twl4030_platform_data *pmic_data,
pmic_data->v2v1 = &omap4_v2v1_idata;
}
#endif /* CONFIG_ARCH_OMAP4 */
+
+#if defined(CONFIG_SND_OMAP_SOC_OMAP_TWL4030) || \
+ defined(CONFIG_SND_OMAP_SOC_OMAP_TWL4030_MODULE)
+#include <linux/platform_data/omap-twl4030.h>
+
+static struct omap_tw4030_pdata omap_twl4030_audio_data;
+
+static struct platform_device audio_device = {
+ .name = "omap-twl4030",
+ .id = -1,
+ .dev = {
+ .platform_data = &omap_twl4030_audio_data,
+ },
+};
+
+void __init omap_twl4030_audio_init(char *card_name)
+{
+ omap_twl4030_audio_data.card_name = card_name;
+ platform_device_register(&audio_device);
+}
+
+#else /* SOC_OMAP_TWL4030 */
+void __init omap_twl4030_audio_init(char *card_name, int codec_sysclk)
+{
+ return;
+}
+#endif /* SOC_OMAP_TWL4030 */