regulator: axp20x: add drivevbus support for axp803
authorJagan Teki <jagan@amarulasolutions.com>
Mon, 23 Apr 2018 06:32:37 +0000 (12:02 +0530)
committerMark Brown <broonie@kernel.org>
Mon, 23 Apr 2018 14:46:12 +0000 (15:46 +0100)
Like axp221, axp223, axp813 the axp803 is also supporting external
regulator to drive the  OTG VBus through N_VBUSEN PMIC pin.

Add support for it.

Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Reviewed-by: Chen-Yu Tsai <wens@csie.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
Documentation/devicetree/bindings/mfd/axp20x.txt
drivers/regulator/axp20x-regulator.c

index 9455503b02993109cb0621519654eacadbc2f35a..d1762f3b30afab38a506adece568f146f91fecc4 100644 (file)
@@ -43,7 +43,7 @@ Optional properties:
                          regulator to drive the OTG VBus, rather then
                          as an input pin which signals whether the
                          board is driving OTG VBus or not.
-                         (axp221 / axp223 / axp813 only)
+                         (axp221 / axp223 / axp803/ axp813 only)
 
 - x-powers,master-mode: Boolean (axp806 only). Set this when the PMIC is
                        wired for master mode. The default is slave mode.
@@ -132,6 +132,7 @@ FLDO2               : LDO           : fldoin-supply         : shared supply
 LDO_IO0                : LDO           : ips-supply            : GPIO 0
 LDO_IO1                : LDO           : ips-supply            : GPIO 1
 RTC_LDO                : LDO           : ips-supply            : always on
+DRIVEVBUS      : Enable output : drivevbus-supply      : external regulator
 
 AXP806 regulators, type, and corresponding input supply names:
 
index 181622b2813d94a963031f31c246944a52c881fb..91b8ff8bac157de97e83974dcb4a2512ea3f0741 100644 (file)
@@ -721,6 +721,8 @@ static int axp20x_regulator_probe(struct platform_device *pdev)
        case AXP803_ID:
                regulators = axp803_regulators;
                nregulators = AXP803_REG_ID_MAX;
+               drivevbus = of_property_read_bool(pdev->dev.parent->of_node,
+                                                 "x-powers,drive-vbus-en");
                break;
        case AXP806_ID:
                regulators = axp806_regulators;