diff options
author | Peter Ujfalusi <peter.ujfalusi@ti.com> | 2011-12-08 04:15:45 -0500 |
---|---|---|
committer | Peter Ujfalusi <peter.ujfalusi@ti.com> | 2012-01-26 08:40:55 -0500 |
commit | 3c90c98a1ebbb08d95700ce8a3b7bce6286607bd (patch) | |
tree | 33a75cee342ef60254115cad8f23833439a619e1 /arch/arm/mach-omap2/board-omap4panda.c | |
parent | 62ba98ce4a74ef606e6a7f6c8541fc5e3127f944 (diff) |
OMAP4: omap4panda: Enable audio support
PandaBoard has twl6040 codec for audio.
Register the omap4-abe-twl6040 platform device.
Add platform data to enable the twl6040 codec.
Since there is a difference in audio between PandaBoard 4430
and PandaBoard ES (4460):
Use different name for the sound card:
"PandaBoard" for PandaBoard 4430
"PandaBoardES" for PandaBoard ES
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
CC: Santosh Shilimkar <santosh.shilimkar@ti.com>
CC: David Anders <x0132446@ti.com>
Acked-by: Tony Lindgren <tony@atomide.com>
Acked-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
Diffstat (limited to 'arch/arm/mach-omap2/board-omap4panda.c')
-rw-r--r-- | arch/arm/mach-omap2/board-omap4panda.c | 60 |
1 files changed, 59 insertions, 1 deletions
diff --git a/arch/arm/mach-omap2/board-omap4panda.c b/arch/arm/mach-omap2/board-omap4panda.c index 30ad40db2cf3..eada955014af 100644 --- a/arch/arm/mach-omap2/board-omap4panda.c +++ b/arch/arm/mach-omap2/board-omap4panda.c | |||
@@ -28,6 +28,7 @@ | |||
28 | #include <linux/regulator/machine.h> | 28 | #include <linux/regulator/machine.h> |
29 | #include <linux/regulator/fixed.h> | 29 | #include <linux/regulator/fixed.h> |
30 | #include <linux/wl12xx.h> | 30 | #include <linux/wl12xx.h> |
31 | #include <linux/platform_data/omap-abe-twl6040.h> | ||
31 | 32 | ||
32 | #include <mach/hardware.h> | 33 | #include <mach/hardware.h> |
33 | #include <asm/hardware/gic.h> | 34 | #include <asm/hardware/gic.h> |
@@ -90,9 +91,34 @@ static struct platform_device leds_gpio = { | |||
90 | }, | 91 | }, |
91 | }; | 92 | }; |
92 | 93 | ||
94 | static struct omap_abe_twl6040_data panda_abe_audio_data = { | ||
95 | /* Audio out */ | ||
96 | .has_hs = ABE_TWL6040_LEFT | ABE_TWL6040_RIGHT, | ||
97 | /* HandsFree through expasion connector */ | ||
98 | .has_hf = ABE_TWL6040_LEFT | ABE_TWL6040_RIGHT, | ||
99 | /* PandaBoard: FM TX, PandaBoardES: can be connected to audio out */ | ||
100 | .has_aux = ABE_TWL6040_LEFT | ABE_TWL6040_RIGHT, | ||
101 | /* PandaBoard: FM RX, PandaBoardES: audio in */ | ||
102 | .has_afm = ABE_TWL6040_LEFT | ABE_TWL6040_RIGHT, | ||
103 | /* No jack detection. */ | ||
104 | .jack_detection = 0, | ||
105 | /* MCLK input is 38.4MHz */ | ||
106 | .mclk_freq = 38400000, | ||
107 | |||
108 | }; | ||
109 | |||
110 | static struct platform_device panda_abe_audio = { | ||
111 | .name = "omap-abe-twl6040", | ||
112 | .id = -1, | ||
113 | .dev = { | ||
114 | .platform_data = &panda_abe_audio_data, | ||
115 | }, | ||
116 | }; | ||
117 | |||
93 | static struct platform_device *panda_devices[] __initdata = { | 118 | static struct platform_device *panda_devices[] __initdata = { |
94 | &leds_gpio, | 119 | &leds_gpio, |
95 | &wl1271_device, | 120 | &wl1271_device, |
121 | &panda_abe_audio, | ||
96 | }; | 122 | }; |
97 | 123 | ||
98 | static const struct usbhs_omap_board_data usbhs_bdata __initconst = { | 124 | static const struct usbhs_omap_board_data usbhs_bdata __initconst = { |
@@ -251,8 +277,25 @@ static int __init omap4_twl6030_hsmmc_init(struct omap2_hsmmc_info *controllers) | |||
251 | return 0; | 277 | return 0; |
252 | } | 278 | } |
253 | 279 | ||
280 | static struct twl4030_codec_data twl6040_codec = { | ||
281 | /* single-step ramp for headset and handsfree */ | ||
282 | .hs_left_step = 0x0f, | ||
283 | .hs_right_step = 0x0f, | ||
284 | .hf_left_step = 0x1d, | ||
285 | .hf_right_step = 0x1d, | ||
286 | }; | ||
287 | |||
288 | static struct twl4030_audio_data twl6040_audio = { | ||
289 | .codec = &twl6040_codec, | ||
290 | .audpwron_gpio = 127, | ||
291 | .naudint_irq = OMAP44XX_IRQ_SYS_2N, | ||
292 | .irq_base = TWL6040_CODEC_IRQ_BASE, | ||
293 | }; | ||
294 | |||
254 | /* Panda board uses the common PMIC configuration */ | 295 | /* Panda board uses the common PMIC configuration */ |
255 | static struct twl4030_platform_data omap4_panda_twldata; | 296 | static struct twl4030_platform_data omap4_panda_twldata = { |
297 | .audio = &twl6040_audio, | ||
298 | }; | ||
256 | 299 | ||
257 | /* | 300 | /* |
258 | * Display monitor features are burnt in their EEPROM as EDID data. The EEPROM | 301 | * Display monitor features are burnt in their EEPROM as EDID data. The EEPROM |
@@ -475,6 +518,20 @@ void omap4_panda_display_init(void) | |||
475 | omap_hdmi_init(0); | 518 | omap_hdmi_init(0); |
476 | } | 519 | } |
477 | 520 | ||
521 | static void omap4_panda_init_rev(void) | ||
522 | { | ||
523 | if (cpu_is_omap4430()) { | ||
524 | /* PandaBoard 4430 */ | ||
525 | /* ASoC audio configuration */ | ||
526 | panda_abe_audio_data.card_name = "PandaBoard"; | ||
527 | panda_abe_audio_data.has_hsmic = 1; | ||
528 | } else { | ||
529 | /* PandaBoard ES */ | ||
530 | /* ASoC audio configuration */ | ||
531 | panda_abe_audio_data.card_name = "PandaBoardES"; | ||
532 | } | ||
533 | } | ||
534 | |||
478 | static void __init omap4_panda_init(void) | 535 | static void __init omap4_panda_init(void) |
479 | { | 536 | { |
480 | int package = OMAP_PACKAGE_CBS; | 537 | int package = OMAP_PACKAGE_CBS; |
@@ -486,6 +543,7 @@ static void __init omap4_panda_init(void) | |||
486 | if (wl12xx_set_platform_data(&omap_panda_wlan_data)) | 543 | if (wl12xx_set_platform_data(&omap_panda_wlan_data)) |
487 | pr_err("error setting wl12xx data\n"); | 544 | pr_err("error setting wl12xx data\n"); |
488 | 545 | ||
546 | omap4_panda_init_rev(); | ||
489 | omap4_panda_i2c_init(); | 547 | omap4_panda_i2c_init(); |
490 | platform_add_devices(panda_devices, ARRAY_SIZE(panda_devices)); | 548 | platform_add_devices(panda_devices, ARRAY_SIZE(panda_devices)); |
491 | platform_device_register(&omap_vwlan_device); | 549 | platform_device_register(&omap_vwlan_device); |