diff mbox

[v1] usb: phy: nop: device tree documentation for vbus

Message ID 1415538138-24434-1-git-send-email-robert.jarzmik@free.fr
State Accepted, archived
Headers show

Commit Message

Robert Jarzmik Nov. 9, 2014, 1:02 p.m. UTC
Enhance the phy documentation by adding 2 new optional bindings :
 - the vbus gpio, which detects usb insertion
 - the vbus regulator, which provides current drawn from the usb cable

Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr>
---
 Documentation/devicetree/bindings/usb/usb-nop-xceiv.txt | 8 ++++++++
 1 file changed, 8 insertions(+)

Comments

Felipe Balbi Nov. 21, 2014, 3:45 p.m. UTC | #1
On Sun, Nov 09, 2014 at 02:02:18PM +0100, Robert Jarzmik wrote:
> Enhance the phy documentation by adding 2 new optional bindings :
>  - the vbus gpio, which detects usb insertion
>  - the vbus regulator, which provides current drawn from the usb cable
> 
> Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr>
> ---
>  Documentation/devicetree/bindings/usb/usb-nop-xceiv.txt | 8 ++++++++
>  1 file changed, 8 insertions(+)
> 
> diff --git a/Documentation/devicetree/bindings/usb/usb-nop-xceiv.txt b/Documentation/devicetree/bindings/usb/usb-nop-xceiv.txt
> index 1bd37fa..65dfe4b 100644
> --- a/Documentation/devicetree/bindings/usb/usb-nop-xceiv.txt
> +++ b/Documentation/devicetree/bindings/usb/usb-nop-xceiv.txt
> @@ -17,6 +17,11 @@ Optional properties:
>  
>  - reset-gpios: Should specify the GPIO for reset.
>  
> +- vbus-gpios: should specify the GPIO detecting a VBus insertion
> +              (see Documentation/devicetree/bindings/gpio/gpio.txt)
> +- vbus-regulator : should specifiy the regulator supplying current drawn from
> +  the VBus line (see Documentation/devicetree/bindings/regulator/regulator.txt).
> +
>  Example:
>  
>  	hsusb1_phy {
> @@ -26,8 +31,11 @@ Example:
>  		clock-names = "main_clk";
>  		vcc-supply = <&hsusb1_vcc_regulator>;
>  		reset-gpios = <&gpio1 7 GPIO_ACTIVE_LOW>;
> +		vbus-gpios = <&gpio2 13 GPIO_ACTIVE_HIGH>;
> +		vbus-regulator = <&vbus_regulator>;

not sure why you need vbus-gpios here. You can pass the gpio to the
regulator as enable-gpio, right ?
Robert Jarzmik Nov. 21, 2014, 5:17 p.m. UTC | #2
Felipe Balbi <balbi@ti.com> writes:

> On Sun, Nov 09, 2014 at 02:02:18PM +0100, Robert Jarzmik wrote:
>>  	hsusb1_phy {
>> @@ -26,8 +31,11 @@ Example:
>>  		clock-names = "main_clk";
>>  		vcc-supply = <&hsusb1_vcc_regulator>;
>>  		reset-gpios = <&gpio1 7 GPIO_ACTIVE_LOW>;
>> +		vbus-gpios = <&gpio2 13 GPIO_ACTIVE_HIGH>;
>> +		vbus-regulator = <&vbus_regulator>;
>
> not sure why you need vbus-gpios here. You can pass the gpio to the
> regulator as enable-gpio, right ?

Euh no. From my understanding a regulator enable-gpio is an _output_ gpio
enabling the regulator. This vbus-gpio is an _input_ gpio detecting the vbus
assertion. Maybe a name like "vbus-detect-gpio" would be more accurante ?

Cheers.
Felipe Balbi Nov. 21, 2014, 5:22 p.m. UTC | #3
On Fri, Nov 21, 2014 at 06:17:58PM +0100, Robert Jarzmik wrote:
> Felipe Balbi <balbi@ti.com> writes:
> 
> > On Sun, Nov 09, 2014 at 02:02:18PM +0100, Robert Jarzmik wrote:
> >>  	hsusb1_phy {
> >> @@ -26,8 +31,11 @@ Example:
> >>  		clock-names = "main_clk";
> >>  		vcc-supply = <&hsusb1_vcc_regulator>;
> >>  		reset-gpios = <&gpio1 7 GPIO_ACTIVE_LOW>;
> >> +		vbus-gpios = <&gpio2 13 GPIO_ACTIVE_HIGH>;
> >> +		vbus-regulator = <&vbus_regulator>;
> >
> > not sure why you need vbus-gpios here. You can pass the gpio to the
> > regulator as enable-gpio, right ?
> 
> Euh no. From my understanding a regulator enable-gpio is an _output_ gpio
> enabling the regulator. This vbus-gpio is an _input_ gpio detecting the vbus
> assertion. Maybe a name like "vbus-detect-gpio" would be more accurante ?

aha, that clears it up, yeah. So the GPIO is detecting if we have VBUS
from the host side while the regulator supplies VBUS ?
Robert Jarzmik Nov. 21, 2014, 5:49 p.m. UTC | #4
Felipe Balbi <balbi@ti.com> writes:

> On Fri, Nov 21, 2014 at 06:17:58PM +0100, Robert Jarzmik wrote:
>> Felipe Balbi <balbi@ti.com> writes:
>> 
>> > On Sun, Nov 09, 2014 at 02:02:18PM +0100, Robert Jarzmik wrote:
>> >>  	hsusb1_phy {
>> >> @@ -26,8 +31,11 @@ Example:
>> >>  		clock-names = "main_clk";
>> >>  		vcc-supply = <&hsusb1_vcc_regulator>;
>> >>  		reset-gpios = <&gpio1 7 GPIO_ACTIVE_LOW>;
>> >> +		vbus-gpios = <&gpio2 13 GPIO_ACTIVE_HIGH>;
>> >> +		vbus-regulator = <&vbus_regulator>;
>> >
>> > not sure why you need vbus-gpios here. You can pass the gpio to the
>> > regulator as enable-gpio, right ?
>> 
>> Euh no. From my understanding a regulator enable-gpio is an _output_ gpio
>> enabling the regulator. This vbus-gpio is an _input_ gpio detecting the vbus
>> assertion. Maybe a name like "vbus-detect-gpio" would be more accurante ?
>
> aha, that clears it up, yeah. So the GPIO is detecting if we have VBUS
> from the host side while the regulator supplies VBUS ?
Yup, exactly. I'll amend the name for v2.

Cheers.
Felipe Balbi Nov. 21, 2014, 6:03 p.m. UTC | #5
On Fri, Nov 21, 2014 at 06:49:47PM +0100, Robert Jarzmik wrote:
> Felipe Balbi <balbi@ti.com> writes:
> 
> > On Fri, Nov 21, 2014 at 06:17:58PM +0100, Robert Jarzmik wrote:
> >> Felipe Balbi <balbi@ti.com> writes:
> >> 
> >> > On Sun, Nov 09, 2014 at 02:02:18PM +0100, Robert Jarzmik wrote:
> >> >>  	hsusb1_phy {
> >> >> @@ -26,8 +31,11 @@ Example:
> >> >>  		clock-names = "main_clk";
> >> >>  		vcc-supply = <&hsusb1_vcc_regulator>;
> >> >>  		reset-gpios = <&gpio1 7 GPIO_ACTIVE_LOW>;
> >> >> +		vbus-gpios = <&gpio2 13 GPIO_ACTIVE_HIGH>;
> >> >> +		vbus-regulator = <&vbus_regulator>;
> >> >
> >> > not sure why you need vbus-gpios here. You can pass the gpio to the
> >> > regulator as enable-gpio, right ?
> >> 
> >> Euh no. From my understanding a regulator enable-gpio is an _output_ gpio
> >> enabling the regulator. This vbus-gpio is an _input_ gpio detecting the vbus
> >> assertion. Maybe a name like "vbus-detect-gpio" would be more accurante ?
> >
> > aha, that clears it up, yeah. So the GPIO is detecting if we have VBUS
> > from the host side while the regulator supplies VBUS ?
> Yup, exactly. I'll amend the name for v2.

Thank you
diff mbox

Patch

diff --git a/Documentation/devicetree/bindings/usb/usb-nop-xceiv.txt b/Documentation/devicetree/bindings/usb/usb-nop-xceiv.txt
index 1bd37fa..65dfe4b 100644
--- a/Documentation/devicetree/bindings/usb/usb-nop-xceiv.txt
+++ b/Documentation/devicetree/bindings/usb/usb-nop-xceiv.txt
@@ -17,6 +17,11 @@  Optional properties:
 
 - reset-gpios: Should specify the GPIO for reset.
 
+- vbus-gpios: should specify the GPIO detecting a VBus insertion
+              (see Documentation/devicetree/bindings/gpio/gpio.txt)
+- vbus-regulator : should specifiy the regulator supplying current drawn from
+  the VBus line (see Documentation/devicetree/bindings/regulator/regulator.txt).
+
 Example:
 
 	hsusb1_phy {
@@ -26,8 +31,11 @@  Example:
 		clock-names = "main_clk";
 		vcc-supply = <&hsusb1_vcc_regulator>;
 		reset-gpios = <&gpio1 7 GPIO_ACTIVE_LOW>;
+		vbus-gpios = <&gpio2 13 GPIO_ACTIVE_HIGH>;
+		vbus-regulator = <&vbus_regulator>;
 	};
 
 hsusb1_phy is a NOP USB PHY device that gets its clock from an oscillator
 and expects that clock to be configured to 19.2MHz by the NOP PHY driver.
 hsusb1_vcc_regulator provides power to the PHY and GPIO 7 controls RESET.
+GPIO 13 detects VBus insertion, and accordingly notifies the vbus-regulator.