diff options
Diffstat (limited to 'arch')
-rw-r--r-- | arch/arm/mach-omap2/twl-common.c | 78 |
1 files changed, 41 insertions, 37 deletions
diff --git a/arch/arm/mach-omap2/twl-common.c b/arch/arm/mach-omap2/twl-common.c index 2543342dbccb..daa056ed8738 100644 --- a/arch/arm/mach-omap2/twl-common.c +++ b/arch/arm/mach-omap2/twl-common.c | |||
@@ -48,14 +48,7 @@ void __init omap_pmic_init(int bus, u32 clkrate, | |||
48 | omap_register_i2c_bus(bus, clkrate, &pmic_i2c_board_info, 1); | 48 | omap_register_i2c_bus(bus, clkrate, &pmic_i2c_board_info, 1); |
49 | } | 49 | } |
50 | 50 | ||
51 | static struct twl4030_usb_data omap4_usb_pdata = { | 51 | #if defined(CONFIG_ARCH_OMAP3) |
52 | .phy_init = omap4430_phy_init, | ||
53 | .phy_exit = omap4430_phy_exit, | ||
54 | .phy_power = omap4430_phy_power, | ||
55 | .phy_set_clock = omap4430_phy_set_clk, | ||
56 | .phy_suspend = omap4430_phy_suspend, | ||
57 | }; | ||
58 | |||
59 | static struct twl4030_usb_data omap3_usb_pdata = { | 52 | static struct twl4030_usb_data omap3_usb_pdata = { |
60 | .usb_mode = T2_USB_MODE_ULPI, | 53 | .usb_mode = T2_USB_MODE_ULPI, |
61 | }; | 54 | }; |
@@ -122,6 +115,45 @@ static struct regulator_init_data omap3_vpll2_idata = { | |||
122 | .consumer_supplies = omap3_vpll2_supplies, | 115 | .consumer_supplies = omap3_vpll2_supplies, |
123 | }; | 116 | }; |
124 | 117 | ||
118 | void __init omap3_pmic_get_config(struct twl4030_platform_data *pmic_data, | ||
119 | u32 pdata_flags, u32 regulators_flags) | ||
120 | { | ||
121 | if (!pmic_data->irq_base) | ||
122 | pmic_data->irq_base = TWL4030_IRQ_BASE; | ||
123 | if (!pmic_data->irq_end) | ||
124 | pmic_data->irq_end = TWL4030_IRQ_END; | ||
125 | |||
126 | /* Common platform data configurations */ | ||
127 | if (pdata_flags & TWL_COMMON_PDATA_USB && !pmic_data->usb) | ||
128 | pmic_data->usb = &omap3_usb_pdata; | ||
129 | |||
130 | if (pdata_flags & TWL_COMMON_PDATA_BCI && !pmic_data->bci) | ||
131 | pmic_data->bci = &omap3_bci_pdata; | ||
132 | |||
133 | if (pdata_flags & TWL_COMMON_PDATA_MADC && !pmic_data->madc) | ||
134 | pmic_data->madc = &omap3_madc_pdata; | ||
135 | |||
136 | if (pdata_flags & TWL_COMMON_PDATA_AUDIO && !pmic_data->audio) | ||
137 | pmic_data->audio = &omap3_audio_pdata; | ||
138 | |||
139 | /* Common regulator configurations */ | ||
140 | if (regulators_flags & TWL_COMMON_REGULATOR_VDAC && !pmic_data->vdac) | ||
141 | pmic_data->vdac = &omap3_vdac_idata; | ||
142 | |||
143 | if (regulators_flags & TWL_COMMON_REGULATOR_VPLL2 && !pmic_data->vpll2) | ||
144 | pmic_data->vpll2 = &omap3_vpll2_idata; | ||
145 | } | ||
146 | #endif /* CONFIG_ARCH_OMAP3 */ | ||
147 | |||
148 | #if defined(CONFIG_ARCH_OMAP4) | ||
149 | static struct twl4030_usb_data omap4_usb_pdata = { | ||
150 | .phy_init = omap4430_phy_init, | ||
151 | .phy_exit = omap4430_phy_exit, | ||
152 | .phy_power = omap4430_phy_power, | ||
153 | .phy_set_clock = omap4430_phy_set_clk, | ||
154 | .phy_suspend = omap4430_phy_suspend, | ||
155 | }; | ||
156 | |||
125 | static struct regulator_init_data omap4_vdac_idata = { | 157 | static struct regulator_init_data omap4_vdac_idata = { |
126 | .constraints = { | 158 | .constraints = { |
127 | .min_uV = 1800000, | 159 | .min_uV = 1800000, |
@@ -273,32 +305,4 @@ void __init omap4_pmic_get_config(struct twl4030_platform_data *pmic_data, | |||
273 | !pmic_data->clk32kg) | 305 | !pmic_data->clk32kg) |
274 | pmic_data->clk32kg = &omap4_clk32kg_idata; | 306 | pmic_data->clk32kg = &omap4_clk32kg_idata; |
275 | } | 307 | } |
276 | 308 | #endif /* CONFIG_ARCH_OMAP4 */ | |
277 | void __init omap3_pmic_get_config(struct twl4030_platform_data *pmic_data, | ||
278 | u32 pdata_flags, u32 regulators_flags) | ||
279 | { | ||
280 | if (!pmic_data->irq_base) | ||
281 | pmic_data->irq_base = TWL4030_IRQ_BASE; | ||
282 | if (!pmic_data->irq_end) | ||
283 | pmic_data->irq_end = TWL4030_IRQ_END; | ||
284 | |||
285 | /* Common platform data configurations */ | ||
286 | if (pdata_flags & TWL_COMMON_PDATA_USB && !pmic_data->usb) | ||
287 | pmic_data->usb = &omap3_usb_pdata; | ||
288 | |||
289 | if (pdata_flags & TWL_COMMON_PDATA_BCI && !pmic_data->bci) | ||
290 | pmic_data->bci = &omap3_bci_pdata; | ||
291 | |||
292 | if (pdata_flags & TWL_COMMON_PDATA_MADC && !pmic_data->madc) | ||
293 | pmic_data->madc = &omap3_madc_pdata; | ||
294 | |||
295 | if (pdata_flags & TWL_COMMON_PDATA_AUDIO && !pmic_data->audio) | ||
296 | pmic_data->audio = &omap3_audio_pdata; | ||
297 | |||
298 | /* Common regulator configurations */ | ||
299 | if (regulators_flags & TWL_COMMON_REGULATOR_VDAC && !pmic_data->vdac) | ||
300 | pmic_data->vdac = &omap3_vdac_idata; | ||
301 | |||
302 | if (regulators_flags & TWL_COMMON_REGULATOR_VPLL2 && !pmic_data->vpll2) | ||
303 | pmic_data->vpll2 = &omap3_vpll2_idata; | ||
304 | } | ||