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>
This commit is contained in:
Peter Ujfalusi
2012-12-05 14:45:23 +01:00
parent 02553f5ac2
commit 40234bf733
8 changed files with 19 additions and 18 deletions

View File

@@ -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;
}