diff mbox series

[v2,1/3] regulator: axp20x: add drivevbus support for axp803

Message ID 1512673460-7865-1-git-send-email-jagan@amarulasolutions.com
State Not Applicable, archived
Headers show
Series [v2,1/3] regulator: axp20x: add drivevbus support for axp803 | expand

Commit Message

Jagan Teki Dec. 7, 2017, 7:04 p.m. UTC
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>
---
Changes for v2:
- New patch

 Documentation/devicetree/bindings/mfd/axp20x.txt | 2 +-
 drivers/regulator/axp20x-regulator.c             | 2 ++
 2 files changed, 3 insertions(+), 1 deletion(-)

Comments

Rob Herring (Arm) Dec. 7, 2017, 11:46 p.m. UTC | #1
On Fri, Dec 08, 2017 at 12:34:18AM +0530, Jagan Teki wrote:
> 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>
> ---
> Changes for v2:
> - New patch
> 
>  Documentation/devicetree/bindings/mfd/axp20x.txt | 2 +-
>  drivers/regulator/axp20x-regulator.c             | 2 ++
>  2 files changed, 3 insertions(+), 1 deletion(-)

Reviewed-by: Rob Herring <robh@kernel.org>
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Chen-Yu Tsai Dec. 8, 2017, 2:18 a.m. UTC | #2
On Fri, Dec 8, 2017 at 3:04 AM, Jagan Teki <jagannadh.teki@gmail.com> wrote:
> 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>
> ---
> Changes for v2:
> - New patch
>
>  Documentation/devicetree/bindings/mfd/axp20x.txt | 2 +-
>  drivers/regulator/axp20x-regulator.c             | 2 ++
>  2 files changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/Documentation/devicetree/bindings/mfd/axp20x.txt b/Documentation/devicetree/bindings/mfd/axp20x.txt
> index 9455503..34f24a2 100644
> --- a/Documentation/devicetree/bindings/mfd/axp20x.txt
> +++ b/Documentation/devicetree/bindings/mfd/axp20x.txt
> @@ -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)

There is also a table of regulators in that file. Please update it.

ChenYu

>
>  - x-powers,master-mode: Boolean (axp806 only). Set this when the PMIC is
>                         wired for master mode. The default is slave mode.
> diff --git a/drivers/regulator/axp20x-regulator.c b/drivers/regulator/axp20x-regulator.c
> index 181622b..91b8ff8 100644
> --- a/drivers/regulator/axp20x-regulator.c
> +++ b/drivers/regulator/axp20x-regulator.c
> @@ -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;
> --
> 2.7.4
>
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Chen-Yu Tsai Dec. 8, 2017, 2:52 a.m. UTC | #3
On Fri, Dec 8, 2017 at 3:04 AM, Jagan Teki <jagannadh.teki@gmail.com> wrote:
> Add reg_drivevbus regualtor for boards which are using
> external regulator to drive the OTG VBus through N_VBUSEN
> PMIC pin.
>
> Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
> ---
> Changes for v2:
> - New patch
>
>  arch/arm64/boot/dts/allwinner/axp803.dtsi | 5 +++++
>  1 file changed, 5 insertions(+)
>
> diff --git a/arch/arm64/boot/dts/allwinner/axp803.dtsi b/arch/arm64/boot/dts/allwinner/axp803.dtsi
> index ff8af52..e5eae8b 100644
> --- a/arch/arm64/boot/dts/allwinner/axp803.dtsi
> +++ b/arch/arm64/boot/dts/allwinner/axp803.dtsi
> @@ -146,5 +146,10 @@
>                         regulator-max-microvolt = <3000000>;
>                         regulator-name = "rtc-ldo";
>                 };
> +
> +               reg_drivevbus: drivevbus {

Could you keep the nodes in alphabetical order please?

Thanks
ChenYu

> +                       regulator-name = "drivevbus";
> +                       status = "disabled";
> +               };
>         };
>  };
> --
> 2.7.4
>
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Jagan Teki Dec. 8, 2017, 5:32 a.m. UTC | #4
On Fri, Dec 8, 2017 at 8:22 AM, Chen-Yu Tsai <wens@csie.org> wrote:
> On Fri, Dec 8, 2017 at 3:04 AM, Jagan Teki <jagannadh.teki@gmail.com> wrote:
>> Add reg_drivevbus regualtor for boards which are using
>> external regulator to drive the OTG VBus through N_VBUSEN
>> PMIC pin.
>>
>> Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
>> ---
>> Changes for v2:
>> - New patch
>>
>>  arch/arm64/boot/dts/allwinner/axp803.dtsi | 5 +++++
>>  1 file changed, 5 insertions(+)
>>
>> diff --git a/arch/arm64/boot/dts/allwinner/axp803.dtsi b/arch/arm64/boot/dts/allwinner/axp803.dtsi
>> index ff8af52..e5eae8b 100644
>> --- a/arch/arm64/boot/dts/allwinner/axp803.dtsi
>> +++ b/arch/arm64/boot/dts/allwinner/axp803.dtsi
>> @@ -146,5 +146,10 @@
>>                         regulator-max-microvolt = <3000000>;
>>                         regulator-name = "rtc-ldo";
>>                 };
>> +
>> +               reg_drivevbus: drivevbus {
>
> Could you keep the nodes in alphabetical order please?

thought the same, but this seems to be different regulator from above
AXP_DESC regulators and even binding documentation follow this order.

thanks!
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/mfd/axp20x.txt b/Documentation/devicetree/bindings/mfd/axp20x.txt
index 9455503..34f24a2 100644
--- a/Documentation/devicetree/bindings/mfd/axp20x.txt
+++ b/Documentation/devicetree/bindings/mfd/axp20x.txt
@@ -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.
diff --git a/drivers/regulator/axp20x-regulator.c b/drivers/regulator/axp20x-regulator.c
index 181622b..91b8ff8 100644
--- a/drivers/regulator/axp20x-regulator.c
+++ b/drivers/regulator/axp20x-regulator.c
@@ -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;