diff options
22 files changed, 244 insertions, 895 deletions
diff --git a/arch/arm/mach-omap2/board-4430sdp.c b/arch/arm/mach-omap2/board-4430sdp.c index f88505a4f21a..d7df07ef2cea 100644 --- a/arch/arm/mach-omap2/board-4430sdp.c +++ b/arch/arm/mach-omap2/board-4430sdp.c | |||
@@ -329,16 +329,11 @@ static struct omap2_hsmmc_info mmc[] = { | |||
329 | }; | 329 | }; |
330 | 330 | ||
331 | static struct regulator_consumer_supply sdp4430_vaux_supply[] = { | 331 | static struct regulator_consumer_supply sdp4430_vaux_supply[] = { |
332 | { | 332 | REGULATOR_SUPPLY("vmmc", "omap_hsmmc.1"), |
333 | .supply = "vmmc", | ||
334 | .dev_name = "omap_hsmmc.1", | ||
335 | }, | ||
336 | }; | 333 | }; |
334 | |||
337 | static struct regulator_consumer_supply sdp4430_vmmc_supply[] = { | 335 | static struct regulator_consumer_supply sdp4430_vmmc_supply[] = { |
338 | { | 336 | REGULATOR_SUPPLY("vmmc", "omap_hsmmc.0"), |
339 | .supply = "vmmc", | ||
340 | .dev_name = "omap_hsmmc.0", | ||
341 | }, | ||
342 | }; | 337 | }; |
343 | 338 | ||
344 | static int omap4_twl6030_hsmmc_late_init(struct device *dev) | 339 | static int omap4_twl6030_hsmmc_late_init(struct device *dev) |
@@ -395,7 +390,7 @@ static struct regulator_init_data sdp4430_vaux1 = { | |||
395 | | REGULATOR_CHANGE_MODE | 390 | | REGULATOR_CHANGE_MODE |
396 | | REGULATOR_CHANGE_STATUS, | 391 | | REGULATOR_CHANGE_STATUS, |
397 | }, | 392 | }, |
398 | .num_consumer_supplies = 1, | 393 | .num_consumer_supplies = ARRAY_SIZE(sdp4430_vaux_supply), |
399 | .consumer_supplies = sdp4430_vaux_supply, | 394 | .consumer_supplies = sdp4430_vaux_supply, |
400 | }; | 395 | }; |
401 | 396 | ||
diff --git a/arch/arm/mach-omap2/board-cm-t35.c b/arch/arm/mach-omap2/board-cm-t35.c index 8b49dc2c7b9d..d76dca788540 100644 --- a/arch/arm/mach-omap2/board-cm-t35.c +++ b/arch/arm/mach-omap2/board-cm-t35.c | |||
@@ -162,9 +162,7 @@ static struct mtd_partition cm_t35_nand_partitions[] = { | |||
162 | static struct omap_nand_platform_data cm_t35_nand_data = { | 162 | static struct omap_nand_platform_data cm_t35_nand_data = { |
163 | .parts = cm_t35_nand_partitions, | 163 | .parts = cm_t35_nand_partitions, |
164 | .nr_parts = ARRAY_SIZE(cm_t35_nand_partitions), | 164 | .nr_parts = ARRAY_SIZE(cm_t35_nand_partitions), |
165 | .dma_channel = -1, /* disable DMA in OMAP NAND driver */ | ||
166 | .cs = 0, | 165 | .cs = 0, |
167 | |||
168 | }; | 166 | }; |
169 | 167 | ||
170 | static void __init cm_t35_init_nand(void) | 168 | static void __init cm_t35_init_nand(void) |
@@ -337,19 +335,21 @@ static void __init cm_t35_init_display(void) | |||
337 | } | 335 | } |
338 | } | 336 | } |
339 | 337 | ||
340 | static struct regulator_consumer_supply cm_t35_vmmc1_supply = { | 338 | static struct regulator_consumer_supply cm_t35_vmmc1_supply[] = { |
341 | .supply = "vmmc", | 339 | REGULATOR_SUPPLY("vmmc", "omap_hsmmc.0"), |
342 | }; | 340 | }; |
343 | 341 | ||
344 | static struct regulator_consumer_supply cm_t35_vsim_supply = { | 342 | static struct regulator_consumer_supply cm_t35_vsim_supply[] = { |
345 | .supply = "vmmc_aux", | 343 | REGULATOR_SUPPLY("vmmc_aux", "omap_hsmmc.0"), |
346 | }; | 344 | }; |
347 | 345 | ||
348 | static struct regulator_consumer_supply cm_t35_vdac_supply = | 346 | static struct regulator_consumer_supply cm_t35_vdac_supply[] = { |
349 | REGULATOR_SUPPLY("vdda_dac", "omapdss_venc"); | 347 | REGULATOR_SUPPLY("vdda_dac", "omapdss_venc"), |
348 | }; | ||
350 | 349 | ||
351 | static struct regulator_consumer_supply cm_t35_vdvi_supply = | 350 | static struct regulator_consumer_supply cm_t35_vdvi_supply[] = { |
352 | REGULATOR_SUPPLY("vdvi", "omapdss"); | 351 | REGULATOR_SUPPLY("vdvi", "omapdss"), |
352 | }; | ||
353 | 353 | ||
354 | /* VMMC1 for MMC1 pins CMD, CLK, DAT0..DAT3 (20 mA, plus card == max 220 mA) */ | 354 | /* VMMC1 for MMC1 pins CMD, CLK, DAT0..DAT3 (20 mA, plus card == max 220 mA) */ |
355 | static struct regulator_init_data cm_t35_vmmc1 = { | 355 | static struct regulator_init_data cm_t35_vmmc1 = { |
@@ -362,8 +362,8 @@ static struct regulator_init_data cm_t35_vmmc1 = { | |||
362 | | REGULATOR_CHANGE_MODE | 362 | | REGULATOR_CHANGE_MODE |
363 | | REGULATOR_CHANGE_STATUS, | 363 | | REGULATOR_CHANGE_STATUS, |
364 | }, | 364 | }, |
365 | .num_consumer_supplies = 1, | 365 | .num_consumer_supplies = ARRAY_SIZE(cm_t35_vmmc1_supply), |
366 | .consumer_supplies = &cm_t35_vmmc1_supply, | 366 | .consumer_supplies = cm_t35_vmmc1_supply, |
367 | }; | 367 | }; |
368 | 368 | ||
369 | /* VSIM for MMC1 pins DAT4..DAT7 (2 mA, plus card == max 50 mA) */ | 369 | /* VSIM for MMC1 pins DAT4..DAT7 (2 mA, plus card == max 50 mA) */ |
@@ -377,8 +377,8 @@ static struct regulator_init_data cm_t35_vsim = { | |||
377 | | REGULATOR_CHANGE_MODE | 377 | | REGULATOR_CHANGE_MODE |
378 | | REGULATOR_CHANGE_STATUS, | 378 | | REGULATOR_CHANGE_STATUS, |
379 | }, | 379 | }, |
380 | .num_consumer_supplies = 1, | 380 | .num_consumer_supplies = ARRAY_SIZE(cm_t35_vsim_supply), |
381 | .consumer_supplies = &cm_t35_vsim_supply, | 381 | .consumer_supplies = cm_t35_vsim_supply, |
382 | }; | 382 | }; |
383 | 383 | ||
384 | /* VDAC for DSS driving S-Video (8 mA unloaded, max 65 mA) */ | 384 | /* VDAC for DSS driving S-Video (8 mA unloaded, max 65 mA) */ |
@@ -391,8 +391,8 @@ static struct regulator_init_data cm_t35_vdac = { | |||
391 | .valid_ops_mask = REGULATOR_CHANGE_MODE | 391 | .valid_ops_mask = REGULATOR_CHANGE_MODE |
392 | | REGULATOR_CHANGE_STATUS, | 392 | | REGULATOR_CHANGE_STATUS, |
393 | }, | 393 | }, |
394 | .num_consumer_supplies = 1, | 394 | .num_consumer_supplies = ARRAY_SIZE(cm_t35_vdac_supply), |
395 | .consumer_supplies = &cm_t35_vdac_supply, | 395 | .consumer_supplies = cm_t35_vdac_supply, |
396 | }; | 396 | }; |
397 | 397 | ||
398 | /* VPLL2 for digital video outputs */ | 398 | /* VPLL2 for digital video outputs */ |
@@ -406,8 +406,8 @@ static struct regulator_init_data cm_t35_vpll2 = { | |||
406 | .valid_ops_mask = REGULATOR_CHANGE_MODE | 406 | .valid_ops_mask = REGULATOR_CHANGE_MODE |
407 | | REGULATOR_CHANGE_STATUS, | 407 | | REGULATOR_CHANGE_STATUS, |
408 | }, | 408 | }, |
409 | .num_consumer_supplies = 1, | 409 | .num_consumer_supplies = ARRAY_SIZE(cm_t35_vdvi_supply), |
410 | .consumer_supplies = &cm_t35_vdvi_supply, | 410 | .consumer_supplies = cm_t35_vdvi_supply, |
411 | }; | 411 | }; |
412 | 412 | ||
413 | static struct twl4030_usb_data cm_t35_usb_data = { | 413 | static struct twl4030_usb_data cm_t35_usb_data = { |
@@ -481,10 +481,6 @@ static int cm_t35_twl_gpio_setup(struct device *dev, unsigned gpio, | |||
481 | mmc[0].gpio_cd = gpio + 0; | 481 | mmc[0].gpio_cd = gpio + 0; |
482 | omap2_hsmmc_init(mmc); | 482 | omap2_hsmmc_init(mmc); |
483 | 483 | ||
484 | /* link regulators to MMC adapters */ | ||
485 | cm_t35_vmmc1_supply.dev = mmc[0].dev; | ||
486 | cm_t35_vsim_supply.dev = mmc[0].dev; | ||
487 | |||
488 | return 0; | 484 | return 0; |
489 | } | 485 | } |
490 | 486 | ||
diff --git a/arch/arm/mach-omap2/board-cm-t3517.c b/arch/arm/mach-omap2/board-cm-t3517.c index aa67240da8e8..05c72f4c1b57 100644 --- a/arch/arm/mach-omap2/board-cm-t3517.c +++ b/arch/arm/mach-omap2/board-cm-t3517.c | |||
@@ -236,7 +236,6 @@ static struct mtd_partition cm_t3517_nand_partitions[] = { | |||
236 | static struct omap_nand_platform_data cm_t3517_nand_data = { | 236 | static struct omap_nand_platform_data cm_t3517_nand_data = { |
237 | .parts = cm_t3517_nand_partitions, | 237 | .parts = cm_t3517_nand_partitions, |
238 | .nr_parts = ARRAY_SIZE(cm_t3517_nand_partitions), | 238 | .nr_parts = ARRAY_SIZE(cm_t3517_nand_partitions), |
239 | .dma_channel = -1, /* disable DMA in OMAP NAND driver */ | ||
240 | .cs = 0, | 239 | .cs = 0, |
241 | }; | 240 | }; |
242 | 241 | ||
diff --git a/arch/arm/mach-omap2/board-devkit8000.c b/arch/arm/mach-omap2/board-devkit8000.c index 360ba7bba687..949dbeabab26 100644 --- a/arch/arm/mach-omap2/board-devkit8000.c +++ b/arch/arm/mach-omap2/board-devkit8000.c | |||
@@ -129,13 +129,14 @@ static void devkit8000_panel_disable_dvi(struct omap_dss_device *dssdev) | |||
129 | gpio_set_value_cansleep(dssdev->reset_gpio, 0); | 129 | gpio_set_value_cansleep(dssdev->reset_gpio, 0); |
130 | } | 130 | } |
131 | 131 | ||
132 | static struct regulator_consumer_supply devkit8000_vmmc1_supply = | 132 | static struct regulator_consumer_supply devkit8000_vmmc1_supply[] = { |
133 | REGULATOR_SUPPLY("vmmc", "omap_hsmmc.0"); | 133 | REGULATOR_SUPPLY("vmmc", "omap_hsmmc.0"), |
134 | 134 | }; | |
135 | 135 | ||
136 | /* ads7846 on SPI */ | 136 | /* ads7846 on SPI */ |
137 | static struct regulator_consumer_supply devkit8000_vio_supply = | 137 | static struct regulator_consumer_supply devkit8000_vio_supply[] = { |
138 | REGULATOR_SUPPLY("vcc", "spi2.0"); | 138 | REGULATOR_SUPPLY("vcc", "spi2.0"), |
139 | }; | ||
139 | 140 | ||
140 | static struct panel_generic_dpi_data lcd_panel = { | 141 | static struct panel_generic_dpi_data lcd_panel = { |
141 | .name = "generic", | 142 | .name = "generic", |
@@ -185,8 +186,9 @@ static struct omap_dss_board_info devkit8000_dss_data = { | |||
185 | .default_device = &devkit8000_lcd_device, | 186 | .default_device = &devkit8000_lcd_device, |
186 | }; | 187 | }; |
187 | 188 | ||
188 | static struct regulator_consumer_supply devkit8000_vdda_dac_supply = | 189 | static struct regulator_consumer_supply devkit8000_vdda_dac_supply[] = { |
189 | REGULATOR_SUPPLY("vdda_dac", "omapdss_venc"); | 190 | REGULATOR_SUPPLY("vdda_dac", "omapdss_venc"), |
191 | }; | ||
190 | 192 | ||
191 | static uint32_t board_keymap[] = { | 193 | static uint32_t board_keymap[] = { |
192 | KEY(0, 0, KEY_1), | 194 | KEY(0, 0, KEY_1), |
@@ -283,8 +285,8 @@ static struct regulator_init_data devkit8000_vmmc1 = { | |||
283 | | REGULATOR_CHANGE_MODE | 285 | | REGULATOR_CHANGE_MODE |
284 | | REGULATOR_CHANGE_STATUS, | 286 | | REGULATOR_CHANGE_STATUS, |
285 | }, | 287 | }, |
286 | .num_consumer_supplies = 1, | 288 | .num_consumer_supplies = ARRAY_SIZE(devkit8000_vmmc1_supply), |
287 | .consumer_supplies = &devkit8000_vmmc1_supply, | 289 | .consumer_supplies = devkit8000_vmmc1_supply, |
288 | }; | 290 | }; |
289 | 291 | ||
290 | /* VDAC for DSS driving S-Video (8 mA unloaded, max 65 mA) */ | 292 | /* VDAC for DSS driving S-Video (8 mA unloaded, max 65 mA) */ |
@@ -297,8 +299,8 @@ static struct regulator_init_data devkit8000_vdac = { | |||
297 | .valid_ops_mask = REGULATOR_CHANGE_MODE | 299 | .valid_ops_mask = REGULATOR_CHANGE_MODE |
298 | | REGULATOR_CHANGE_STATUS, | 300 | | REGULATOR_CHANGE_STATUS, |
299 | }, | 301 | }, |
300 | .num_consumer_supplies = 1, | 302 | .num_consumer_supplies = ARRAY_SIZE(devkit8000_vdda_dac_supply), |
301 | .consumer_supplies = &devkit8000_vdda_dac_supply, | 303 | .consumer_supplies = devkit8000_vdda_dac_supply, |
302 | }; | 304 | }; |
303 | 305 | ||
304 | /* VPLL1 for digital video outputs */ | 306 | /* VPLL1 for digital video outputs */ |
@@ -326,8 +328,8 @@ static struct regulator_init_data devkit8000_vio = { | |||
326 | .valid_ops_mask = REGULATOR_CHANGE_MODE | 328 | .valid_ops_mask = REGULATOR_CHANGE_MODE |
327 | | REGULATOR_CHANGE_STATUS, | 329 | | REGULATOR_CHANGE_STATUS, |
328 | }, | 330 | }, |
329 | .num_consumer_supplies = 1, | 331 | .num_consumer_supplies = ARRAY_SIZE(devkit8000_vio_supply), |
330 | .consumer_supplies = &devkit8000_vio_supply, | 332 | .consumer_supplies = devkit8000_vio_supply, |
331 | }; | 333 | }; |
332 | 334 | ||
333 | static struct twl4030_usb_data devkit8000_usb_data = { | 335 | static struct twl4030_usb_data devkit8000_usb_data = { |
diff --git a/arch/arm/mach-omap2/board-flash.c b/arch/arm/mach-omap2/board-flash.c index 729892fdcf2e..aa1b0cbe19d2 100644 --- a/arch/arm/mach-omap2/board-flash.c +++ b/arch/arm/mach-omap2/board-flash.c | |||
@@ -132,11 +132,7 @@ static struct gpmc_timings nand_timings = { | |||
132 | }; | 132 | }; |
133 | 133 | ||
134 | static struct omap_nand_platform_data board_nand_data = { | 134 | static struct omap_nand_platform_data board_nand_data = { |
135 | .nand_setup = NULL, | ||
136 | .gpmc_t = &nand_timings, | 135 | .gpmc_t = &nand_timings, |
137 | .dma_channel = -1, /* disable DMA in OMAP NAND driver */ | ||
138 | .dev_ready = NULL, | ||
139 | .devsize = 0, /* '0' for 8-bit, '1' for 16-bit device */ | ||
140 | }; | 136 | }; |
141 | 137 | ||
142 | void | 138 | void |
diff --git a/arch/arm/mach-omap2/board-igep0020.c b/arch/arm/mach-omap2/board-igep0020.c index 381a27c615b7..f683835f936c 100644 --- a/arch/arm/mach-omap2/board-igep0020.c +++ b/arch/arm/mach-omap2/board-igep0020.c | |||
@@ -222,8 +222,9 @@ static inline void __init igep2_init_smsc911x(void) | |||
222 | static inline void __init igep2_init_smsc911x(void) { } | 222 | static inline void __init igep2_init_smsc911x(void) { } |
223 | #endif | 223 | #endif |
224 | 224 | ||
225 | static struct regulator_consumer_supply igep_vmmc1_supply = | 225 | static struct regulator_consumer_supply igep_vmmc1_supply[] = { |
226 | REGULATOR_SUPPLY("vmmc", "omap_hsmmc.0"); | 226 | REGULATOR_SUPPLY("vmmc", "omap_hsmmc.0"), |
227 | }; | ||
227 | 228 | ||
228 | /* VMMC1 for OMAP VDD_MMC1 (i/o) and MMC1 card */ | 229 | /* VMMC1 for OMAP VDD_MMC1 (i/o) and MMC1 card */ |
229 | static struct regulator_init_data igep_vmmc1 = { | 230 | static struct regulator_init_data igep_vmmc1 = { |
@@ -236,12 +237,13 @@ static struct regulator_init_data igep_vmmc1 = { | |||
236 | | REGULATOR_CHANGE_MODE | 237 | | REGULATOR_CHANGE_MODE |
237 | | REGULATOR_CHANGE_STATUS, | 238 | | REGULATOR_CHANGE_STATUS, |
238 | }, | 239 | }, |
239 | .num_consumer_supplies = 1, | 240 | .num_consumer_supplies = ARRAY_SIZE(igep_vmmc1_supply), |
240 | .consumer_supplies = &igep_vmmc1_supply, | 241 | .consumer_supplies = igep_vmmc1_supply, |
241 | }; | 242 | }; |
242 | 243 | ||
243 | static struct regulator_consumer_supply igep_vio_supply = | 244 | static struct regulator_consumer_supply igep_vio_supply[] = { |
244 | REGULATOR_SUPPLY("vmmc_aux", "omap_hsmmc.1"); | 245 | REGULATOR_SUPPLY("vmmc_aux", "omap_hsmmc.1"), |
246 | }; | ||
245 | 247 | ||
246 | static struct regulator_init_data igep_vio = { | 248 | static struct regulator_init_data igep_vio = { |
247 | .constraints = { | 249 | .constraints = { |
@@ -254,20 +256,21 @@ static struct regulator_init_data igep_vio = { | |||
254 | | REGULATOR_CHANGE_MODE | 256 | | REGULATOR_CHANGE_MODE |
255 | | REGULATOR_CHANGE_STATUS, | 257 | | REGULATOR_CHANGE_STATUS, |
256 | }, | 258 | }, |
257 | .num_consumer_supplies = 1, | 259 | .num_consumer_supplies = ARRAY_SIZE(igep_vio_supply), |
258 | .consumer_supplies = &igep_vio_supply, | 260 | .consumer_supplies = igep_vio_supply, |
259 | }; | 261 | }; |
260 | 262 | ||
261 | static struct regulator_consumer_supply igep_vmmc2_supply = | 263 | static struct regulator_consumer_supply igep_vmmc2_supply[] = { |
262 | REGULATOR_SUPPLY("vmmc", "omap_hsmmc.1"); | 264 | REGULATOR_SUPPLY("vmmc", "omap_hsmmc.1"), |
265 | }; | ||
263 | 266 | ||
264 | static struct regulator_init_data igep_vmmc2 = { | 267 | static struct regulator_init_data igep_vmmc2 = { |
265 | .constraints = { | 268 | .constraints = { |
266 | .valid_modes_mask = REGULATOR_MODE_NORMAL, | 269 | .valid_modes_mask = REGULATOR_MODE_NORMAL, |
267 | .always_on = 1, | 270 | .always_on = 1, |
268 | }, | 271 | }, |
269 | .num_consumer_supplies = 1, | 272 | .num_consumer_supplies = ARRAY_SIZE(igep_vmmc2_supply), |
270 | .consumer_supplies = &igep_vmmc2_supply, | 273 | .consumer_supplies = igep_vmmc2_supply, |
271 | }; | 274 | }; |
272 | 275 | ||
273 | static struct fixed_voltage_config igep_vwlan = { | 276 | static struct fixed_voltage_config igep_vwlan = { |
diff --git a/arch/arm/mach-omap2/board-ldp.c b/arch/arm/mach-omap2/board-ldp.c index 75ebc99f9d53..5d4328f19c0f 100644 --- a/arch/arm/mach-omap2/board-ldp.c +++ b/arch/arm/mach-omap2/board-ldp.c | |||
@@ -213,8 +213,8 @@ static struct twl4030_madc_platform_data ldp_madc_data = { | |||
213 | .irq_line = 1, | 213 | .irq_line = 1, |
214 | }; | 214 | }; |
215 | 215 | ||
216 | static struct regulator_consumer_supply ldp_vmmc1_supply = { | 216 | static struct regulator_consumer_supply ldp_vmmc1_supply[] = { |
217 | .supply = "vmmc", | 217 | REGULATOR_SUPPLY("vmmc", "omap_hsmmc.0"), |
218 | }; | 218 | }; |
219 | 219 | ||
220 | /* VMMC1 for MMC1 pins CMD, CLK, DAT0..DAT3 (20 mA, plus card == max 220 mA) */ | 220 | /* VMMC1 for MMC1 pins CMD, CLK, DAT0..DAT3 (20 mA, plus card == max 220 mA) */ |
@@ -228,8 +228,8 @@ static struct regulator_init_data ldp_vmmc1 = { | |||
228 | | REGULATOR_CHANGE_MODE | 228 | | REGULATOR_CHANGE_MODE |
229 | | REGULATOR_CHANGE_STATUS, | 229 | | REGULATOR_CHANGE_STATUS, |
230 | }, | 230 | }, |
231 | .num_consumer_supplies = 1, | 231 | .num_consumer_supplies = ARRAY_SIZE(ldp_vmmc1_supply), |
232 | .consumer_supplies = &ldp_vmmc1_supply, | 232 | .consumer_supplies = ldp_vmmc1_supply, |
233 | }; | 233 | }; |
234 | 234 | ||
235 | /* ads7846 on SPI */ | 235 | /* ads7846 on SPI */ |
@@ -341,8 +341,6 @@ static void __init omap_ldp_init(void) | |||
341 | ARRAY_SIZE(ldp_nand_partitions), ZOOM_NAND_CS, 0); | 341 | ARRAY_SIZE(ldp_nand_partitions), ZOOM_NAND_CS, 0); |
342 | 342 | ||
343 | omap2_hsmmc_init(mmc); | 343 | omap2_hsmmc_init(mmc); |
344 | /* link regulators to MMC adapters */ | ||
345 | ldp_vmmc1_supply.dev = mmc[0].dev; | ||
346 | } | 344 | } |
347 | 345 | ||
348 | MACHINE_START(OMAP_LDP, "OMAP LDP board") | 346 | MACHINE_START(OMAP_LDP, "OMAP LDP board") |
diff --git a/arch/arm/mach-omap2/board-omap3beagle.c b/arch/arm/mach-omap2/board-omap3beagle.c index 5a830dfe2ad9..2d8dfb3213bf 100644 --- a/arch/arm/mach-omap2/board-omap3beagle.c +++ b/arch/arm/mach-omap2/board-omap3beagle.c | |||
@@ -209,8 +209,9 @@ static struct omap_dss_board_info beagle_dss_data = { | |||
209 | .default_device = &beagle_dvi_device, | 209 | .default_device = &beagle_dvi_device, |
210 | }; | 210 | }; |
211 | 211 | ||
212 | static struct regulator_consumer_supply beagle_vdac_supply = | 212 | static struct regulator_consumer_supply beagle_vdac_supply[] = { |
213 | REGULATOR_SUPPLY("vdda_dac", "omapdss_venc"); | 213 | REGULATOR_SUPPLY("vdda_dac", "omapdss_venc"), |
214 | }; | ||
214 | 215 | ||
215 | static struct regulator_consumer_supply beagle_vdvi_supplies[] = { | 216 | static struct regulator_consumer_supply beagle_vdvi_supplies[] = { |
216 | REGULATOR_SUPPLY("vdds_dsi", "omapdss"), | 217 | REGULATOR_SUPPLY("vdds_dsi", "omapdss"), |
@@ -238,12 +239,12 @@ static struct omap2_hsmmc_info mmc[] = { | |||
238 | {} /* Terminator */ | 239 | {} /* Terminator */ |
239 | }; | 240 | }; |
240 | 241 | ||
241 | static struct regulator_consumer_supply beagle_vmmc1_supply = { | 242 | static struct regulator_consumer_supply beagle_vmmc1_supply[] = { |
242 | .supply = "vmmc", | 243 | REGULATOR_SUPPLY("vmmc", "omap_hsmmc.0"), |
243 | }; | 244 | }; |
244 | 245 | ||
245 | static struct regulator_consumer_supply beagle_vsim_supply = { | 246 | static struct regulator_consumer_supply beagle_vsim_supply[] = { |
246 | .supply = "vmmc_aux", | 247 | REGULATOR_SUPPLY("vmmc_aux", "omap_hsmmc.0"), |
247 | }; | 248 | }; |
248 | 249 | ||
249 | static struct gpio_led gpio_leds[]; | 250 | static struct gpio_led gpio_leds[]; |
@@ -266,10 +267,6 @@ static int beagle_twl_gpio_setup(struct device *dev, | |||
266 | mmc[0].gpio_cd = gpio + 0; | 267 | mmc[0].gpio_cd = gpio + 0; |
267 | omap2_hsmmc_init(mmc); | 268 | omap2_hsmmc_init(mmc); |
268 | 269 | ||
269 | /* link regulators to MMC adapters */ | ||
270 | beagle_vmmc1_supply.dev = mmc[0].dev; | ||
271 | beagle_vsim_supply.dev = mmc[0].dev; | ||
272 | |||
273 | /* | 270 | /* |
274 | * TWL4030_GPIO_MAX + 0 == ledA, EHCI nEN_USB_PWR (out, XM active | 271 | * TWL4030_GPIO_MAX + 0 == ledA, EHCI nEN_USB_PWR (out, XM active |
275 | * high / others active low) | 272 | * high / others active low) |
@@ -335,8 +332,8 @@ static struct regulator_init_data beagle_vmmc1 = { | |||
335 | | REGULATOR_CHANGE_MODE | 332 | | REGULATOR_CHANGE_MODE |
336 | | REGULATOR_CHANGE_STATUS, | 333 | | REGULATOR_CHANGE_STATUS, |
337 | }, | 334 | }, |
338 | .num_consumer_supplies = 1, | 335 | .num_consumer_supplies = ARRAY_SIZE(beagle_vmmc1_supply), |
339 | .consumer_supplies = &beagle_vmmc1_supply, | 336 | .consumer_supplies = beagle_vmmc1_supply, |
340 | }; | 337 | }; |
341 | 338 | ||
342 | /* VSIM for MMC1 pins DAT4..DAT7 (2 mA, plus card == max 50 mA) */ | 339 | /* VSIM for MMC1 pins DAT4..DAT7 (2 mA, plus card == max 50 mA) */ |
@@ -350,8 +347,8 @@ static struct regulator_init_data beagle_vsim = { | |||
350 | | REGULATOR_CHANGE_MODE | 347 | | REGULATOR_CHANGE_MODE |
351 | | REGULATOR_CHANGE_STATUS, | 348 | | REGULATOR_CHANGE_STATUS, |
352 | }, | 349 | }, |
353 | .num_consumer_supplies = 1, | 350 | .num_consumer_supplies = ARRAY_SIZE(beagle_vsim_supply), |
354 | .consumer_supplies = &beagle_vsim_supply, | 351 | .consumer_supplies = beagle_vsim_supply, |
355 | }; | 352 | }; |
356 | 353 | ||
357 | /* VDAC for DSS driving S-Video (8 mA unloaded, max 65 mA) */ | 354 | /* VDAC for DSS driving S-Video (8 mA unloaded, max 65 mA) */ |
@@ -364,8 +361,8 @@ static struct regulator_init_data beagle_vdac = { | |||
364 | .valid_ops_mask = REGULATOR_CHANGE_MODE | 361 | .valid_ops_mask = REGULATOR_CHANGE_MODE |
365 | | REGULATOR_CHANGE_STATUS, | 362 | | REGULATOR_CHANGE_STATUS, |
366 | }, | 363 | }, |
367 | .num_consumer_supplies = 1, | 364 | .num_consumer_supplies = ARRAY_SIZE(beagle_vdac_supply), |
368 | .consumer_supplies = &beagle_vdac_supply, | 365 | .consumer_supplies = beagle_vdac_supply, |
369 | }; | 366 | }; |
370 | 367 | ||
371 | /* VPLL2 for digital video outputs */ | 368 | /* VPLL2 for digital video outputs */ |
diff --git a/arch/arm/mach-omap2/board-omap3evm.c b/arch/arm/mach-omap2/board-omap3evm.c index 7cbcf6043626..57bce0f2e195 100644 --- a/arch/arm/mach-omap2/board-omap3evm.c +++ b/arch/arm/mach-omap2/board-omap3evm.c | |||
@@ -273,12 +273,12 @@ static struct omap_dss_board_info omap3_evm_dss_data = { | |||
273 | .default_device = &omap3_evm_lcd_device, | 273 | .default_device = &omap3_evm_lcd_device, |
274 | }; | 274 | }; |
275 | 275 | ||
276 | static struct regulator_consumer_supply omap3evm_vmmc1_supply = { | 276 | static struct regulator_consumer_supply omap3evm_vmmc1_supply[] = { |
277 | .supply = "vmmc", | 277 | REGULATOR_SUPPLY("vmmc", "omap_hsmmc.0"), |
278 | }; | 278 | }; |
279 | 279 | ||
280 | static struct regulator_consumer_supply omap3evm_vsim_supply = { | 280 | static struct regulator_consumer_supply omap3evm_vsim_supply[] = { |
281 | .supply = "vmmc_aux", | 281 | REGULATOR_SUPPLY("vmmc_aux", "omap_hsmmc.0"), |
282 | }; | 282 | }; |
283 | 283 | ||
284 | /* VMMC1 for MMC1 pins CMD, CLK, DAT0..DAT3 (20 mA, plus card == max 220 mA) */ | 284 | /* VMMC1 for MMC1 pins CMD, CLK, DAT0..DAT3 (20 mA, plus card == max 220 mA) */ |
@@ -292,8 +292,8 @@ static struct regulator_init_data omap3evm_vmmc1 = { | |||
292 | | REGULATOR_CHANGE_MODE | 292 | | REGULATOR_CHANGE_MODE |
293 | | REGULATOR_CHANGE_STATUS, | 293 | | REGULATOR_CHANGE_STATUS, |
294 | }, | 294 | }, |
295 | .num_consumer_supplies = 1, | 295 | .num_consumer_supplies = ARRAY_SIZE(omap3evm_vmmc1_supply), |
296 | .consumer_supplies = &omap3evm_vmmc1_supply, | 296 | .consumer_supplies = omap3evm_vmmc1_supply, |
297 | }; | 297 | }; |
298 | 298 | ||
299 | /* VSIM for MMC1 pins DAT4..DAT7 (2 mA, plus card == max 50 mA) */ | 299 | /* VSIM for MMC1 pins DAT4..DAT7 (2 mA, plus card == max 50 mA) */ |
@@ -307,8 +307,8 @@ static struct regulator_init_data omap3evm_vsim = { | |||
307 | | REGULATOR_CHANGE_MODE | 307 | | REGULATOR_CHANGE_MODE |
308 | | REGULATOR_CHANGE_STATUS, | 308 | | REGULATOR_CHANGE_STATUS, |
309 | }, | 309 | }, |
310 | .num_consumer_supplies = 1, | 310 | .num_consumer_supplies = ARRAY_SIZE(omap3evm_vsim_supply), |
311 | .consumer_supplies = &omap3evm_vsim_supply, | 311 | .consumer_supplies = omap3evm_vsim_supply, |
312 | }; | 312 | }; |
313 | 313 | ||
314 | static struct omap2_hsmmc_info mmc[] = { | 314 | static struct omap2_hsmmc_info mmc[] = { |
@@ -365,10 +365,6 @@ static int omap3evm_twl_gpio_setup(struct device *dev, | |||
365 | mmc[0].gpio_cd = gpio + 0; | 365 | mmc[0].gpio_cd = gpio + 0; |
366 | omap2_hsmmc_init(mmc); | 366 | omap2_hsmmc_init(mmc); |
367 | 367 | ||
368 | /* link regulators to MMC adapters */ | ||
369 | omap3evm_vmmc1_supply.dev = mmc[0].dev; | ||
370 | omap3evm_vsim_supply.dev = mmc[0].dev; | ||
371 | |||
372 | /* | 368 | /* |
373 | * Most GPIOs are for USB OTG. Some are mostly sent to | 369 | * Most GPIOs are for USB OTG. Some are mostly sent to |
374 | * the P2 connector; notably LEDA for the LCD backlight. | 370 | * the P2 connector; notably LEDA for the LCD backlight. |
@@ -449,8 +445,9 @@ static struct twl4030_codec_data omap3evm_codec_data = { | |||
449 | .audio = &omap3evm_audio_data, | 445 | .audio = &omap3evm_audio_data, |
450 | }; | 446 | }; |
451 | 447 | ||
452 | static struct regulator_consumer_supply omap3_evm_vdda_dac_supply = | 448 | static struct regulator_consumer_supply omap3_evm_vdda_dac_supply[] = { |
453 | REGULATOR_SUPPLY("vdda_dac", "omapdss_venc"); | 449 | REGULATOR_SUPPLY("vdda_dac", "omapdss_venc"), |
450 | }; | ||
454 | 451 | ||
455 | /* VDAC for DSS driving S-Video */ | 452 | /* VDAC for DSS driving S-Video */ |
456 | static struct regulator_init_data omap3_evm_vdac = { | 453 | static struct regulator_init_data omap3_evm_vdac = { |
@@ -463,8 +460,8 @@ static struct regulator_init_data omap3_evm_vdac = { | |||
463 | .valid_ops_mask = REGULATOR_CHANGE_MODE | 460 | .valid_ops_mask = REGULATOR_CHANGE_MODE |
464 | | REGULATOR_CHANGE_STATUS, | 461 | | REGULATOR_CHANGE_STATUS, |
465 | }, | 462 | }, |
466 | .num_consumer_supplies = 1, | 463 | .num_consumer_supplies = ARRAY_SIZE(omap3_evm_vdda_dac_supply), |
467 | .consumer_supplies = &omap3_evm_vdda_dac_supply, | 464 | .consumer_supplies = omap3_evm_vdda_dac_supply, |
468 | }; | 465 | }; |
469 | 466 | ||
470 | /* VPLL2 for digital video outputs */ | 467 | /* VPLL2 for digital video outputs */ |
@@ -488,8 +485,9 @@ static struct regulator_init_data omap3_evm_vpll2 = { | |||
488 | }; | 485 | }; |
489 | 486 | ||
490 | /* ads7846 on SPI */ | 487 | /* ads7846 on SPI */ |
491 | static struct regulator_consumer_supply omap3evm_vio_supply = | 488 | static struct regulator_consumer_supply omap3evm_vio_supply[] = { |
492 | REGULATOR_SUPPLY("vcc", "spi1.0"); | 489 | REGULATOR_SUPPLY("vcc", "spi1.0"), |
490 | }; | ||
493 | 491 | ||
494 | /* VIO for ads7846 */ | 492 | /* VIO for ads7846 */ |
495 | static struct regulator_init_data omap3evm_vio = { | 493 | static struct regulator_init_data omap3evm_vio = { |
@@ -502,8 +500,8 @@ static struct regulator_init_data omap3evm_vio = { | |||
502 | .valid_ops_mask = REGULATOR_CHANGE_MODE | 500 | .valid_ops_mask = REGULATOR_CHANGE_MODE |
503 | | REGULATOR_CHANGE_STATUS, | 501 | | REGULATOR_CHANGE_STATUS, |
504 | }, | 502 | }, |
505 | .num_consumer_supplies = 1, | 503 | .num_consumer_supplies = ARRAY_SIZE(omap3evm_vio_supply), |
506 | .consumer_supplies = &omap3evm_vio_supply, | 504 | .consumer_supplies = omap3evm_vio_supply, |
507 | }; | 505 | }; |
508 | 506 | ||
509 | #ifdef CONFIG_WL12XX_PLATFORM_DATA | 507 | #ifdef CONFIG_WL12XX_PLATFORM_DATA |
@@ -511,16 +509,17 @@ static struct regulator_init_data omap3evm_vio = { | |||
511 | #define OMAP3EVM_WLAN_PMENA_GPIO (150) | 509 | #define OMAP3EVM_WLAN_PMENA_GPIO (150) |
512 | #define OMAP3EVM_WLAN_IRQ_GPIO (149) | 510 | #define OMAP3EVM_WLAN_IRQ_GPIO (149) |
513 | 511 | ||
514 | static struct regulator_consumer_supply omap3evm_vmmc2_supply = | 512 | static struct regulator_consumer_supply omap3evm_vmmc2_supply[] = { |
515 | REGULATOR_SUPPLY("vmmc", "omap_hsmmc.1"); | 513 | REGULATOR_SUPPLY("vmmc", "omap_hsmmc.1"), |
514 | }; | ||
516 | 515 | ||
517 | /* VMMC2 for driving the WL12xx module */ | 516 | /* VMMC2 for driving the WL12xx module */ |
518 | static struct regulator_init_data omap3evm_vmmc2 = { | 517 | static struct regulator_init_data omap3evm_vmmc2 = { |
519 | .constraints = { | 518 | .constraints = { |
520 | .valid_ops_mask = REGULATOR_CHANGE_STATUS, | 519 | .valid_ops_mask = REGULATOR_CHANGE_STATUS, |
521 | }, | 520 | }, |
522 | .num_consumer_supplies = 1, | 521 | .num_consumer_supplies = ARRAY_SIZE(omap3evm_vmmc2_supply), |
523 | .consumer_supplies = &omap3evm_vmmc2_supply, | 522 | .consumer_supplies = omap3evm_vmmc2_supply, |
524 | }; | 523 | }; |
525 | 524 | ||
526 | static struct fixed_voltage_config omap3evm_vwlan = { | 525 | static struct fixed_voltage_config omap3evm_vwlan = { |
diff --git a/arch/arm/mach-omap2/board-omap3logic.c b/arch/arm/mach-omap2/board-omap3logic.c index 8e67567ad10f..703aeb5b8fd4 100644 --- a/arch/arm/mach-omap2/board-omap3logic.c +++ b/arch/arm/mach-omap2/board-omap3logic.c | |||
@@ -54,8 +54,8 @@ | |||
54 | #define OMAP3_TORPEDO_MMC_GPIO_CD 127 | 54 | #define OMAP3_TORPEDO_MMC_GPIO_CD 127 |
55 | #define OMAP3_TORPEDO_SMSC911X_GPIO_IRQ 129 | 55 | #define OMAP3_TORPEDO_SMSC911X_GPIO_IRQ 129 |
56 | 56 | ||
57 | static struct regulator_consumer_supply omap3logic_vmmc1_supply = { | 57 | static struct regulator_consumer_supply omap3logic_vmmc1_supply[] = { |
58 | .supply = "vmmc", | 58 | REGULATOR_SUPPLY("vmmc", "omap_hsmmc.0"), |
59 | }; | 59 | }; |
60 | 60 | ||
61 | /* VMMC1 for MMC1 pins CMD, CLK, DAT0..DAT3 (20 mA, plus card == max 220 mA) */ | 61 | /* VMMC1 for MMC1 pins CMD, CLK, DAT0..DAT3 (20 mA, plus card == max 220 mA) */ |
@@ -70,8 +70,8 @@ static struct regulator_init_data omap3logic_vmmc1 = { | |||
70 | | REGULATOR_CHANGE_MODE | 70 | | REGULATOR_CHANGE_MODE |
71 | | REGULATOR_CHANGE_STATUS, | 71 | | REGULATOR_CHANGE_STATUS, |
72 | }, | 72 | }, |
73 | .num_consumer_supplies = 1, | 73 | .num_consumer_supplies = ARRAY_SIZE(omap3logic_vmmc1_supply), |
74 | .consumer_supplies = &omap3logic_vmmc1_supply, | 74 | .consumer_supplies = omap3logic_vmmc1_supply, |
75 | }; | 75 | }; |
76 | 76 | ||
77 | static struct twl4030_gpio_platform_data omap3logic_gpio_data = { | 77 | static struct twl4030_gpio_platform_data omap3logic_gpio_data = { |
@@ -129,8 +129,6 @@ static void __init board_mmc_init(void) | |||
129 | } | 129 | } |
130 | 130 | ||
131 | omap2_hsmmc_init(board_mmc_info); | 131 | omap2_hsmmc_init(board_mmc_info); |
132 | /* link regulators to MMC adapters */ | ||
133 | omap3logic_vmmc1_supply.dev = board_mmc_info[0].dev; | ||
134 | } | 132 | } |
135 | 133 | ||
136 | static struct omap_smsc911x_platform_data __initdata board_smsc911x_data = { | 134 | static struct omap_smsc911x_platform_data __initdata board_smsc911x_data = { |
diff --git a/arch/arm/mach-omap2/board-omap3pandora.c b/arch/arm/mach-omap2/board-omap3pandora.c index ff0be8320793..47c426e8420a 100644 --- a/arch/arm/mach-omap2/board-omap3pandora.c +++ b/arch/arm/mach-omap2/board-omap3pandora.c | |||
@@ -319,17 +319,21 @@ static struct twl4030_gpio_platform_data omap3pandora_gpio_data = { | |||
319 | .setup = omap3pandora_twl_gpio_setup, | 319 | .setup = omap3pandora_twl_gpio_setup, |
320 | }; | 320 | }; |
321 | 321 | ||
322 | static struct regulator_consumer_supply pandora_vmmc1_supply = | 322 | static struct regulator_consumer_supply pandora_vmmc1_supply[] = { |
323 | REGULATOR_SUPPLY("vmmc", "omap_hsmmc.0"); | 323 | REGULATOR_SUPPLY("vmmc", "omap_hsmmc.0"), |
324 | }; | ||
324 | 325 | ||
325 | static struct regulator_consumer_supply pandora_vmmc2_supply = | 326 | static struct regulator_consumer_supply pandora_vmmc2_supply[] = { |
326 | REGULATOR_SUPPLY("vmmc", "omap_hsmmc.1"); | 327 | REGULATOR_SUPPLY("vmmc", "omap_hsmmc.1") |
328 | }; | ||
327 | 329 | ||
328 | static struct regulator_consumer_supply pandora_vmmc3_supply = | 330 | static struct regulator_consumer_supply pandora_vmmc3_supply[] = { |
329 | REGULATOR_SUPPLY("vmmc", "omap_hsmmc.2"); | 331 | REGULATOR_SUPPLY("vmmc", "omap_hsmmc.2"), |
332 | }; | ||
330 | 333 | ||
331 | static struct regulator_consumer_supply pandora_vdda_dac_supply = | 334 | static struct regulator_consumer_supply pandora_vdda_dac_supply[] = { |
332 | REGULATOR_SUPPLY("vdda_dac", "omapdss_venc"); | 335 | REGULATOR_SUPPLY("vdda_dac", "omapdss_venc"), |
336 | }; | ||
333 | 337 | ||
334 | static struct regulator_consumer_supply pandora_vdds_supplies[] = { | 338 | static struct regulator_consumer_supply pandora_vdds_supplies[] = { |
335 | REGULATOR_SUPPLY("vdds_sdi", "omapdss"), | 339 | REGULATOR_SUPPLY("vdds_sdi", "omapdss"), |
@@ -337,11 +341,13 @@ static struct regulator_consumer_supply pandora_vdds_supplies[] = { | |||
337 | REGULATOR_SUPPLY("vdds_dsi", "omapdss_dsi1"), | 341 | REGULATOR_SUPPLY("vdds_dsi", "omapdss_dsi1"), |
338 | }; | 342 | }; |
339 | 343 | ||
340 | static struct regulator_consumer_supply pandora_vcc_lcd_supply = | 344 | static struct regulator_consumer_supply pandora_vcc_lcd_supply[] = { |
341 | REGULATOR_SUPPLY("vcc", "display0"); | 345 | REGULATOR_SUPPLY("vcc", "display0"), |
346 | }; | ||
342 | 347 | ||
343 | static struct regulator_consumer_supply pandora_usb_phy_supply = | 348 | static struct regulator_consumer_supply pandora_usb_phy_supply[] = { |
344 | REGULATOR_SUPPLY("hsusb0", "ehci-omap.0"); | 349 | REGULATOR_SUPPLY("hsusb0", "ehci-omap.0"), |
350 | }; | ||
345 | 351 | ||
346 | /* ads7846 on SPI and 2 nub controllers on I2C */ | 352 | /* ads7846 on SPI and 2 nub controllers on I2C */ |
347 | static struct regulator_consumer_supply pandora_vaux4_supplies[] = { | 353 | static struct regulator_consumer_supply pandora_vaux4_supplies[] = { |
@@ -350,8 +356,9 @@ static struct regulator_consumer_supply pandora_vaux4_supplies[] = { | |||
350 | REGULATOR_SUPPLY("vcc", "3-0067"), | 356 | REGULATOR_SUPPLY("vcc", "3-0067"), |
351 | }; | 357 | }; |
352 | 358 | ||
353 | static struct regulator_consumer_supply pandora_adac_supply = | 359 | static struct regulator_consumer_supply pandora_adac_supply[] = { |
354 | REGULATOR_SUPPLY("vcc", "soc-audio"); | 360 | REGULATOR_SUPPLY("vcc", "soc-audio"), |
361 | }; | ||
355 | 362 | ||
356 | /* VMMC1 for MMC1 pins CMD, CLK, DAT0..DAT3 (20 mA, plus card == max 220 mA) */ | 363 | /* VMMC1 for MMC1 pins CMD, CLK, DAT0..DAT3 (20 mA, plus card == max 220 mA) */ |
357 | static struct regulator_init_data pandora_vmmc1 = { | 364 | static struct regulator_init_data pandora_vmmc1 = { |
@@ -364,8 +371,8 @@ static struct regulator_init_data pandora_vmmc1 = { | |||
364 | | REGULATOR_CHANGE_MODE | 371 | | REGULATOR_CHANGE_MODE |
365 | | REGULATOR_CHANGE_STATUS, | 372 | | REGULATOR_CHANGE_STATUS, |
366 | }, | 373 | }, |
367 | .num_consumer_supplies = 1, | 374 | .num_consumer_supplies = ARRAY_SIZE(pandora_vmmc1_supply), |
368 | .consumer_supplies = &pandora_vmmc1_supply, | 375 | .consumer_supplies = pandora_vmmc1_supply, |
369 | }; | 376 | }; |
370 | 377 | ||
371 | /* VMMC2 for MMC2 pins CMD, CLK, DAT0..DAT3 (max 100 mA) */ | 378 | /* VMMC2 for MMC2 pins CMD, CLK, DAT0..DAT3 (max 100 mA) */ |
@@ -379,8 +386,8 @@ static struct regulator_init_data pandora_vmmc2 = { | |||
379 | | REGULATOR_CHANGE_MODE | 386 | | REGULATOR_CHANGE_MODE |
380 | | REGULATOR_CHANGE_STATUS, | 387 | | REGULATOR_CHANGE_STATUS, |
381 | }, | 388 | }, |
382 | .num_consumer_supplies = 1, | 389 | .num_consumer_supplies = ARRAY_SIZE(pandora_vmmc2_supply), |
383 | .consumer_supplies = &pandora_vmmc2_supply, | 390 | .consumer_supplies = pandora_vmmc2_supply, |
384 | }; | 391 | }; |
385 | 392 | ||
386 | /* VDAC for DSS driving S-Video */ | 393 | /* VDAC for DSS driving S-Video */ |
@@ -394,8 +401,8 @@ static struct regulator_init_data pandora_vdac = { | |||
394 | .valid_ops_mask = REGULATOR_CHANGE_MODE | 401 | .valid_ops_mask = REGULATOR_CHANGE_MODE |
395 | | REGULATOR_CHANGE_STATUS, | 402 | | REGULATOR_CHANGE_STATUS, |
396 | }, | 403 | }, |
397 | .num_consumer_supplies = 1, | 404 | .num_consumer_supplies = ARRAY_SIZE(pandora_vdda_dac_supply), |
398 | .consumer_supplies = &pandora_vdda_dac_supply, | 405 | .consumer_supplies = pandora_vdda_dac_supply, |
399 | }; | 406 | }; |
400 | 407 | ||
401 | /* VPLL2 for digital video outputs */ | 408 | /* VPLL2 for digital video outputs */ |
@@ -424,8 +431,8 @@ static struct regulator_init_data pandora_vaux1 = { | |||
424 | .valid_ops_mask = REGULATOR_CHANGE_MODE | 431 | .valid_ops_mask = REGULATOR_CHANGE_MODE |
425 | | REGULATOR_CHANGE_STATUS, | 432 | | REGULATOR_CHANGE_STATUS, |
426 | }, | 433 | }, |
427 | .num_consumer_supplies = 1, | 434 | .num_consumer_supplies = ARRAY_SIZE(pandora_vcc_lcd_supply), |
428 | .consumer_supplies = &pandora_vcc_lcd_supply, | 435 | .consumer_supplies = pandora_vcc_lcd_supply, |
429 | }; | 436 | }; |
430 | 437 | ||
431 | /* VAUX2 for USB host PHY */ | 438 | /* VAUX2 for USB host PHY */ |
@@ -439,8 +446,8 @@ static struct regulator_init_data pandora_vaux2 = { | |||
439 | .valid_ops_mask = REGULATOR_CHANGE_MODE | 446 | .valid_ops_mask = REGULATOR_CHANGE_MODE |
440 | | REGULATOR_CHANGE_STATUS, | 447 | | REGULATOR_CHANGE_STATUS, |
441 | }, | 448 | }, |
442 | .num_consumer_supplies = 1, | 449 | .num_consumer_supplies = ARRAY_SIZE(pandora_usb_phy_supply), |
443 | .consumer_supplies = &pandora_usb_phy_supply, | 450 | .consumer_supplies = pandora_usb_phy_supply, |
444 | }; | 451 | }; |
445 | 452 | ||
446 | /* VAUX4 for ads7846 and nubs */ | 453 | /* VAUX4 for ads7846 and nubs */ |
@@ -469,8 +476,8 @@ static struct regulator_init_data pandora_vsim = { | |||
469 | .valid_ops_mask = REGULATOR_CHANGE_MODE | 476 | .valid_ops_mask = REGULATOR_CHANGE_MODE |
470 | | REGULATOR_CHANGE_STATUS, | 477 | | REGULATOR_CHANGE_STATUS, |
471 | }, | 478 | }, |
472 | .num_consumer_supplies = 1, | 479 | .num_consumer_supplies = ARRAY_SIZE(pandora_adac_supply), |
473 | .consumer_supplies = &pandora_adac_supply, | 480 | .consumer_supplies = pandora_adac_supply, |
474 | }; | 481 | }; |
475 | 482 | ||
476 | /* Fixed regulator internal to Wifi module */ | 483 | /* Fixed regulator internal to Wifi module */ |
@@ -478,8 +485,8 @@ static struct regulator_init_data pandora_vmmc3 = { | |||
478 | .constraints = { | 485 | .constraints = { |
479 | .valid_ops_mask = REGULATOR_CHANGE_STATUS, | 486 | .valid_ops_mask = REGULATOR_CHANGE_STATUS, |
480 | }, | 487 | }, |
481 | .num_consumer_supplies = 1, | 488 | .num_consumer_supplies = ARRAY_SIZE(pandora_vmmc3_supply), |
482 | .consumer_supplies = &pandora_vmmc3_supply, | 489 | .consumer_supplies = pandora_vmmc3_supply, |
483 | }; | 490 | }; |
484 | 491 | ||
485 | static struct fixed_voltage_config pandora_vwlan = { | 492 | static struct fixed_voltage_config pandora_vwlan = { |
diff --git a/arch/arm/mach-omap2/board-omap3stalker.c b/arch/arm/mach-omap2/board-omap3stalker.c index c8e53d0b6b45..b8ad4dd5bbbf 100644 --- a/arch/arm/mach-omap2/board-omap3stalker.c +++ b/arch/arm/mach-omap2/board-omap3stalker.c | |||
@@ -205,12 +205,12 @@ static struct omap_dss_board_info omap3_stalker_dss_data = { | |||
205 | .default_device = &omap3_stalker_dvi_device, | 205 | .default_device = &omap3_stalker_dvi_device, |
206 | }; | 206 | }; |
207 | 207 | ||
208 | static struct regulator_consumer_supply omap3stalker_vmmc1_supply = { | 208 | static struct regulator_consumer_supply omap3stalker_vmmc1_supply[] = { |
209 | .supply = "vmmc", | 209 | REGULATOR_SUPPLY("vmmc", "omap_hsmmc.0"), |
210 | }; | 210 | }; |
211 | 211 | ||
212 | static struct regulator_consumer_supply omap3stalker_vsim_supply = { | 212 | static struct regulator_consumer_supply omap3stalker_vsim_supply[] = { |
213 | .supply = "vmmc_aux", | 213 | REGULATOR_SUPPLY("vmmc_aux", "omap_hsmmc.0"), |
214 | }; | 214 | }; |
215 | 215 | ||
216 | /* VMMC1 for MMC1 pins CMD, CLK, DAT0..DAT3 (20 mA, plus card == max 220 mA) */ | 216 | /* VMMC1 for MMC1 pins CMD, CLK, DAT0..DAT3 (20 mA, plus card == max 220 mA) */ |
@@ -223,8 +223,8 @@ static struct regulator_init_data omap3stalker_vmmc1 = { | |||
223 | .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE | 223 | .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE |
224 | | REGULATOR_CHANGE_MODE | REGULATOR_CHANGE_STATUS, | 224 | | REGULATOR_CHANGE_MODE | REGULATOR_CHANGE_STATUS, |
225 | }, | 225 | }, |
226 | .num_consumer_supplies = 1, | 226 | .num_consumer_supplies = ARRAY_SIZE(omap3stalker_vmmc1_supply), |
227 | .consumer_supplies = &omap3stalker_vmmc1_supply, | 227 | .consumer_supplies = omap3stalker_vmmc1_supply, |
228 | }; | 228 | }; |
229 | 229 | ||
230 | /* VSIM for MMC1 pins DAT4..DAT7 (2 mA, plus card == max 50 mA) */ | 230 | /* VSIM for MMC1 pins DAT4..DAT7 (2 mA, plus card == max 50 mA) */ |
@@ -237,8 +237,8 @@ static struct regulator_init_data omap3stalker_vsim = { | |||
237 | .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE | 237 | .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE |
238 | | REGULATOR_CHANGE_MODE | REGULATOR_CHANGE_STATUS, | 238 | | REGULATOR_CHANGE_MODE | REGULATOR_CHANGE_STATUS, |
239 | }, | 239 | }, |
240 | .num_consumer_supplies = 1, | 240 | .num_consumer_supplies = ARRAY_SIZE(omap3stalker_vsim_supply), |
241 | .consumer_supplies = &omap3stalker_vsim_supply, | 241 | .consumer_supplies = omap3stalker_vsim_supply, |
242 | }; | 242 | }; |
243 | 243 | ||
244 | static struct omap2_hsmmc_info mmc[] = { | 244 | static struct omap2_hsmmc_info mmc[] = { |
@@ -320,10 +320,6 @@ omap3stalker_twl_gpio_setup(struct device *dev, | |||
320 | mmc[0].gpio_cd = gpio + 0; | 320 | mmc[0].gpio_cd = gpio + 0; |
321 | omap2_hsmmc_init(mmc); | 321 | omap2_hsmmc_init(mmc); |
322 | 322 | ||
323 | /* link regulators to MMC adapters */ | ||
324 | omap3stalker_vmmc1_supply.dev = mmc[0].dev; | ||
325 | omap3stalker_vsim_supply.dev = mmc[0].dev; | ||
326 | |||
327 | /* | 323 | /* |
328 | * Most GPIOs are for USB OTG. Some are mostly sent to | 324 | * Most GPIOs are for USB OTG. Some are mostly sent to |
329 | * the P2 connector; notably LEDA for the LCD backlight. | 325 | * the P2 connector; notably LEDA for the LCD backlight. |
@@ -402,8 +398,9 @@ static struct twl4030_codec_data omap3stalker_codec_data = { | |||
402 | .audio = &omap3stalker_audio_data, | 398 | .audio = &omap3stalker_audio_data, |
403 | }; | 399 | }; |
404 | 400 | ||
405 | static struct regulator_consumer_supply omap3_stalker_vdda_dac_supply = | 401 | static struct regulator_consumer_supply omap3_stalker_vdda_dac_supply[] = { |
406 | REGULATOR_SUPPLY("vdda_dac", "omapdss_venc"); | 402 | REGULATOR_SUPPLY("vdda_dac", "omapdss_venc"), |
403 | }; | ||
407 | 404 | ||
408 | /* VDAC for DSS driving S-Video */ | 405 | /* VDAC for DSS driving S-Video */ |
409 | static struct regulator_init_data omap3_stalker_vdac = { | 406 | static struct regulator_init_data omap3_stalker_vdac = { |
@@ -416,8 +413,8 @@ static struct regulator_init_data omap3_stalker_vdac = { | |||
416 | .valid_ops_mask = REGULATOR_CHANGE_MODE | 413 | .valid_ops_mask = REGULATOR_CHANGE_MODE |
417 | | REGULATOR_CHANGE_STATUS, | 414 | | REGULATOR_CHANGE_STATUS, |
418 | }, | 415 | }, |
419 | .num_consumer_supplies = 1, | 416 | .num_consumer_supplies = ARRAY_SIZE(omap3_stalker_vdda_dac_supply), |
420 | .consumer_supplies = &omap3_stalker_vdda_dac_supply, | 417 | .consumer_supplies = omap3_stalker_vdda_dac_supply, |
421 | }; | 418 | }; |
422 | 419 | ||
423 | /* VPLL2 for digital video outputs */ | 420 | /* VPLL2 for digital video outputs */ |
diff --git a/arch/arm/mach-omap2/board-omap3touchbook.c b/arch/arm/mach-omap2/board-omap3touchbook.c index 729565c0feac..57e6ed34ebbc 100644 --- a/arch/arm/mach-omap2/board-omap3touchbook.c +++ b/arch/arm/mach-omap2/board-omap3touchbook.c | |||
@@ -113,12 +113,12 @@ static struct omap_lcd_config omap3_touchbook_lcd_config __initdata = { | |||
113 | .ctrl_name = "internal", | 113 | .ctrl_name = "internal", |
114 | }; | 114 | }; |
115 | 115 | ||
116 | static struct regulator_consumer_supply touchbook_vmmc1_supply = { | 116 | static struct regulator_consumer_supply touchbook_vmmc1_supply[] = { |
117 | .supply = "vmmc", | 117 | REGULATOR_SUPPLY("vmmc", "omap_hsmmc.0"), |
118 | }; | 118 | }; |
119 | 119 | ||
120 | static struct regulator_consumer_supply touchbook_vsim_supply = { | 120 | static struct regulator_consumer_supply touchbook_vsim_supply[] = { |
121 | .supply = "vmmc_aux", | 121 | REGULATOR_SUPPLY("vmmc_aux", "omap_hsmmc.0"), |
122 | }; | 122 | }; |
123 | 123 | ||
124 | static struct gpio_led gpio_leds[]; | 124 | static struct gpio_led gpio_leds[]; |
@@ -136,10 +136,6 @@ static int touchbook_twl_gpio_setup(struct device *dev, | |||
136 | mmc[0].gpio_cd = gpio + 0; | 136 | mmc[0].gpio_cd = gpio + 0; |
137 | omap2_hsmmc_init(mmc); | 137 | omap2_hsmmc_init(mmc); |
138 | 138 | ||
139 | /* link regulators to MMC adapters */ | ||
140 | touchbook_vmmc1_supply.dev = mmc[0].dev; | ||
141 | touchbook_vsim_supply.dev = mmc[0].dev; | ||
142 | |||
143 | /* REVISIT: need ehci-omap hooks for external VBUS | 139 | /* REVISIT: need ehci-omap hooks for external VBUS |
144 | * power switch and overcurrent detect | 140 | * power switch and overcurrent detect |
145 | */ | 141 | */ |
@@ -166,14 +162,18 @@ static struct twl4030_gpio_platform_data touchbook_gpio_data = { | |||
166 | .setup = touchbook_twl_gpio_setup, | 162 | .setup = touchbook_twl_gpio_setup, |
167 | }; | 163 | }; |
168 | 164 | ||
169 | static struct regulator_consumer_supply touchbook_vdac_supply = { | 165 | static struct regulator_consumer_supply touchbook_vdac_supply[] = { |
166 | { | ||
170 | .supply = "vdac", | 167 | .supply = "vdac", |
171 | .dev = &omap3_touchbook_lcd_device.dev, | 168 | .dev = &omap3_touchbook_lcd_device.dev, |
169 | }, | ||
172 | }; | 170 | }; |
173 | 171 | ||
174 | static struct regulator_consumer_supply touchbook_vdvi_supply = { | 172 | static struct regulator_consumer_supply touchbook_vdvi_supply[] = { |
173 | { | ||
175 | .supply = "vdvi", | 174 | .supply = "vdvi", |
176 | .dev = &omap3_touchbook_lcd_device.dev, | 175 | .dev = &omap3_touchbook_lcd_device.dev, |
176 | }, | ||
177 | }; | 177 | }; |
178 | 178 | ||
179 | /* VMMC1 for MMC1 pins CMD, CLK, DAT0..DAT3 (20 mA, plus card == max 220 mA) */ | 179 | /* VMMC1 for MMC1 pins CMD, CLK, DAT0..DAT3 (20 mA, plus card == max 220 mA) */ |
@@ -187,8 +187,8 @@ static struct regulator_init_data touchbook_vmmc1 = { | |||
187 | | REGULATOR_CHANGE_MODE | 187 | | REGULATOR_CHANGE_MODE |
188 | | REGULATOR_CHANGE_STATUS, | 188 | | REGULATOR_CHANGE_STATUS, |
189 | }, | 189 | }, |
190 | .num_consumer_supplies = 1, | 190 | .num_consumer_supplies = ARRAY_SIZE(touchbook_vmmc1_supply), |
191 | .consumer_supplies = &touchbook_vmmc1_supply, | 191 | .consumer_supplies = touchbook_vmmc1_supply, |
192 | }; | 192 | }; |
193 | 193 | ||
194 | /* VSIM for MMC1 pins DAT4..DAT7 (2 mA, plus card == max 50 mA) */ | 194 | /* VSIM for MMC1 pins DAT4..DAT7 (2 mA, plus card == max 50 mA) */ |
@@ -202,8 +202,8 @@ static struct regulator_init_data touchbook_vsim = { | |||
202 | | REGULATOR_CHANGE_MODE | 202 | | REGULATOR_CHANGE_MODE |
203 | | REGULATOR_CHANGE_STATUS, | 203 | | REGULATOR_CHANGE_STATUS, |
204 | }, | 204 | }, |
205 | .num_consumer_supplies = 1, | 205 | .num_consumer_supplies = ARRAY_SIZE(touchbook_vsim_supply), |
206 | .consumer_supplies = &touchbook_vsim_supply, | 206 | .consumer_supplies = touchbook_vsim_supply, |
207 | }; | 207 | }; |
208 | 208 | ||
209 | /* VDAC for DSS driving S-Video (8 mA unloaded, max 65 mA) */ | 209 | /* VDAC for DSS driving S-Video (8 mA unloaded, max 65 mA) */ |
@@ -216,8 +216,8 @@ static struct regulator_init_data touchbook_vdac = { | |||
216 | .valid_ops_mask = REGULATOR_CHANGE_MODE | 216 | .valid_ops_mask = REGULATOR_CHANGE_MODE |
217 | | REGULATOR_CHANGE_STATUS, | 217 | | REGULATOR_CHANGE_STATUS, |
218 | }, | 218 | }, |
219 | .num_consumer_supplies = 1, | 219 | .num_consumer_supplies = ARRAY_SIZE(touchbook_vdac_supply), |
220 | .consumer_supplies = &touchbook_vdac_supply, | 220 | .consumer_supplies = touchbook_vdac_supply, |
221 | }; | 221 | }; |
222 | 222 | ||
223 | /* VPLL2 for digital video outputs */ | 223 | /* VPLL2 for digital video outputs */ |
@@ -231,8 +231,8 @@ static struct regulator_init_data touchbook_vpll2 = { | |||
231 | .valid_ops_mask = REGULATOR_CHANGE_MODE | 231 | .valid_ops_mask = REGULATOR_CHANGE_MODE |
232 | | REGULATOR_CHANGE_STATUS, | 232 | | REGULATOR_CHANGE_STATUS, |
233 | }, | 233 | }, |
234 | .num_consumer_supplies = 1, | 234 | .num_consumer_supplies = ARRAY_SIZE(touchbook_vdvi_supply), |
235 | .consumer_supplies = &touchbook_vdvi_supply, | 235 | .consumer_supplies = touchbook_vdvi_supply, |
236 | }; | 236 | }; |
237 | 237 | ||
238 | static struct twl4030_usb_data touchbook_usb_data = { | 238 | static struct twl4030_usb_data touchbook_usb_data = { |
diff --git a/arch/arm/mach-omap2/board-omap4panda.c b/arch/arm/mach-omap2/board-omap4panda.c index f106489bb76f..ee2034e37468 100644 --- a/arch/arm/mach-omap2/board-omap4panda.c +++ b/arch/arm/mach-omap2/board-omap4panda.c | |||
@@ -182,23 +182,19 @@ static struct omap2_hsmmc_info mmc[] = { | |||
182 | }; | 182 | }; |
183 | 183 | ||
184 | static struct regulator_consumer_supply omap4_panda_vmmc_supply[] = { | 184 | static struct regulator_consumer_supply omap4_panda_vmmc_supply[] = { |
185 | { | 185 | REGULATOR_SUPPLY("vmmc", "omap_hsmmc.0"), |
186 | .supply = "vmmc", | ||
187 | .dev_name = "omap_hsmmc.0", | ||
188 | }, | ||
189 | }; | 186 | }; |
190 | 187 | ||
191 | static struct regulator_consumer_supply omap4_panda_vmmc5_supply = { | 188 | static struct regulator_consumer_supply omap4_panda_vmmc5_supply[] = { |
192 | .supply = "vmmc", | 189 | REGULATOR_SUPPLY("vmmc", "omap_hsmmc.4"), |
193 | .dev_name = "omap_hsmmc.4", | ||
194 | }; | 190 | }; |
195 | 191 | ||
196 | static struct regulator_init_data panda_vmmc5 = { | 192 | static struct regulator_init_data panda_vmmc5 = { |
197 | .constraints = { | 193 | .constraints = { |
198 | .valid_ops_mask = REGULATOR_CHANGE_STATUS, | 194 | .valid_ops_mask = REGULATOR_CHANGE_STATUS, |
199 | }, | 195 | }, |
200 | .num_consumer_supplies = 1, | 196 | .num_consumer_supplies = ARRAY_SIZE(omap4_panda_vmmc5_supply), |
201 | .consumer_supplies = &omap4_panda_vmmc5_supply, | 197 | .consumer_supplies = omap4_panda_vmmc5_supply, |
202 | }; | 198 | }; |
203 | 199 | ||
204 | static struct fixed_voltage_config panda_vwlan = { | 200 | static struct fixed_voltage_config panda_vwlan = { |
@@ -311,7 +307,7 @@ static struct regulator_init_data omap4_panda_vmmc = { | |||
311 | | REGULATOR_CHANGE_MODE | 307 | | REGULATOR_CHANGE_MODE |
312 | | REGULATOR_CHANGE_STATUS, | 308 | | REGULATOR_CHANGE_STATUS, |
313 | }, | 309 | }, |
314 | .num_consumer_supplies = 1, | 310 | .num_consumer_supplies = ARRAY_SIZE(omap4_panda_vmmc_supply), |
315 | .consumer_supplies = omap4_panda_vmmc_supply, | 311 | .consumer_supplies = omap4_panda_vmmc_supply, |
316 | }; | 312 | }; |
317 | 313 | ||
diff --git a/arch/arm/mach-omap2/board-overo.c b/arch/arm/mach-omap2/board-overo.c index d06248f0b802..1bf2f39b9d0e 100644 --- a/arch/arm/mach-omap2/board-overo.c +++ b/arch/arm/mach-omap2/board-overo.c | |||
@@ -74,15 +74,16 @@ | |||
74 | defined(CONFIG_TOUCHSCREEN_ADS7846_MODULE) | 74 | defined(CONFIG_TOUCHSCREEN_ADS7846_MODULE) |
75 | 75 | ||
76 | /* fixed regulator for ads7846 */ | 76 | /* fixed regulator for ads7846 */ |
77 | static struct regulator_consumer_supply ads7846_supply = | 77 | static struct regulator_consumer_supply ads7846_supply[] = { |
78 | REGULATOR_SUPPLY("vcc", "spi1.0"); | 78 | REGULATOR_SUPPLY("vcc", "spi1.0"), |
79 | }; | ||
79 | 80 | ||
80 | static struct regulator_init_data vads7846_regulator = { | 81 | static struct regulator_init_data vads7846_regulator = { |
81 | .constraints = { | 82 | .constraints = { |
82 | .valid_ops_mask = REGULATOR_CHANGE_STATUS, | 83 | .valid_ops_mask = REGULATOR_CHANGE_STATUS, |
83 | }, | 84 | }, |
84 | .num_consumer_supplies = 1, | 85 | .num_consumer_supplies = ARRAY_SIZE(ads7846_supply), |
85 | .consumer_supplies = &ads7846_supply, | 86 | .consumer_supplies = ads7846_supply, |
86 | }; | 87 | }; |
87 | 88 | ||
88 | static struct fixed_voltage_config vads7846 = { | 89 | static struct fixed_voltage_config vads7846 = { |
@@ -264,8 +265,9 @@ static struct omap_dss_board_info overo_dss_data = { | |||
264 | .default_device = &overo_dvi_device, | 265 | .default_device = &overo_dvi_device, |
265 | }; | 266 | }; |
266 | 267 | ||
267 | static struct regulator_consumer_supply overo_vdda_dac_supply = | 268 | static struct regulator_consumer_supply overo_vdda_dac_supply[] = { |
268 | REGULATOR_SUPPLY("vdda_dac", "omapdss_venc"); | 269 | REGULATOR_SUPPLY("vdda_dac", "omapdss_venc"), |
270 | }; | ||
269 | 271 | ||
270 | static struct regulator_consumer_supply overo_vdds_dsi_supply[] = { | 272 | static struct regulator_consumer_supply overo_vdds_dsi_supply[] = { |
271 | REGULATOR_SUPPLY("vdds_dsi", "omapdss"), | 273 | REGULATOR_SUPPLY("vdds_dsi", "omapdss"), |
@@ -319,8 +321,8 @@ static struct omap2_hsmmc_info mmc[] = { | |||
319 | {} /* Terminator */ | 321 | {} /* Terminator */ |
320 | }; | 322 | }; |
321 | 323 | ||
322 | static struct regulator_consumer_supply overo_vmmc1_supply = { | 324 | static struct regulator_consumer_supply overo_vmmc1_supply[] = { |
323 | .supply = "vmmc", | 325 | REGULATOR_SUPPLY("vmmc", "omap_hsmmc.0"), |
324 | }; | 326 | }; |
325 | 327 | ||
326 | #if defined(CONFIG_LEDS_GPIO) || defined(CONFIG_LEDS_GPIO_MODULE) | 328 | #if defined(CONFIG_LEDS_GPIO) || defined(CONFIG_LEDS_GPIO_MODULE) |
@@ -415,8 +417,6 @@ static int overo_twl_gpio_setup(struct device *dev, | |||
415 | { | 417 | { |
416 | omap2_hsmmc_init(mmc); | 418 | omap2_hsmmc_init(mmc); |
417 | 419 | ||
418 | overo_vmmc1_supply.dev = mmc[0].dev; | ||
419 | |||
420 | #if defined(CONFIG_LEDS_GPIO) || defined(CONFIG_LEDS_GPIO_MODULE) | 420 | #if defined(CONFIG_LEDS_GPIO) || defined(CONFIG_LEDS_GPIO_MODULE) |
421 | /* TWL4030_GPIO_MAX + 1 == ledB, PMU_STAT (out, active low LED) */ | 421 | /* TWL4030_GPIO_MAX + 1 == ledB, PMU_STAT (out, active low LED) */ |
422 | gpio_leds[2].gpio = gpio + TWL4030_GPIO_MAX + 1; | 422 | gpio_leds[2].gpio = gpio + TWL4030_GPIO_MAX + 1; |
@@ -447,8 +447,8 @@ static struct regulator_init_data overo_vmmc1 = { | |||
447 | | REGULATOR_CHANGE_MODE | 447 | | REGULATOR_CHANGE_MODE |
448 | | REGULATOR_CHANGE_STATUS, | 448 | | REGULATOR_CHANGE_STATUS, |
449 | }, | 449 | }, |
450 | .num_consumer_supplies = 1, | 450 | .num_consumer_supplies = ARRAY_SIZE(overo_vmmc1_supply), |
451 | .consumer_supplies = &overo_vmmc1_supply, | 451 | .consumer_supplies = overo_vmmc1_supply, |
452 | }; | 452 | }; |
453 | 453 | ||
454 | /* VDAC for DSS driving S-Video (8 mA unloaded, max 65 mA) */ | 454 | /* VDAC for DSS driving S-Video (8 mA unloaded, max 65 mA) */ |
@@ -461,8 +461,8 @@ static struct regulator_init_data overo_vdac = { | |||
461 | .valid_ops_mask = REGULATOR_CHANGE_MODE | 461 | .valid_ops_mask = REGULATOR_CHANGE_MODE |
462 | | REGULATOR_CHANGE_STATUS, | 462 | | REGULATOR_CHANGE_STATUS, |
463 | }, | 463 | }, |
464 | .num_consumer_supplies = 1, | 464 | .num_consumer_supplies = ARRAY_SIZE(overo_vdda_dac_supply), |
465 | .consumer_supplies = &overo_vdda_dac_supply, | 465 | .consumer_supplies = overo_vdda_dac_supply, |
466 | }; | 466 | }; |
467 | 467 | ||
468 | /* VPLL2 for digital video outputs */ | 468 | /* VPLL2 for digital video outputs */ |
diff --git a/arch/arm/mach-omap2/board-rx51-peripherals.c b/arch/arm/mach-omap2/board-rx51-peripherals.c index 990366726c58..5e559dda3cc3 100644 --- a/arch/arm/mach-omap2/board-rx51-peripherals.c +++ b/arch/arm/mach-omap2/board-rx51-peripherals.c | |||
@@ -358,14 +358,17 @@ static struct omap2_hsmmc_info mmc[] __initdata = { | |||
358 | {} /* Terminator */ | 358 | {} /* Terminator */ |
359 | }; | 359 | }; |
360 | 360 | ||
361 | static struct regulator_consumer_supply rx51_vmmc1_supply = | 361 | static struct regulator_consumer_supply rx51_vmmc1_supply[] = { |
362 | REGULATOR_SUPPLY("vmmc", "omap_hsmmc.0"); | 362 | REGULATOR_SUPPLY("vmmc", "omap_hsmmc.0"), |
363 | }; | ||
363 | 364 | ||
364 | static struct regulator_consumer_supply rx51_vaux3_supply = | 365 | static struct regulator_consumer_supply rx51_vaux3_supply[] = { |
365 | REGULATOR_SUPPLY("vmmc", "omap_hsmmc.1"); | 366 | REGULATOR_SUPPLY("vmmc", "omap_hsmmc.1"), |
367 | }; | ||
366 | 368 | ||
367 | static struct regulator_consumer_supply rx51_vsim_supply = | 369 | static struct regulator_consumer_supply rx51_vsim_supply[] = { |
368 | REGULATOR_SUPPLY("vmmc_aux", "omap_hsmmc.1"); | 370 | REGULATOR_SUPPLY("vmmc_aux", "omap_hsmmc.1"), |
371 | }; | ||
369 | 372 | ||
370 | static struct regulator_consumer_supply rx51_vmmc2_supplies[] = { | 373 | static struct regulator_consumer_supply rx51_vmmc2_supplies[] = { |
371 | /* tlv320aic3x analog supplies */ | 374 | /* tlv320aic3x analog supplies */ |
@@ -452,8 +455,8 @@ static struct regulator_init_data rx51_vaux3_mmc = { | |||
452 | | REGULATOR_CHANGE_MODE | 455 | | REGULATOR_CHANGE_MODE |
453 | | REGULATOR_CHANGE_STATUS, | 456 | | REGULATOR_CHANGE_STATUS, |
454 | }, | 457 | }, |
455 | .num_consumer_supplies = 1, | 458 | .num_consumer_supplies = ARRAY_SIZE(rx51_vaux3_supply), |
456 | .consumer_supplies = &rx51_vaux3_supply, | 459 | .consumer_supplies = rx51_vaux3_supply, |
457 | }; | 460 | }; |
458 | 461 | ||
459 | static struct regulator_init_data rx51_vaux4 = { | 462 | static struct regulator_init_data rx51_vaux4 = { |
@@ -479,8 +482,8 @@ static struct regulator_init_data rx51_vmmc1 = { | |||
479 | | REGULATOR_CHANGE_MODE | 482 | | REGULATOR_CHANGE_MODE |
480 | | REGULATOR_CHANGE_STATUS, | 483 | | REGULATOR_CHANGE_STATUS, |
481 | }, | 484 | }, |
482 | .num_consumer_supplies = 1, | 485 | .num_consumer_supplies = ARRAY_SIZE(rx51_vmmc1_supply), |
483 | .consumer_supplies = &rx51_vmmc1_supply, | 486 | .consumer_supplies = rx51_vmmc1_supply, |
484 | }; | 487 | }; |
485 | 488 | ||
486 | static struct regulator_init_data rx51_vmmc2 = { | 489 | static struct regulator_init_data rx51_vmmc2 = { |
@@ -511,8 +514,8 @@ static struct regulator_init_data rx51_vsim = { | |||
511 | .valid_ops_mask = REGULATOR_CHANGE_MODE | 514 | .valid_ops_mask = REGULATOR_CHANGE_MODE |
512 | | REGULATOR_CHANGE_STATUS, | 515 | | REGULATOR_CHANGE_STATUS, |
513 | }, | 516 | }, |
514 | .num_consumer_supplies = 1, | 517 | .num_consumer_supplies = ARRAY_SIZE(rx51_vsim_supply), |
515 | .consumer_supplies = &rx51_vsim_supply, | 518 | .consumer_supplies = rx51_vsim_supply, |
516 | }; | 519 | }; |
517 | 520 | ||
518 | static struct regulator_init_data rx51_vdac = { | 521 | static struct regulator_init_data rx51_vdac = { |
@@ -526,7 +529,7 @@ static struct regulator_init_data rx51_vdac = { | |||
526 | .valid_ops_mask = REGULATOR_CHANGE_MODE | 529 | .valid_ops_mask = REGULATOR_CHANGE_MODE |
527 | | REGULATOR_CHANGE_STATUS, | 530 | | REGULATOR_CHANGE_STATUS, |
528 | }, | 531 | }, |
529 | .num_consumer_supplies = 1, | 532 | .num_consumer_supplies = ARRAY_SIZE(rx51_vdac_supply), |
530 | .consumer_supplies = rx51_vdac_supply, | 533 | .consumer_supplies = rx51_vdac_supply, |
531 | }; | 534 | }; |
532 | 535 | ||
diff --git a/arch/arm/mach-omap2/board-zoom-peripherals.c b/arch/arm/mach-omap2/board-zoom-peripherals.c index 118c6f53c5eb..8495f82fcbab 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 | ||
108 | static struct regulator_consumer_supply zoom_vmmc1_supply = { | 108 | static struct regulator_consumer_supply zoom_vmmc1_supply[] = { |
109 | .supply = "vmmc", | 109 | REGULATOR_SUPPLY("vmmc", "omap_hsmmc.0"), |
110 | }; | 110 | }; |
111 | 111 | ||
112 | static struct regulator_consumer_supply zoom_vsim_supply = { | 112 | static struct regulator_consumer_supply zoom_vsim_supply[] = { |
113 | .supply = "vmmc_aux", | 113 | REGULATOR_SUPPLY("vmmc_aux", "omap_hsmmc.0"), |
114 | }; | 114 | }; |
115 | 115 | ||
116 | static struct regulator_consumer_supply zoom_vmmc2_supply = { | 116 | static struct regulator_consumer_supply zoom_vmmc2_supply[] = { |
117 | .supply = "vmmc", | 117 | REGULATOR_SUPPLY("vmmc", "omap_hsmmc.1"), |
118 | }; | 118 | }; |
119 | 119 | ||
120 | static struct regulator_consumer_supply zoom_vmmc3_supply = { | 120 | static 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 | ||
170 | static struct regulator_init_data zoom_vmmc3 = { | 169 | static 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 | ||
178 | static struct fixed_voltage_config zoom_vwlan = { | 177 | static struct fixed_voltage_config zoom_vwlan = { |
@@ -232,8 +231,9 @@ static struct regulator_consumer_supply zoom_vpll2_supplies[] = { | |||
232 | REGULATOR_SUPPLY("vdds_dsi", "omapdss_dsi1"), | 231 | REGULATOR_SUPPLY("vdds_dsi", "omapdss_dsi1"), |
233 | }; | 232 | }; |
234 | 233 | ||
235 | static struct regulator_consumer_supply zoom_vdda_dac_supply = | 234 | static struct regulator_consumer_supply zoom_vdda_dac_supply[] = { |
236 | REGULATOR_SUPPLY("vdda_dac", "omapdss_venc"); | 235 | REGULATOR_SUPPLY("vdda_dac", "omapdss_venc"), |
236 | }; | ||
237 | 237 | ||
238 | static struct regulator_init_data zoom_vpll2 = { | 238 | static struct regulator_init_data zoom_vpll2 = { |
239 | .constraints = { | 239 | .constraints = { |
@@ -257,8 +257,8 @@ static struct regulator_init_data zoom_vdac = { | |||
257 | .valid_ops_mask = REGULATOR_CHANGE_MODE | 257 | .valid_ops_mask = REGULATOR_CHANGE_MODE |
258 | | REGULATOR_CHANGE_STATUS, | 258 | | REGULATOR_CHANGE_STATUS, |
259 | }, | 259 | }, |
260 | .num_consumer_supplies = 1, | 260 | .num_consumer_supplies = ARRAY_SIZE(zoom_vdda_dac_supply), |
261 | .consumer_supplies = &zoom_vdda_dac_supply, | 261 | .consumer_supplies = zoom_vdda_dac_supply, |
262 | }; | 262 | }; |
263 | 263 | ||
264 | static int zoom_twl_gpio_setup(struct device *dev, | 264 | static int zoom_twl_gpio_setup(struct device *dev, |
@@ -270,13 +270,6 @@ static int zoom_twl_gpio_setup(struct device *dev, | |||
270 | mmc[0].gpio_cd = gpio + 0; | 270 | mmc[0].gpio_cd = gpio + 0; |
271 | omap2_hsmmc_init(mmc); | 271 | omap2_hsmmc_init(mmc); |
272 | 272 | ||
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, | 273 | ret = gpio_request_one(LCD_PANEL_ENABLE_GPIO, GPIOF_OUT_INIT_LOW, |
281 | "lcd enable"); | 274 | "lcd enable"); |
282 | if (ret) | 275 | if (ret) |
diff --git a/arch/arm/mach-omap2/common-board-devices.c b/arch/arm/mach-omap2/common-board-devices.c index 94ccf464677b..0043fa8e3703 100644 --- a/arch/arm/mach-omap2/common-board-devices.c +++ b/arch/arm/mach-omap2/common-board-devices.c | |||
@@ -115,9 +115,7 @@ void __init omap_ads7846_init(int bus_num, int gpio_pendown, int gpio_debounce, | |||
115 | #endif | 115 | #endif |
116 | 116 | ||
117 | #if defined(CONFIG_MTD_NAND_OMAP2) || defined(CONFIG_MTD_NAND_OMAP2_MODULE) | 117 | #if defined(CONFIG_MTD_NAND_OMAP2) || defined(CONFIG_MTD_NAND_OMAP2_MODULE) |
118 | static struct omap_nand_platform_data nand_data = { | 118 | static struct omap_nand_platform_data nand_data; |
119 | .dma_channel = -1, /* disable DMA in OMAP NAND driver */ | ||
120 | }; | ||
121 | 119 | ||
122 | void __init omap_nand_flash_init(int options, struct mtd_partition *parts, | 120 | void __init omap_nand_flash_init(int options, struct mtd_partition *parts, |
123 | int nr_parts) | 121 | int nr_parts) |
@@ -148,7 +146,7 @@ void __init omap_nand_flash_init(int options, struct mtd_partition *parts, | |||
148 | nand_data.cs = nandcs; | 146 | nand_data.cs = nandcs; |
149 | nand_data.parts = parts; | 147 | nand_data.parts = parts; |
150 | nand_data.nr_parts = nr_parts; | 148 | nand_data.nr_parts = nr_parts; |
151 | nand_data.options = options; | 149 | nand_data.devsize = options; |
152 | 150 | ||
153 | printk(KERN_INFO "Registering NAND on CS%d\n", nandcs); | 151 | printk(KERN_INFO "Registering NAND on CS%d\n", nandcs); |
154 | if (gpmc_nand_init(&nand_data) < 0) | 152 | if (gpmc_nand_init(&nand_data) < 0) |
diff --git a/arch/arm/mach-omap2/gpmc-nand.c b/arch/arm/mach-omap2/gpmc-nand.c index c1791d08ae56..8ad210bda9a9 100644 --- a/arch/arm/mach-omap2/gpmc-nand.c +++ b/arch/arm/mach-omap2/gpmc-nand.c | |||
@@ -20,8 +20,6 @@ | |||
20 | #include <plat/board.h> | 20 | #include <plat/board.h> |
21 | #include <plat/gpmc.h> | 21 | #include <plat/gpmc.h> |
22 | 22 | ||
23 | static struct omap_nand_platform_data *gpmc_nand_data; | ||
24 | |||
25 | static struct resource gpmc_nand_resource = { | 23 | static struct resource gpmc_nand_resource = { |
26 | .flags = IORESOURCE_MEM, | 24 | .flags = IORESOURCE_MEM, |
27 | }; | 25 | }; |
@@ -33,7 +31,7 @@ static struct platform_device gpmc_nand_device = { | |||
33 | .resource = &gpmc_nand_resource, | 31 | .resource = &gpmc_nand_resource, |
34 | }; | 32 | }; |
35 | 33 | ||
36 | static int omap2_nand_gpmc_retime(void) | 34 | static int omap2_nand_gpmc_retime(struct omap_nand_platform_data *gpmc_nand_data) |
37 | { | 35 | { |
38 | struct gpmc_timings t; | 36 | struct gpmc_timings t; |
39 | int err; | 37 | int err; |
@@ -83,13 +81,11 @@ static int omap2_nand_gpmc_retime(void) | |||
83 | return 0; | 81 | return 0; |
84 | } | 82 | } |
85 | 83 | ||
86 | int __init gpmc_nand_init(struct omap_nand_platform_data *_nand_data) | 84 | int __init gpmc_nand_init(struct omap_nand_platform_data *gpmc_nand_data) |
87 | { | 85 | { |
88 | int err = 0; | 86 | int err = 0; |
89 | struct device *dev = &gpmc_nand_device.dev; | 87 | struct device *dev = &gpmc_nand_device.dev; |
90 | 88 | ||
91 | gpmc_nand_data = _nand_data; | ||
92 | gpmc_nand_data->nand_setup = omap2_nand_gpmc_retime; | ||
93 | gpmc_nand_device.dev.platform_data = gpmc_nand_data; | 89 | gpmc_nand_device.dev.platform_data = gpmc_nand_data; |
94 | 90 | ||
95 | err = gpmc_cs_request(gpmc_nand_data->cs, NAND_IO_SIZE, | 91 | err = gpmc_cs_request(gpmc_nand_data->cs, NAND_IO_SIZE, |
@@ -100,7 +96,7 @@ int __init gpmc_nand_init(struct omap_nand_platform_data *_nand_data) | |||
100 | } | 96 | } |
101 | 97 | ||
102 | /* Set timings in GPMC */ | 98 | /* Set timings in GPMC */ |
103 | err = omap2_nand_gpmc_retime(); | 99 | err = omap2_nand_gpmc_retime(gpmc_nand_data); |
104 | if (err < 0) { | 100 | if (err < 0) { |
105 | dev_err(dev, "Unable to set gpmc timings: %d\n", err); | 101 | dev_err(dev, "Unable to set gpmc timings: %d\n", err); |
106 | return err; | 102 | return err; |
diff --git a/arch/arm/plat-omap/include/plat/mcbsp.h b/arch/arm/plat-omap/include/plat/mcbsp.h index f8f690ab2997..6c5350832407 100644 --- a/arch/arm/plat-omap/include/plat/mcbsp.h +++ b/arch/arm/plat-omap/include/plat/mcbsp.h | |||
@@ -24,7 +24,6 @@ | |||
24 | #ifndef __ASM_ARCH_OMAP_MCBSP_H | 24 | #ifndef __ASM_ARCH_OMAP_MCBSP_H |
25 | #define __ASM_ARCH_OMAP_MCBSP_H | 25 | #define __ASM_ARCH_OMAP_MCBSP_H |
26 | 26 | ||
27 | #include <linux/completion.h> | ||
28 | #include <linux/spinlock.h> | 27 | #include <linux/spinlock.h> |
29 | 28 | ||
30 | #include <mach/hardware.h> | 29 | #include <mach/hardware.h> |
@@ -340,10 +339,6 @@ typedef enum { | |||
340 | OMAP_MCBSP5 | 339 | OMAP_MCBSP5 |
341 | } omap_mcbsp_id; | 340 | } omap_mcbsp_id; |
342 | 341 | ||
343 | typedef int __bitwise omap_mcbsp_io_type_t; | ||
344 | #define OMAP_MCBSP_IRQ_IO ((__force omap_mcbsp_io_type_t) 1) | ||
345 | #define OMAP_MCBSP_POLL_IO ((__force omap_mcbsp_io_type_t) 2) | ||
346 | |||
347 | typedef enum { | 342 | typedef enum { |
348 | OMAP_MCBSP_WORD_8 = 0, | 343 | OMAP_MCBSP_WORD_8 = 0, |
349 | OMAP_MCBSP_WORD_12, | 344 | OMAP_MCBSP_WORD_12, |
@@ -353,38 +348,6 @@ typedef enum { | |||
353 | OMAP_MCBSP_WORD_32, | 348 | OMAP_MCBSP_WORD_32, |
354 | } omap_mcbsp_word_length; | 349 | } omap_mcbsp_word_length; |
355 | 350 | ||
356 | typedef enum { | ||
357 | OMAP_MCBSP_CLK_RISING = 0, | ||
358 | OMAP_MCBSP_CLK_FALLING, | ||
359 | } omap_mcbsp_clk_polarity; | ||
360 | |||
361 | typedef enum { | ||
362 | OMAP_MCBSP_FS_ACTIVE_HIGH = 0, | ||
363 | OMAP_MCBSP_FS_ACTIVE_LOW, | ||
364 | } omap_mcbsp_fs_polarity; | ||
365 | |||
366 | typedef enum { | ||
367 | OMAP_MCBSP_CLK_STP_MODE_NO_DELAY = 0, | ||
368 | OMAP_MCBSP_CLK_STP_MODE_DELAY, | ||
369 | } omap_mcbsp_clk_stp_mode; | ||
370 | |||
371 | |||
372 | /******* SPI specific mode **********/ | ||
373 | typedef enum { | ||
374 | OMAP_MCBSP_SPI_MASTER = 0, | ||
375 | OMAP_MCBSP_SPI_SLAVE, | ||
376 | } omap_mcbsp_spi_mode; | ||
377 | |||
378 | struct omap_mcbsp_spi_cfg { | ||
379 | omap_mcbsp_spi_mode spi_mode; | ||
380 | omap_mcbsp_clk_polarity rx_clock_polarity; | ||
381 | omap_mcbsp_clk_polarity tx_clock_polarity; | ||
382 | omap_mcbsp_fs_polarity fsx_polarity; | ||
383 | u8 clk_div; | ||
384 | omap_mcbsp_clk_stp_mode clk_stp_mode; | ||
385 | omap_mcbsp_word_length word_length; | ||
386 | }; | ||
387 | |||
388 | /* Platform specific configuration */ | 351 | /* Platform specific configuration */ |
389 | struct omap_mcbsp_ops { | 352 | struct omap_mcbsp_ops { |
390 | void (*request)(unsigned int); | 353 | void (*request)(unsigned int); |
@@ -425,22 +388,12 @@ struct omap_mcbsp { | |||
425 | omap_mcbsp_word_length rx_word_length; | 388 | omap_mcbsp_word_length rx_word_length; |
426 | omap_mcbsp_word_length tx_word_length; | 389 | omap_mcbsp_word_length tx_word_length; |
427 | 390 | ||
428 | omap_mcbsp_io_type_t io_type; /* IRQ or poll */ | ||
429 | /* IRQ based TX/RX */ | ||
430 | int rx_irq; | 391 | int rx_irq; |
431 | int tx_irq; | 392 | int tx_irq; |
432 | 393 | ||
433 | /* DMA stuff */ | 394 | /* DMA stuff */ |
434 | u8 dma_rx_sync; | 395 | u8 dma_rx_sync; |
435 | short dma_rx_lch; | ||
436 | u8 dma_tx_sync; | 396 | u8 dma_tx_sync; |
437 | short dma_tx_lch; | ||
438 | |||
439 | /* Completion queues */ | ||
440 | struct completion tx_irq_completion; | ||
441 | struct completion rx_irq_completion; | ||
442 | struct completion tx_dma_completion; | ||
443 | struct completion rx_dma_completion; | ||
444 | 397 | ||
445 | /* Protect the field .free, while checking if the mcbsp is in use */ | 398 | /* Protect the field .free, while checking if the mcbsp is in use */ |
446 | spinlock_t lock; | 399 | spinlock_t lock; |
@@ -499,24 +452,9 @@ int omap_mcbsp_request(unsigned int id); | |||
499 | void omap_mcbsp_free(unsigned int id); | 452 | void omap_mcbsp_free(unsigned int id); |
500 | void omap_mcbsp_start(unsigned int id, int tx, int rx); | 453 | void omap_mcbsp_start(unsigned int id, int tx, int rx); |
501 | void omap_mcbsp_stop(unsigned int id, int tx, int rx); | 454 | void omap_mcbsp_stop(unsigned int id, int tx, int rx); |
502 | void omap_mcbsp_xmit_word(unsigned int id, u32 word); | ||
503 | u32 omap_mcbsp_recv_word(unsigned int id); | ||
504 | |||
505 | int omap_mcbsp_xmit_buffer(unsigned int id, dma_addr_t buffer, unsigned int length); | ||
506 | int omap_mcbsp_recv_buffer(unsigned int id, dma_addr_t buffer, unsigned int length); | ||
507 | int omap_mcbsp_spi_master_xmit_word_poll(unsigned int id, u32 word); | ||
508 | int omap_mcbsp_spi_master_recv_word_poll(unsigned int id, u32 * word); | ||
509 | |||
510 | 455 | ||
511 | /* McBSP functional clock source changing function */ | 456 | /* McBSP functional clock source changing function */ |
512 | extern int omap2_mcbsp_set_clks_src(u8 id, u8 fck_src_id); | 457 | extern int omap2_mcbsp_set_clks_src(u8 id, u8 fck_src_id); |
513 | /* SPI specific API */ | ||
514 | void omap_mcbsp_set_spi_mode(unsigned int id, const struct omap_mcbsp_spi_cfg * spi_cfg); | ||
515 | |||
516 | /* Polled read/write functions */ | ||
517 | int omap_mcbsp_pollread(unsigned int id, u16 * buf); | ||
518 | int omap_mcbsp_pollwrite(unsigned int id, u16 buf); | ||
519 | int omap_mcbsp_set_io_type(unsigned int id, omap_mcbsp_io_type_t io_type); | ||
520 | 458 | ||
521 | /* McBSP signal muxing API */ | 459 | /* McBSP signal muxing API */ |
522 | void omap2_mcbsp1_mux_clkr_src(u8 mux); | 460 | void omap2_mcbsp1_mux_clkr_src(u8 mux); |
diff --git a/arch/arm/plat-omap/include/plat/nand.h b/arch/arm/plat-omap/include/plat/nand.h index d86d1ecf0068..67fc5060183e 100644 --- a/arch/arm/plat-omap/include/plat/nand.h +++ b/arch/arm/plat-omap/include/plat/nand.h | |||
@@ -19,15 +19,11 @@ enum nand_io { | |||
19 | }; | 19 | }; |
20 | 20 | ||
21 | struct omap_nand_platform_data { | 21 | struct omap_nand_platform_data { |
22 | unsigned int options; | ||
23 | int cs; | 22 | int cs; |
24 | int gpio_irq; | ||
25 | struct mtd_partition *parts; | 23 | struct mtd_partition *parts; |
26 | struct gpmc_timings *gpmc_t; | 24 | struct gpmc_timings *gpmc_t; |
27 | int nr_parts; | 25 | int nr_parts; |
28 | int (*nand_setup)(void); | 26 | bool dev_ready; |
29 | int (*dev_ready)(struct omap_nand_platform_data *); | ||
30 | int dma_channel; | ||
31 | int gpmc_irq; | 27 | int gpmc_irq; |
32 | enum nand_io xfer_type; | 28 | enum nand_io xfer_type; |
33 | unsigned long phys_base; | 29 | unsigned long phys_base; |
diff --git a/arch/arm/plat-omap/mcbsp.c b/arch/arm/plat-omap/mcbsp.c index 5587acf0eb2c..455eadcd820c 100644 --- a/arch/arm/plat-omap/mcbsp.c +++ b/arch/arm/plat-omap/mcbsp.c | |||
@@ -16,8 +16,6 @@ | |||
16 | #include <linux/init.h> | 16 | #include <linux/init.h> |
17 | #include <linux/device.h> | 17 | #include <linux/device.h> |
18 | #include <linux/platform_device.h> | 18 | #include <linux/platform_device.h> |
19 | #include <linux/wait.h> | ||
20 | #include <linux/completion.h> | ||
21 | #include <linux/interrupt.h> | 19 | #include <linux/interrupt.h> |
22 | #include <linux/err.h> | 20 | #include <linux/err.h> |
23 | #include <linux/clk.h> | 21 | #include <linux/clk.h> |
@@ -25,7 +23,6 @@ | |||
25 | #include <linux/io.h> | 23 | #include <linux/io.h> |
26 | #include <linux/slab.h> | 24 | #include <linux/slab.h> |
27 | 25 | ||
28 | #include <plat/dma.h> | ||
29 | #include <plat/mcbsp.h> | 26 | #include <plat/mcbsp.h> |
30 | #include <plat/omap_device.h> | 27 | #include <plat/omap_device.h> |
31 | #include <linux/pm_runtime.h> | 28 | #include <linux/pm_runtime.h> |
@@ -136,8 +133,6 @@ static irqreturn_t omap_mcbsp_tx_irq_handler(int irq, void *dev_id) | |||
136 | irqst_spcr2); | 133 | irqst_spcr2); |
137 | /* Writing zero to XSYNC_ERR clears the IRQ */ | 134 | /* Writing zero to XSYNC_ERR clears the IRQ */ |
138 | MCBSP_WRITE(mcbsp_tx, SPCR2, MCBSP_READ_CACHE(mcbsp_tx, SPCR2)); | 135 | MCBSP_WRITE(mcbsp_tx, SPCR2, MCBSP_READ_CACHE(mcbsp_tx, SPCR2)); |
139 | } else { | ||
140 | complete(&mcbsp_tx->tx_irq_completion); | ||
141 | } | 136 | } |
142 | 137 | ||
143 | return IRQ_HANDLED; | 138 | return IRQ_HANDLED; |
@@ -156,41 +151,11 @@ static irqreturn_t omap_mcbsp_rx_irq_handler(int irq, void *dev_id) | |||
156 | irqst_spcr1); | 151 | irqst_spcr1); |
157 | /* Writing zero to RSYNC_ERR clears the IRQ */ | 152 | /* Writing zero to RSYNC_ERR clears the IRQ */ |
158 | MCBSP_WRITE(mcbsp_rx, SPCR1, MCBSP_READ_CACHE(mcbsp_rx, SPCR1)); | 153 | MCBSP_WRITE(mcbsp_rx, SPCR1, MCBSP_READ_CACHE(mcbsp_rx, SPCR1)); |
159 | } else { | ||
160 | complete(&mcbsp_rx->rx_irq_completion); | ||
161 | } | 154 | } |
162 | 155 | ||
163 | return IRQ_HANDLED; | 156 | return IRQ_HANDLED; |
164 | } | 157 | } |
165 | 158 | ||
166 | static void omap_mcbsp_tx_dma_callback(int lch, u16 ch_status, void *data) | ||
167 | { | ||
168 | struct omap_mcbsp *mcbsp_dma_tx = data; | ||
169 | |||
170 | dev_dbg(mcbsp_dma_tx->dev, "TX DMA callback : 0x%x\n", | ||
171 | MCBSP_READ(mcbsp_dma_tx, SPCR2)); | ||
172 | |||
173 | /* We can free the channels */ | ||
174 | omap_free_dma(mcbsp_dma_tx->dma_tx_lch); | ||
175 | mcbsp_dma_tx->dma_tx_lch = -1; | ||
176 | |||
177 | complete(&mcbsp_dma_tx->tx_dma_completion); | ||
178 | } | ||
179 | |||
180 | static void omap_mcbsp_rx_dma_callback(int lch, u16 ch_status, void *data) | ||
181 | { | ||
182 | struct omap_mcbsp *mcbsp_dma_rx = data; | ||
183 | |||
184 | dev_dbg(mcbsp_dma_rx->dev, "RX DMA callback : 0x%x\n", | ||
185 | MCBSP_READ(mcbsp_dma_rx, SPCR2)); | ||
186 | |||
187 | /* We can free the channels */ | ||
188 | omap_free_dma(mcbsp_dma_rx->dma_rx_lch); | ||
189 | mcbsp_dma_rx->dma_rx_lch = -1; | ||
190 | |||
191 | complete(&mcbsp_dma_rx->rx_dma_completion); | ||
192 | } | ||
193 | |||
194 | /* | 159 | /* |
195 | * omap_mcbsp_config simply write a config to the | 160 | * omap_mcbsp_config simply write a config to the |
196 | * appropriate McBSP. | 161 | * appropriate McBSP. |
@@ -758,37 +723,6 @@ static inline void omap_st_start(struct omap_mcbsp *mcbsp) {} | |||
758 | static inline void omap_st_stop(struct omap_mcbsp *mcbsp) {} | 723 | static inline void omap_st_stop(struct omap_mcbsp *mcbsp) {} |
759 | #endif | 724 | #endif |
760 | 725 | ||
761 | /* | ||
762 | * We can choose between IRQ based or polled IO. | ||
763 | * This needs to be called before omap_mcbsp_request(). | ||
764 | */ | ||
765 | int omap_mcbsp_set_io_type(unsigned int id, omap_mcbsp_io_type_t io_type) | ||
766 | { | ||
767 | struct omap_mcbsp *mcbsp; | ||
768 | |||
769 | if (!omap_mcbsp_check_valid_id(id)) { | ||
770 | printk(KERN_ERR "%s: Invalid id (%d)\n", __func__, id + 1); | ||
771 | return -ENODEV; | ||
772 | } | ||
773 | mcbsp = id_to_mcbsp_ptr(id); | ||
774 | |||
775 | spin_lock(&mcbsp->lock); | ||
776 | |||
777 | if (!mcbsp->free) { | ||
778 | dev_err(mcbsp->dev, "McBSP%d is currently in use\n", | ||
779 | mcbsp->id); | ||
780 | spin_unlock(&mcbsp->lock); | ||
781 | return -EINVAL; | ||
782 | } | ||
783 | |||
784 | mcbsp->io_type = io_type; | ||
785 | |||
786 | spin_unlock(&mcbsp->lock); | ||
787 | |||
788 | return 0; | ||
789 | } | ||
790 | EXPORT_SYMBOL(omap_mcbsp_set_io_type); | ||
791 | |||
792 | int omap_mcbsp_request(unsigned int id) | 726 | int omap_mcbsp_request(unsigned int id) |
793 | { | 727 | { |
794 | struct omap_mcbsp *mcbsp; | 728 | struct omap_mcbsp *mcbsp; |
@@ -833,29 +767,24 @@ int omap_mcbsp_request(unsigned int id) | |||
833 | MCBSP_WRITE(mcbsp, SPCR1, 0); | 767 | MCBSP_WRITE(mcbsp, SPCR1, 0); |
834 | MCBSP_WRITE(mcbsp, SPCR2, 0); | 768 | MCBSP_WRITE(mcbsp, SPCR2, 0); |
835 | 769 | ||
836 | if (mcbsp->io_type == OMAP_MCBSP_IRQ_IO) { | 770 | err = request_irq(mcbsp->tx_irq, omap_mcbsp_tx_irq_handler, |
837 | /* We need to get IRQs here */ | 771 | 0, "McBSP", (void *)mcbsp); |
838 | init_completion(&mcbsp->tx_irq_completion); | 772 | if (err != 0) { |
839 | err = request_irq(mcbsp->tx_irq, omap_mcbsp_tx_irq_handler, | 773 | dev_err(mcbsp->dev, "Unable to request TX IRQ %d " |
840 | 0, "McBSP", (void *)mcbsp); | 774 | "for McBSP%d\n", mcbsp->tx_irq, |
775 | mcbsp->id); | ||
776 | goto err_clk_disable; | ||
777 | } | ||
778 | |||
779 | if (mcbsp->rx_irq) { | ||
780 | err = request_irq(mcbsp->rx_irq, | ||
781 | omap_mcbsp_rx_irq_handler, | ||
782 | 0, "McBSP", (void *)mcbsp); | ||
841 | if (err != 0) { | 783 | if (err != 0) { |
842 | dev_err(mcbsp->dev, "Unable to request TX IRQ %d " | 784 | dev_err(mcbsp->dev, "Unable to request RX IRQ %d " |
843 | "for McBSP%d\n", mcbsp->tx_irq, | 785 | "for McBSP%d\n", mcbsp->rx_irq, |
844 | mcbsp->id); | 786 | mcbsp->id); |
845 | goto err_clk_disable; | 787 | goto err_free_irq; |
846 | } | ||
847 | |||
848 | if (mcbsp->rx_irq) { | ||
849 | init_completion(&mcbsp->rx_irq_completion); | ||
850 | err = request_irq(mcbsp->rx_irq, | ||
851 | omap_mcbsp_rx_irq_handler, | ||
852 | 0, "McBSP", (void *)mcbsp); | ||
853 | if (err != 0) { | ||
854 | dev_err(mcbsp->dev, "Unable to request RX IRQ %d " | ||
855 | "for McBSP%d\n", mcbsp->rx_irq, | ||
856 | mcbsp->id); | ||
857 | goto err_free_irq; | ||
858 | } | ||
859 | } | 788 | } |
860 | } | 789 | } |
861 | 790 | ||
@@ -901,12 +830,9 @@ void omap_mcbsp_free(unsigned int id) | |||
901 | 830 | ||
902 | pm_runtime_put_sync(mcbsp->dev); | 831 | pm_runtime_put_sync(mcbsp->dev); |
903 | 832 | ||
904 | if (mcbsp->io_type == OMAP_MCBSP_IRQ_IO) { | 833 | if (mcbsp->rx_irq) |
905 | /* Free IRQs */ | 834 | free_irq(mcbsp->rx_irq, (void *)mcbsp); |
906 | if (mcbsp->rx_irq) | 835 | free_irq(mcbsp->tx_irq, (void *)mcbsp); |
907 | free_irq(mcbsp->rx_irq, (void *)mcbsp); | ||
908 | free_irq(mcbsp->tx_irq, (void *)mcbsp); | ||
909 | } | ||
910 | 836 | ||
911 | reg_cache = mcbsp->reg_cache; | 837 | reg_cache = mcbsp->reg_cache; |
912 | 838 | ||
@@ -1043,485 +969,6 @@ void omap_mcbsp_stop(unsigned int id, int tx, int rx) | |||
1043 | } | 969 | } |
1044 | EXPORT_SYMBOL(omap_mcbsp_stop); | 970 | EXPORT_SYMBOL(omap_mcbsp_stop); |
1045 | 971 | ||
1046 | /* polled mcbsp i/o operations */ | ||
1047 | int omap_mcbsp_pollwrite(unsigned int id, u16 buf) | ||
1048 | { | ||
1049 | struct omap_mcbsp *mcbsp; | ||
1050 | |||
1051 | if (!omap_mcbsp_check_valid_id(id)) { | ||
1052 | printk(KERN_ERR "%s: Invalid id (%d)\n", __func__, id + 1); | ||
1053 | return -ENODEV; | ||
1054 | } | ||
1055 | |||
1056 | mcbsp = id_to_mcbsp_ptr(id); | ||
1057 | |||
1058 | MCBSP_WRITE(mcbsp, DXR1, buf); | ||
1059 | /* if frame sync error - clear the error */ | ||
1060 | if (MCBSP_READ(mcbsp, SPCR2) & XSYNC_ERR) { | ||
1061 | /* clear error */ | ||
1062 | MCBSP_WRITE(mcbsp, SPCR2, MCBSP_READ_CACHE(mcbsp, SPCR2)); | ||
1063 | /* resend */ | ||
1064 | return -1; | ||
1065 | } else { | ||
1066 | /* wait for transmit confirmation */ | ||
1067 | int attemps = 0; | ||
1068 | while (!(MCBSP_READ(mcbsp, SPCR2) & XRDY)) { | ||
1069 | if (attemps++ > 1000) { | ||
1070 | MCBSP_WRITE(mcbsp, SPCR2, | ||
1071 | MCBSP_READ_CACHE(mcbsp, SPCR2) & | ||
1072 | (~XRST)); | ||
1073 | udelay(10); | ||
1074 | MCBSP_WRITE(mcbsp, SPCR2, | ||
1075 | MCBSP_READ_CACHE(mcbsp, SPCR2) | | ||
1076 | (XRST)); | ||
1077 | udelay(10); | ||
1078 | dev_err(mcbsp->dev, "Could not write to" | ||
1079 | " McBSP%d Register\n", mcbsp->id); | ||
1080 | return -2; | ||
1081 | } | ||
1082 | } | ||
1083 | } | ||
1084 | |||
1085 | return 0; | ||
1086 | } | ||
1087 | EXPORT_SYMBOL(omap_mcbsp_pollwrite); | ||
1088 | |||
1089 | int omap_mcbsp_pollread(unsigned int id, u16 *buf) | ||
1090 | { | ||
1091 | struct omap_mcbsp *mcbsp; | ||
1092 | |||
1093 | if (!omap_mcbsp_check_valid_id(id)) { | ||
1094 | printk(KERN_ERR "%s: Invalid id (%d)\n", __func__, id + 1); | ||
1095 | return -ENODEV; | ||
1096 | } | ||
1097 | mcbsp = id_to_mcbsp_ptr(id); | ||
1098 | |||
1099 | /* if frame sync error - clear the error */ | ||
1100 | if (MCBSP_READ(mcbsp, SPCR1) & RSYNC_ERR) { | ||
1101 | /* clear error */ | ||
1102 | MCBSP_WRITE(mcbsp, SPCR1, MCBSP_READ_CACHE(mcbsp, SPCR1)); | ||
1103 | /* resend */ | ||
1104 | return -1; | ||
1105 | } else { | ||
1106 | /* wait for receive confirmation */ | ||
1107 | int attemps = 0; | ||
1108 | while (!(MCBSP_READ(mcbsp, SPCR1) & RRDY)) { | ||
1109 | if (attemps++ > 1000) { | ||
1110 | MCBSP_WRITE(mcbsp, SPCR1, | ||
1111 | MCBSP_READ_CACHE(mcbsp, SPCR1) & | ||
1112 | (~RRST)); | ||
1113 | udelay(10); | ||
1114 | MCBSP_WRITE(mcbsp, SPCR1, | ||
1115 | MCBSP_READ_CACHE(mcbsp, SPCR1) | | ||
1116 | (RRST)); | ||
1117 | udelay(10); | ||
1118 | dev_err(mcbsp->dev, "Could not read from" | ||
1119 | " McBSP%d Register\n", mcbsp->id); | ||
1120 | return -2; | ||
1121 | } | ||
1122 | } | ||
1123 | } | ||
1124 | *buf = MCBSP_READ(mcbsp, DRR1); | ||
1125 | |||
1126 | return 0; | ||
1127 | } | ||
1128 | EXPORT_SYMBOL(omap_mcbsp_pollread); | ||
1129 | |||
1130 | /* | ||
1131 | * IRQ based word transmission. | ||
1132 | */ | ||
1133 | void omap_mcbsp_xmit_word(unsigned int id, u32 word) | ||
1134 | { | ||
1135 | struct omap_mcbsp *mcbsp; | ||
1136 | omap_mcbsp_word_length word_length; | ||
1137 | |||
1138 | if (!omap_mcbsp_check_valid_id(id)) { | ||
1139 | printk(KERN_ERR "%s: Invalid id (%d)\n", __func__, id + 1); | ||
1140 | return; | ||
1141 | } | ||
1142 | |||
1143 | mcbsp = id_to_mcbsp_ptr(id); | ||
1144 | word_length = mcbsp->tx_word_length; | ||
1145 | |||
1146 | wait_for_completion(&mcbsp->tx_irq_completion); | ||
1147 | |||
1148 | if (word_length > OMAP_MCBSP_WORD_16) | ||
1149 | MCBSP_WRITE(mcbsp, DXR2, word >> 16); | ||
1150 | MCBSP_WRITE(mcbsp, DXR1, word & 0xffff); | ||
1151 | } | ||
1152 | EXPORT_SYMBOL(omap_mcbsp_xmit_word); | ||
1153 | |||
1154 | u32 omap_mcbsp_recv_word(unsigned int id) | ||
1155 | { | ||
1156 | struct omap_mcbsp *mcbsp; | ||
1157 | u16 word_lsb, word_msb = 0; | ||
1158 | omap_mcbsp_word_length word_length; | ||
1159 | |||
1160 | if (!omap_mcbsp_check_valid_id(id)) { | ||
1161 | printk(KERN_ERR "%s: Invalid id (%d)\n", __func__, id + 1); | ||
1162 | return -ENODEV; | ||
1163 | } | ||
1164 | mcbsp = id_to_mcbsp_ptr(id); | ||
1165 | |||
1166 | word_length = mcbsp->rx_word_length; | ||
1167 | |||
1168 | wait_for_completion(&mcbsp->rx_irq_completion); | ||
1169 | |||
1170 | if (word_length > OMAP_MCBSP_WORD_16) | ||
1171 | word_msb = MCBSP_READ(mcbsp, DRR2); | ||
1172 | word_lsb = MCBSP_READ(mcbsp, DRR1); | ||
1173 | |||
1174 | return (word_lsb | (word_msb << 16)); | ||
1175 | } | ||
1176 | EXPORT_SYMBOL(omap_mcbsp_recv_word); | ||
1177 | |||
1178 | int omap_mcbsp_spi_master_xmit_word_poll(unsigned int id, u32 word) | ||
1179 | { | ||
1180 | struct omap_mcbsp *mcbsp; | ||
1181 | omap_mcbsp_word_length tx_word_length; | ||
1182 | omap_mcbsp_word_length rx_word_length; | ||
1183 | u16 spcr2, spcr1, attempts = 0, word_lsb, word_msb = 0; | ||
1184 | |||
1185 | if (!omap_mcbsp_check_valid_id(id)) { | ||
1186 | printk(KERN_ERR "%s: Invalid id (%d)\n", __func__, id + 1); | ||
1187 | return -ENODEV; | ||
1188 | } | ||
1189 | mcbsp = id_to_mcbsp_ptr(id); | ||
1190 | tx_word_length = mcbsp->tx_word_length; | ||
1191 | rx_word_length = mcbsp->rx_word_length; | ||
1192 | |||
1193 | if (tx_word_length != rx_word_length) | ||
1194 | return -EINVAL; | ||
1195 | |||
1196 | /* First we wait for the transmitter to be ready */ | ||
1197 | spcr2 = MCBSP_READ(mcbsp, SPCR2); | ||
1198 | while (!(spcr2 & XRDY)) { | ||
1199 | spcr2 = MCBSP_READ(mcbsp, SPCR2); | ||
1200 | if (attempts++ > 1000) { | ||
1201 | /* We must reset the transmitter */ | ||
1202 | MCBSP_WRITE(mcbsp, SPCR2, | ||
1203 | MCBSP_READ_CACHE(mcbsp, SPCR2) & (~XRST)); | ||
1204 | udelay(10); | ||
1205 | MCBSP_WRITE(mcbsp, SPCR2, | ||
1206 | MCBSP_READ_CACHE(mcbsp, SPCR2) | XRST); | ||
1207 | udelay(10); | ||
1208 | dev_err(mcbsp->dev, "McBSP%d transmitter not " | ||
1209 | "ready\n", mcbsp->id); | ||
1210 | return -EAGAIN; | ||
1211 | } | ||
1212 | } | ||
1213 | |||
1214 | /* Now we can push the data */ | ||
1215 | if (tx_word_length > OMAP_MCBSP_WORD_16) | ||
1216 | MCBSP_WRITE(mcbsp, DXR2, word >> 16); | ||
1217 | MCBSP_WRITE(mcbsp, DXR1, word & 0xffff); | ||
1218 | |||
1219 | /* We wait for the receiver to be ready */ | ||
1220 | spcr1 = MCBSP_READ(mcbsp, SPCR1); | ||
1221 | while (!(spcr1 & RRDY)) { | ||
1222 | spcr1 = MCBSP_READ(mcbsp, SPCR1); | ||
1223 | if (attempts++ > 1000) { | ||
1224 | /* We must reset the receiver */ | ||
1225 | MCBSP_WRITE(mcbsp, SPCR1, | ||
1226 | MCBSP_READ_CACHE(mcbsp, SPCR1) & (~RRST)); | ||
1227 | udelay(10); | ||
1228 | MCBSP_WRITE(mcbsp, SPCR1, | ||
1229 | MCBSP_READ_CACHE(mcbsp, SPCR1) | RRST); | ||
1230 | udelay(10); | ||
1231 | dev_err(mcbsp->dev, "McBSP%d receiver not " | ||
1232 | "ready\n", mcbsp->id); | ||
1233 | return -EAGAIN; | ||
1234 | } | ||
1235 | } | ||
1236 | |||
1237 | /* Receiver is ready, let's read the dummy data */ | ||
1238 | if (rx_word_length > OMAP_MCBSP_WORD_16) | ||
1239 | word_msb = MCBSP_READ(mcbsp, DRR2); | ||
1240 | word_lsb = MCBSP_READ(mcbsp, DRR1); | ||
1241 | |||
1242 | return 0; | ||
1243 | } | ||
1244 | EXPORT_SYMBOL(omap_mcbsp_spi_master_xmit_word_poll); | ||
1245 | |||
1246 | int omap_mcbsp_spi_master_recv_word_poll(unsigned int id, u32 *word) | ||
1247 | { | ||
1248 | struct omap_mcbsp *mcbsp; | ||
1249 | u32 clock_word = 0; | ||
1250 | omap_mcbsp_word_length tx_word_length; | ||
1251 | omap_mcbsp_word_length rx_word_length; | ||
1252 | u16 spcr2, spcr1, attempts = 0, word_lsb, word_msb = 0; | ||
1253 | |||
1254 | if (!omap_mcbsp_check_valid_id(id)) { | ||
1255 | printk(KERN_ERR "%s: Invalid id (%d)\n", __func__, id + 1); | ||
1256 | return -ENODEV; | ||
1257 | } | ||
1258 | |||
1259 | mcbsp = id_to_mcbsp_ptr(id); | ||
1260 | |||
1261 | tx_word_length = mcbsp->tx_word_length; | ||
1262 | rx_word_length = mcbsp->rx_word_length; | ||
1263 | |||
1264 | if (tx_word_length != rx_word_length) | ||
1265 | return -EINVAL; | ||
1266 | |||
1267 | /* First we wait for the transmitter to be ready */ | ||
1268 | spcr2 = MCBSP_READ(mcbsp, SPCR2); | ||
1269 | while (!(spcr2 & XRDY)) { | ||
1270 | spcr2 = MCBSP_READ(mcbsp, SPCR2); | ||
1271 | if (attempts++ > 1000) { | ||
1272 | /* We must reset the transmitter */ | ||
1273 | MCBSP_WRITE(mcbsp, SPCR2, | ||
1274 | MCBSP_READ_CACHE(mcbsp, SPCR2) & (~XRST)); | ||
1275 | udelay(10); | ||
1276 | MCBSP_WRITE(mcbsp, SPCR2, | ||
1277 | MCBSP_READ_CACHE(mcbsp, SPCR2) | XRST); | ||
1278 | udelay(10); | ||
1279 | dev_err(mcbsp->dev, "McBSP%d transmitter not " | ||
1280 | "ready\n", mcbsp->id); | ||
1281 | return -EAGAIN; | ||
1282 | } | ||
1283 | } | ||
1284 | |||
1285 | /* We first need to enable the bus clock */ | ||
1286 | if (tx_word_length > OMAP_MCBSP_WORD_16) | ||
1287 | MCBSP_WRITE(mcbsp, DXR2, clock_word >> 16); | ||
1288 | MCBSP_WRITE(mcbsp, DXR1, clock_word & 0xffff); | ||
1289 | |||
1290 | /* We wait for the receiver to be ready */ | ||
1291 | spcr1 = MCBSP_READ(mcbsp, SPCR1); | ||
1292 | while (!(spcr1 & RRDY)) { | ||
1293 | spcr1 = MCBSP_READ(mcbsp, SPCR1); | ||
1294 | if (attempts++ > 1000) { | ||
1295 | /* We must reset the receiver */ | ||
1296 | MCBSP_WRITE(mcbsp, SPCR1, | ||
1297 | MCBSP_READ_CACHE(mcbsp, SPCR1) & (~RRST)); | ||
1298 | udelay(10); | ||
1299 | MCBSP_WRITE(mcbsp, SPCR1, | ||
1300 | MCBSP_READ_CACHE(mcbsp, SPCR1) | RRST); | ||
1301 | udelay(10); | ||
1302 | dev_err(mcbsp->dev, "McBSP%d receiver not " | ||
1303 | "ready\n", mcbsp->id); | ||
1304 | return -EAGAIN; | ||
1305 | } | ||
1306 | } | ||
1307 | |||
1308 | /* Receiver is ready, there is something for us */ | ||
1309 | if (rx_word_length > OMAP_MCBSP_WORD_16) | ||
1310 | word_msb = MCBSP_READ(mcbsp, DRR2); | ||
1311 | word_lsb = MCBSP_READ(mcbsp, DRR1); | ||
1312 | |||
1313 | word[0] = (word_lsb | (word_msb << 16)); | ||
1314 | |||
1315 | return 0; | ||
1316 | } | ||
1317 | EXPORT_SYMBOL(omap_mcbsp_spi_master_recv_word_poll); | ||
1318 | |||
1319 | /* | ||
1320 | * Simple DMA based buffer rx/tx routines. | ||
1321 | * Nothing fancy, just a single buffer tx/rx through DMA. | ||
1322 | * The DMA resources are released once the transfer is done. | ||
1323 | * For anything fancier, you should use your own customized DMA | ||
1324 | * routines and callbacks. | ||
1325 | */ | ||
1326 | int omap_mcbsp_xmit_buffer(unsigned int id, dma_addr_t buffer, | ||
1327 | unsigned int length) | ||
1328 | { | ||
1329 | struct omap_mcbsp *mcbsp; | ||
1330 | int dma_tx_ch; | ||
1331 | int src_port = 0; | ||
1332 | int dest_port = 0; | ||
1333 | int sync_dev = 0; | ||
1334 | |||
1335 | if (!omap_mcbsp_check_valid_id(id)) { | ||
1336 | printk(KERN_ERR "%s: Invalid id (%d)\n", __func__, id + 1); | ||
1337 | return -ENODEV; | ||
1338 | } | ||
1339 | mcbsp = id_to_mcbsp_ptr(id); | ||
1340 | |||
1341 | if (omap_request_dma(mcbsp->dma_tx_sync, "McBSP TX", | ||
1342 | omap_mcbsp_tx_dma_callback, | ||
1343 | mcbsp, | ||
1344 | &dma_tx_ch)) { | ||
1345 | dev_err(mcbsp->dev, " Unable to request DMA channel for " | ||
1346 | "McBSP%d TX. Trying IRQ based TX\n", | ||
1347 | mcbsp->id); | ||
1348 | return -EAGAIN; | ||
1349 | } | ||
1350 | mcbsp->dma_tx_lch = dma_tx_ch; | ||
1351 | |||
1352 | dev_err(mcbsp->dev, "McBSP%d TX DMA on channel %d\n", mcbsp->id, | ||
1353 | dma_tx_ch); | ||
1354 | |||
1355 | init_completion(&mcbsp->tx_dma_completion); | ||
1356 | |||
1357 | if (cpu_class_is_omap1()) { | ||
1358 | src_port = OMAP_DMA_PORT_TIPB; | ||
1359 | dest_port = OMAP_DMA_PORT_EMIFF; | ||
1360 | } | ||
1361 | if (cpu_class_is_omap2()) | ||
1362 | sync_dev = mcbsp->dma_tx_sync; | ||
1363 | |||
1364 | omap_set_dma_transfer_params(mcbsp->dma_tx_lch, | ||
1365 | OMAP_DMA_DATA_TYPE_S16, | ||
1366 | length >> 1, 1, | ||
1367 | OMAP_DMA_SYNC_ELEMENT, | ||
1368 | sync_dev, 0); | ||
1369 | |||
1370 | omap_set_dma_dest_params(mcbsp->dma_tx_lch, | ||
1371 | src_port, | ||
1372 | OMAP_DMA_AMODE_CONSTANT, | ||
1373 | mcbsp->phys_base + OMAP_MCBSP_REG_DXR1, | ||
1374 | 0, 0); | ||
1375 | |||
1376 | omap_set_dma_src_params(mcbsp->dma_tx_lch, | ||
1377 | dest_port, | ||
1378 | OMAP_DMA_AMODE_POST_INC, | ||
1379 | buffer, | ||
1380 | 0, 0); | ||
1381 | |||
1382 | omap_start_dma(mcbsp->dma_tx_lch); | ||
1383 | wait_for_completion(&mcbsp->tx_dma_completion); | ||
1384 | |||
1385 | return 0; | ||
1386 | } | ||
1387 | EXPORT_SYMBOL(omap_mcbsp_xmit_buffer); | ||
1388 | |||
1389 | int omap_mcbsp_recv_buffer(unsigned int id, dma_addr_t buffer, | ||
1390 | unsigned int length) | ||
1391 | { | ||
1392 | struct omap_mcbsp *mcbsp; | ||
1393 | int dma_rx_ch; | ||
1394 | int src_port = 0; | ||
1395 | int dest_port = 0; | ||
1396 | int sync_dev = 0; | ||
1397 | |||
1398 | if (!omap_mcbsp_check_valid_id(id)) { | ||
1399 | printk(KERN_ERR "%s: Invalid id (%d)\n", __func__, id + 1); | ||
1400 | return -ENODEV; | ||
1401 | } | ||
1402 | mcbsp = id_to_mcbsp_ptr(id); | ||
1403 | |||
1404 | if (omap_request_dma(mcbsp->dma_rx_sync, "McBSP RX", | ||
1405 | omap_mcbsp_rx_dma_callback, | ||
1406 | mcbsp, | ||
1407 | &dma_rx_ch)) { | ||
1408 | dev_err(mcbsp->dev, "Unable to request DMA channel for " | ||
1409 | "McBSP%d RX. Trying IRQ based RX\n", | ||
1410 | mcbsp->id); | ||
1411 | return -EAGAIN; | ||
1412 | } | ||
1413 | mcbsp->dma_rx_lch = dma_rx_ch; | ||
1414 | |||
1415 | dev_err(mcbsp->dev, "McBSP%d RX DMA on channel %d\n", mcbsp->id, | ||
1416 | dma_rx_ch); | ||
1417 | |||
1418 | init_completion(&mcbsp->rx_dma_completion); | ||
1419 | |||
1420 | if (cpu_class_is_omap1()) { | ||
1421 | src_port = OMAP_DMA_PORT_TIPB; | ||
1422 | dest_port = OMAP_DMA_PORT_EMIFF; | ||
1423 | } | ||
1424 | if (cpu_class_is_omap2()) | ||
1425 | sync_dev = mcbsp->dma_rx_sync; | ||
1426 | |||
1427 | omap_set_dma_transfer_params(mcbsp->dma_rx_lch, | ||
1428 | OMAP_DMA_DATA_TYPE_S16, | ||
1429 | length >> 1, 1, | ||
1430 | OMAP_DMA_SYNC_ELEMENT, | ||
1431 | sync_dev, 0); | ||
1432 | |||
1433 | omap_set_dma_src_params(mcbsp->dma_rx_lch, | ||
1434 | src_port, | ||
1435 | OMAP_DMA_AMODE_CONSTANT, | ||
1436 | mcbsp->phys_base + OMAP_MCBSP_REG_DRR1, | ||
1437 | 0, 0); | ||
1438 | |||
1439 | omap_set_dma_dest_params(mcbsp->dma_rx_lch, | ||
1440 | dest_port, | ||
1441 | OMAP_DMA_AMODE_POST_INC, | ||
1442 | buffer, | ||
1443 | 0, 0); | ||
1444 | |||
1445 | omap_start_dma(mcbsp->dma_rx_lch); | ||
1446 | wait_for_completion(&mcbsp->rx_dma_completion); | ||
1447 | |||
1448 | return 0; | ||
1449 | } | ||
1450 | EXPORT_SYMBOL(omap_mcbsp_recv_buffer); | ||
1451 | |||
1452 | /* | ||
1453 | * SPI wrapper. | ||
1454 | * Since SPI setup is much simpler than the generic McBSP one, | ||
1455 | * this wrapper just need an omap_mcbsp_spi_cfg structure as an input. | ||
1456 | * Once this is done, you can call omap_mcbsp_start(). | ||
1457 | */ | ||
1458 | void omap_mcbsp_set_spi_mode(unsigned int id, | ||
1459 | const struct omap_mcbsp_spi_cfg *spi_cfg) | ||
1460 | { | ||
1461 | struct omap_mcbsp *mcbsp; | ||
1462 | struct omap_mcbsp_reg_cfg mcbsp_cfg; | ||
1463 | |||
1464 | if (!omap_mcbsp_check_valid_id(id)) { | ||
1465 | printk(KERN_ERR "%s: Invalid id (%d)\n", __func__, id + 1); | ||
1466 | return; | ||
1467 | } | ||
1468 | mcbsp = id_to_mcbsp_ptr(id); | ||
1469 | |||
1470 | memset(&mcbsp_cfg, 0, sizeof(struct omap_mcbsp_reg_cfg)); | ||
1471 | |||
1472 | /* SPI has only one frame */ | ||
1473 | mcbsp_cfg.rcr1 |= (RWDLEN1(spi_cfg->word_length) | RFRLEN1(0)); | ||
1474 | mcbsp_cfg.xcr1 |= (XWDLEN1(spi_cfg->word_length) | XFRLEN1(0)); | ||
1475 | |||
1476 | /* Clock stop mode */ | ||
1477 | if (spi_cfg->clk_stp_mode == OMAP_MCBSP_CLK_STP_MODE_NO_DELAY) | ||
1478 | mcbsp_cfg.spcr1 |= (1 << 12); | ||
1479 | else | ||
1480 | mcbsp_cfg.spcr1 |= (3 << 11); | ||
1481 | |||
1482 | /* Set clock parities */ | ||
1483 | if (spi_cfg->rx_clock_polarity == OMAP_MCBSP_CLK_RISING) | ||
1484 | mcbsp_cfg.pcr0 |= CLKRP; | ||
1485 | else | ||
1486 | mcbsp_cfg.pcr0 &= ~CLKRP; | ||
1487 | |||
1488 | if (spi_cfg->tx_clock_polarity == OMAP_MCBSP_CLK_RISING) | ||
1489 | mcbsp_cfg.pcr0 &= ~CLKXP; | ||
1490 | else | ||
1491 | mcbsp_cfg.pcr0 |= CLKXP; | ||
1492 | |||
1493 | /* Set SCLKME to 0 and CLKSM to 1 */ | ||
1494 | mcbsp_cfg.pcr0 &= ~SCLKME; | ||
1495 | mcbsp_cfg.srgr2 |= CLKSM; | ||
1496 | |||
1497 | /* Set FSXP */ | ||
1498 | if (spi_cfg->fsx_polarity == OMAP_MCBSP_FS_ACTIVE_HIGH) | ||
1499 | mcbsp_cfg.pcr0 &= ~FSXP; | ||
1500 | else | ||
1501 | mcbsp_cfg.pcr0 |= FSXP; | ||
1502 | |||
1503 | if (spi_cfg->spi_mode == OMAP_MCBSP_SPI_MASTER) { | ||
1504 | mcbsp_cfg.pcr0 |= CLKXM; | ||
1505 | mcbsp_cfg.srgr1 |= CLKGDV(spi_cfg->clk_div - 1); | ||
1506 | mcbsp_cfg.pcr0 |= FSXM; | ||
1507 | mcbsp_cfg.srgr2 &= ~FSGM; | ||
1508 | mcbsp_cfg.xcr2 |= XDATDLY(1); | ||
1509 | mcbsp_cfg.rcr2 |= RDATDLY(1); | ||
1510 | } else { | ||
1511 | mcbsp_cfg.pcr0 &= ~CLKXM; | ||
1512 | mcbsp_cfg.srgr1 |= CLKGDV(1); | ||
1513 | mcbsp_cfg.pcr0 &= ~FSXM; | ||
1514 | mcbsp_cfg.xcr2 &= ~XDATDLY(3); | ||
1515 | mcbsp_cfg.rcr2 &= ~RDATDLY(3); | ||
1516 | } | ||
1517 | |||
1518 | mcbsp_cfg.xcr2 &= ~XPHASE; | ||
1519 | mcbsp_cfg.rcr2 &= ~RPHASE; | ||
1520 | |||
1521 | omap_mcbsp_config(id, &mcbsp_cfg); | ||
1522 | } | ||
1523 | EXPORT_SYMBOL(omap_mcbsp_set_spi_mode); | ||
1524 | |||
1525 | #ifdef CONFIG_ARCH_OMAP3 | 972 | #ifdef CONFIG_ARCH_OMAP3 |
1526 | #define max_thres(m) (mcbsp->pdata->buffer_size) | 973 | #define max_thres(m) (mcbsp->pdata->buffer_size) |
1527 | #define valid_threshold(m, val) ((val) <= max_thres(m)) | 974 | #define valid_threshold(m, val) ((val) <= max_thres(m)) |
@@ -1833,8 +1280,6 @@ static int __devinit omap_mcbsp_probe(struct platform_device *pdev) | |||
1833 | spin_lock_init(&mcbsp->lock); | 1280 | spin_lock_init(&mcbsp->lock); |
1834 | mcbsp->id = id + 1; | 1281 | mcbsp->id = id + 1; |
1835 | mcbsp->free = true; | 1282 | mcbsp->free = true; |
1836 | mcbsp->dma_tx_lch = -1; | ||
1837 | mcbsp->dma_rx_lch = -1; | ||
1838 | 1283 | ||
1839 | res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "mpu"); | 1284 | res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "mpu"); |
1840 | if (!res) { | 1285 | if (!res) { |
@@ -1860,9 +1305,6 @@ static int __devinit omap_mcbsp_probe(struct platform_device *pdev) | |||
1860 | else | 1305 | else |
1861 | mcbsp->phys_dma_base = res->start; | 1306 | mcbsp->phys_dma_base = res->start; |
1862 | 1307 | ||
1863 | /* Default I/O is IRQ based */ | ||
1864 | mcbsp->io_type = OMAP_MCBSP_IRQ_IO; | ||
1865 | |||
1866 | mcbsp->tx_irq = platform_get_irq_byname(pdev, "tx"); | 1308 | mcbsp->tx_irq = platform_get_irq_byname(pdev, "tx"); |
1867 | mcbsp->rx_irq = platform_get_irq_byname(pdev, "rx"); | 1309 | mcbsp->rx_irq = platform_get_irq_byname(pdev, "rx"); |
1868 | 1310 | ||