aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-omap2/board-zoom-peripherals.c
diff options
context:
space:
mode:
authorArnd Bergmann <arnd@arndb.de>2011-07-28 11:25:46 -0400
committerArnd Bergmann <arnd@arndb.de>2011-07-28 11:25:46 -0400
commit6124a4e430b64d1577438c8648c59e996d02e73e (patch)
tree49cfafad785d1c9e403a5b0d755298b9af2c260f /arch/arm/mach-omap2/board-zoom-peripherals.c
parent8e267f3da5f117d2f1316cf6ddf740f93f1c73aa (diff)
parent580975d7f48d7d047e22bb0f42adf7557801d8d4 (diff)
Merge branch 'imx/dt' into next/dt
Diffstat (limited to 'arch/arm/mach-omap2/board-zoom-peripherals.c')
-rw-r--r--arch/arm/mach-omap2/board-zoom-peripherals.c128
1 files changed, 27 insertions, 101 deletions
diff --git a/arch/arm/mach-omap2/board-zoom-peripherals.c b/arch/arm/mach-omap2/board-zoom-peripherals.c
index 118c6f53c5e..6d0aa4fcb7c 100644
--- a/arch/arm/mach-omap2/board-zoom-peripherals.c
+++ b/arch/arm/mach-omap2/board-zoom-peripherals.c
@@ -105,21 +105,20 @@ static struct twl4030_keypad_data zoom_kp_twl4030_data = {
105 .rep = 1, 105 .rep = 1,
106}; 106};
107 107
108static struct regulator_consumer_supply zoom_vmmc1_supply = { 108static struct regulator_consumer_supply zoom_vmmc1_supply[] = {
109 .supply = "vmmc", 109 REGULATOR_SUPPLY("vmmc", "omap_hsmmc.0"),
110}; 110};
111 111
112static struct regulator_consumer_supply zoom_vsim_supply = { 112static struct regulator_consumer_supply zoom_vsim_supply[] = {
113 .supply = "vmmc_aux", 113 REGULATOR_SUPPLY("vmmc_aux", "omap_hsmmc.0"),
114}; 114};
115 115
116static struct regulator_consumer_supply zoom_vmmc2_supply = { 116static struct regulator_consumer_supply zoom_vmmc2_supply[] = {
117 .supply = "vmmc", 117 REGULATOR_SUPPLY("vmmc", "omap_hsmmc.1"),
118}; 118};
119 119
120static struct regulator_consumer_supply zoom_vmmc3_supply = { 120static struct regulator_consumer_supply zoom_vmmc3_supply[] = {
121 .supply = "vmmc", 121 REGULATOR_SUPPLY("vmmc", "omap_hsmmc.2"),
122 .dev_name = "omap_hsmmc.2",
123}; 122};
124 123
125/* VMMC1 for OMAP VDD_MMC1 (i/o) and MMC1 card */ 124/* VMMC1 for OMAP VDD_MMC1 (i/o) and MMC1 card */
@@ -133,8 +132,8 @@ static struct regulator_init_data zoom_vmmc1 = {
133 | REGULATOR_CHANGE_MODE 132 | REGULATOR_CHANGE_MODE
134 | REGULATOR_CHANGE_STATUS, 133 | REGULATOR_CHANGE_STATUS,
135 }, 134 },
136 .num_consumer_supplies = 1, 135 .num_consumer_supplies = ARRAY_SIZE(zoom_vmmc1_supply),
137 .consumer_supplies = &zoom_vmmc1_supply, 136 .consumer_supplies = zoom_vmmc1_supply,
138}; 137};
139 138
140/* VMMC2 for MMC2 card */ 139/* VMMC2 for MMC2 card */
@@ -148,8 +147,8 @@ static struct regulator_init_data zoom_vmmc2 = {
148 .valid_ops_mask = REGULATOR_CHANGE_MODE 147 .valid_ops_mask = REGULATOR_CHANGE_MODE
149 | REGULATOR_CHANGE_STATUS, 148 | REGULATOR_CHANGE_STATUS,
150 }, 149 },
151 .num_consumer_supplies = 1, 150 .num_consumer_supplies = ARRAY_SIZE(zoom_vmmc2_supply),
152 .consumer_supplies = &zoom_vmmc2_supply, 151 .consumer_supplies = zoom_vmmc2_supply,
153}; 152};
154 153
155/* VSIM for OMAP VDD_MMC1A (i/o for DAT4..DAT7) */ 154/* VSIM for OMAP VDD_MMC1A (i/o for DAT4..DAT7) */
@@ -163,16 +162,16 @@ static struct regulator_init_data zoom_vsim = {
163 | REGULATOR_CHANGE_MODE 162 | REGULATOR_CHANGE_MODE
164 | REGULATOR_CHANGE_STATUS, 163 | REGULATOR_CHANGE_STATUS,
165 }, 164 },
166 .num_consumer_supplies = 1, 165 .num_consumer_supplies = ARRAY_SIZE(zoom_vsim_supply),
167 .consumer_supplies = &zoom_vsim_supply, 166 .consumer_supplies = zoom_vsim_supply,
168}; 167};
169 168
170static struct regulator_init_data zoom_vmmc3 = { 169static struct regulator_init_data zoom_vmmc3 = {
171 .constraints = { 170 .constraints = {
172 .valid_ops_mask = REGULATOR_CHANGE_STATUS, 171 .valid_ops_mask = REGULATOR_CHANGE_STATUS,
173 }, 172 },
174 .num_consumer_supplies = 1, 173 .num_consumer_supplies = ARRAY_SIZE(zoom_vmmc3_supply),
175 .consumer_supplies = &zoom_vmmc3_supply, 174 .consumer_supplies = zoom_vmmc3_supply,
176}; 175};
177 176
178static struct fixed_voltage_config zoom_vwlan = { 177static struct fixed_voltage_config zoom_vwlan = {
@@ -227,40 +226,6 @@ static struct omap2_hsmmc_info mmc[] = {
227 {} /* Terminator */ 226 {} /* Terminator */
228}; 227};
229 228
230static struct regulator_consumer_supply zoom_vpll2_supplies[] = {
231 REGULATOR_SUPPLY("vdds_dsi", "omapdss"),
232 REGULATOR_SUPPLY("vdds_dsi", "omapdss_dsi1"),
233};
234
235static struct regulator_consumer_supply zoom_vdda_dac_supply =
236 REGULATOR_SUPPLY("vdda_dac", "omapdss_venc");
237
238static struct regulator_init_data zoom_vpll2 = {
239 .constraints = {
240 .min_uV = 1800000,
241 .max_uV = 1800000,
242 .valid_modes_mask = REGULATOR_MODE_NORMAL
243 | REGULATOR_MODE_STANDBY,
244 .valid_ops_mask = REGULATOR_CHANGE_MODE
245 | REGULATOR_CHANGE_STATUS,
246 },
247 .num_consumer_supplies = ARRAY_SIZE(zoom_vpll2_supplies),
248 .consumer_supplies = zoom_vpll2_supplies,
249};
250
251static struct regulator_init_data zoom_vdac = {
252 .constraints = {
253 .min_uV = 1800000,
254 .max_uV = 1800000,
255 .valid_modes_mask = REGULATOR_MODE_NORMAL
256 | REGULATOR_MODE_STANDBY,
257 .valid_ops_mask = REGULATOR_CHANGE_MODE
258 | REGULATOR_CHANGE_STATUS,
259 },
260 .num_consumer_supplies = 1,
261 .consumer_supplies = &zoom_vdda_dac_supply,
262};
263
264static int zoom_twl_gpio_setup(struct device *dev, 229static int zoom_twl_gpio_setup(struct device *dev,
265 unsigned gpio, unsigned ngpio) 230 unsigned gpio, unsigned ngpio)
266{ 231{
@@ -270,13 +235,6 @@ static int zoom_twl_gpio_setup(struct device *dev,
270 mmc[0].gpio_cd = gpio + 0; 235 mmc[0].gpio_cd = gpio + 0;
271 omap2_hsmmc_init(mmc); 236 omap2_hsmmc_init(mmc);
272 237
273 /* link regulators to MMC adapters ... we "know" the
274 * regulators will be set up only *after* we return.
275 */
276 zoom_vmmc1_supply.dev = mmc[0].dev;
277 zoom_vsim_supply.dev = mmc[0].dev;
278 zoom_vmmc2_supply.dev = mmc[1].dev;
279
280 ret = gpio_request_one(LCD_PANEL_ENABLE_GPIO, GPIOF_OUT_INIT_LOW, 238 ret = gpio_request_one(LCD_PANEL_ENABLE_GPIO, GPIOF_OUT_INIT_LOW,
281 "lcd enable"); 239 "lcd enable");
282 if (ret) 240 if (ret)
@@ -292,26 +250,6 @@ static void zoom2_set_hs_extmute(int mute)
292 gpio_set_value(ZOOM2_HEADSET_EXTMUTE_GPIO, mute); 250 gpio_set_value(ZOOM2_HEADSET_EXTMUTE_GPIO, mute);
293} 251}
294 252
295static int zoom_batt_table[] = {
296/* 0 C*/
29730800, 29500, 28300, 27100,
29826000, 24900, 23900, 22900, 22000, 21100, 20300, 19400, 18700, 17900,
29917200, 16500, 15900, 15300, 14700, 14100, 13600, 13100, 12600, 12100,
30011600, 11200, 10800, 10400, 10000, 9630, 9280, 8950, 8620, 8310,
3018020, 7730, 7460, 7200, 6950, 6710, 6470, 6250, 6040, 5830,
3025640, 5450, 5260, 5090, 4920, 4760, 4600, 4450, 4310, 4170,
3034040, 3910, 3790, 3670, 3550
304};
305
306static struct twl4030_bci_platform_data zoom_bci_data = {
307 .battery_tmp_tbl = zoom_batt_table,
308 .tblsize = ARRAY_SIZE(zoom_batt_table),
309};
310
311static struct twl4030_usb_data zoom_usb_data = {
312 .usb_mode = T2_USB_MODE_ULPI,
313};
314
315static struct twl4030_gpio_platform_data zoom_gpio_data = { 253static struct twl4030_gpio_platform_data zoom_gpio_data = {
316 .gpio_base = OMAP_MAX_GPIO_LINES, 254 .gpio_base = OMAP_MAX_GPIO_LINES,
317 .irq_base = TWL4030_GPIO_IRQ_BASE, 255 .irq_base = TWL4030_GPIO_IRQ_BASE,
@@ -319,41 +257,29 @@ static struct twl4030_gpio_platform_data zoom_gpio_data = {
319 .setup = zoom_twl_gpio_setup, 257 .setup = zoom_twl_gpio_setup,
320}; 258};
321 259
322static struct twl4030_madc_platform_data zoom_madc_data = {
323 .irq_line = 1,
324};
325
326static struct twl4030_codec_audio_data zoom_audio_data;
327
328static struct twl4030_codec_data zoom_codec_data = {
329 .audio_mclk = 26000000,
330 .audio = &zoom_audio_data,
331};
332
333static struct twl4030_platform_data zoom_twldata = { 260static struct twl4030_platform_data zoom_twldata = {
334 .irq_base = TWL4030_IRQ_BASE,
335 .irq_end = TWL4030_IRQ_END,
336
337 /* platform_data for children goes here */ 261 /* platform_data for children goes here */
338 .bci = &zoom_bci_data,
339 .madc = &zoom_madc_data,
340 .usb = &zoom_usb_data,
341 .gpio = &zoom_gpio_data, 262 .gpio = &zoom_gpio_data,
342 .keypad = &zoom_kp_twl4030_data, 263 .keypad = &zoom_kp_twl4030_data,
343 .codec = &zoom_codec_data,
344 .vmmc1 = &zoom_vmmc1, 264 .vmmc1 = &zoom_vmmc1,
345 .vmmc2 = &zoom_vmmc2, 265 .vmmc2 = &zoom_vmmc2,
346 .vsim = &zoom_vsim, 266 .vsim = &zoom_vsim,
347 .vpll2 = &zoom_vpll2,
348 .vdac = &zoom_vdac,
349}; 267};
350 268
351static int __init omap_i2c_init(void) 269static int __init omap_i2c_init(void)
352{ 270{
271 omap3_pmic_get_config(&zoom_twldata,
272 TWL_COMMON_PDATA_USB | TWL_COMMON_PDATA_BCI |
273 TWL_COMMON_PDATA_MADC | TWL_COMMON_PDATA_AUDIO,
274 TWL_COMMON_REGULATOR_VDAC | TWL_COMMON_REGULATOR_VPLL2);
275
353 if (machine_is_omap_zoom2()) { 276 if (machine_is_omap_zoom2()) {
354 zoom_audio_data.ramp_delay_value = 3; /* 161 ms */ 277 struct twl4030_codec_data *codec_data;
355 zoom_audio_data.hs_extmute = 1; 278 codec_data = zoom_twldata.audio->codec;
356 zoom_audio_data.set_hs_extmute = zoom2_set_hs_extmute; 279
280 codec_data->ramp_delay_value = 3; /* 161 ms */
281 codec_data->hs_extmute = 1;
282 codec_data->set_hs_extmute = zoom2_set_hs_extmute;
357 } 283 }
358 omap_pmic_init(1, 2400, "twl5030", INT_34XX_SYS_NIRQ, &zoom_twldata); 284 omap_pmic_init(1, 2400, "twl5030", INT_34XX_SYS_NIRQ, &zoom_twldata);
359 omap_register_i2c_bus(2, 400, NULL, 0); 285 omap_register_i2c_bus(2, 400, NULL, 0);