aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPeter Ujfalusi <peter.ujfalusi@ti.com>2012-12-05 08:45:23 -0500
committerPeter Ujfalusi <peter.ujfalusi@ti.com>2013-01-22 04:34:50 -0500
commit40234bf733042eb4343cb47c816619758e477eeb (patch)
tree8ef9db0274dd96b47a7a72297a24f3b9be6a417c
parent02553f5ac2b3e7d0405e5a51d87ef0727ad6fb2f (diff)
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 <peter.ujfalusi@ti.com>
-rw-r--r--arch/arm/mach-omap2/board-cm-t35.c2
-rw-r--r--arch/arm/mach-omap2/board-devkit8000.c2
-rw-r--r--arch/arm/mach-omap2/board-igep0020.c2
-rw-r--r--arch/arm/mach-omap2/board-omap3beagle.c2
-rw-r--r--arch/arm/mach-omap2/board-omap3evm.c2
-rw-r--r--arch/arm/mach-omap2/board-overo.c2
-rw-r--r--arch/arm/mach-omap2/twl-common.c22
-rw-r--r--arch/arm/mach-omap2/twl-common.h3
8 files changed, 19 insertions, 18 deletions
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 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)
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..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)
524 board_nand_init(omap3beagle_nand_partitions, 524 board_nand_init(omap3beagle_nand_partitions,
525 ARRAY_SIZE(omap3beagle_nand_partitions), NAND_CS, 525 ARRAY_SIZE(omap3beagle_nand_partitions), NAND_CS,
526 NAND_BUSWIDTH_16, NULL); 526 NAND_BUSWIDTH_16, NULL);
527 omap_twl4030_audio_init("omap3beagle"); 527 omap_twl4030_audio_init("omap3beagle", NULL);
528 528
529 /* Ensure msecure is mux'd to be able to set the RTC. */ 529 /* 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); 530 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)
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
750MACHINE_START(OMAP3EVM, "OMAP3 EVM") 750MACHINE_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/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,
529#include <linux/platform_data/omap-twl4030.h> 529#include <linux/platform_data/omap-twl4030.h>
530 530
531/* Commonly used configuration */ 531/* Commonly used configuration */
532static struct omap_tw4030_pdata omap_twl4030_audio_data = { 532static struct omap_tw4030_pdata omap_twl4030_audio_data;
533 .has_hs = OMAP_TWL4030_LEFT | OMAP_TWL4030_RIGHT,
534 .has_hf = OMAP_TWL4030_LEFT | OMAP_TWL4030_RIGHT,
535 .has_linein = OMAP_TWL4030_LEFT | OMAP_TWL4030_RIGHT,
536};
537 533
538static struct platform_device audio_device = { 534static struct platform_device audio_device = {
539 .name = "omap-twl4030", 535 .name = "omap-twl4030",
540 .id = -1, 536 .id = -1,
541 .dev = {
542 .platform_data = &omap_twl4030_audio_data,
543 },
544}; 537};
545 538
546void __init omap_twl4030_audio_init(char *card_name) 539void __init omap_twl4030_audio_init(char *card_name,
540 struct omap_tw4030_pdata *pdata)
547{ 541{
548 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;
549 platform_device_register(&audio_device); 548 platform_device_register(&audio_device);
550} 549}
551 550
552#else /* SOC_OMAP_TWL4030 */ 551#else /* SOC_OMAP_TWL4030 */
553void __init omap_twl4030_audio_init(char *card_name) 552void __init omap_twl4030_audio_init(char *card_name,
553 struct omap_tw4030_pdata *pdata)
554{ 554{
555 return; 555 return;
556} 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
33struct twl4030_platform_data; 33struct twl4030_platform_data;
34struct twl6040_platform_data; 34struct twl6040_platform_data;
35struct omap_tw4030_pdata;
35struct i2c_board_info; 36struct i2c_board_info;
36 37
37void omap_pmic_init(int bus, u32 clkrate, const char *pmic_type, int pmic_irq, 38void 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,
60void omap4_pmic_get_config(struct twl4030_platform_data *pmic_data, 61void 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
63void omap_twl4030_audio_init(char *card_name); 64void omap_twl4030_audio_init(char *card_name, struct omap_tw4030_pdata *pdata);
64 65
65#endif /* __OMAP_PMIC_COMMON__ */ 66#endif /* __OMAP_PMIC_COMMON__ */