From 7b00077a6595d241d06ef38f6868bb44d1e913c0 Mon Sep 17 00:00:00 2001 From: Peter Ujfalusi Date: Tue, 4 Dec 2012 10:29:42 +0100 Subject: ARM: OMAP: 3430sdp: Enable extmute functionality for audio Enable the use of extmute on the HS path. Signed-off-by: Peter Ujfalusi --- arch/arm/mach-omap2/board-3430sdp.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'arch/arm/mach-omap2') diff --git a/arch/arm/mach-omap2/board-3430sdp.c b/arch/arm/mach-omap2/board-3430sdp.c index bb73afc9ac17..40c22a7b80dc 100644 --- a/arch/arm/mach-omap2/board-3430sdp.c +++ b/arch/arm/mach-omap2/board-3430sdp.c @@ -382,6 +382,9 @@ static int __init omap3430_i2c_init(void) sdp3430_twldata.vpll2->constraints.apply_uV = true; sdp3430_twldata.vpll2->constraints.name = "VDVI"; + sdp3430_twldata.audio->codec->hs_extmute = 1; + sdp3430_twldata.audio->codec->hs_extmute_gpio = -EINVAL; + omap3_pmic_init("twl4030", &sdp3430_twldata); /* i2c2 on camera connector (for sensor control) and optional isp1301 */ -- cgit v1.2.3 From 98b0606e9a31397f534eb8bce697618d84a2165d Mon Sep 17 00:00:00 2001 From: Peter Ujfalusi Date: Wed, 5 Dec 2012 11:35:32 +0100 Subject: ARM: OMAP: zoom: Zoom2 does not have extmute functionality The HS extmute is not used on Zoom2 boards. Furthermore the GPIO153 is used as IRQ for the TSC2004 touchscreen controller - for which we do not have driver upstream, yet. Signed-off-by: Peter Ujfalusi --- arch/arm/mach-omap2/board-zoom-peripherals.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) (limited to 'arch/arm/mach-omap2') diff --git a/arch/arm/mach-omap2/board-zoom-peripherals.c b/arch/arm/mach-omap2/board-zoom-peripherals.c index 26e07addc9d7..03ec6b2fbde1 100644 --- a/arch/arm/mach-omap2/board-zoom-peripherals.c +++ b/arch/arm/mach-omap2/board-zoom-peripherals.c @@ -34,7 +34,7 @@ #include "common-board-devices.h" #define OMAP_ZOOM_WLAN_PMENA_GPIO (101) -#define ZOOM2_HEADSET_EXTMUTE_GPIO (153) +#define OMAP_ZOOM_TSC2004_IRQ_GPIO (153) #define OMAP_ZOOM_WLAN_IRQ_GPIO (162) #define LCD_PANEL_ENABLE_GPIO (7 + OMAP_MAX_GPIO_LINES) @@ -264,14 +264,9 @@ static int __init omap_i2c_init(void) TWL_COMMON_PDATA_MADC | TWL_COMMON_PDATA_AUDIO, TWL_COMMON_REGULATOR_VDAC | TWL_COMMON_REGULATOR_VPLL2); - if (machine_is_omap_zoom2()) { - struct twl4030_codec_data *codec_data; - codec_data = zoom_twldata.audio->codec; + if (machine_is_omap_zoom2()) + zoom_twldata.audio->codec->ramp_delay_value = 3; /* 161 ms */ - codec_data->ramp_delay_value = 3; /* 161 ms */ - codec_data->hs_extmute = 1; - codec_data->hs_extmute_gpio = ZOOM2_HEADSET_EXTMUTE_GPIO; - } omap_pmic_init(1, 2400, "twl5030", 7 + OMAP_INTC_START, &zoom_twldata); omap_register_i2c_bus(2, 400, NULL, 0); omap_register_i2c_bus(3, 400, NULL, 0); -- cgit v1.2.3 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') diff --git a/arch/arm/mach-omap2/twl-common.c b/arch/arm/mach-omap2/twl-common.c index e49b40b4c90a..cd1cba84bcd9 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/board-cm-t35.c | 2 +- arch/arm/mach-omap2/board-devkit8000.c | 2 +- arch/arm/mach-omap2/board-igep0020.c | 2 +- arch/arm/mach-omap2/board-omap3beagle.c | 2 +- arch/arm/mach-omap2/board-omap3evm.c | 2 +- arch/arm/mach-omap2/board-overo.c | 2 +- arch/arm/mach-omap2/twl-common.c | 22 +++++++++++----------- arch/arm/mach-omap2/twl-common.h | 3 ++- 8 files changed, 19 insertions(+), 18 deletions(-) (limited to 'arch/arm/mach-omap2') diff --git a/arch/arm/mach-omap2/board-cm-t35.c b/arch/arm/mach-omap2/board-cm-t35.c index b3102c2f4a3c..eec635e15edd 100644 --- a/arch/arm/mach-omap2/board-cm-t35.c +++ b/arch/arm/mach-omap2/board-cm-t35.c @@ -722,7 +722,7 @@ static void __init cm_t3x_common_init(void) cm_t35_init_ethernet(); cm_t35_init_led(); cm_t35_init_display(); - omap_twl4030_audio_init("cm-t3x"); + omap_twl4030_audio_init("cm-t3x", NULL); usb_musb_init(NULL); cm_t35_init_usbh(); diff --git a/arch/arm/mach-omap2/board-devkit8000.c b/arch/arm/mach-omap2/board-devkit8000.c index 12865af25d3a..f0aa64b1e977 100644 --- a/arch/arm/mach-omap2/board-devkit8000.c +++ b/arch/arm/mach-omap2/board-devkit8000.c @@ -627,7 +627,7 @@ static void __init devkit8000_init(void) board_nand_init(devkit8000_nand_partitions, ARRAY_SIZE(devkit8000_nand_partitions), NAND_CS, NAND_BUSWIDTH_16, NULL); - omap_twl4030_audio_init("omap3beagle"); + omap_twl4030_audio_init("omap3beagle", NULL); /* Ensure SDRC pins are mux'd for self-refresh */ omap_mux_init_signal("sdrc_cke0", OMAP_PIN_OUTPUT); diff --git a/arch/arm/mach-omap2/board-igep0020.c b/arch/arm/mach-omap2/board-igep0020.c index 0f24cb84ba5a..d1a735291596 100644 --- a/arch/arm/mach-omap2/board-igep0020.c +++ b/arch/arm/mach-omap2/board-igep0020.c @@ -629,7 +629,7 @@ static void __init igep_init(void) igep_flash_init(); igep_leds_init(); - omap_twl4030_audio_init("igep2"); + omap_twl4030_audio_init("igep2", NULL); /* * WLAN-BT combo module from MuRata which has a Marvell WLAN diff --git a/arch/arm/mach-omap2/board-omap3beagle.c b/arch/arm/mach-omap2/board-omap3beagle.c index 22c483d5dfa8..909e7fa6d299 100644 --- a/arch/arm/mach-omap2/board-omap3beagle.c +++ b/arch/arm/mach-omap2/board-omap3beagle.c @@ -524,7 +524,7 @@ static void __init omap3_beagle_init(void) board_nand_init(omap3beagle_nand_partitions, ARRAY_SIZE(omap3beagle_nand_partitions), NAND_CS, NAND_BUSWIDTH_16, NULL); - omap_twl4030_audio_init("omap3beagle"); + omap_twl4030_audio_init("omap3beagle", NULL); /* Ensure msecure is mux'd to be able to set the RTC. */ omap_mux_init_signal("sys_drm_msecure", OMAP_PIN_OFF_OUTPUT_HIGH); diff --git a/arch/arm/mach-omap2/board-omap3evm.c b/arch/arm/mach-omap2/board-omap3evm.c index 3985f35aee06..8803b5cff09d 100644 --- a/arch/arm/mach-omap2/board-omap3evm.c +++ b/arch/arm/mach-omap2/board-omap3evm.c @@ -744,7 +744,7 @@ static void __init omap3_evm_init(void) omap3evm_init_smsc911x(); omap3_evm_display_init(); omap3_evm_wl12xx_init(); - omap_twl4030_audio_init("omap3evm"); + omap_twl4030_audio_init("omap3evm", NULL); } MACHINE_START(OMAP3EVM, "OMAP3 EVM") diff --git a/arch/arm/mach-omap2/board-overo.c b/arch/arm/mach-omap2/board-overo.c index c8fde3e56441..fe644ebe7657 100644 --- a/arch/arm/mach-omap2/board-overo.c +++ b/arch/arm/mach-omap2/board-overo.c @@ -506,7 +506,7 @@ static void __init overo_init(void) overo_display_init(); overo_init_led(); overo_init_keys(); - omap_twl4030_audio_init("overo"); + omap_twl4030_audio_init("overo", NULL); /* Ensure SDRC pins are mux'd for self-refresh */ omap_mux_init_signal("sdrc_cke0", OMAP_PIN_OUTPUT); diff --git a/arch/arm/mach-omap2/twl-common.c b/arch/arm/mach-omap2/twl-common.c index cd1cba84bcd9..931495a25872 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; } diff --git a/arch/arm/mach-omap2/twl-common.h b/arch/arm/mach-omap2/twl-common.h index dcfbad5ac471..24b65d081b69 100644 --- a/arch/arm/mach-omap2/twl-common.h +++ b/arch/arm/mach-omap2/twl-common.h @@ -32,6 +32,7 @@ struct twl4030_platform_data; struct twl6040_platform_data; +struct omap_tw4030_pdata; struct i2c_board_info; void omap_pmic_init(int bus, u32 clkrate, const char *pmic_type, int pmic_irq, @@ -60,6 +61,6 @@ void omap3_pmic_get_config(struct twl4030_platform_data *pmic_data, void omap4_pmic_get_config(struct twl4030_platform_data *pmic_data, u32 pdata_flags, u32 regulators_flags); -void omap_twl4030_audio_init(char *card_name); +void omap_twl4030_audio_init(char *card_name, struct omap_tw4030_pdata *pdata); #endif /* __OMAP_PMIC_COMMON__ */ -- cgit v1.2.3 From c5913935657f81b8c9cae93d1a4200bba7faffb8 Mon Sep 17 00:00:00 2001 From: Peter Ujfalusi Date: Wed, 5 Dec 2012 15:39:35 +0100 Subject: ARM: OMAP: zoom: Audio support via the common omap-twl4030 machine driver Use the common omap-twl4030 ASoC machine driver for audio. Signed-off-by: Peter Ujfalusi --- arch/arm/mach-omap2/board-zoom-peripherals.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'arch/arm/mach-omap2') diff --git a/arch/arm/mach-omap2/board-zoom-peripherals.c b/arch/arm/mach-omap2/board-zoom-peripherals.c index 03ec6b2fbde1..f4ea92649672 100644 --- a/arch/arm/mach-omap2/board-zoom-peripherals.c +++ b/arch/arm/mach-omap2/board-zoom-peripherals.c @@ -20,6 +20,7 @@ #include #include #include +#include #include #include @@ -226,6 +227,19 @@ static struct omap2_hsmmc_info mmc[] = { {} /* Terminator */ }; +static struct omap_tw4030_pdata omap_twl4030_audio_data = { + .voice_connected = true, + .custom_routing = true, + + .has_hs = OMAP_TWL4030_LEFT | OMAP_TWL4030_RIGHT, + .has_hf = OMAP_TWL4030_LEFT | OMAP_TWL4030_RIGHT, + + .has_mainmic = true, + .has_submic = true, + .has_hsmic = true, + .has_linein = OMAP_TWL4030_LEFT | OMAP_TWL4030_RIGHT, +}; + static int zoom_twl_gpio_setup(struct device *dev, unsigned gpio, unsigned ngpio) { @@ -241,6 +255,10 @@ static int zoom_twl_gpio_setup(struct device *dev, pr_err("Failed to get LCD_PANEL_ENABLE_GPIO (gpio%d).\n", LCD_PANEL_ENABLE_GPIO); + /* Audio setup */ + omap_twl4030_audio_data.jack_detect = gpio + 2; + omap_twl4030_audio_init("Zoom2", &omap_twl4030_audio_data); + return ret; } -- cgit v1.2.3 From 77f86144984e4cd375c9dcda83b79f32670f85fe Mon Sep 17 00:00:00 2001 From: Peter Ujfalusi Date: Wed, 5 Dec 2012 16:00:07 +0100 Subject: ARM: OMAP: sdp3430: Audio support via the common omap-twl4030 machine driver Use the common omap-twl4030 ASoC machine driver for audio. Signed-off-by: Peter Ujfalusi --- arch/arm/mach-omap2/board-3430sdp.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'arch/arm/mach-omap2') diff --git a/arch/arm/mach-omap2/board-3430sdp.c b/arch/arm/mach-omap2/board-3430sdp.c index 40c22a7b80dc..e7ef3111a0f2 100644 --- a/arch/arm/mach-omap2/board-3430sdp.c +++ b/arch/arm/mach-omap2/board-3430sdp.c @@ -25,6 +25,7 @@ #include #include #include +#include #include #include @@ -209,6 +210,19 @@ static struct omap2_hsmmc_info mmc[] = { {} /* Terminator */ }; +static struct omap_tw4030_pdata omap_twl4030_audio_data = { + .voice_connected = true, + .custom_routing = true, + + .has_hs = OMAP_TWL4030_LEFT | OMAP_TWL4030_RIGHT, + .has_hf = OMAP_TWL4030_LEFT | OMAP_TWL4030_RIGHT, + + .has_mainmic = true, + .has_submic = true, + .has_hsmic = true, + .has_linein = OMAP_TWL4030_LEFT | OMAP_TWL4030_RIGHT, +}; + static int sdp3430_twl_gpio_setup(struct device *dev, unsigned gpio, unsigned ngpio) { @@ -225,6 +239,9 @@ static int sdp3430_twl_gpio_setup(struct device *dev, /* gpio + 15 is "sub_lcd_nRST" (output) */ gpio_request_one(gpio + 15, GPIOF_OUT_INIT_LOW, "sub_lcd_nRST"); + omap_twl4030_audio_data.jack_detect = gpio + 2; + omap_twl4030_audio_init("SDP3430", &omap_twl4030_audio_data); + return 0; } -- cgit v1.2.3 From 42997c4b2ec3c5dcf97c739cd64128d3e55d8f31 Mon Sep 17 00:00:00 2001 From: Peter Ujfalusi Date: Wed, 7 Nov 2012 11:40:18 +0100 Subject: ARM: OMAP: board-4430sdp: Proper support for TWL6030 PWM LED/Backlight New PWM drivers are being prepared for twl series which will enable the use of all PWMs (PWMs and LEDs). They are implemented as generic PWM drivers to be able to use them for different purposes. The current platform code was broken: the leds_pwm driver was not able to pick up the PWM since the pwm_id was incorrect. With the other patches we will be able to control the followings: LCD backlight via pwm-backlight driver Keypad leds via leds_pwm driver as normal LED Charging indicator via leds_pwm driver as normal LED Signed-off-by: Peter Ujfalusi --- arch/arm/mach-omap2/board-4430sdp.c | 30 +++++++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) (limited to 'arch/arm/mach-omap2') diff --git a/arch/arm/mach-omap2/board-4430sdp.c b/arch/arm/mach-omap2/board-4430sdp.c index 1cc6696594fd..918b73bd0215 100644 --- a/arch/arm/mach-omap2/board-4430sdp.c +++ b/arch/arm/mach-omap2/board-4430sdp.c @@ -24,8 +24,10 @@ #include #include #include +#include #include #include +#include #include #include @@ -256,10 +258,20 @@ static struct gpio_led_platform_data sdp4430_led_data = { .num_leds = ARRAY_SIZE(sdp4430_gpio_leds), }; +static struct pwm_lookup sdp4430_pwm_lookup[] = { + PWM_LOOKUP("twl-pwm", 0, "leds_pwm", "omap4::keypad"), + PWM_LOOKUP("twl-pwm", 1, "pwm-backlight", NULL), + PWM_LOOKUP("twl-pwmled", 0, "leds_pwm", "omap4:green:chrg"), +}; + static struct led_pwm sdp4430_pwm_leds[] = { + { + .name = "omap4::keypad", + .max_brightness = 127, + .pwm_period_ns = 7812500, + }, { .name = "omap4:green:chrg", - .pwm_id = 1, .max_brightness = 255, .pwm_period_ns = 7812500, }, @@ -278,6 +290,20 @@ static struct platform_device sdp4430_leds_pwm = { }, }; +static struct platform_pwm_backlight_data sdp4430_backlight_data = { + .max_brightness = 127, + .dft_brightness = 127, + .pwm_period_ns = 7812500, +}; + +static struct platform_device sdp4430_backlight_pwm = { + .name = "pwm-backlight", + .id = -1, + .dev = { + .platform_data = &sdp4430_backlight_data, + }, +}; + static int omap_prox_activate(struct device *dev) { gpio_set_value(OMAP4_SFH7741_ENABLE_GPIO , 1); @@ -412,6 +438,7 @@ static struct platform_device *sdp4430_devices[] __initdata = { &sdp4430_gpio_keys_device, &sdp4430_leds_gpio, &sdp4430_leds_pwm, + &sdp4430_backlight_pwm, &sdp4430_vbat, &sdp4430_dmic_codec, &sdp4430_abe_audio, @@ -707,6 +734,7 @@ static void __init omap_4430sdp_init(void) ARRAY_SIZE(sdp4430_spi_board_info)); } + pwm_add_table(sdp4430_pwm_lookup, ARRAY_SIZE(sdp4430_pwm_lookup)); status = omap4_keyboard_init(&sdp4430_keypad_data, &keypad_data); if (status) pr_err("Keypad initialization failed: %d\n", status); -- cgit v1.2.3 From b8e21308dd9561e37d9860c5423f3247f76f06b6 Mon Sep 17 00:00:00 2001 From: Peter Ujfalusi Date: Wed, 7 Nov 2012 15:25:30 +0100 Subject: ARM: OMAP: omap3beagle: Use the pwm_leds driver to control the PMU_STAT led With the PWM backed driver the PMU_STAT led's brighness can be controlled. This needs the new drivers for the TWL PWM/LED to work. Signed-off-by: Peter Ujfalusi --- arch/arm/mach-omap2/board-omap3beagle.c | 39 ++++++++++++++++++++++++++------- 1 file changed, 31 insertions(+), 8 deletions(-) (limited to 'arch/arm/mach-omap2') diff --git a/arch/arm/mach-omap2/board-omap3beagle.c b/arch/arm/mach-omap2/board-omap3beagle.c index 909e7fa6d299..2a6e8ad1d68b 100644 --- a/arch/arm/mach-omap2/board-omap3beagle.c +++ b/arch/arm/mach-omap2/board-omap3beagle.c @@ -20,6 +20,8 @@ #include #include #include +#include +#include #include #include #include @@ -55,6 +57,32 @@ #define NAND_CS 0 +static struct pwm_lookup pwm_lookup[] = { + /* LEDB -> PMU_STAT */ + PWM_LOOKUP("twl-pwmled", 1, "leds_pwm", "beagleboard::pmu_stat"), +}; + +static struct led_pwm pwm_leds[] = { + { + .name = "beagleboard::pmu_stat", + .max_brightness = 127, + .pwm_period_ns = 7812500, + }, +}; + +static struct led_pwm_platform_data pwm_data = { + .num_leds = ARRAY_SIZE(pwm_leds), + .leds = pwm_leds, +}; + +static struct platform_device leds_pwm = { + .name = "leds_pwm", + .id = -1, + .dev = { + .platform_data = &pwm_data, + }, +}; + /* * OMAP3 Beagle revision * Run time detection of Beagle revision is done by reading GPIO. @@ -292,9 +320,6 @@ static int beagle_twl_gpio_setup(struct device *dev, gpio_request_one(gpio + TWL4030_GPIO_MAX, beagle_config.usb_pwr_level, "nEN_USB_PWR"); - /* TWL4030_GPIO_MAX + 1 == ledB, PMU_STAT (out, active low LED) */ - gpio_leds[2].gpio = gpio + TWL4030_GPIO_MAX + 1; - return 0; } @@ -376,11 +401,6 @@ static struct gpio_led gpio_leds[] = { .default_trigger = "mmc0", .gpio = 149, }, - { - .name = "beagleboard::pmu_stat", - .gpio = -EINVAL, /* gets replaced */ - .active_low = true, - }, }; static struct gpio_led_platform_data gpio_led_info = { @@ -428,6 +448,7 @@ static struct platform_device *omap3_beagle_devices[] __initdata = { &leds_gpio, &keys_gpio, &madc_hwmon, + &leds_pwm, }; static const struct usbhs_omap_board_data usbhs_bdata __initconst = { @@ -532,6 +553,8 @@ static void __init omap3_beagle_init(void) /* Ensure SDRC pins are mux'd for self-refresh */ omap_mux_init_signal("sdrc_cke0", OMAP_PIN_OUTPUT); omap_mux_init_signal("sdrc_cke1", OMAP_PIN_OUTPUT); + + pwm_add_table(pwm_lookup, ARRAY_SIZE(pwm_lookup)); } MACHINE_START(OMAP3_BEAGLE, "OMAP3 Beagle Board") -- cgit v1.2.3 From e4f4e8bfa47431b91fbb21dd9b86d9bc2c15cbd7 Mon Sep 17 00:00:00 2001 From: Peter Ujfalusi Date: Fri, 30 Nov 2012 14:40:51 +0100 Subject: ARM: board-zoom: Do not request LCD panel enable GPIO from twl4030 The pin in question is muxed between GPIO7 and PWM1. For backlight control there is a custom code in board-zoom-display to control the backlight. No need to request the GPIO7 - which was failing since the way it is requested no longer valid: twl's gpio range is allocated dynamically. Signed-off-by: Peter Ujfalusi --- arch/arm/mach-omap2/board-zoom-peripherals.c | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) (limited to 'arch/arm/mach-omap2') diff --git a/arch/arm/mach-omap2/board-zoom-peripherals.c b/arch/arm/mach-omap2/board-zoom-peripherals.c index f4ea92649672..0745bd93f398 100644 --- a/arch/arm/mach-omap2/board-zoom-peripherals.c +++ b/arch/arm/mach-omap2/board-zoom-peripherals.c @@ -38,8 +38,6 @@ #define OMAP_ZOOM_TSC2004_IRQ_GPIO (153) #define OMAP_ZOOM_WLAN_IRQ_GPIO (162) -#define LCD_PANEL_ENABLE_GPIO (7 + OMAP_MAX_GPIO_LINES) - /* Zoom2 has Qwerty keyboard*/ static uint32_t board_keymap[] = { KEY(0, 0, KEY_E), @@ -243,23 +241,15 @@ static struct omap_tw4030_pdata omap_twl4030_audio_data = { static int zoom_twl_gpio_setup(struct device *dev, unsigned gpio, unsigned ngpio) { - int ret; - /* gpio + 0 is "mmc0_cd" (input/IRQ) */ mmc[0].gpio_cd = gpio + 0; omap_hsmmc_late_init(mmc); - ret = gpio_request_one(LCD_PANEL_ENABLE_GPIO, GPIOF_OUT_INIT_LOW, - "lcd enable"); - if (ret) - pr_err("Failed to get LCD_PANEL_ENABLE_GPIO (gpio%d).\n", - LCD_PANEL_ENABLE_GPIO); - /* Audio setup */ omap_twl4030_audio_data.jack_detect = gpio + 2; omap_twl4030_audio_init("Zoom2", &omap_twl4030_audio_data); - return ret; + return 0; } static struct twl4030_gpio_platform_data zoom_gpio_data = { -- 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') diff --git a/arch/arm/mach-omap2/twl-common.c b/arch/arm/mach-omap2/twl-common.c index 931495a25872..62cf40b86e4a 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