aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/arm/mach-omap2/board-4430sdp.c12
-rw-r--r--arch/arm/mach-omap2/board-omap4panda.c12
-rw-r--r--arch/arm/mach-omap2/twl-common.c37
-rw-r--r--arch/arm/mach-omap2/twl-common.h3
4 files changed, 33 insertions, 31 deletions
diff --git a/arch/arm/mach-omap2/board-4430sdp.c b/arch/arm/mach-omap2/board-4430sdp.c
index e82098fbedd6..749ce9634e8e 100644
--- a/arch/arm/mach-omap2/board-4430sdp.c
+++ b/arch/arm/mach-omap2/board-4430sdp.c
@@ -545,6 +545,14 @@ static struct twl6040_platform_data twl6040_data = {
545 .audpwron_gpio = 127, 545 .audpwron_gpio = 127,
546}; 546};
547 547
548static struct i2c_board_info __initdata sdp4430_i2c_1_boardinfo[] = {
549 {
550 I2C_BOARD_INFO("twl6040", 0x4b),
551 .irq = 119 + OMAP44XX_IRQ_GIC_START,
552 .platform_data = &twl6040_data,
553 },
554};
555
548static struct twl4030_platform_data sdp4430_twldata = { 556static struct twl4030_platform_data sdp4430_twldata = {
549 /* Regulators */ 557 /* Regulators */
550 .vusim = &sdp4430_vusim, 558 .vusim = &sdp4430_vusim,
@@ -578,8 +586,8 @@ static int __init omap4_i2c_init(void)
578 TWL_COMMON_REGULATOR_CLK32KG | 586 TWL_COMMON_REGULATOR_CLK32KG |
579 TWL_COMMON_REGULATOR_V1V8 | 587 TWL_COMMON_REGULATOR_V1V8 |
580 TWL_COMMON_REGULATOR_V2V1); 588 TWL_COMMON_REGULATOR_V2V1);
581 omap4_pmic_init("twl6030", &sdp4430_twldata, 589 omap4_pmic_init("twl6030", &sdp4430_twldata, sdp4430_i2c_1_boardinfo,
582 &twl6040_data, 119 + OMAP44XX_IRQ_GIC_START); 590 ARRAY_SIZE(sdp4430_i2c_1_boardinfo));
583 omap_register_i2c_bus(2, 400, NULL, 0); 591 omap_register_i2c_bus(2, 400, NULL, 0);
584 omap_register_i2c_bus(3, 400, sdp4430_i2c_3_boardinfo, 592 omap_register_i2c_bus(3, 400, sdp4430_i2c_3_boardinfo,
585 ARRAY_SIZE(sdp4430_i2c_3_boardinfo)); 593 ARRAY_SIZE(sdp4430_i2c_3_boardinfo));
diff --git a/arch/arm/mach-omap2/board-omap4panda.c b/arch/arm/mach-omap2/board-omap4panda.c
index 45fe2d3f59b1..7b592d3d7797 100644
--- a/arch/arm/mach-omap2/board-omap4panda.c
+++ b/arch/arm/mach-omap2/board-omap4panda.c
@@ -264,6 +264,14 @@ static struct twl6040_platform_data twl6040_data = {
264 .audpwron_gpio = 127, 264 .audpwron_gpio = 127,
265}; 265};
266 266
267static struct i2c_board_info __initdata panda_i2c_1_boardinfo[] = {
268 {
269 I2C_BOARD_INFO("twl6040", 0x4b),
270 .irq = 119 + OMAP44XX_IRQ_GIC_START,
271 .platform_data = &twl6040_data,
272 },
273};
274
267/* Panda board uses the common PMIC configuration */ 275/* Panda board uses the common PMIC configuration */
268static struct twl4030_platform_data omap4_panda_twldata; 276static struct twl4030_platform_data omap4_panda_twldata;
269 277
@@ -291,8 +299,8 @@ static int __init omap4_panda_i2c_init(void)
291 TWL_COMMON_REGULATOR_CLK32KG | 299 TWL_COMMON_REGULATOR_CLK32KG |
292 TWL_COMMON_REGULATOR_V1V8 | 300 TWL_COMMON_REGULATOR_V1V8 |
293 TWL_COMMON_REGULATOR_V2V1); 301 TWL_COMMON_REGULATOR_V2V1);
294 omap4_pmic_init("twl6030", &omap4_panda_twldata, 302 omap4_pmic_init("twl6030", &omap4_panda_twldata, panda_i2c_1_boardinfo,
295 &twl6040_data, 119 + OMAP44XX_IRQ_GIC_START); 303 ARRAY_SIZE(panda_i2c_1_boardinfo));
296 omap_register_i2c_bus(2, 400, NULL, 0); 304 omap_register_i2c_bus(2, 400, NULL, 0);
297 /* 305 /*
298 * Bus 3 is attached to the DVI port where devices like the pico DLP 306 * Bus 3 is attached to the DVI port where devices like the pico DLP
diff --git a/arch/arm/mach-omap2/twl-common.c b/arch/arm/mach-omap2/twl-common.c
index 99be94e94547..af93acccc70b 100644
--- a/arch/arm/mach-omap2/twl-common.c
+++ b/arch/arm/mach-omap2/twl-common.c
@@ -40,16 +40,6 @@ static struct i2c_board_info __initdata pmic_i2c_board_info = {
40 .flags = I2C_CLIENT_WAKE, 40 .flags = I2C_CLIENT_WAKE,
41}; 41};
42 42
43static struct i2c_board_info __initdata omap4_i2c1_board_info[] = {
44 {
45 .addr = 0x48,
46 .flags = I2C_CLIENT_WAKE,
47 },
48 {
49 I2C_BOARD_INFO("twl6040", 0x4b),
50 },
51};
52
53#if defined(CONFIG_ARCH_OMAP3) || defined(CONFIG_ARCH_OMAP4) 43#if defined(CONFIG_ARCH_OMAP3) || defined(CONFIG_ARCH_OMAP4)
54static int twl_set_voltage(void *data, int target_uV) 44static int twl_set_voltage(void *data, int target_uV)
55{ 45{
@@ -79,30 +69,25 @@ void __init omap_pmic_init(int bus, u32 clkrate,
79 69
80void __init omap4_pmic_init(const char *pmic_type, 70void __init omap4_pmic_init(const char *pmic_type,
81 struct twl4030_platform_data *pmic_data, 71 struct twl4030_platform_data *pmic_data,
82 struct twl6040_platform_data *twl6040_data, int twl6040_irq) 72 struct i2c_board_info *devices, int nr_devices)
83{ 73{
84 /* PMIC part*/ 74 /* PMIC part*/
85 omap_mux_init_signal("sys_nirq1", OMAP_PIN_INPUT_PULLUP | OMAP_PIN_OFF_WAKEUPENABLE); 75 omap_mux_init_signal("sys_nirq1", OMAP_PIN_INPUT_PULLUP | OMAP_PIN_OFF_WAKEUPENABLE);
86 strncpy(omap4_i2c1_board_info[0].type, pmic_type, 76 omap_pmic_init(1, 400, pmic_type, 7 + OMAP44XX_IRQ_GIC_START, pmic_data);
87 sizeof(omap4_i2c1_board_info[0].type));
88 omap4_i2c1_board_info[0].irq = 7 + OMAP44XX_IRQ_GIC_START;
89 omap4_i2c1_board_info[0].platform_data = pmic_data;
90
91 /* TWL6040 audio IC part */
92 omap4_i2c1_board_info[1].irq = twl6040_irq;
93 omap4_i2c1_board_info[1].platform_data = twl6040_data;
94
95 omap_register_i2c_bus(1, 400, omap4_i2c1_board_info, 2);
96 77
78 /* Register additional devices on i2c1 bus if needed */
79 if (devices)
80 i2c_register_board_info(1, devices, nr_devices);
97} 81}
98 82
99void __init omap_pmic_late_init(void) 83void __init omap_pmic_late_init(void)
100{ 84{
101 /* Init the OMAP TWL parameters (if PMIC has been registered) */ 85 /* Init the OMAP TWL parameters (if PMIC has been registerd) */
102 if (pmic_i2c_board_info.irq) 86 if (!pmic_i2c_board_info.irq)
103 omap3_twl_init(); 87 return;
104 if (omap4_i2c1_board_info[0].irq) 88
105 omap4_twl_init(); 89 omap3_twl_init();
90 omap4_twl_init();
106} 91}
107 92
108#if defined(CONFIG_ARCH_OMAP3) 93#if defined(CONFIG_ARCH_OMAP3)
diff --git a/arch/arm/mach-omap2/twl-common.h b/arch/arm/mach-omap2/twl-common.h
index d109c09ef34b..2256efe90cf1 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 i2c_board_info;
35 36
36void omap_pmic_init(int bus, u32 clkrate, const char *pmic_type, int pmic_irq, 37void omap_pmic_init(int bus, u32 clkrate, const char *pmic_type, int pmic_irq,
37 struct twl4030_platform_data *pmic_data); 38 struct twl4030_platform_data *pmic_data);
@@ -51,7 +52,7 @@ static inline void omap3_pmic_init(const char *pmic_type,
51 52
52void omap4_pmic_init(const char *pmic_type, 53void omap4_pmic_init(const char *pmic_type,
53 struct twl4030_platform_data *pmic_data, 54 struct twl4030_platform_data *pmic_data,
54 struct twl6040_platform_data *audio_data, int twl6040_irq); 55 struct i2c_board_info *devices, int nr_devices);
55 56
56void omap3_pmic_get_config(struct twl4030_platform_data *pmic_data, 57void omap3_pmic_get_config(struct twl4030_platform_data *pmic_data,
57 u32 pdata_flags, u32 regulators_flags); 58 u32 pdata_flags, u32 regulators_flags);