diff mbox

[3/6] ARM: sun8i: r40: add 5V regulator for Banana Pi M2 Ultra

Message ID 20171008042906.46779-4-icenowy@aosc.io (mailing list archive)
State New, archived
Headers show

Commit Message

Icenowy Zheng Oct. 8, 2017, 4:29 a.m. UTC
On newer revisions of the Banana Pi M2 Ultra boards, the 5V power output
(used by HDMI, SATA and USB) is controller via a GPIO.

Add the regulator node for it.

Older revisions just have the 5V power output always on, and the GPIO is
reserved on these boards. So it won't affect the older revisions.

Signed-off-by: Icenowy Zheng <icenowy@aosc.io>
---
 arch/arm/boot/dts/sun8i-r40-bananapi-m2-ultra.dts | 9 +++++++++
 1 file changed, 9 insertions(+)

Comments

Maxime Ripard Oct. 9, 2017, 9:04 p.m. UTC | #1
On Sun, Oct 08, 2017 at 04:29:03AM +0000, Icenowy Zheng wrote:
> On newer revisions of the Banana Pi M2 Ultra boards, the 5V power output
> (used by HDMI, SATA and USB) is controller via a GPIO.
> 
> Add the regulator node for it.
> 
> Older revisions just have the 5V power output always on, and the GPIO is
> reserved on these boards. So it won't affect the older revisions.
> 
> Signed-off-by: Icenowy Zheng <icenowy@aosc.io>
> ---
>  arch/arm/boot/dts/sun8i-r40-bananapi-m2-ultra.dts | 9 +++++++++
>  1 file changed, 9 insertions(+)
> 
> diff --git a/arch/arm/boot/dts/sun8i-r40-bananapi-m2-ultra.dts b/arch/arm/boot/dts/sun8i-r40-bananapi-m2-ultra.dts
> index 7b52608cebe6..035599d870b9 100644
> --- a/arch/arm/boot/dts/sun8i-r40-bananapi-m2-ultra.dts
> +++ b/arch/arm/boot/dts/sun8i-r40-bananapi-m2-ultra.dts
> @@ -78,6 +78,15 @@
>  		};
>  	};
>  
> +	reg_vcc5v0: vcc5v0 {
> +		compatible = "regulator-fixed";
> +		regulator-name = "vcc5v0";
> +		regulator-min-microvolt = <5000000>;
> +		regulator-max-microvolt = <5000000>;
> +		gpio = <&pio 7 23 GPIO_ACTIVE_HIGH>; /* PH23 */
> +		enable-active-high;

This is redundant with the GPIO flag

Maxime
Icenowy Zheng Oct. 9, 2017, 11:25 p.m. UTC | #2
于 2017年10月10日 GMT+08:00 上午5:04:07, Maxime Ripard <maxime.ripard@free-electrons.com> 写到:
>On Sun, Oct 08, 2017 at 04:29:03AM +0000, Icenowy Zheng wrote:
>> On newer revisions of the Banana Pi M2 Ultra boards, the 5V power
>output
>> (used by HDMI, SATA and USB) is controller via a GPIO.
>> 
>> Add the regulator node for it.
>> 
>> Older revisions just have the 5V power output always on, and the GPIO
>is
>> reserved on these boards. So it won't affect the older revisions.
>> 
>> Signed-off-by: Icenowy Zheng <icenowy@aosc.io>
>> ---
>>  arch/arm/boot/dts/sun8i-r40-bananapi-m2-ultra.dts | 9 +++++++++
>>  1 file changed, 9 insertions(+)
>> 
>> diff --git a/arch/arm/boot/dts/sun8i-r40-bananapi-m2-ultra.dts
>b/arch/arm/boot/dts/sun8i-r40-bananapi-m2-ultra.dts
>> index 7b52608cebe6..035599d870b9 100644
>> --- a/arch/arm/boot/dts/sun8i-r40-bananapi-m2-ultra.dts
>> +++ b/arch/arm/boot/dts/sun8i-r40-bananapi-m2-ultra.dts
>> @@ -78,6 +78,15 @@
>>  		};
>>  	};
>>  
>> +	reg_vcc5v0: vcc5v0 {
>> +		compatible = "regulator-fixed";
>> +		regulator-name = "vcc5v0";
>> +		regulator-min-microvolt = <5000000>;
>> +		regulator-max-microvolt = <5000000>;
>> +		gpio = <&pio 7 23 GPIO_ACTIVE_HIGH>; /* PH23 */
>> +		enable-active-high;
>
>This is redundant with the GPIO flag

I remember someone suggested me to add this
property (maybe wens). It's said that the driver may not
process the GPIO_ACTIVE_HIGH correctly.

>
>Maxime
Chen-Yu Tsai Oct. 10, 2017, 2:25 a.m. UTC | #3
On Tue, Oct 10, 2017 at 7:25 AM, Icenowy Zheng <icenowy@aosc.io> wrote:
>
>
> 于 2017年10月10日 GMT+08:00 上午5:04:07, Maxime Ripard <maxime.ripard@free-electrons.com> 写到:
>>On Sun, Oct 08, 2017 at 04:29:03AM +0000, Icenowy Zheng wrote:
>>> On newer revisions of the Banana Pi M2 Ultra boards, the 5V power
>>output
>>> (used by HDMI, SATA and USB) is controller via a GPIO.
>>>
>>> Add the regulator node for it.
>>>
>>> Older revisions just have the 5V power output always on, and the GPIO
>>is
>>> reserved on these boards. So it won't affect the older revisions.
>>>
>>> Signed-off-by: Icenowy Zheng <icenowy@aosc.io>
>>> ---
>>>  arch/arm/boot/dts/sun8i-r40-bananapi-m2-ultra.dts | 9 +++++++++
>>>  1 file changed, 9 insertions(+)
>>>
>>> diff --git a/arch/arm/boot/dts/sun8i-r40-bananapi-m2-ultra.dts
>>b/arch/arm/boot/dts/sun8i-r40-bananapi-m2-ultra.dts
>>> index 7b52608cebe6..035599d870b9 100644
>>> --- a/arch/arm/boot/dts/sun8i-r40-bananapi-m2-ultra.dts
>>> +++ b/arch/arm/boot/dts/sun8i-r40-bananapi-m2-ultra.dts
>>> @@ -78,6 +78,15 @@
>>>              };
>>>      };
>>>
>>> +    reg_vcc5v0: vcc5v0 {
>>> +            compatible = "regulator-fixed";
>>> +            regulator-name = "vcc5v0";
>>> +            regulator-min-microvolt = <5000000>;
>>> +            regulator-max-microvolt = <5000000>;
>>> +            gpio = <&pio 7 23 GPIO_ACTIVE_HIGH>; /* PH23 */
>>> +            enable-active-high;
>>
>>This is redundant with the GPIO flag
>
> I remember someone suggested me to add this
> property (maybe wens). It's said that the driver may not
> process the GPIO_ACTIVE_HIGH correctly.

I believe it was me. The fixed regulator driver has not migrated to
the GPIO descriptor API, and it doesn't look like it cares about the
GPIO flags.

ChenYu
Maxime Ripard Oct. 10, 2017, 9:39 a.m. UTC | #4
On Tue, Oct 10, 2017 at 02:25:35AM +0000, Chen-Yu Tsai wrote:
> On Tue, Oct 10, 2017 at 7:25 AM, Icenowy Zheng <icenowy@aosc.io> wrote:
> >
> >
> > 于 2017年10月10日 GMT+08:00 上午5:04:07, Maxime Ripard <maxime.ripard@free-electrons.com> 写到:
> >>On Sun, Oct 08, 2017 at 04:29:03AM +0000, Icenowy Zheng wrote:
> >>> On newer revisions of the Banana Pi M2 Ultra boards, the 5V power
> >>output
> >>> (used by HDMI, SATA and USB) is controller via a GPIO.
> >>>
> >>> Add the regulator node for it.
> >>>
> >>> Older revisions just have the 5V power output always on, and the GPIO
> >>is
> >>> reserved on these boards. So it won't affect the older revisions.
> >>>
> >>> Signed-off-by: Icenowy Zheng <icenowy@aosc.io>
> >>> ---
> >>>  arch/arm/boot/dts/sun8i-r40-bananapi-m2-ultra.dts | 9 +++++++++
> >>>  1 file changed, 9 insertions(+)
> >>>
> >>> diff --git a/arch/arm/boot/dts/sun8i-r40-bananapi-m2-ultra.dts
> >>b/arch/arm/boot/dts/sun8i-r40-bananapi-m2-ultra.dts
> >>> index 7b52608cebe6..035599d870b9 100644
> >>> --- a/arch/arm/boot/dts/sun8i-r40-bananapi-m2-ultra.dts
> >>> +++ b/arch/arm/boot/dts/sun8i-r40-bananapi-m2-ultra.dts
> >>> @@ -78,6 +78,15 @@
> >>>              };
> >>>      };
> >>>
> >>> +    reg_vcc5v0: vcc5v0 {
> >>> +            compatible = "regulator-fixed";
> >>> +            regulator-name = "vcc5v0";
> >>> +            regulator-min-microvolt = <5000000>;
> >>> +            regulator-max-microvolt = <5000000>;
> >>> +            gpio = <&pio 7 23 GPIO_ACTIVE_HIGH>; /* PH23 */
> >>> +            enable-active-high;
> >>
> >>This is redundant with the GPIO flag
> >
> > I remember someone suggested me to add this
> > property (maybe wens). It's said that the driver may not
> > process the GPIO_ACTIVE_HIGH correctly.
> 
> I believe it was me. The fixed regulator driver has not migrated to
> the GPIO descriptor API, and it doesn't look like it cares about the
> GPIO flags.

Maybe we should just migrate it then?

Maxime
diff mbox

Patch

diff --git a/arch/arm/boot/dts/sun8i-r40-bananapi-m2-ultra.dts b/arch/arm/boot/dts/sun8i-r40-bananapi-m2-ultra.dts
index 7b52608cebe6..035599d870b9 100644
--- a/arch/arm/boot/dts/sun8i-r40-bananapi-m2-ultra.dts
+++ b/arch/arm/boot/dts/sun8i-r40-bananapi-m2-ultra.dts
@@ -78,6 +78,15 @@ 
 		};
 	};
 
+	reg_vcc5v0: vcc5v0 {
+		compatible = "regulator-fixed";
+		regulator-name = "vcc5v0";
+		regulator-min-microvolt = <5000000>;
+		regulator-max-microvolt = <5000000>;
+		gpio = <&pio 7 23 GPIO_ACTIVE_HIGH>; /* PH23 */
+		enable-active-high;
+	};
+
 	wifi_pwrseq: wifi_pwrseq {
 		compatible = "mmc-pwrseq-simple";
 		reset-gpios = <&pio 6 10 GPIO_ACTIVE_LOW>; /* PG10 WIFI_EN */