From 02553f5ac2b3e7d0405e5a51d87ef0727ad6fb2f Mon Sep 17 00:00:00 2001 From: Peter Ujfalusi Date: Wed, 5 Dec 2012 14:40:30 +0100 Subject: ARM: OMAP2+: twl-common: Add default twl4030 audio configuration Select the most commonly used audio configuration on boards with twl4030 audio: Headset, Handsfree output and Line in input Signed-off-by: Peter Ujfalusi --- arch/arm/mach-omap2/twl-common.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'arch/arm/mach-omap2/twl-common.c') diff --git a/arch/arm/mach-omap2/twl-common.c b/arch/arm/mach-omap2/twl-common.c index e49b40b4c90..cd1cba84bcd 100644 --- a/arch/arm/mach-omap2/twl-common.c +++ b/arch/arm/mach-omap2/twl-common.c @@ -528,7 +528,12 @@ void __init omap4_pmic_get_config(struct twl4030_platform_data *pmic_data, defined(CONFIG_SND_OMAP_SOC_OMAP_TWL4030_MODULE) #include -static struct omap_tw4030_pdata omap_twl4030_audio_data; +/* Commonly used configuration */ +static struct omap_tw4030_pdata omap_twl4030_audio_data = { + .has_hs = OMAP_TWL4030_LEFT | OMAP_TWL4030_RIGHT, + .has_hf = OMAP_TWL4030_LEFT | OMAP_TWL4030_RIGHT, + .has_linein = OMAP_TWL4030_LEFT | OMAP_TWL4030_RIGHT, +}; static struct platform_device audio_device = { .name = "omap-twl4030", -- cgit v1.2.3 From 40234bf733042eb4343cb47c816619758e477eeb Mon Sep 17 00:00:00 2001 From: Peter Ujfalusi Date: Wed, 5 Dec 2012 14:45:23 +0100 Subject: ARM: OMAP2+: twl-common: Allow boards to customize the twl4030 audio setup Boards with special audio routing can pass a custom omap_tw4030_pdata to the audio machine driver. At the same time update the board files using the same audio driver. Signed-off-by: Peter Ujfalusi --- arch/arm/mach-omap2/twl-common.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'arch/arm/mach-omap2/twl-common.c') diff --git a/arch/arm/mach-omap2/twl-common.c b/arch/arm/mach-omap2/twl-common.c index cd1cba84bcd..931495a2587 100644 --- a/arch/arm/mach-omap2/twl-common.c +++ b/arch/arm/mach-omap2/twl-common.c @@ -529,28 +529,28 @@ void __init omap4_pmic_get_config(struct twl4030_platform_data *pmic_data, #include /* Commonly used configuration */ -static struct omap_tw4030_pdata omap_twl4030_audio_data = { - .has_hs = OMAP_TWL4030_LEFT | OMAP_TWL4030_RIGHT, - .has_hf = OMAP_TWL4030_LEFT | OMAP_TWL4030_RIGHT, - .has_linein = OMAP_TWL4030_LEFT | OMAP_TWL4030_RIGHT, -}; +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) +void __init omap_twl4030_audio_init(char *card_name, + struct omap_tw4030_pdata *pdata) { - omap_twl4030_audio_data.card_name = card_name; + if (!pdata) + pdata = &omap_twl4030_audio_data; + + pdata->card_name = card_name; + + audio_device.dev.platform_data = pdata; platform_device_register(&audio_device); } #else /* SOC_OMAP_TWL4030 */ -void __init omap_twl4030_audio_init(char *card_name) +void __init omap_twl4030_audio_init(char *card_name, + struct omap_tw4030_pdata *pdata) { return; } -- cgit v1.2.3 From 6689c87555839d90f2a0b76d1f982713487a11d2 Mon Sep 17 00:00:00 2001 From: Tony Lindgren Date: Tue, 5 Feb 2013 10:36:21 -0800 Subject: ARM: OMAP2+: Fix twl section warnings related to omap_twl4030_audio_init With the recent twl related changes we can now get: WARNING: arch/arm/mach-omap2/built-in.o(.text+0x15f88): Section mismatch in reference from the function sdp3430_twl_gpio_setup() to the function .init.text:omap_twl4030_audio_init() The function sdp3430_twl_gpio_setup() references the function __init omap_twl4030_audio_init(). This is often because sdp3430_twl_gpio_setup lacks a __init annotation or the annotation of omap_twl4030_audio_init is wrong. WARNING: arch/arm/mach-omap2/built-in.o(.text+0x16968): Section mismatch in reference from the function zoom_twl_gpio_setup() to the function .init.text:omap_twl4030_audio_init() The function zoom_twl_gpio_setup() references the function __init omap_twl4030_audio_init(). This is often because zoom_twl_gpio_setup lacks a __init annotation or the annotation of omap_twl4030_audio_init is wrong. Fix this by removing __init from omap_twl4030_audio_init() as suggested by Peter Ujfalusi . Signed-off-by: Tony Lindgren --- arch/arm/mach-omap2/twl-common.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'arch/arm/mach-omap2/twl-common.c') diff --git a/arch/arm/mach-omap2/twl-common.c b/arch/arm/mach-omap2/twl-common.c index 931495a2587..62cf40b86e4 100644 --- a/arch/arm/mach-omap2/twl-common.c +++ b/arch/arm/mach-omap2/twl-common.c @@ -536,7 +536,7 @@ static struct platform_device audio_device = { .id = -1, }; -void __init omap_twl4030_audio_init(char *card_name, +void omap_twl4030_audio_init(char *card_name, struct omap_tw4030_pdata *pdata) { if (!pdata) @@ -549,7 +549,7 @@ void __init omap_twl4030_audio_init(char *card_name, } #else /* SOC_OMAP_TWL4030 */ -void __init omap_twl4030_audio_init(char *card_name, +void omap_twl4030_audio_init(char *card_name, struct omap_tw4030_pdata *pdata) { return; -- cgit v1.2.3