diff options
Diffstat (limited to 'arch/arm/mach-exynos4/mach-nuri.c')
-rw-r--r-- | arch/arm/mach-exynos4/mach-nuri.c | 753 |
1 files changed, 752 insertions, 1 deletions
diff --git a/arch/arm/mach-exynos4/mach-nuri.c b/arch/arm/mach-exynos4/mach-nuri.c index 642702bb5b12..43be71b799cb 100644 --- a/arch/arm/mach-exynos4/mach-nuri.c +++ b/arch/arm/mach-exynos4/mach-nuri.c | |||
@@ -13,10 +13,15 @@ | |||
13 | #include <linux/input.h> | 13 | #include <linux/input.h> |
14 | #include <linux/i2c.h> | 14 | #include <linux/i2c.h> |
15 | #include <linux/i2c/atmel_mxt_ts.h> | 15 | #include <linux/i2c/atmel_mxt_ts.h> |
16 | #include <linux/i2c-gpio.h> | ||
16 | #include <linux/gpio_keys.h> | 17 | #include <linux/gpio_keys.h> |
17 | #include <linux/gpio.h> | 18 | #include <linux/gpio.h> |
19 | #include <linux/power/max8903_charger.h> | ||
20 | #include <linux/power/max17042_battery.h> | ||
18 | #include <linux/regulator/machine.h> | 21 | #include <linux/regulator/machine.h> |
19 | #include <linux/regulator/fixed.h> | 22 | #include <linux/regulator/fixed.h> |
23 | #include <linux/mfd/max8997.h> | ||
24 | #include <linux/mfd/max8997-private.h> | ||
20 | #include <linux/mmc/host.h> | 25 | #include <linux/mmc/host.h> |
21 | #include <linux/fb.h> | 26 | #include <linux/fb.h> |
22 | #include <linux/pwm_backlight.h> | 27 | #include <linux/pwm_backlight.h> |
@@ -26,6 +31,7 @@ | |||
26 | #include <asm/mach/arch.h> | 31 | #include <asm/mach/arch.h> |
27 | #include <asm/mach-types.h> | 32 | #include <asm/mach-types.h> |
28 | 33 | ||
34 | #include <plat/adc.h> | ||
29 | #include <plat/regs-serial.h> | 35 | #include <plat/regs-serial.h> |
30 | #include <plat/exynos4.h> | 36 | #include <plat/exynos4.h> |
31 | #include <plat/cpu.h> | 37 | #include <plat/cpu.h> |
@@ -35,6 +41,8 @@ | |||
35 | #include <plat/clock.h> | 41 | #include <plat/clock.h> |
36 | #include <plat/gpio-cfg.h> | 42 | #include <plat/gpio-cfg.h> |
37 | #include <plat/iic.h> | 43 | #include <plat/iic.h> |
44 | #include <plat/mfc.h> | ||
45 | #include <plat/pd.h> | ||
38 | 46 | ||
39 | #include <mach/map.h> | 47 | #include <mach/map.h> |
40 | 48 | ||
@@ -54,6 +62,7 @@ | |||
54 | 62 | ||
55 | enum fixed_regulator_id { | 63 | enum fixed_regulator_id { |
56 | FIXED_REG_ID_MMC = 0, | 64 | FIXED_REG_ID_MMC = 0, |
65 | FIXED_REG_ID_MAX8903, | ||
57 | }; | 66 | }; |
58 | 67 | ||
59 | static struct s3c2410_uartcfg nuri_uartcfgs[] __initdata = { | 68 | static struct s3c2410_uartcfg nuri_uartcfgs[] __initdata = { |
@@ -344,10 +353,730 @@ static void __init nuri_tsp_init(void) | |||
344 | s3c_gpio_setpull(gpio, S3C_GPIO_PULL_UP); | 353 | s3c_gpio_setpull(gpio, S3C_GPIO_PULL_UP); |
345 | } | 354 | } |
346 | 355 | ||
356 | static struct regulator_consumer_supply __initdata max8997_ldo1_[] = { | ||
357 | REGULATOR_SUPPLY("vdd", "s5p-adc"), /* Used by CPU's ADC drv */ | ||
358 | }; | ||
359 | static struct regulator_consumer_supply __initdata max8997_ldo3_[] = { | ||
360 | REGULATOR_SUPPLY("vdd11", "s5p-mipi-csis.0"), /* MIPI */ | ||
361 | }; | ||
362 | static struct regulator_consumer_supply __initdata max8997_ldo4_[] = { | ||
363 | REGULATOR_SUPPLY("vdd18", "s5p-mipi-csis.0"), /* MIPI */ | ||
364 | }; | ||
365 | static struct regulator_consumer_supply __initdata max8997_ldo5_[] = { | ||
366 | REGULATOR_SUPPLY("vhsic", "modemctl"), /* MODEM */ | ||
367 | }; | ||
368 | static struct regulator_consumer_supply __initdata max8997_ldo7_[] = { | ||
369 | REGULATOR_SUPPLY("dig_18", "0-001f"), /* HCD803 */ | ||
370 | }; | ||
371 | static struct regulator_consumer_supply __initdata max8997_ldo8_[] = { | ||
372 | REGULATOR_SUPPLY("vusb_d", NULL), /* Used by CPU */ | ||
373 | REGULATOR_SUPPLY("vdac", NULL), /* Used by CPU */ | ||
374 | }; | ||
375 | static struct regulator_consumer_supply __initdata max8997_ldo11_[] = { | ||
376 | REGULATOR_SUPPLY("vcc", "platform-lcd"), /* U804 LVDS */ | ||
377 | }; | ||
378 | static struct regulator_consumer_supply __initdata max8997_ldo12_[] = { | ||
379 | REGULATOR_SUPPLY("vddio", "6-003c"), /* HDC802 */ | ||
380 | }; | ||
381 | static struct regulator_consumer_supply __initdata max8997_ldo13_[] = { | ||
382 | REGULATOR_SUPPLY("vmmc", "s3c-sdhci.2"), /* TFLASH */ | ||
383 | }; | ||
384 | static struct regulator_consumer_supply __initdata max8997_ldo14_[] = { | ||
385 | REGULATOR_SUPPLY("inmotor", "max8997-haptic"), | ||
386 | }; | ||
387 | static struct regulator_consumer_supply __initdata max8997_ldo15_[] = { | ||
388 | REGULATOR_SUPPLY("avdd", "3-004a"), /* Touch Screen */ | ||
389 | }; | ||
390 | static struct regulator_consumer_supply __initdata max8997_ldo16_[] = { | ||
391 | REGULATOR_SUPPLY("d_sensor", "0-001f"), /* HDC803 */ | ||
392 | }; | ||
393 | static struct regulator_consumer_supply __initdata max8997_ldo18_[] = { | ||
394 | REGULATOR_SUPPLY("vdd", "3-004a"), /* Touch Screen */ | ||
395 | }; | ||
396 | static struct regulator_consumer_supply __initdata max8997_buck1_[] = { | ||
397 | REGULATOR_SUPPLY("vdd_arm", NULL), /* CPUFREQ */ | ||
398 | }; | ||
399 | static struct regulator_consumer_supply __initdata max8997_buck2_[] = { | ||
400 | REGULATOR_SUPPLY("vdd_int", NULL), /* CPUFREQ */ | ||
401 | }; | ||
402 | static struct regulator_consumer_supply __initdata max8997_buck3_[] = { | ||
403 | REGULATOR_SUPPLY("vdd", "mali_dev.0"), /* G3D of Exynos 4 */ | ||
404 | }; | ||
405 | static struct regulator_consumer_supply __initdata max8997_buck4_[] = { | ||
406 | REGULATOR_SUPPLY("core", "0-001f"), /* HDC803 */ | ||
407 | }; | ||
408 | static struct regulator_consumer_supply __initdata max8997_buck6_[] = { | ||
409 | REGULATOR_SUPPLY("dig_28", "0-001f"), /* pin "7" of HDC803 */ | ||
410 | }; | ||
411 | static struct regulator_consumer_supply __initdata max8997_esafeout1_[] = { | ||
412 | REGULATOR_SUPPLY("usb_vbus", NULL), /* CPU's USB OTG */ | ||
413 | }; | ||
414 | static struct regulator_consumer_supply __initdata max8997_esafeout2_[] = { | ||
415 | REGULATOR_SUPPLY("usb_vbus", "modemctl"), /* VBUS of Modem */ | ||
416 | }; | ||
417 | |||
418 | static struct regulator_consumer_supply __initdata max8997_charger_[] = { | ||
419 | REGULATOR_SUPPLY("vinchg1", "charger-manager.0"), | ||
420 | }; | ||
421 | static struct regulator_consumer_supply __initdata max8997_chg_toff_[] = { | ||
422 | REGULATOR_SUPPLY("vinchg_stop", NULL), /* for jack interrupt handlers */ | ||
423 | }; | ||
424 | |||
425 | static struct regulator_consumer_supply __initdata max8997_32khz_ap_[] = { | ||
426 | REGULATOR_SUPPLY("gps_clk", "bcm4751"), | ||
427 | REGULATOR_SUPPLY("bt_clk", "bcm4330-b1"), | ||
428 | REGULATOR_SUPPLY("wifi_clk", "bcm433-b1"), | ||
429 | }; | ||
430 | |||
431 | static struct regulator_init_data __initdata max8997_ldo1_data = { | ||
432 | .constraints = { | ||
433 | .name = "VADC_3.3V_C210", | ||
434 | .min_uV = 3300000, | ||
435 | .max_uV = 3300000, | ||
436 | .valid_ops_mask = REGULATOR_CHANGE_STATUS, | ||
437 | .apply_uV = 1, | ||
438 | .state_mem = { | ||
439 | .disabled = 1, | ||
440 | }, | ||
441 | }, | ||
442 | .num_consumer_supplies = ARRAY_SIZE(max8997_ldo1_), | ||
443 | .consumer_supplies = max8997_ldo1_, | ||
444 | }; | ||
445 | |||
446 | static struct regulator_init_data __initdata max8997_ldo2_data = { | ||
447 | .constraints = { | ||
448 | .name = "VALIVE_1.1V_C210", | ||
449 | .min_uV = 1100000, | ||
450 | .max_uV = 1100000, | ||
451 | .apply_uV = 1, | ||
452 | .always_on = 1, | ||
453 | .state_mem = { | ||
454 | .enabled = 1, | ||
455 | }, | ||
456 | }, | ||
457 | }; | ||
458 | |||
459 | static struct regulator_init_data __initdata max8997_ldo3_data = { | ||
460 | .constraints = { | ||
461 | .name = "VUSB_1.1V_C210", | ||
462 | .min_uV = 1100000, | ||
463 | .max_uV = 1100000, | ||
464 | .valid_ops_mask = REGULATOR_CHANGE_STATUS, | ||
465 | .apply_uV = 1, | ||
466 | .state_mem = { | ||
467 | .disabled = 1, | ||
468 | }, | ||
469 | }, | ||
470 | .num_consumer_supplies = ARRAY_SIZE(max8997_ldo3_), | ||
471 | .consumer_supplies = max8997_ldo3_, | ||
472 | }; | ||
473 | |||
474 | static struct regulator_init_data __initdata max8997_ldo4_data = { | ||
475 | .constraints = { | ||
476 | .name = "VMIPI_1.8V", | ||
477 | .min_uV = 1800000, | ||
478 | .max_uV = 1800000, | ||
479 | .valid_ops_mask = REGULATOR_CHANGE_STATUS, | ||
480 | .apply_uV = 1, | ||
481 | .state_mem = { | ||
482 | .disabled = 1, | ||
483 | }, | ||
484 | }, | ||
485 | .num_consumer_supplies = ARRAY_SIZE(max8997_ldo4_), | ||
486 | .consumer_supplies = max8997_ldo4_, | ||
487 | }; | ||
488 | |||
489 | static struct regulator_init_data __initdata max8997_ldo5_data = { | ||
490 | .constraints = { | ||
491 | .name = "VHSIC_1.2V_C210", | ||
492 | .min_uV = 1200000, | ||
493 | .max_uV = 1200000, | ||
494 | .valid_ops_mask = REGULATOR_CHANGE_STATUS, | ||
495 | .apply_uV = 1, | ||
496 | .state_mem = { | ||
497 | .disabled = 1, | ||
498 | }, | ||
499 | }, | ||
500 | .num_consumer_supplies = ARRAY_SIZE(max8997_ldo5_), | ||
501 | .consumer_supplies = max8997_ldo5_, | ||
502 | }; | ||
503 | |||
504 | static struct regulator_init_data __initdata max8997_ldo6_data = { | ||
505 | .constraints = { | ||
506 | .name = "VCC_1.8V_PDA", | ||
507 | .min_uV = 1800000, | ||
508 | .max_uV = 1800000, | ||
509 | .apply_uV = 1, | ||
510 | .always_on = 1, | ||
511 | .state_mem = { | ||
512 | .enabled = 1, | ||
513 | }, | ||
514 | }, | ||
515 | }; | ||
516 | |||
517 | static struct regulator_init_data __initdata max8997_ldo7_data = { | ||
518 | .constraints = { | ||
519 | .name = "CAM_ISP_1.8V", | ||
520 | .min_uV = 1800000, | ||
521 | .max_uV = 1800000, | ||
522 | .valid_ops_mask = REGULATOR_CHANGE_STATUS, | ||
523 | .apply_uV = 1, | ||
524 | .state_mem = { | ||
525 | .disabled = 1, | ||
526 | }, | ||
527 | }, | ||
528 | .num_consumer_supplies = ARRAY_SIZE(max8997_ldo7_), | ||
529 | .consumer_supplies = max8997_ldo7_, | ||
530 | }; | ||
531 | |||
532 | static struct regulator_init_data __initdata max8997_ldo8_data = { | ||
533 | .constraints = { | ||
534 | .name = "VUSB/VDAC_3.3V_C210", | ||
535 | .min_uV = 3300000, | ||
536 | .max_uV = 3300000, | ||
537 | .valid_ops_mask = REGULATOR_CHANGE_STATUS, | ||
538 | .apply_uV = 1, | ||
539 | .state_mem = { | ||
540 | .disabled = 1, | ||
541 | }, | ||
542 | }, | ||
543 | .num_consumer_supplies = ARRAY_SIZE(max8997_ldo8_), | ||
544 | .consumer_supplies = max8997_ldo8_, | ||
545 | }; | ||
546 | |||
547 | static struct regulator_init_data __initdata max8997_ldo9_data = { | ||
548 | .constraints = { | ||
549 | .name = "VCC_2.8V_PDA", | ||
550 | .min_uV = 2800000, | ||
551 | .max_uV = 2800000, | ||
552 | .apply_uV = 1, | ||
553 | .always_on = 1, | ||
554 | .state_mem = { | ||
555 | .enabled = 1, | ||
556 | }, | ||
557 | }, | ||
558 | }; | ||
559 | |||
560 | static struct regulator_init_data __initdata max8997_ldo10_data = { | ||
561 | .constraints = { | ||
562 | .name = "VPLL_1.1V_C210", | ||
563 | .min_uV = 1100000, | ||
564 | .max_uV = 1100000, | ||
565 | .apply_uV = 1, | ||
566 | .always_on = 1, | ||
567 | .state_mem = { | ||
568 | .disabled = 1, | ||
569 | }, | ||
570 | }, | ||
571 | }; | ||
572 | |||
573 | static struct regulator_init_data __initdata max8997_ldo11_data = { | ||
574 | .constraints = { | ||
575 | .name = "LVDS_VDD3.3V", | ||
576 | .min_uV = 3300000, | ||
577 | .max_uV = 3300000, | ||
578 | .valid_ops_mask = REGULATOR_CHANGE_STATUS, | ||
579 | .apply_uV = 1, | ||
580 | .boot_on = 1, | ||
581 | .state_mem = { | ||
582 | .disabled = 1, | ||
583 | }, | ||
584 | }, | ||
585 | .num_consumer_supplies = ARRAY_SIZE(max8997_ldo11_), | ||
586 | .consumer_supplies = max8997_ldo11_, | ||
587 | }; | ||
588 | |||
589 | static struct regulator_init_data __initdata max8997_ldo12_data = { | ||
590 | .constraints = { | ||
591 | .name = "VT_CAM_1.8V", | ||
592 | .min_uV = 1800000, | ||
593 | .max_uV = 1800000, | ||
594 | .valid_ops_mask = REGULATOR_CHANGE_STATUS, | ||
595 | .apply_uV = 1, | ||
596 | .state_mem = { | ||
597 | .disabled = 1, | ||
598 | }, | ||
599 | }, | ||
600 | .num_consumer_supplies = ARRAY_SIZE(max8997_ldo12_), | ||
601 | .consumer_supplies = max8997_ldo12_, | ||
602 | }; | ||
603 | |||
604 | static struct regulator_init_data __initdata max8997_ldo13_data = { | ||
605 | .constraints = { | ||
606 | .name = "VTF_2.8V", | ||
607 | .min_uV = 2800000, | ||
608 | .max_uV = 2800000, | ||
609 | .valid_ops_mask = REGULATOR_CHANGE_STATUS, | ||
610 | .apply_uV = 1, | ||
611 | .state_mem = { | ||
612 | .disabled = 1, | ||
613 | }, | ||
614 | }, | ||
615 | .num_consumer_supplies = ARRAY_SIZE(max8997_ldo13_), | ||
616 | .consumer_supplies = max8997_ldo13_, | ||
617 | }; | ||
618 | |||
619 | static struct regulator_init_data __initdata max8997_ldo14_data = { | ||
620 | .constraints = { | ||
621 | .name = "VCC_3.0V_MOTOR", | ||
622 | .min_uV = 3000000, | ||
623 | .max_uV = 3000000, | ||
624 | .valid_ops_mask = REGULATOR_CHANGE_STATUS, | ||
625 | .apply_uV = 1, | ||
626 | .state_mem = { | ||
627 | .disabled = 1, | ||
628 | }, | ||
629 | }, | ||
630 | .num_consumer_supplies = ARRAY_SIZE(max8997_ldo14_), | ||
631 | .consumer_supplies = max8997_ldo14_, | ||
632 | }; | ||
633 | |||
634 | static struct regulator_init_data __initdata max8997_ldo15_data = { | ||
635 | .constraints = { | ||
636 | .name = "VTOUCH_ADVV2.8V", | ||
637 | .min_uV = 2800000, | ||
638 | .max_uV = 2800000, | ||
639 | .apply_uV = 1, | ||
640 | .valid_ops_mask = REGULATOR_CHANGE_STATUS, | ||
641 | .state_mem = { | ||
642 | .disabled = 1, | ||
643 | }, | ||
644 | }, | ||
645 | .num_consumer_supplies = ARRAY_SIZE(max8997_ldo15_), | ||
646 | .consumer_supplies = max8997_ldo15_, | ||
647 | }; | ||
648 | |||
649 | static struct regulator_init_data __initdata max8997_ldo16_data = { | ||
650 | .constraints = { | ||
651 | .name = "CAM_SENSOR_IO_1.8V", | ||
652 | .min_uV = 1800000, | ||
653 | .max_uV = 1800000, | ||
654 | .valid_ops_mask = REGULATOR_CHANGE_STATUS, | ||
655 | .apply_uV = 1, | ||
656 | .state_mem = { | ||
657 | .disabled = 1, | ||
658 | }, | ||
659 | }, | ||
660 | .num_consumer_supplies = ARRAY_SIZE(max8997_ldo16_), | ||
661 | .consumer_supplies = max8997_ldo16_, | ||
662 | }; | ||
663 | |||
664 | static struct regulator_init_data __initdata max8997_ldo18_data = { | ||
665 | .constraints = { | ||
666 | .name = "VTOUCH_VDD2.8V", | ||
667 | .min_uV = 2800000, | ||
668 | .max_uV = 2800000, | ||
669 | .valid_ops_mask = REGULATOR_CHANGE_STATUS, | ||
670 | .apply_uV = 1, | ||
671 | .state_mem = { | ||
672 | .disabled = 1, | ||
673 | }, | ||
674 | }, | ||
675 | .num_consumer_supplies = ARRAY_SIZE(max8997_ldo18_), | ||
676 | .consumer_supplies = max8997_ldo18_, | ||
677 | }; | ||
678 | |||
679 | static struct regulator_init_data __initdata max8997_ldo21_data = { | ||
680 | .constraints = { | ||
681 | .name = "VDDQ_M1M2_1.2V", | ||
682 | .min_uV = 1200000, | ||
683 | .max_uV = 1200000, | ||
684 | .apply_uV = 1, | ||
685 | .always_on = 1, | ||
686 | .state_mem = { | ||
687 | .disabled = 1, | ||
688 | }, | ||
689 | }, | ||
690 | }; | ||
691 | |||
692 | static struct regulator_init_data __initdata max8997_buck1_data = { | ||
693 | .constraints = { | ||
694 | .name = "VARM_1.2V_C210", | ||
695 | .min_uV = 900000, | ||
696 | .max_uV = 1350000, | ||
697 | .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE, | ||
698 | .always_on = 1, | ||
699 | .state_mem = { | ||
700 | .disabled = 1, | ||
701 | }, | ||
702 | }, | ||
703 | .num_consumer_supplies = ARRAY_SIZE(max8997_buck1_), | ||
704 | .consumer_supplies = max8997_buck1_, | ||
705 | }; | ||
706 | |||
707 | static struct regulator_init_data __initdata max8997_buck2_data = { | ||
708 | .constraints = { | ||
709 | .name = "VINT_1.1V_C210", | ||
710 | .min_uV = 900000, | ||
711 | .max_uV = 1100000, | ||
712 | .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE, | ||
713 | .always_on = 1, | ||
714 | .state_mem = { | ||
715 | .disabled = 1, | ||
716 | }, | ||
717 | }, | ||
718 | .num_consumer_supplies = ARRAY_SIZE(max8997_buck2_), | ||
719 | .consumer_supplies = max8997_buck2_, | ||
720 | }; | ||
721 | |||
722 | static struct regulator_init_data __initdata max8997_buck3_data = { | ||
723 | .constraints = { | ||
724 | .name = "VG3D_1.1V_C210", | ||
725 | .min_uV = 900000, | ||
726 | .max_uV = 1100000, | ||
727 | .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE | | ||
728 | REGULATOR_CHANGE_STATUS, | ||
729 | .state_mem = { | ||
730 | .disabled = 1, | ||
731 | }, | ||
732 | }, | ||
733 | .num_consumer_supplies = ARRAY_SIZE(max8997_buck3_), | ||
734 | .consumer_supplies = max8997_buck3_, | ||
735 | }; | ||
736 | |||
737 | static struct regulator_init_data __initdata max8997_buck4_data = { | ||
738 | .constraints = { | ||
739 | .name = "CAM_ISP_CORE_1.2V", | ||
740 | .min_uV = 1200000, | ||
741 | .max_uV = 1200000, | ||
742 | .apply_uV = 1, | ||
743 | .valid_ops_mask = REGULATOR_CHANGE_STATUS, | ||
744 | .state_mem = { | ||
745 | .disabled = 1, | ||
746 | }, | ||
747 | }, | ||
748 | .num_consumer_supplies = ARRAY_SIZE(max8997_buck4_), | ||
749 | .consumer_supplies = max8997_buck4_, | ||
750 | }; | ||
751 | |||
752 | static struct regulator_init_data __initdata max8997_buck5_data = { | ||
753 | .constraints = { | ||
754 | .name = "VMEM_1.2V_C210", | ||
755 | .min_uV = 1200000, | ||
756 | .max_uV = 1200000, | ||
757 | .apply_uV = 1, | ||
758 | .always_on = 1, | ||
759 | .state_mem = { | ||
760 | .enabled = 1, | ||
761 | }, | ||
762 | }, | ||
763 | }; | ||
764 | |||
765 | static struct regulator_init_data __initdata max8997_buck6_data = { | ||
766 | .constraints = { | ||
767 | .name = "CAM_AF_2.8V", | ||
768 | .min_uV = 2800000, | ||
769 | .max_uV = 2800000, | ||
770 | .valid_ops_mask = REGULATOR_CHANGE_STATUS, | ||
771 | .state_mem = { | ||
772 | .disabled = 1, | ||
773 | }, | ||
774 | }, | ||
775 | .num_consumer_supplies = ARRAY_SIZE(max8997_buck6_), | ||
776 | .consumer_supplies = max8997_buck6_, | ||
777 | }; | ||
778 | |||
779 | static struct regulator_init_data __initdata max8997_buck7_data = { | ||
780 | .constraints = { | ||
781 | .name = "VCC_SUB_2.0V", | ||
782 | .min_uV = 2000000, | ||
783 | .max_uV = 2000000, | ||
784 | .apply_uV = 1, | ||
785 | .always_on = 1, | ||
786 | .state_mem = { | ||
787 | .enabled = 1, | ||
788 | }, | ||
789 | }, | ||
790 | }; | ||
791 | |||
792 | static struct regulator_init_data __initdata max8997_32khz_ap_data = { | ||
793 | .constraints = { | ||
794 | .name = "32KHz AP", | ||
795 | .always_on = 1, | ||
796 | .state_mem = { | ||
797 | .enabled = 1, | ||
798 | }, | ||
799 | }, | ||
800 | .num_consumer_supplies = ARRAY_SIZE(max8997_32khz_ap_), | ||
801 | .consumer_supplies = max8997_32khz_ap_, | ||
802 | }; | ||
803 | |||
804 | static struct regulator_init_data __initdata max8997_32khz_cp_data = { | ||
805 | .constraints = { | ||
806 | .name = "32KHz CP", | ||
807 | .state_mem = { | ||
808 | .disabled = 1, | ||
809 | }, | ||
810 | }, | ||
811 | }; | ||
812 | |||
813 | static struct regulator_init_data __initdata max8997_vichg_data = { | ||
814 | .constraints = { | ||
815 | .name = "VICHG", | ||
816 | .state_mem = { | ||
817 | .disabled = 1, | ||
818 | }, | ||
819 | }, | ||
820 | }; | ||
821 | |||
822 | static struct regulator_init_data __initdata max8997_esafeout1_data = { | ||
823 | .constraints = { | ||
824 | .name = "SAFEOUT1", | ||
825 | .valid_ops_mask = REGULATOR_CHANGE_STATUS, | ||
826 | .state_mem = { | ||
827 | .disabled = 1, | ||
828 | }, | ||
829 | }, | ||
830 | .num_consumer_supplies = ARRAY_SIZE(max8997_esafeout1_), | ||
831 | .consumer_supplies = max8997_esafeout1_, | ||
832 | }; | ||
833 | |||
834 | static struct regulator_init_data __initdata max8997_esafeout2_data = { | ||
835 | .constraints = { | ||
836 | .name = "SAFEOUT2", | ||
837 | .valid_ops_mask = REGULATOR_CHANGE_STATUS, | ||
838 | .state_mem = { | ||
839 | .disabled = 1, | ||
840 | }, | ||
841 | }, | ||
842 | .num_consumer_supplies = ARRAY_SIZE(max8997_esafeout2_), | ||
843 | .consumer_supplies = max8997_esafeout2_, | ||
844 | }; | ||
845 | |||
846 | static struct regulator_init_data __initdata max8997_charger_cv_data = { | ||
847 | .constraints = { | ||
848 | .name = "CHARGER_CV", | ||
849 | .min_uV = 4200000, | ||
850 | .max_uV = 4200000, | ||
851 | .apply_uV = 1, | ||
852 | }, | ||
853 | }; | ||
854 | |||
855 | static struct regulator_init_data __initdata max8997_charger_data = { | ||
856 | .constraints = { | ||
857 | .name = "CHARGER", | ||
858 | .min_uA = 200000, | ||
859 | .max_uA = 950000, | ||
860 | .boot_on = 1, | ||
861 | .valid_ops_mask = REGULATOR_CHANGE_STATUS | | ||
862 | REGULATOR_CHANGE_CURRENT, | ||
863 | }, | ||
864 | .num_consumer_supplies = ARRAY_SIZE(max8997_charger_), | ||
865 | .consumer_supplies = max8997_charger_, | ||
866 | }; | ||
867 | |||
868 | static struct regulator_init_data __initdata max8997_charger_topoff_data = { | ||
869 | .constraints = { | ||
870 | .name = "CHARGER TOPOFF", | ||
871 | .min_uA = 50000, | ||
872 | .max_uA = 200000, | ||
873 | .valid_ops_mask = REGULATOR_CHANGE_CURRENT, | ||
874 | }, | ||
875 | .num_consumer_supplies = ARRAY_SIZE(max8997_chg_toff_), | ||
876 | .consumer_supplies = max8997_chg_toff_, | ||
877 | }; | ||
878 | |||
879 | static struct max8997_regulator_data __initdata nuri_max8997_regulators[] = { | ||
880 | { MAX8997_LDO1, &max8997_ldo1_data }, | ||
881 | { MAX8997_LDO2, &max8997_ldo2_data }, | ||
882 | { MAX8997_LDO3, &max8997_ldo3_data }, | ||
883 | { MAX8997_LDO4, &max8997_ldo4_data }, | ||
884 | { MAX8997_LDO5, &max8997_ldo5_data }, | ||
885 | { MAX8997_LDO6, &max8997_ldo6_data }, | ||
886 | { MAX8997_LDO7, &max8997_ldo7_data }, | ||
887 | { MAX8997_LDO8, &max8997_ldo8_data }, | ||
888 | { MAX8997_LDO9, &max8997_ldo9_data }, | ||
889 | { MAX8997_LDO10, &max8997_ldo10_data }, | ||
890 | { MAX8997_LDO11, &max8997_ldo11_data }, | ||
891 | { MAX8997_LDO12, &max8997_ldo12_data }, | ||
892 | { MAX8997_LDO13, &max8997_ldo13_data }, | ||
893 | { MAX8997_LDO14, &max8997_ldo14_data }, | ||
894 | { MAX8997_LDO15, &max8997_ldo15_data }, | ||
895 | { MAX8997_LDO16, &max8997_ldo16_data }, | ||
896 | |||
897 | { MAX8997_LDO18, &max8997_ldo18_data }, | ||
898 | { MAX8997_LDO21, &max8997_ldo21_data }, | ||
899 | |||
900 | { MAX8997_BUCK1, &max8997_buck1_data }, | ||
901 | { MAX8997_BUCK2, &max8997_buck2_data }, | ||
902 | { MAX8997_BUCK3, &max8997_buck3_data }, | ||
903 | { MAX8997_BUCK4, &max8997_buck4_data }, | ||
904 | { MAX8997_BUCK5, &max8997_buck5_data }, | ||
905 | { MAX8997_BUCK6, &max8997_buck6_data }, | ||
906 | { MAX8997_BUCK7, &max8997_buck7_data }, | ||
907 | |||
908 | { MAX8997_EN32KHZ_AP, &max8997_32khz_ap_data }, | ||
909 | { MAX8997_EN32KHZ_CP, &max8997_32khz_cp_data }, | ||
910 | |||
911 | { MAX8997_ENVICHG, &max8997_vichg_data }, | ||
912 | { MAX8997_ESAFEOUT1, &max8997_esafeout1_data }, | ||
913 | { MAX8997_ESAFEOUT2, &max8997_esafeout2_data }, | ||
914 | { MAX8997_CHARGER_CV, &max8997_charger_cv_data }, | ||
915 | { MAX8997_CHARGER, &max8997_charger_data }, | ||
916 | { MAX8997_CHARGER_TOPOFF, &max8997_charger_topoff_data }, | ||
917 | }; | ||
918 | |||
919 | static struct max8997_platform_data __initdata nuri_max8997_pdata = { | ||
920 | .wakeup = 1, | ||
921 | |||
922 | .num_regulators = ARRAY_SIZE(nuri_max8997_regulators), | ||
923 | .regulators = nuri_max8997_regulators, | ||
924 | |||
925 | .buck125_gpios = { EXYNOS4_GPX0(5), EXYNOS4_GPX0(6), EXYNOS4_GPL0(0) }, | ||
926 | .buck2_gpiodvs = true, | ||
927 | |||
928 | .buck1_voltage[0] = 1350000, /* 1.35V */ | ||
929 | .buck1_voltage[1] = 1300000, /* 1.3V */ | ||
930 | .buck1_voltage[2] = 1250000, /* 1.25V */ | ||
931 | .buck1_voltage[3] = 1200000, /* 1.2V */ | ||
932 | .buck1_voltage[4] = 1150000, /* 1.15V */ | ||
933 | .buck1_voltage[5] = 1100000, /* 1.1V */ | ||
934 | .buck1_voltage[6] = 1000000, /* 1.0V */ | ||
935 | .buck1_voltage[7] = 950000, /* 0.95V */ | ||
936 | |||
937 | .buck2_voltage[0] = 1100000, /* 1.1V */ | ||
938 | .buck2_voltage[1] = 1000000, /* 1.0V */ | ||
939 | .buck2_voltage[2] = 950000, /* 0.95V */ | ||
940 | .buck2_voltage[3] = 900000, /* 0.9V */ | ||
941 | .buck2_voltage[4] = 1100000, /* 1.1V */ | ||
942 | .buck2_voltage[5] = 1000000, /* 1.0V */ | ||
943 | .buck2_voltage[6] = 950000, /* 0.95V */ | ||
944 | .buck2_voltage[7] = 900000, /* 0.9V */ | ||
945 | |||
946 | .buck5_voltage[0] = 1200000, /* 1.2V */ | ||
947 | .buck5_voltage[1] = 1200000, /* 1.2V */ | ||
948 | .buck5_voltage[2] = 1200000, /* 1.2V */ | ||
949 | .buck5_voltage[3] = 1200000, /* 1.2V */ | ||
950 | .buck5_voltage[4] = 1200000, /* 1.2V */ | ||
951 | .buck5_voltage[5] = 1200000, /* 1.2V */ | ||
952 | .buck5_voltage[6] = 1200000, /* 1.2V */ | ||
953 | .buck5_voltage[7] = 1200000, /* 1.2V */ | ||
954 | }; | ||
955 | |||
347 | /* GPIO I2C 5 (PMIC) */ | 956 | /* GPIO I2C 5 (PMIC) */ |
957 | enum { I2C5_MAX8997 }; | ||
348 | static struct i2c_board_info i2c5_devs[] __initdata = { | 958 | static struct i2c_board_info i2c5_devs[] __initdata = { |
349 | /* max8997, To be updated */ | 959 | [I2C5_MAX8997] = { |
960 | I2C_BOARD_INFO("max8997", 0xCC >> 1), | ||
961 | .platform_data = &nuri_max8997_pdata, | ||
962 | }, | ||
963 | }; | ||
964 | |||
965 | static struct max17042_platform_data nuri_battery_platform_data = { | ||
966 | }; | ||
967 | |||
968 | /* GPIO I2C 9 (Fuel Gauge) */ | ||
969 | static struct i2c_gpio_platform_data i2c9_gpio_data = { | ||
970 | .sda_pin = EXYNOS4_GPY4(0), /* XM0ADDR_8 */ | ||
971 | .scl_pin = EXYNOS4_GPY4(1), /* XM0ADDR_9 */ | ||
972 | }; | ||
973 | static struct platform_device i2c9_gpio = { | ||
974 | .name = "i2c-gpio", | ||
975 | .id = 9, | ||
976 | .dev = { | ||
977 | .platform_data = &i2c9_gpio_data, | ||
978 | }, | ||
350 | }; | 979 | }; |
980 | enum { I2C9_MAX17042}; | ||
981 | static struct i2c_board_info i2c9_devs[] __initdata = { | ||
982 | [I2C9_MAX17042] = { | ||
983 | I2C_BOARD_INFO("max17042", 0x36), | ||
984 | .platform_data = &nuri_battery_platform_data, | ||
985 | }, | ||
986 | }; | ||
987 | |||
988 | /* MAX8903 Secondary Charger */ | ||
989 | static struct regulator_consumer_supply supplies_max8903[] = { | ||
990 | REGULATOR_SUPPLY("vinchg2", "charger-manager.0"), | ||
991 | }; | ||
992 | |||
993 | static struct regulator_init_data max8903_charger_en_data = { | ||
994 | .constraints = { | ||
995 | .name = "VOUT_CHARGER", | ||
996 | .valid_ops_mask = REGULATOR_CHANGE_STATUS, | ||
997 | .boot_on = 1, | ||
998 | }, | ||
999 | .num_consumer_supplies = ARRAY_SIZE(supplies_max8903), | ||
1000 | .consumer_supplies = supplies_max8903, | ||
1001 | }; | ||
1002 | |||
1003 | static struct fixed_voltage_config max8903_charger_en = { | ||
1004 | .supply_name = "VOUT_CHARGER", | ||
1005 | .microvolts = 5000000, /* Assume 5VDC */ | ||
1006 | .gpio = EXYNOS4_GPY4(5), /* TA_EN negaged */ | ||
1007 | .enable_high = 0, /* Enable = Low */ | ||
1008 | .enabled_at_boot = 1, | ||
1009 | .init_data = &max8903_charger_en_data, | ||
1010 | }; | ||
1011 | |||
1012 | static struct platform_device max8903_fixed_reg_dev = { | ||
1013 | .name = "reg-fixed-voltage", | ||
1014 | .id = FIXED_REG_ID_MAX8903, | ||
1015 | .dev = { .platform_data = &max8903_charger_en }, | ||
1016 | }; | ||
1017 | |||
1018 | static struct max8903_pdata nuri_max8903 = { | ||
1019 | /* | ||
1020 | * cen: don't control with the driver, let it be | ||
1021 | * controlled by regulator above | ||
1022 | */ | ||
1023 | .dok = EXYNOS4_GPX1(4), /* TA_nCONNECTED */ | ||
1024 | /* uok, usus: not connected */ | ||
1025 | .chg = EXYNOS4_GPE2(0), /* TA_nCHG */ | ||
1026 | /* flt: vcc_1.8V_pda */ | ||
1027 | .dcm = EXYNOS4_GPL0(1), /* CURR_ADJ */ | ||
1028 | |||
1029 | .dc_valid = true, | ||
1030 | .usb_valid = false, /* USB is not wired to MAX8903 */ | ||
1031 | }; | ||
1032 | |||
1033 | static struct platform_device nuri_max8903_device = { | ||
1034 | .name = "max8903-charger", | ||
1035 | .dev = { | ||
1036 | .platform_data = &nuri_max8903, | ||
1037 | }, | ||
1038 | }; | ||
1039 | |||
1040 | static struct device *nuri_cm_devices[] = { | ||
1041 | &s3c_device_i2c5.dev, | ||
1042 | &s3c_device_adc.dev, | ||
1043 | NULL, /* Reserved for UART */ | ||
1044 | NULL, | ||
1045 | }; | ||
1046 | |||
1047 | static void __init nuri_power_init(void) | ||
1048 | { | ||
1049 | int gpio; | ||
1050 | int irq_base = IRQ_GPIO_END + 1; | ||
1051 | int ta_en = 0; | ||
1052 | |||
1053 | nuri_max8997_pdata.irq_base = irq_base; | ||
1054 | irq_base += MAX8997_IRQ_NR; | ||
1055 | |||
1056 | gpio = EXYNOS4_GPX0(7); | ||
1057 | gpio_request(gpio, "AP_PMIC_IRQ"); | ||
1058 | s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(0xf)); | ||
1059 | s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE); | ||
1060 | |||
1061 | gpio = EXYNOS4_GPX2(3); | ||
1062 | gpio_request(gpio, "FUEL_ALERT"); | ||
1063 | s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(0xf)); | ||
1064 | s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE); | ||
1065 | |||
1066 | gpio = nuri_max8903.dok; | ||
1067 | gpio_request(gpio, "TA_nCONNECTED"); | ||
1068 | s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(0xf)); | ||
1069 | s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE); | ||
1070 | ta_en = gpio_get_value(gpio) ? 0 : 1; | ||
1071 | |||
1072 | gpio = nuri_max8903.chg; | ||
1073 | gpio_request(gpio, "TA_nCHG"); | ||
1074 | gpio_direction_input(gpio); | ||
1075 | |||
1076 | gpio = nuri_max8903.dcm; | ||
1077 | gpio_request(gpio, "CURR_ADJ"); | ||
1078 | gpio_direction_output(gpio, ta_en); | ||
1079 | } | ||
351 | 1080 | ||
352 | /* USB EHCI */ | 1081 | /* USB EHCI */ |
353 | static struct s5p_ehci_platdata nuri_ehci_pdata; | 1082 | static struct s5p_ehci_platdata nuri_ehci_pdata; |
@@ -361,6 +1090,7 @@ static void __init nuri_ehci_init(void) | |||
361 | 1090 | ||
362 | static struct platform_device *nuri_devices[] __initdata = { | 1091 | static struct platform_device *nuri_devices[] __initdata = { |
363 | /* Samsung Platform Devices */ | 1092 | /* Samsung Platform Devices */ |
1093 | &s3c_device_i2c5, /* PMIC should initialize first */ | ||
364 | &emmc_fixed_voltage, | 1094 | &emmc_fixed_voltage, |
365 | &s3c_device_hsmmc0, | 1095 | &s3c_device_hsmmc0, |
366 | &s3c_device_hsmmc2, | 1096 | &s3c_device_hsmmc2, |
@@ -369,11 +1099,20 @@ static struct platform_device *nuri_devices[] __initdata = { | |||
369 | &s3c_device_timer[0], | 1099 | &s3c_device_timer[0], |
370 | &s5p_device_ehci, | 1100 | &s5p_device_ehci, |
371 | &s3c_device_i2c3, | 1101 | &s3c_device_i2c3, |
1102 | &i2c9_gpio, | ||
1103 | &s3c_device_adc, | ||
1104 | &s3c_device_rtc, | ||
1105 | &s5p_device_mfc, | ||
1106 | &s5p_device_mfc_l, | ||
1107 | &s5p_device_mfc_r, | ||
1108 | &exynos4_device_pd[PD_MFC], | ||
372 | 1109 | ||
373 | /* NURI Devices */ | 1110 | /* NURI Devices */ |
374 | &nuri_gpio_keys, | 1111 | &nuri_gpio_keys, |
375 | &nuri_lcd_device, | 1112 | &nuri_lcd_device, |
376 | &nuri_backlight_device, | 1113 | &nuri_backlight_device, |
1114 | &max8903_fixed_reg_dev, | ||
1115 | &nuri_max8903_device, | ||
377 | }; | 1116 | }; |
378 | 1117 | ||
379 | static void __init nuri_map_io(void) | 1118 | static void __init nuri_map_io(void) |
@@ -383,21 +1122,32 @@ static void __init nuri_map_io(void) | |||
383 | s3c24xx_init_uarts(nuri_uartcfgs, ARRAY_SIZE(nuri_uartcfgs)); | 1122 | s3c24xx_init_uarts(nuri_uartcfgs, ARRAY_SIZE(nuri_uartcfgs)); |
384 | } | 1123 | } |
385 | 1124 | ||
1125 | static void __init nuri_reserve(void) | ||
1126 | { | ||
1127 | s5p_mfc_reserve_mem(0x43000000, 8 << 20, 0x51000000, 8 << 20); | ||
1128 | } | ||
1129 | |||
386 | static void __init nuri_machine_init(void) | 1130 | static void __init nuri_machine_init(void) |
387 | { | 1131 | { |
388 | nuri_sdhci_init(); | 1132 | nuri_sdhci_init(); |
389 | nuri_tsp_init(); | 1133 | nuri_tsp_init(); |
1134 | nuri_power_init(); | ||
390 | 1135 | ||
391 | i2c_register_board_info(1, i2c1_devs, ARRAY_SIZE(i2c1_devs)); | 1136 | i2c_register_board_info(1, i2c1_devs, ARRAY_SIZE(i2c1_devs)); |
392 | s3c_i2c3_set_platdata(&i2c3_data); | 1137 | s3c_i2c3_set_platdata(&i2c3_data); |
393 | i2c_register_board_info(3, i2c3_devs, ARRAY_SIZE(i2c3_devs)); | 1138 | i2c_register_board_info(3, i2c3_devs, ARRAY_SIZE(i2c3_devs)); |
1139 | s3c_i2c5_set_platdata(NULL); | ||
1140 | i2c5_devs[I2C5_MAX8997].irq = gpio_to_irq(EXYNOS4_GPX0(7)); | ||
394 | i2c_register_board_info(5, i2c5_devs, ARRAY_SIZE(i2c5_devs)); | 1141 | i2c_register_board_info(5, i2c5_devs, ARRAY_SIZE(i2c5_devs)); |
1142 | i2c9_devs[I2C9_MAX17042].irq = gpio_to_irq(EXYNOS4_GPX2(3)); | ||
1143 | i2c_register_board_info(9, i2c9_devs, ARRAY_SIZE(i2c9_devs)); | ||
395 | 1144 | ||
396 | nuri_ehci_init(); | 1145 | nuri_ehci_init(); |
397 | clk_xusbxti.rate = 24000000; | 1146 | clk_xusbxti.rate = 24000000; |
398 | 1147 | ||
399 | /* Last */ | 1148 | /* Last */ |
400 | platform_add_devices(nuri_devices, ARRAY_SIZE(nuri_devices)); | 1149 | platform_add_devices(nuri_devices, ARRAY_SIZE(nuri_devices)); |
1150 | s5p_device_mfc.dev.parent = &exynos4_device_pd[PD_MFC].dev; | ||
401 | } | 1151 | } |
402 | 1152 | ||
403 | MACHINE_START(NURI, "NURI") | 1153 | MACHINE_START(NURI, "NURI") |
@@ -407,4 +1157,5 @@ MACHINE_START(NURI, "NURI") | |||
407 | .map_io = nuri_map_io, | 1157 | .map_io = nuri_map_io, |
408 | .init_machine = nuri_machine_init, | 1158 | .init_machine = nuri_machine_init, |
409 | .timer = &exynos4_timer, | 1159 | .timer = &exynos4_timer, |
1160 | .reserve = &nuri_reserve, | ||
410 | MACHINE_END | 1161 | MACHINE_END |