Commit 9da66539281b5e15afc4a4739014c8923059d894
Committed by
Samuel Ortiz
1 parent
441a450554
Exists in
master
and in
7 other branches
mfd: Add twl6030 regulator subdevices
This patch adds initial support for creating twl6030 PMIC specific voltage regulators in the twl mfd driver. Board specific regulator configurations will have to be passed from respective board files. Signed-off-by: Rajendra Nayak <rnayak@ti.com> Signed-off-by: Balaji T K <balajitk@ti.com> Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Reviewed-by: Tony Lindgren <tony@atomide.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Showing 2 changed files with 60 additions and 7 deletions Side-by-side Diff
drivers/mfd/twl-core.c
... | ... | @@ -639,7 +639,7 @@ |
639 | 639 | return PTR_ERR(child); |
640 | 640 | } |
641 | 641 | |
642 | - if (twl_has_usb() && pdata->usb) { | |
642 | + if (twl_has_usb() && pdata->usb && twl_class_is_4030()) { | |
643 | 643 | |
644 | 644 | static struct regulator_consumer_supply usb1v5 = { |
645 | 645 | .supply = "usb1v5", |
... | ... | @@ -719,7 +719,8 @@ |
719 | 719 | return PTR_ERR(child); |
720 | 720 | } |
721 | 721 | |
722 | - if (twl_has_regulator()) { | |
722 | + /* twl4030 regulators */ | |
723 | + if (twl_has_regulator() && twl_class_is_4030()) { | |
723 | 724 | child = add_regulator(TWL4030_REG_VPLL1, pdata->vpll1); |
724 | 725 | if (IS_ERR(child)) |
725 | 726 | return PTR_ERR(child); |
... | ... | @@ -765,7 +766,8 @@ |
765 | 766 | } |
766 | 767 | |
767 | 768 | /* maybe add LDOs that are omitted on cost-reduced parts */ |
768 | - if (twl_has_regulator() && !(features & TPS_SUBSET)) { | |
769 | + if (twl_has_regulator() && !(features & TPS_SUBSET) | |
770 | + && twl_class_is_4030()) { | |
769 | 771 | child = add_regulator(TWL4030_REG_VPLL2, pdata->vpll2); |
770 | 772 | if (IS_ERR(child)) |
771 | 773 | return PTR_ERR(child); |
... | ... | @@ -787,6 +789,49 @@ |
787 | 789 | return PTR_ERR(child); |
788 | 790 | |
789 | 791 | child = add_regulator(TWL4030_REG_VAUX4, pdata->vaux4); |
792 | + if (IS_ERR(child)) | |
793 | + return PTR_ERR(child); | |
794 | + } | |
795 | + | |
796 | + /* twl6030 regulators */ | |
797 | + if (twl_has_regulator() && twl_class_is_6030()) { | |
798 | + child = add_regulator(TWL6030_REG_VMMC, pdata->vmmc); | |
799 | + if (IS_ERR(child)) | |
800 | + return PTR_ERR(child); | |
801 | + | |
802 | + child = add_regulator(TWL6030_REG_VPP, pdata->vpp); | |
803 | + if (IS_ERR(child)) | |
804 | + return PTR_ERR(child); | |
805 | + | |
806 | + child = add_regulator(TWL6030_REG_VUSIM, pdata->vusim); | |
807 | + if (IS_ERR(child)) | |
808 | + return PTR_ERR(child); | |
809 | + | |
810 | + child = add_regulator(TWL6030_REG_VANA, pdata->vana); | |
811 | + if (IS_ERR(child)) | |
812 | + return PTR_ERR(child); | |
813 | + | |
814 | + child = add_regulator(TWL6030_REG_VCXIO, pdata->vcxio); | |
815 | + if (IS_ERR(child)) | |
816 | + return PTR_ERR(child); | |
817 | + | |
818 | + child = add_regulator(TWL6030_REG_VDAC, pdata->vdac); | |
819 | + if (IS_ERR(child)) | |
820 | + return PTR_ERR(child); | |
821 | + | |
822 | + child = add_regulator(TWL6030_REG_VUSB, pdata->vusb); | |
823 | + if (IS_ERR(child)) | |
824 | + return PTR_ERR(child); | |
825 | + | |
826 | + child = add_regulator(TWL6030_REG_VAUX1_6030, pdata->vaux1); | |
827 | + if (IS_ERR(child)) | |
828 | + return PTR_ERR(child); | |
829 | + | |
830 | + child = add_regulator(TWL6030_REG_VAUX2_6030, pdata->vaux2); | |
831 | + if (IS_ERR(child)) | |
832 | + return PTR_ERR(child); | |
833 | + | |
834 | + child = add_regulator(TWL6030_REG_VAUX3_6030, pdata->vaux3); | |
790 | 835 | if (IS_ERR(child)) |
791 | 836 | return PTR_ERR(child); |
792 | 837 | } |
include/linux/i2c/twl.h
... | ... | @@ -560,16 +560,17 @@ |
560 | 560 | struct twl4030_power_data *power; |
561 | 561 | struct twl4030_codec_data *codec; |
562 | 562 | |
563 | - /* LDO regulators */ | |
563 | + /* Common LDO regulators for TWL4030/TWL6030 */ | |
564 | 564 | struct regulator_init_data *vdac; |
565 | + struct regulator_init_data *vaux1; | |
566 | + struct regulator_init_data *vaux2; | |
567 | + struct regulator_init_data *vaux3; | |
568 | + /* TWL4030 LDO regulators */ | |
565 | 569 | struct regulator_init_data *vpll1; |
566 | 570 | struct regulator_init_data *vpll2; |
567 | 571 | struct regulator_init_data *vmmc1; |
568 | 572 | struct regulator_init_data *vmmc2; |
569 | 573 | struct regulator_init_data *vsim; |
570 | - struct regulator_init_data *vaux1; | |
571 | - struct regulator_init_data *vaux2; | |
572 | - struct regulator_init_data *vaux3; | |
573 | 574 | struct regulator_init_data *vaux4; |
574 | 575 | struct regulator_init_data *vio; |
575 | 576 | struct regulator_init_data *vdd1; |
... | ... | @@ -577,6 +578,13 @@ |
577 | 578 | struct regulator_init_data *vintana1; |
578 | 579 | struct regulator_init_data *vintana2; |
579 | 580 | struct regulator_init_data *vintdig; |
581 | + /* TWL6030 LDO regulators */ | |
582 | + struct regulator_init_data *vmmc; | |
583 | + struct regulator_init_data *vpp; | |
584 | + struct regulator_init_data *vusim; | |
585 | + struct regulator_init_data *vana; | |
586 | + struct regulator_init_data *vcxio; | |
587 | + struct regulator_init_data *vusb; | |
580 | 588 | }; |
581 | 589 | |
582 | 590 | /*----------------------------------------------------------------------*/ |