Skip to content

Commit

Permalink
ARM: OMAP2+: twl-common: Allow boards to customize the twl4030 audio …
Browse files Browse the repository at this point in the history
…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>
  • Loading branch information
Peter Ujfalusi committed Jan 22, 2013
1 parent 02553f5 commit 40234bf
Show file tree
Hide file tree
Showing 8 changed files with 19 additions and 18 deletions.
2 changes: 1 addition & 1 deletion arch/arm/mach-omap2/board-cm-t35.c
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mach-omap2/board-devkit8000.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mach-omap2/board-igep0020.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mach-omap2/board-omap3beagle.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mach-omap2/board-omap3evm.c
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mach-omap2/board-overo.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
22 changes: 11 additions & 11 deletions arch/arm/mach-omap2/twl-common.c
Original file line number Diff line number Diff line change
Expand Up @@ -529,28 +529,28 @@ void __init omap4_pmic_get_config(struct twl4030_platform_data *pmic_data,
#include <linux/platform_data/omap-twl4030.h>

/* 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;
}
Expand Down
3 changes: 2 additions & 1 deletion arch/arm/mach-omap2/twl-common.h
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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__ */

0 comments on commit 40234bf

Please sign in to comment.