diff options
Diffstat (limited to 'arch/arm/mach-omap2/twl-common.c')
-rw-r--r-- | arch/arm/mach-omap2/twl-common.c | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/arch/arm/mach-omap2/twl-common.c b/arch/arm/mach-omap2/twl-common.c index e49b40b4c90a..51e138cc5398 100644 --- a/arch/arm/mach-omap2/twl-common.c +++ b/arch/arm/mach-omap2/twl-common.c | |||
@@ -23,6 +23,7 @@ | |||
23 | #include <linux/i2c.h> | 23 | #include <linux/i2c.h> |
24 | #include <linux/i2c/twl.h> | 24 | #include <linux/i2c/twl.h> |
25 | #include <linux/gpio.h> | 25 | #include <linux/gpio.h> |
26 | #include <linux/string.h> | ||
26 | #include <linux/regulator/machine.h> | 27 | #include <linux/regulator/machine.h> |
27 | #include <linux/regulator/fixed.h> | 28 | #include <linux/regulator/fixed.h> |
28 | 29 | ||
@@ -56,7 +57,7 @@ void __init omap_pmic_init(int bus, u32 clkrate, | |||
56 | struct twl4030_platform_data *pmic_data) | 57 | struct twl4030_platform_data *pmic_data) |
57 | { | 58 | { |
58 | omap_mux_init_signal("sys_nirq", OMAP_PIN_INPUT_PULLUP | OMAP_PIN_OFF_WAKEUPENABLE); | 59 | omap_mux_init_signal("sys_nirq", OMAP_PIN_INPUT_PULLUP | OMAP_PIN_OFF_WAKEUPENABLE); |
59 | strncpy(pmic_i2c_board_info.type, pmic_type, | 60 | strlcpy(pmic_i2c_board_info.type, pmic_type, |
60 | sizeof(pmic_i2c_board_info.type)); | 61 | sizeof(pmic_i2c_board_info.type)); |
61 | pmic_i2c_board_info.irq = pmic_irq; | 62 | pmic_i2c_board_info.irq = pmic_irq; |
62 | pmic_i2c_board_info.platform_data = pmic_data; | 63 | pmic_i2c_board_info.platform_data = pmic_data; |
@@ -528,24 +529,29 @@ void __init omap4_pmic_get_config(struct twl4030_platform_data *pmic_data, | |||
528 | defined(CONFIG_SND_OMAP_SOC_OMAP_TWL4030_MODULE) | 529 | defined(CONFIG_SND_OMAP_SOC_OMAP_TWL4030_MODULE) |
529 | #include <linux/platform_data/omap-twl4030.h> | 530 | #include <linux/platform_data/omap-twl4030.h> |
530 | 531 | ||
532 | /* Commonly used configuration */ | ||
531 | static struct omap_tw4030_pdata omap_twl4030_audio_data; | 533 | static struct omap_tw4030_pdata omap_twl4030_audio_data; |
532 | 534 | ||
533 | static struct platform_device audio_device = { | 535 | static struct platform_device audio_device = { |
534 | .name = "omap-twl4030", | 536 | .name = "omap-twl4030", |
535 | .id = -1, | 537 | .id = -1, |
536 | .dev = { | ||
537 | .platform_data = &omap_twl4030_audio_data, | ||
538 | }, | ||
539 | }; | 538 | }; |
540 | 539 | ||
541 | void __init omap_twl4030_audio_init(char *card_name) | 540 | void omap_twl4030_audio_init(char *card_name, |
541 | struct omap_tw4030_pdata *pdata) | ||
542 | { | 542 | { |
543 | omap_twl4030_audio_data.card_name = card_name; | 543 | if (!pdata) |
544 | pdata = &omap_twl4030_audio_data; | ||
545 | |||
546 | pdata->card_name = card_name; | ||
547 | |||
548 | audio_device.dev.platform_data = pdata; | ||
544 | platform_device_register(&audio_device); | 549 | platform_device_register(&audio_device); |
545 | } | 550 | } |
546 | 551 | ||
547 | #else /* SOC_OMAP_TWL4030 */ | 552 | #else /* SOC_OMAP_TWL4030 */ |
548 | void __init omap_twl4030_audio_init(char *card_name) | 553 | void omap_twl4030_audio_init(char *card_name, |
554 | struct omap_tw4030_pdata *pdata) | ||
549 | { | 555 | { |
550 | return; | 556 | return; |
551 | } | 557 | } |