diff options
-rw-r--r-- | arch/arm/mach-omap2/board-3430sdp.c | 20 | ||||
-rw-r--r-- | arch/arm/mach-omap2/board-4430sdp.c | 30 | ||||
-rw-r--r-- | arch/arm/mach-omap2/board-cm-t35.c | 2 | ||||
-rw-r--r-- | arch/arm/mach-omap2/board-devkit8000.c | 2 | ||||
-rw-r--r-- | arch/arm/mach-omap2/board-igep0020.c | 2 | ||||
-rw-r--r-- | arch/arm/mach-omap2/board-omap3beagle.c | 41 | ||||
-rw-r--r-- | arch/arm/mach-omap2/board-omap3evm.c | 2 | ||||
-rw-r--r-- | arch/arm/mach-omap2/board-overo.c | 2 | ||||
-rw-r--r-- | arch/arm/mach-omap2/board-zoom-peripherals.c | 39 | ||||
-rw-r--r-- | arch/arm/mach-omap2/twl-common.c | 17 | ||||
-rw-r--r-- | arch/arm/mach-omap2/twl-common.h | 3 |
11 files changed, 120 insertions, 40 deletions
diff --git a/arch/arm/mach-omap2/board-3430sdp.c b/arch/arm/mach-omap2/board-3430sdp.c index bb73afc9ac17..e7ef3111a0f2 100644 --- a/arch/arm/mach-omap2/board-3430sdp.c +++ b/arch/arm/mach-omap2/board-3430sdp.c | |||
@@ -25,6 +25,7 @@ | |||
25 | #include <linux/gpio.h> | 25 | #include <linux/gpio.h> |
26 | #include <linux/mmc/host.h> | 26 | #include <linux/mmc/host.h> |
27 | #include <linux/platform_data/spi-omap2-mcspi.h> | 27 | #include <linux/platform_data/spi-omap2-mcspi.h> |
28 | #include <linux/platform_data/omap-twl4030.h> | ||
28 | 29 | ||
29 | #include <asm/mach-types.h> | 30 | #include <asm/mach-types.h> |
30 | #include <asm/mach/arch.h> | 31 | #include <asm/mach/arch.h> |
@@ -209,6 +210,19 @@ static struct omap2_hsmmc_info mmc[] = { | |||
209 | {} /* Terminator */ | 210 | {} /* Terminator */ |
210 | }; | 211 | }; |
211 | 212 | ||
213 | static struct omap_tw4030_pdata omap_twl4030_audio_data = { | ||
214 | .voice_connected = true, | ||
215 | .custom_routing = true, | ||
216 | |||
217 | .has_hs = OMAP_TWL4030_LEFT | OMAP_TWL4030_RIGHT, | ||
218 | .has_hf = OMAP_TWL4030_LEFT | OMAP_TWL4030_RIGHT, | ||
219 | |||
220 | .has_mainmic = true, | ||
221 | .has_submic = true, | ||
222 | .has_hsmic = true, | ||
223 | .has_linein = OMAP_TWL4030_LEFT | OMAP_TWL4030_RIGHT, | ||
224 | }; | ||
225 | |||
212 | static int sdp3430_twl_gpio_setup(struct device *dev, | 226 | static int sdp3430_twl_gpio_setup(struct device *dev, |
213 | unsigned gpio, unsigned ngpio) | 227 | unsigned gpio, unsigned ngpio) |
214 | { | 228 | { |
@@ -225,6 +239,9 @@ static int sdp3430_twl_gpio_setup(struct device *dev, | |||
225 | /* gpio + 15 is "sub_lcd_nRST" (output) */ | 239 | /* gpio + 15 is "sub_lcd_nRST" (output) */ |
226 | gpio_request_one(gpio + 15, GPIOF_OUT_INIT_LOW, "sub_lcd_nRST"); | 240 | gpio_request_one(gpio + 15, GPIOF_OUT_INIT_LOW, "sub_lcd_nRST"); |
227 | 241 | ||
242 | omap_twl4030_audio_data.jack_detect = gpio + 2; | ||
243 | omap_twl4030_audio_init("SDP3430", &omap_twl4030_audio_data); | ||
244 | |||
228 | return 0; | 245 | return 0; |
229 | } | 246 | } |
230 | 247 | ||
@@ -382,6 +399,9 @@ static int __init omap3430_i2c_init(void) | |||
382 | sdp3430_twldata.vpll2->constraints.apply_uV = true; | 399 | sdp3430_twldata.vpll2->constraints.apply_uV = true; |
383 | sdp3430_twldata.vpll2->constraints.name = "VDVI"; | 400 | sdp3430_twldata.vpll2->constraints.name = "VDVI"; |
384 | 401 | ||
402 | sdp3430_twldata.audio->codec->hs_extmute = 1; | ||
403 | sdp3430_twldata.audio->codec->hs_extmute_gpio = -EINVAL; | ||
404 | |||
385 | omap3_pmic_init("twl4030", &sdp3430_twldata); | 405 | omap3_pmic_init("twl4030", &sdp3430_twldata); |
386 | 406 | ||
387 | /* i2c2 on camera connector (for sensor control) and optional isp1301 */ | 407 | /* i2c2 on camera connector (for sensor control) and optional isp1301 */ |
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 @@ | |||
24 | #include <linux/gpio_keys.h> | 24 | #include <linux/gpio_keys.h> |
25 | #include <linux/regulator/machine.h> | 25 | #include <linux/regulator/machine.h> |
26 | #include <linux/regulator/fixed.h> | 26 | #include <linux/regulator/fixed.h> |
27 | #include <linux/pwm.h> | ||
27 | #include <linux/leds.h> | 28 | #include <linux/leds.h> |
28 | #include <linux/leds_pwm.h> | 29 | #include <linux/leds_pwm.h> |
30 | #include <linux/pwm_backlight.h> | ||
29 | #include <linux/platform_data/omap4-keypad.h> | 31 | #include <linux/platform_data/omap4-keypad.h> |
30 | #include <linux/usb/musb.h> | 32 | #include <linux/usb/musb.h> |
31 | 33 | ||
@@ -256,10 +258,20 @@ static struct gpio_led_platform_data sdp4430_led_data = { | |||
256 | .num_leds = ARRAY_SIZE(sdp4430_gpio_leds), | 258 | .num_leds = ARRAY_SIZE(sdp4430_gpio_leds), |
257 | }; | 259 | }; |
258 | 260 | ||
261 | static struct pwm_lookup sdp4430_pwm_lookup[] = { | ||
262 | PWM_LOOKUP("twl-pwm", 0, "leds_pwm", "omap4::keypad"), | ||
263 | PWM_LOOKUP("twl-pwm", 1, "pwm-backlight", NULL), | ||
264 | PWM_LOOKUP("twl-pwmled", 0, "leds_pwm", "omap4:green:chrg"), | ||
265 | }; | ||
266 | |||
259 | static struct led_pwm sdp4430_pwm_leds[] = { | 267 | static struct led_pwm sdp4430_pwm_leds[] = { |
260 | { | 268 | { |
269 | .name = "omap4::keypad", | ||
270 | .max_brightness = 127, | ||
271 | .pwm_period_ns = 7812500, | ||
272 | }, | ||
273 | { | ||
261 | .name = "omap4:green:chrg", | 274 | .name = "omap4:green:chrg", |
262 | .pwm_id = 1, | ||
263 | .max_brightness = 255, | 275 | .max_brightness = 255, |
264 | .pwm_period_ns = 7812500, | 276 | .pwm_period_ns = 7812500, |
265 | }, | 277 | }, |
@@ -278,6 +290,20 @@ static struct platform_device sdp4430_leds_pwm = { | |||
278 | }, | 290 | }, |
279 | }; | 291 | }; |
280 | 292 | ||
293 | static struct platform_pwm_backlight_data sdp4430_backlight_data = { | ||
294 | .max_brightness = 127, | ||
295 | .dft_brightness = 127, | ||
296 | .pwm_period_ns = 7812500, | ||
297 | }; | ||
298 | |||
299 | static struct platform_device sdp4430_backlight_pwm = { | ||
300 | .name = "pwm-backlight", | ||
301 | .id = -1, | ||
302 | .dev = { | ||
303 | .platform_data = &sdp4430_backlight_data, | ||
304 | }, | ||
305 | }; | ||
306 | |||
281 | static int omap_prox_activate(struct device *dev) | 307 | static int omap_prox_activate(struct device *dev) |
282 | { | 308 | { |
283 | gpio_set_value(OMAP4_SFH7741_ENABLE_GPIO , 1); | 309 | gpio_set_value(OMAP4_SFH7741_ENABLE_GPIO , 1); |
@@ -412,6 +438,7 @@ static struct platform_device *sdp4430_devices[] __initdata = { | |||
412 | &sdp4430_gpio_keys_device, | 438 | &sdp4430_gpio_keys_device, |
413 | &sdp4430_leds_gpio, | 439 | &sdp4430_leds_gpio, |
414 | &sdp4430_leds_pwm, | 440 | &sdp4430_leds_pwm, |
441 | &sdp4430_backlight_pwm, | ||
415 | &sdp4430_vbat, | 442 | &sdp4430_vbat, |
416 | &sdp4430_dmic_codec, | 443 | &sdp4430_dmic_codec, |
417 | &sdp4430_abe_audio, | 444 | &sdp4430_abe_audio, |
@@ -707,6 +734,7 @@ static void __init omap_4430sdp_init(void) | |||
707 | ARRAY_SIZE(sdp4430_spi_board_info)); | 734 | ARRAY_SIZE(sdp4430_spi_board_info)); |
708 | } | 735 | } |
709 | 736 | ||
737 | pwm_add_table(sdp4430_pwm_lookup, ARRAY_SIZE(sdp4430_pwm_lookup)); | ||
710 | status = omap4_keyboard_init(&sdp4430_keypad_data, &keypad_data); | 738 | status = omap4_keyboard_init(&sdp4430_keypad_data, &keypad_data); |
711 | if (status) | 739 | if (status) |
712 | pr_err("Keypad initialization failed: %d\n", status); | 740 | pr_err("Keypad initialization failed: %d\n", status); |
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) | |||
722 | cm_t35_init_ethernet(); | 722 | cm_t35_init_ethernet(); |
723 | cm_t35_init_led(); | 723 | cm_t35_init_led(); |
724 | cm_t35_init_display(); | 724 | cm_t35_init_display(); |
725 | omap_twl4030_audio_init("cm-t3x"); | 725 | omap_twl4030_audio_init("cm-t3x", NULL); |
726 | 726 | ||
727 | usb_musb_init(NULL); | 727 | usb_musb_init(NULL); |
728 | cm_t35_init_usbh(); | 728 | 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) | |||
627 | board_nand_init(devkit8000_nand_partitions, | 627 | board_nand_init(devkit8000_nand_partitions, |
628 | ARRAY_SIZE(devkit8000_nand_partitions), NAND_CS, | 628 | ARRAY_SIZE(devkit8000_nand_partitions), NAND_CS, |
629 | NAND_BUSWIDTH_16, NULL); | 629 | NAND_BUSWIDTH_16, NULL); |
630 | omap_twl4030_audio_init("omap3beagle"); | 630 | omap_twl4030_audio_init("omap3beagle", NULL); |
631 | 631 | ||
632 | /* Ensure SDRC pins are mux'd for self-refresh */ | 632 | /* Ensure SDRC pins are mux'd for self-refresh */ |
633 | omap_mux_init_signal("sdrc_cke0", OMAP_PIN_OUTPUT); | 633 | 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 1921541a7277..2939c3d65492 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) | |||
629 | 629 | ||
630 | igep_flash_init(); | 630 | igep_flash_init(); |
631 | igep_leds_init(); | 631 | igep_leds_init(); |
632 | omap_twl4030_audio_init("igep2"); | 632 | omap_twl4030_audio_init("igep2", NULL); |
633 | 633 | ||
634 | /* | 634 | /* |
635 | * WLAN-BT combo module from MuRata which has a Marvell WLAN | 635 | * 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..2a6e8ad1d68b 100644 --- a/arch/arm/mach-omap2/board-omap3beagle.c +++ b/arch/arm/mach-omap2/board-omap3beagle.c | |||
@@ -20,6 +20,8 @@ | |||
20 | #include <linux/clk.h> | 20 | #include <linux/clk.h> |
21 | #include <linux/io.h> | 21 | #include <linux/io.h> |
22 | #include <linux/leds.h> | 22 | #include <linux/leds.h> |
23 | #include <linux/pwm.h> | ||
24 | #include <linux/leds_pwm.h> | ||
23 | #include <linux/gpio.h> | 25 | #include <linux/gpio.h> |
24 | #include <linux/input.h> | 26 | #include <linux/input.h> |
25 | #include <linux/gpio_keys.h> | 27 | #include <linux/gpio_keys.h> |
@@ -55,6 +57,32 @@ | |||
55 | 57 | ||
56 | #define NAND_CS 0 | 58 | #define NAND_CS 0 |
57 | 59 | ||
60 | static struct pwm_lookup pwm_lookup[] = { | ||
61 | /* LEDB -> PMU_STAT */ | ||
62 | PWM_LOOKUP("twl-pwmled", 1, "leds_pwm", "beagleboard::pmu_stat"), | ||
63 | }; | ||
64 | |||
65 | static struct led_pwm pwm_leds[] = { | ||
66 | { | ||
67 | .name = "beagleboard::pmu_stat", | ||
68 | .max_brightness = 127, | ||
69 | .pwm_period_ns = 7812500, | ||
70 | }, | ||
71 | }; | ||
72 | |||
73 | static struct led_pwm_platform_data pwm_data = { | ||
74 | .num_leds = ARRAY_SIZE(pwm_leds), | ||
75 | .leds = pwm_leds, | ||
76 | }; | ||
77 | |||
78 | static struct platform_device leds_pwm = { | ||
79 | .name = "leds_pwm", | ||
80 | .id = -1, | ||
81 | .dev = { | ||
82 | .platform_data = &pwm_data, | ||
83 | }, | ||
84 | }; | ||
85 | |||
58 | /* | 86 | /* |
59 | * OMAP3 Beagle revision | 87 | * OMAP3 Beagle revision |
60 | * Run time detection of Beagle revision is done by reading GPIO. | 88 | * Run time detection of Beagle revision is done by reading GPIO. |
@@ -292,9 +320,6 @@ static int beagle_twl_gpio_setup(struct device *dev, | |||
292 | gpio_request_one(gpio + TWL4030_GPIO_MAX, beagle_config.usb_pwr_level, | 320 | gpio_request_one(gpio + TWL4030_GPIO_MAX, beagle_config.usb_pwr_level, |
293 | "nEN_USB_PWR"); | 321 | "nEN_USB_PWR"); |
294 | 322 | ||
295 | /* TWL4030_GPIO_MAX + 1 == ledB, PMU_STAT (out, active low LED) */ | ||
296 | gpio_leds[2].gpio = gpio + TWL4030_GPIO_MAX + 1; | ||
297 | |||
298 | return 0; | 323 | return 0; |
299 | } | 324 | } |
300 | 325 | ||
@@ -376,11 +401,6 @@ static struct gpio_led gpio_leds[] = { | |||
376 | .default_trigger = "mmc0", | 401 | .default_trigger = "mmc0", |
377 | .gpio = 149, | 402 | .gpio = 149, |
378 | }, | 403 | }, |
379 | { | ||
380 | .name = "beagleboard::pmu_stat", | ||
381 | .gpio = -EINVAL, /* gets replaced */ | ||
382 | .active_low = true, | ||
383 | }, | ||
384 | }; | 404 | }; |
385 | 405 | ||
386 | static struct gpio_led_platform_data gpio_led_info = { | 406 | static struct gpio_led_platform_data gpio_led_info = { |
@@ -428,6 +448,7 @@ static struct platform_device *omap3_beagle_devices[] __initdata = { | |||
428 | &leds_gpio, | 448 | &leds_gpio, |
429 | &keys_gpio, | 449 | &keys_gpio, |
430 | &madc_hwmon, | 450 | &madc_hwmon, |
451 | &leds_pwm, | ||
431 | }; | 452 | }; |
432 | 453 | ||
433 | static const struct usbhs_omap_board_data usbhs_bdata __initconst = { | 454 | static const struct usbhs_omap_board_data usbhs_bdata __initconst = { |
@@ -524,7 +545,7 @@ static void __init omap3_beagle_init(void) | |||
524 | board_nand_init(omap3beagle_nand_partitions, | 545 | board_nand_init(omap3beagle_nand_partitions, |
525 | ARRAY_SIZE(omap3beagle_nand_partitions), NAND_CS, | 546 | ARRAY_SIZE(omap3beagle_nand_partitions), NAND_CS, |
526 | NAND_BUSWIDTH_16, NULL); | 547 | NAND_BUSWIDTH_16, NULL); |
527 | omap_twl4030_audio_init("omap3beagle"); | 548 | omap_twl4030_audio_init("omap3beagle", NULL); |
528 | 549 | ||
529 | /* Ensure msecure is mux'd to be able to set the RTC. */ | 550 | /* Ensure msecure is mux'd to be able to set the RTC. */ |
530 | omap_mux_init_signal("sys_drm_msecure", OMAP_PIN_OFF_OUTPUT_HIGH); | 551 | omap_mux_init_signal("sys_drm_msecure", OMAP_PIN_OFF_OUTPUT_HIGH); |
@@ -532,6 +553,8 @@ static void __init omap3_beagle_init(void) | |||
532 | /* Ensure SDRC pins are mux'd for self-refresh */ | 553 | /* Ensure SDRC pins are mux'd for self-refresh */ |
533 | omap_mux_init_signal("sdrc_cke0", OMAP_PIN_OUTPUT); | 554 | omap_mux_init_signal("sdrc_cke0", OMAP_PIN_OUTPUT); |
534 | omap_mux_init_signal("sdrc_cke1", OMAP_PIN_OUTPUT); | 555 | omap_mux_init_signal("sdrc_cke1", OMAP_PIN_OUTPUT); |
556 | |||
557 | pwm_add_table(pwm_lookup, ARRAY_SIZE(pwm_lookup)); | ||
535 | } | 558 | } |
536 | 559 | ||
537 | MACHINE_START(OMAP3_BEAGLE, "OMAP3 Beagle Board") | 560 | MACHINE_START(OMAP3_BEAGLE, "OMAP3 Beagle Board") |
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) | |||
744 | omap3evm_init_smsc911x(); | 744 | omap3evm_init_smsc911x(); |
745 | omap3_evm_display_init(); | 745 | omap3_evm_display_init(); |
746 | omap3_evm_wl12xx_init(); | 746 | omap3_evm_wl12xx_init(); |
747 | omap_twl4030_audio_init("omap3evm"); | 747 | omap_twl4030_audio_init("omap3evm", NULL); |
748 | } | 748 | } |
749 | 749 | ||
750 | MACHINE_START(OMAP3EVM, "OMAP3 EVM") | 750 | 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) | |||
506 | overo_display_init(); | 506 | overo_display_init(); |
507 | overo_init_led(); | 507 | overo_init_led(); |
508 | overo_init_keys(); | 508 | overo_init_keys(); |
509 | omap_twl4030_audio_init("overo"); | 509 | omap_twl4030_audio_init("overo", NULL); |
510 | 510 | ||
511 | /* Ensure SDRC pins are mux'd for self-refresh */ | 511 | /* Ensure SDRC pins are mux'd for self-refresh */ |
512 | omap_mux_init_signal("sdrc_cke0", OMAP_PIN_OUTPUT); | 512 | omap_mux_init_signal("sdrc_cke0", OMAP_PIN_OUTPUT); |
diff --git a/arch/arm/mach-omap2/board-zoom-peripherals.c b/arch/arm/mach-omap2/board-zoom-peripherals.c index 26e07addc9d7..0745bd93f398 100644 --- a/arch/arm/mach-omap2/board-zoom-peripherals.c +++ b/arch/arm/mach-omap2/board-zoom-peripherals.c | |||
@@ -20,6 +20,7 @@ | |||
20 | #include <linux/wl12xx.h> | 20 | #include <linux/wl12xx.h> |
21 | #include <linux/mmc/host.h> | 21 | #include <linux/mmc/host.h> |
22 | #include <linux/platform_data/gpio-omap.h> | 22 | #include <linux/platform_data/gpio-omap.h> |
23 | #include <linux/platform_data/omap-twl4030.h> | ||
23 | 24 | ||
24 | #include <asm/mach-types.h> | 25 | #include <asm/mach-types.h> |
25 | #include <asm/mach/arch.h> | 26 | #include <asm/mach/arch.h> |
@@ -34,11 +35,9 @@ | |||
34 | #include "common-board-devices.h" | 35 | #include "common-board-devices.h" |
35 | 36 | ||
36 | #define OMAP_ZOOM_WLAN_PMENA_GPIO (101) | 37 | #define OMAP_ZOOM_WLAN_PMENA_GPIO (101) |
37 | #define ZOOM2_HEADSET_EXTMUTE_GPIO (153) | 38 | #define OMAP_ZOOM_TSC2004_IRQ_GPIO (153) |
38 | #define OMAP_ZOOM_WLAN_IRQ_GPIO (162) | 39 | #define OMAP_ZOOM_WLAN_IRQ_GPIO (162) |
39 | 40 | ||
40 | #define LCD_PANEL_ENABLE_GPIO (7 + OMAP_MAX_GPIO_LINES) | ||
41 | |||
42 | /* Zoom2 has Qwerty keyboard*/ | 41 | /* Zoom2 has Qwerty keyboard*/ |
43 | static uint32_t board_keymap[] = { | 42 | static uint32_t board_keymap[] = { |
44 | KEY(0, 0, KEY_E), | 43 | KEY(0, 0, KEY_E), |
@@ -226,22 +225,31 @@ static struct omap2_hsmmc_info mmc[] = { | |||
226 | {} /* Terminator */ | 225 | {} /* Terminator */ |
227 | }; | 226 | }; |
228 | 227 | ||
228 | static struct omap_tw4030_pdata omap_twl4030_audio_data = { | ||
229 | .voice_connected = true, | ||
230 | .custom_routing = true, | ||
231 | |||
232 | .has_hs = OMAP_TWL4030_LEFT | OMAP_TWL4030_RIGHT, | ||
233 | .has_hf = OMAP_TWL4030_LEFT | OMAP_TWL4030_RIGHT, | ||
234 | |||
235 | .has_mainmic = true, | ||
236 | .has_submic = true, | ||
237 | .has_hsmic = true, | ||
238 | .has_linein = OMAP_TWL4030_LEFT | OMAP_TWL4030_RIGHT, | ||
239 | }; | ||
240 | |||
229 | static int zoom_twl_gpio_setup(struct device *dev, | 241 | static int zoom_twl_gpio_setup(struct device *dev, |
230 | unsigned gpio, unsigned ngpio) | 242 | unsigned gpio, unsigned ngpio) |
231 | { | 243 | { |
232 | int ret; | ||
233 | |||
234 | /* gpio + 0 is "mmc0_cd" (input/IRQ) */ | 244 | /* gpio + 0 is "mmc0_cd" (input/IRQ) */ |
235 | mmc[0].gpio_cd = gpio + 0; | 245 | mmc[0].gpio_cd = gpio + 0; |
236 | omap_hsmmc_late_init(mmc); | 246 | omap_hsmmc_late_init(mmc); |
237 | 247 | ||
238 | ret = gpio_request_one(LCD_PANEL_ENABLE_GPIO, GPIOF_OUT_INIT_LOW, | 248 | /* Audio setup */ |
239 | "lcd enable"); | 249 | omap_twl4030_audio_data.jack_detect = gpio + 2; |
240 | if (ret) | 250 | omap_twl4030_audio_init("Zoom2", &omap_twl4030_audio_data); |
241 | pr_err("Failed to get LCD_PANEL_ENABLE_GPIO (gpio%d).\n", | ||
242 | LCD_PANEL_ENABLE_GPIO); | ||
243 | 251 | ||
244 | return ret; | 252 | return 0; |
245 | } | 253 | } |
246 | 254 | ||
247 | static struct twl4030_gpio_platform_data zoom_gpio_data = { | 255 | static struct twl4030_gpio_platform_data zoom_gpio_data = { |
@@ -264,14 +272,9 @@ static int __init omap_i2c_init(void) | |||
264 | TWL_COMMON_PDATA_MADC | TWL_COMMON_PDATA_AUDIO, | 272 | TWL_COMMON_PDATA_MADC | TWL_COMMON_PDATA_AUDIO, |
265 | TWL_COMMON_REGULATOR_VDAC | TWL_COMMON_REGULATOR_VPLL2); | 273 | TWL_COMMON_REGULATOR_VDAC | TWL_COMMON_REGULATOR_VPLL2); |
266 | 274 | ||
267 | if (machine_is_omap_zoom2()) { | 275 | if (machine_is_omap_zoom2()) |
268 | struct twl4030_codec_data *codec_data; | 276 | zoom_twldata.audio->codec->ramp_delay_value = 3; /* 161 ms */ |
269 | codec_data = zoom_twldata.audio->codec; | ||
270 | 277 | ||
271 | codec_data->ramp_delay_value = 3; /* 161 ms */ | ||
272 | codec_data->hs_extmute = 1; | ||
273 | codec_data->hs_extmute_gpio = ZOOM2_HEADSET_EXTMUTE_GPIO; | ||
274 | } | ||
275 | omap_pmic_init(1, 2400, "twl5030", 7 + OMAP_INTC_START, &zoom_twldata); | 278 | omap_pmic_init(1, 2400, "twl5030", 7 + OMAP_INTC_START, &zoom_twldata); |
276 | omap_register_i2c_bus(2, 400, NULL, 0); | 279 | omap_register_i2c_bus(2, 400, NULL, 0); |
277 | omap_register_i2c_bus(3, 400, NULL, 0); | 280 | omap_register_i2c_bus(3, 400, NULL, 0); |
diff --git a/arch/arm/mach-omap2/twl-common.c b/arch/arm/mach-omap2/twl-common.c index e49b40b4c90a..62cf40b86e4a 100644 --- a/arch/arm/mach-omap2/twl-common.c +++ b/arch/arm/mach-omap2/twl-common.c | |||
@@ -528,24 +528,29 @@ void __init omap4_pmic_get_config(struct twl4030_platform_data *pmic_data, | |||
528 | defined(CONFIG_SND_OMAP_SOC_OMAP_TWL4030_MODULE) | 528 | defined(CONFIG_SND_OMAP_SOC_OMAP_TWL4030_MODULE) |
529 | #include <linux/platform_data/omap-twl4030.h> | 529 | #include <linux/platform_data/omap-twl4030.h> |
530 | 530 | ||
531 | /* Commonly used configuration */ | ||
531 | static struct omap_tw4030_pdata omap_twl4030_audio_data; | 532 | static struct omap_tw4030_pdata omap_twl4030_audio_data; |
532 | 533 | ||
533 | static struct platform_device audio_device = { | 534 | static struct platform_device audio_device = { |
534 | .name = "omap-twl4030", | 535 | .name = "omap-twl4030", |
535 | .id = -1, | 536 | .id = -1, |
536 | .dev = { | ||
537 | .platform_data = &omap_twl4030_audio_data, | ||
538 | }, | ||
539 | }; | 537 | }; |
540 | 538 | ||
541 | void __init omap_twl4030_audio_init(char *card_name) | 539 | void omap_twl4030_audio_init(char *card_name, |
540 | struct omap_tw4030_pdata *pdata) | ||
542 | { | 541 | { |
543 | omap_twl4030_audio_data.card_name = card_name; | 542 | if (!pdata) |
543 | pdata = &omap_twl4030_audio_data; | ||
544 | |||
545 | pdata->card_name = card_name; | ||
546 | |||
547 | audio_device.dev.platform_data = pdata; | ||
544 | platform_device_register(&audio_device); | 548 | platform_device_register(&audio_device); |
545 | } | 549 | } |
546 | 550 | ||
547 | #else /* SOC_OMAP_TWL4030 */ | 551 | #else /* SOC_OMAP_TWL4030 */ |
548 | void __init omap_twl4030_audio_init(char *card_name) | 552 | void omap_twl4030_audio_init(char *card_name, |
553 | struct omap_tw4030_pdata *pdata) | ||
549 | { | 554 | { |
550 | return; | 555 | return; |
551 | } | 556 | } |
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 @@ | |||
32 | 32 | ||
33 | struct twl4030_platform_data; | 33 | struct twl4030_platform_data; |
34 | struct twl6040_platform_data; | 34 | struct twl6040_platform_data; |
35 | struct omap_tw4030_pdata; | ||
35 | struct i2c_board_info; | 36 | struct i2c_board_info; |
36 | 37 | ||
37 | void omap_pmic_init(int bus, u32 clkrate, const char *pmic_type, int pmic_irq, | 38 | 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, | |||
60 | void omap4_pmic_get_config(struct twl4030_platform_data *pmic_data, | 61 | void omap4_pmic_get_config(struct twl4030_platform_data *pmic_data, |
61 | u32 pdata_flags, u32 regulators_flags); | 62 | u32 pdata_flags, u32 regulators_flags); |
62 | 63 | ||
63 | void omap_twl4030_audio_init(char *card_name); | 64 | void omap_twl4030_audio_init(char *card_name, struct omap_tw4030_pdata *pdata); |
64 | 65 | ||
65 | #endif /* __OMAP_PMIC_COMMON__ */ | 66 | #endif /* __OMAP_PMIC_COMMON__ */ |