diff options
author | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2010-02-17 13:19:29 -0500 |
---|---|---|
committer | Ben Dooks <ben-linux@fluff.org> | 2010-02-23 20:58:41 -0500 |
commit | 60f9101a8881797fecd89450b8a8d17a440e6281 (patch) | |
tree | 426d666dced99de45a0ce88b9842882be2fa3a5e /arch/arm/mach-s3c64xx/mach-smdk6410.c | |
parent | bc449e53121681d16fbefb9c14d28b0638ae33db (diff) |
ARM: SMDK6410: Add initial support for WM1192-EV1 PMIC board
The Wolfson Microelectronics 1192-EV1 is a plug in module for the
SMDK6410 providing power using a WM8312 PMIC. This patch provides
initial hookup sufficient to initialise the board, though not all
features are fully described yet.
As part of this supplies for the system that are provided as a
single supply by one of the currently merged PMIC boards are
factored out so they can be reused between different regulators.
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Ben Dooks <ben-linux@fluff.org>
Diffstat (limited to 'arch/arm/mach-s3c64xx/mach-smdk6410.c')
-rw-r--r-- | arch/arm/mach-s3c64xx/mach-smdk6410.c | 256 |
1 files changed, 201 insertions, 55 deletions
diff --git a/arch/arm/mach-s3c64xx/mach-smdk6410.c b/arch/arm/mach-s3c64xx/mach-smdk6410.c index fdf8f7539a12..cf2327f0bf77 100644 --- a/arch/arm/mach-s3c64xx/mach-smdk6410.c +++ b/arch/arm/mach-s3c64xx/mach-smdk6410.c | |||
@@ -32,6 +32,10 @@ | |||
32 | #include <linux/mfd/wm8350/pmic.h> | 32 | #include <linux/mfd/wm8350/pmic.h> |
33 | #endif | 33 | #endif |
34 | 34 | ||
35 | #ifdef CONFIG_SMDK6410_WM1192_EV1 | ||
36 | #include <linux/mfd/wm831x/pdata.h> | ||
37 | #endif | ||
38 | |||
35 | #include <video/platform_lcd.h> | 39 | #include <video/platform_lcd.h> |
36 | 40 | ||
37 | #include <asm/mach/arch.h> | 41 | #include <asm/mach/arch.h> |
@@ -257,77 +261,124 @@ static struct platform_device *smdk6410_devices[] __initdata = { | |||
257 | &smdk6410_smsc911x, | 261 | &smdk6410_smsc911x, |
258 | }; | 262 | }; |
259 | 263 | ||
260 | #ifdef CONFIG_SMDK6410_WM1190_EV1 | 264 | #ifdef CONFIG_REGULATOR |
261 | /* S3C64xx internal logic & PLL */ | 265 | /* ARM core */ |
262 | static struct regulator_init_data wm8350_dcdc1_data = { | 266 | static struct regulator_consumer_supply smdk6410_vddarm_consumers[] = { |
267 | { | ||
268 | .supply = "vddarm", | ||
269 | } | ||
270 | }; | ||
271 | |||
272 | /* VDDARM, BUCK1 on J5 */ | ||
273 | static struct regulator_init_data smdk6410_vddarm = { | ||
263 | .constraints = { | 274 | .constraints = { |
264 | .name = "PVDD_INT/PVDD_PLL", | 275 | .name = "PVDD_ARM", |
265 | .min_uV = 1200000, | 276 | .min_uV = 1000000, |
277 | .max_uV = 1300000, | ||
278 | .always_on = 1, | ||
279 | .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE, | ||
280 | }, | ||
281 | .num_consumer_supplies = ARRAY_SIZE(smdk6410_vddarm_consumers), | ||
282 | .consumer_supplies = smdk6410_vddarm_consumers, | ||
283 | }; | ||
284 | |||
285 | /* VDD_INT, BUCK2 on J5 */ | ||
286 | static struct regulator_init_data smdk6410_vddint = { | ||
287 | .constraints = { | ||
288 | .name = "PVDD_INT", | ||
289 | .min_uV = 1000000, | ||
266 | .max_uV = 1200000, | 290 | .max_uV = 1200000, |
267 | .always_on = 1, | 291 | .always_on = 1, |
268 | .apply_uV = 1, | 292 | .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE, |
269 | }, | 293 | }, |
270 | }; | 294 | }; |
271 | 295 | ||
272 | /* Memory */ | 296 | /* VDD_HI, LDO3 on J5 */ |
273 | static struct regulator_init_data wm8350_dcdc3_data = { | 297 | static struct regulator_init_data smdk6410_vddhi = { |
274 | .constraints = { | 298 | .constraints = { |
275 | .name = "PVDD_MEM", | 299 | .name = "PVDD_HI", |
276 | .min_uV = 1800000, | ||
277 | .max_uV = 1800000, | ||
278 | .always_on = 1, | 300 | .always_on = 1, |
279 | .state_mem = { | ||
280 | .uV = 1800000, | ||
281 | .mode = REGULATOR_MODE_NORMAL, | ||
282 | .enabled = 1, | ||
283 | }, | ||
284 | .initial_state = PM_SUSPEND_MEM, | ||
285 | }, | 301 | }, |
286 | }; | 302 | }; |
287 | 303 | ||
288 | /* USB, EXT, PCM, ADC/DAC, USB, MMC */ | 304 | /* VDD_PLL, LDO2 on J5 */ |
289 | static struct regulator_consumer_supply wm8350_dcdc4_consumers[] = { | 305 | static struct regulator_init_data smdk6410_vddpll = { |
290 | { | 306 | .constraints = { |
291 | /* WM8580 */ | 307 | .name = "PVDD_PLL", |
292 | .supply = "DVDD", | 308 | .always_on = 1, |
293 | .dev_name = "0-001b", | ||
294 | }, | 309 | }, |
295 | }; | 310 | }; |
296 | 311 | ||
297 | static struct regulator_init_data wm8350_dcdc4_data = { | 312 | /* VDD_UH_MMC, LDO5 on J5 */ |
313 | static struct regulator_init_data smdk6410_vdduh_mmc = { | ||
298 | .constraints = { | 314 | .constraints = { |
299 | .name = "PVDD_HI/PVDD_EXT/PVDD_SYS/PVCCM2MTV", | 315 | .name = "PVDD_UH/PVDD_MMC", |
300 | .min_uV = 3000000, | ||
301 | .max_uV = 3000000, | ||
302 | .always_on = 1, | 316 | .always_on = 1, |
303 | }, | 317 | }, |
304 | .num_consumer_supplies = ARRAY_SIZE(wm8350_dcdc4_consumers), | ||
305 | .consumer_supplies = wm8350_dcdc4_consumers, | ||
306 | }; | 318 | }; |
307 | 319 | ||
308 | /* ARM core */ | 320 | /* VCCM3BT, LDO8 on J5 */ |
309 | static struct regulator_consumer_supply dcdc6_consumers[] = { | 321 | static struct regulator_init_data smdk6410_vccmc3bt = { |
310 | { | 322 | .constraints = { |
311 | .supply = "vddarm", | 323 | .name = "PVCCM3BT", |
312 | } | 324 | .always_on = 1, |
325 | }, | ||
313 | }; | 326 | }; |
314 | 327 | ||
315 | static struct regulator_init_data wm8350_dcdc6_data = { | 328 | /* VCCM2MTV, LDO11 on J5 */ |
329 | static struct regulator_init_data smdk6410_vccm2mtv = { | ||
316 | .constraints = { | 330 | .constraints = { |
317 | .name = "PVDD_ARM", | 331 | .name = "PVCCM2MTV", |
318 | .min_uV = 1000000, | 332 | .always_on = 1, |
319 | .max_uV = 1300000, | 333 | }, |
334 | }; | ||
335 | |||
336 | /* VDD_LCD, LDO12 on J5 */ | ||
337 | static struct regulator_init_data smdk6410_vddlcd = { | ||
338 | .constraints = { | ||
339 | .name = "PVDD_LCD", | ||
340 | .always_on = 1, | ||
341 | }, | ||
342 | }; | ||
343 | |||
344 | /* VDD_OTGI, LDO9 on J5 */ | ||
345 | static struct regulator_init_data smdk6410_vddotgi = { | ||
346 | .constraints = { | ||
347 | .name = "PVDD_OTGI", | ||
348 | .always_on = 1, | ||
349 | }, | ||
350 | }; | ||
351 | |||
352 | /* VDD_OTG, LDO14 on J5 */ | ||
353 | static struct regulator_init_data smdk6410_vddotg = { | ||
354 | .constraints = { | ||
355 | .name = "PVDD_OTG", | ||
320 | .always_on = 1, | 356 | .always_on = 1, |
321 | .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE, | ||
322 | }, | 357 | }, |
323 | .num_consumer_supplies = ARRAY_SIZE(dcdc6_consumers), | ||
324 | .consumer_supplies = dcdc6_consumers, | ||
325 | }; | 358 | }; |
326 | 359 | ||
327 | /* Alive */ | 360 | /* VDD_ALIVE, LDO15 on J5 */ |
328 | static struct regulator_init_data wm8350_ldo1_data = { | 361 | static struct regulator_init_data smdk6410_vddalive = { |
329 | .constraints = { | 362 | .constraints = { |
330 | .name = "PVDD_ALIVE", | 363 | .name = "PVDD_ALIVE", |
364 | .always_on = 1, | ||
365 | }, | ||
366 | }; | ||
367 | |||
368 | /* VDD_AUDIO, VLDO_AUDIO on J5 */ | ||
369 | static struct regulator_init_data smdk6410_vddaudio = { | ||
370 | .constraints = { | ||
371 | .name = "PVDD_AUDIO", | ||
372 | .always_on = 1, | ||
373 | }, | ||
374 | }; | ||
375 | #endif | ||
376 | |||
377 | #ifdef CONFIG_SMDK6410_WM1190_EV1 | ||
378 | /* S3C64xx internal logic & PLL */ | ||
379 | static struct regulator_init_data wm8350_dcdc1_data = { | ||
380 | .constraints = { | ||
381 | .name = "PVDD_INT/PVDD_PLL", | ||
331 | .min_uV = 1200000, | 382 | .min_uV = 1200000, |
332 | .max_uV = 1200000, | 383 | .max_uV = 1200000, |
333 | .always_on = 1, | 384 | .always_on = 1, |
@@ -335,24 +386,40 @@ static struct regulator_init_data wm8350_ldo1_data = { | |||
335 | }, | 386 | }, |
336 | }; | 387 | }; |
337 | 388 | ||
338 | /* OTG */ | 389 | /* Memory */ |
339 | static struct regulator_init_data wm8350_ldo2_data = { | 390 | static struct regulator_init_data wm8350_dcdc3_data = { |
340 | .constraints = { | 391 | .constraints = { |
341 | .name = "PVDD_OTG", | 392 | .name = "PVDD_MEM", |
342 | .min_uV = 3300000, | 393 | .min_uV = 1800000, |
343 | .max_uV = 3300000, | 394 | .max_uV = 1800000, |
344 | .always_on = 1, | 395 | .always_on = 1, |
396 | .state_mem = { | ||
397 | .uV = 1800000, | ||
398 | .mode = REGULATOR_MODE_NORMAL, | ||
399 | .enabled = 1, | ||
400 | }, | ||
401 | .initial_state = PM_SUSPEND_MEM, | ||
345 | }, | 402 | }, |
346 | }; | 403 | }; |
347 | 404 | ||
348 | /* LCD */ | 405 | /* USB, EXT, PCM, ADC/DAC, USB, MMC */ |
349 | static struct regulator_init_data wm8350_ldo3_data = { | 406 | static struct regulator_consumer_supply wm8350_dcdc4_consumers[] = { |
407 | { | ||
408 | /* WM8580 */ | ||
409 | .supply = "DVDD", | ||
410 | .dev_name = "0-001b", | ||
411 | }, | ||
412 | }; | ||
413 | |||
414 | static struct regulator_init_data wm8350_dcdc4_data = { | ||
350 | .constraints = { | 415 | .constraints = { |
351 | .name = "PVDD_LCD", | 416 | .name = "PVDD_HI/PVDD_EXT/PVDD_SYS/PVCCM2MTV", |
352 | .min_uV = 3000000, | 417 | .min_uV = 3000000, |
353 | .max_uV = 3000000, | 418 | .max_uV = 3000000, |
354 | .always_on = 1, | 419 | .always_on = 1, |
355 | }, | 420 | }, |
421 | .num_consumer_supplies = ARRAY_SIZE(wm8350_dcdc4_consumers), | ||
422 | .consumer_supplies = wm8350_dcdc4_consumers, | ||
356 | }; | 423 | }; |
357 | 424 | ||
358 | /* OTGi/1190-EV1 HPVDD & AVDD */ | 425 | /* OTGi/1190-EV1 HPVDD & AVDD */ |
@@ -373,10 +440,10 @@ static struct { | |||
373 | { WM8350_DCDC_1, &wm8350_dcdc1_data }, | 440 | { WM8350_DCDC_1, &wm8350_dcdc1_data }, |
374 | { WM8350_DCDC_3, &wm8350_dcdc3_data }, | 441 | { WM8350_DCDC_3, &wm8350_dcdc3_data }, |
375 | { WM8350_DCDC_4, &wm8350_dcdc4_data }, | 442 | { WM8350_DCDC_4, &wm8350_dcdc4_data }, |
376 | { WM8350_DCDC_6, &wm8350_dcdc6_data }, | 443 | { WM8350_DCDC_6, &smdk6410_vddarm }, |
377 | { WM8350_LDO_1, &wm8350_ldo1_data }, | 444 | { WM8350_LDO_1, &smdk6410_vddalive }, |
378 | { WM8350_LDO_2, &wm8350_ldo2_data }, | 445 | { WM8350_LDO_2, &smdk6410_vddotg }, |
379 | { WM8350_LDO_3, &wm8350_ldo3_data }, | 446 | { WM8350_LDO_3, &smdk6410_vddlcd }, |
380 | { WM8350_LDO_4, &wm8350_ldo4_data }, | 447 | { WM8350_LDO_4, &wm8350_ldo4_data }, |
381 | }; | 448 | }; |
382 | 449 | ||
@@ -403,10 +470,89 @@ static struct wm8350_platform_data __initdata smdk6410_wm8350_pdata = { | |||
403 | }; | 470 | }; |
404 | #endif | 471 | #endif |
405 | 472 | ||
473 | #ifdef CONFIG_SMDK6410_WM1192_EV1 | ||
474 | static int wm1192_pre_init(struct wm831x *wm831x) | ||
475 | { | ||
476 | /* Configure the IRQ line */ | ||
477 | s3c_gpio_setpull(S3C64XX_GPN(12), S3C_GPIO_PULL_UP); | ||
478 | |||
479 | return 0; | ||
480 | } | ||
481 | |||
482 | static struct wm831x_backlight_pdata wm1192_backlight_pdata = { | ||
483 | .isink = 1, | ||
484 | .max_uA = 27554, | ||
485 | }; | ||
486 | |||
487 | static struct regulator_init_data wm1192_dcdc3 = { | ||
488 | .constraints = { | ||
489 | .name = "PVDD_MEM/PVDD_GPS", | ||
490 | .always_on = 1, | ||
491 | }, | ||
492 | }; | ||
493 | |||
494 | static struct regulator_consumer_supply wm1192_ldo1_consumers[] = { | ||
495 | { .supply = "DVDD", .dev_name = "0-001b", }, /* WM8580 */ | ||
496 | }; | ||
497 | |||
498 | static struct regulator_init_data wm1192_ldo1 = { | ||
499 | .constraints = { | ||
500 | .name = "PVDD_LCD/PVDD_EXT", | ||
501 | .always_on = 1, | ||
502 | }, | ||
503 | .consumer_supplies = wm1192_ldo1_consumers, | ||
504 | .num_consumer_supplies = ARRAY_SIZE(wm1192_ldo1_consumers), | ||
505 | }; | ||
506 | |||
507 | static struct wm831x_status_pdata wm1192_led7_pdata = { | ||
508 | .name = "LED7:green:", | ||
509 | }; | ||
510 | |||
511 | static struct wm831x_status_pdata wm1192_led8_pdata = { | ||
512 | .name = "LED8:green:", | ||
513 | }; | ||
514 | |||
515 | static struct wm831x_pdata smdk6410_wm1192_pdata = { | ||
516 | .pre_init = wm1192_pre_init, | ||
517 | .irq_base = IRQ_BOARD_START, | ||
518 | |||
519 | .backlight = &wm1192_backlight_pdata, | ||
520 | .dcdc = { | ||
521 | &smdk6410_vddarm, /* DCDC1 */ | ||
522 | &smdk6410_vddint, /* DCDC2 */ | ||
523 | &wm1192_dcdc3, | ||
524 | }, | ||
525 | .ldo = { | ||
526 | &wm1192_ldo1, /* LDO1 */ | ||
527 | &smdk6410_vdduh_mmc, /* LDO2 */ | ||
528 | NULL, /* LDO3 NC */ | ||
529 | &smdk6410_vddotgi, /* LDO4 */ | ||
530 | &smdk6410_vddotg, /* LDO5 */ | ||
531 | &smdk6410_vddhi, /* LDO6 */ | ||
532 | &smdk6410_vddaudio, /* LDO7 */ | ||
533 | &smdk6410_vccm2mtv, /* LDO8 */ | ||
534 | &smdk6410_vddpll, /* LDO9 */ | ||
535 | &smdk6410_vccmc3bt, /* LDO10 */ | ||
536 | &smdk6410_vddalive, /* LDO11 */ | ||
537 | }, | ||
538 | .status = { | ||
539 | &wm1192_led7_pdata, | ||
540 | &wm1192_led8_pdata, | ||
541 | }, | ||
542 | }; | ||
543 | #endif | ||
544 | |||
406 | static struct i2c_board_info i2c_devs0[] __initdata = { | 545 | static struct i2c_board_info i2c_devs0[] __initdata = { |
407 | { I2C_BOARD_INFO("24c08", 0x50), }, | 546 | { I2C_BOARD_INFO("24c08", 0x50), }, |
408 | { I2C_BOARD_INFO("wm8580", 0x1b), }, | 547 | { I2C_BOARD_INFO("wm8580", 0x1b), }, |
409 | 548 | ||
549 | #ifdef CONFIG_SMDK6410_WM1192_EV1 | ||
550 | { I2C_BOARD_INFO("wm8312", 0x34), | ||
551 | .platform_data = &smdk6410_wm1192_pdata, | ||
552 | .irq = S3C_EINT(12), | ||
553 | }, | ||
554 | #endif | ||
555 | |||
410 | #ifdef CONFIG_SMDK6410_WM1190_EV1 | 556 | #ifdef CONFIG_SMDK6410_WM1190_EV1 |
411 | { I2C_BOARD_INFO("wm8350", 0x1a), | 557 | { I2C_BOARD_INFO("wm8350", 0x1a), |
412 | .platform_data = &smdk6410_wm8350_pdata, | 558 | .platform_data = &smdk6410_wm8350_pdata, |