diff mbox

[v4,1/2] dt-bindings: usb: ehci: add optional external vbus supply property

Message ID 1519897899-8577-2-git-send-email-amelie.delaunay@st.com (mailing list archive)
State New, archived
Headers show

Commit Message

Amelie Delaunay March 1, 2018, 9:51 a.m. UTC
On some boards, especially when vbus supply requires large current,
and the charge pump on the PHY isn't enough, an external vbus power switch
per port may be used.
Add portN_vbus-supply property to usb-ehci bindings. As the number of ports
depends on the ehci controller, and the port on which an external vbus
supply depends on the platform, <portN> is used to make it generic.

Signed-off-by: Amelie Delaunay <amelie.delaunay@st.com>
---
 Documentation/devicetree/bindings/usb/usb-ehci.txt | 1 +
 1 file changed, 1 insertion(+)

Comments

Rob Herring March 6, 2018, 1:57 a.m. UTC | #1
On Thu, Mar 01, 2018 at 10:51:38AM +0100, Amelie Delaunay wrote:
> On some boards, especially when vbus supply requires large current,
> and the charge pump on the PHY isn't enough, an external vbus power switch
> per port may be used.
> Add portN_vbus-supply property to usb-ehci bindings. As the number of ports
> depends on the ehci controller, and the port on which an external vbus
> supply depends on the platform, <portN> is used to make it generic.
> 
> Signed-off-by: Amelie Delaunay <amelie.delaunay@st.com>
> ---
>  Documentation/devicetree/bindings/usb/usb-ehci.txt | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/Documentation/devicetree/bindings/usb/usb-ehci.txt b/Documentation/devicetree/bindings/usb/usb-ehci.txt
> index 3efde12..cd576db 100644
> --- a/Documentation/devicetree/bindings/usb/usb-ehci.txt
> +++ b/Documentation/devicetree/bindings/usb/usb-ehci.txt
> @@ -19,6 +19,7 @@ Optional properties:
>   - phys : phandle + phy specifier pair
>   - phy-names : "usb"
>   - resets : phandle + reset specifier pair
> + - portN_vbus-supply : phandle of regulator supplying vbus for port N

Just make this an array with the index being the port (and drop 
"portN_").

Rob
Robin Murphy March 6, 2018, 2:09 p.m. UTC | #2
On 06/03/18 01:57, Rob Herring wrote:
> On Thu, Mar 01, 2018 at 10:51:38AM +0100, Amelie Delaunay wrote:
>> On some boards, especially when vbus supply requires large current,
>> and the charge pump on the PHY isn't enough, an external vbus power switch
>> per port may be used.
>> Add portN_vbus-supply property to usb-ehci bindings. As the number of ports
>> depends on the ehci controller, and the port on which an external vbus
>> supply depends on the platform, <portN> is used to make it generic.
>>
>> Signed-off-by: Amelie Delaunay <amelie.delaunay@st.com>
>> ---
>>   Documentation/devicetree/bindings/usb/usb-ehci.txt | 1 +
>>   1 file changed, 1 insertion(+)
>>
>> diff --git a/Documentation/devicetree/bindings/usb/usb-ehci.txt b/Documentation/devicetree/bindings/usb/usb-ehci.txt
>> index 3efde12..cd576db 100644
>> --- a/Documentation/devicetree/bindings/usb/usb-ehci.txt
>> +++ b/Documentation/devicetree/bindings/usb/usb-ehci.txt
>> @@ -19,6 +19,7 @@ Optional properties:
>>    - phys : phandle + phy specifier pair
>>    - phy-names : "usb"
>>    - resets : phandle + reset specifier pair
>> + - portN_vbus-supply : phandle of regulator supplying vbus for port N
> 
> Just make this an array with the index being the port (and drop
> "portN_").

Does that still work if there is an external supply for port 1 but none 
for port 0? I believe that was brought up as a possibility before.

Robin.
Rob Herring March 6, 2018, 2:40 p.m. UTC | #3
On Tue, Mar 6, 2018 at 8:09 AM, Robin Murphy <robin.murphy@arm.com> wrote:
> On 06/03/18 01:57, Rob Herring wrote:
>>
>> On Thu, Mar 01, 2018 at 10:51:38AM +0100, Amelie Delaunay wrote:
>>>
>>> On some boards, especially when vbus supply requires large current,
>>> and the charge pump on the PHY isn't enough, an external vbus power
>>> switch
>>> per port may be used.
>>> Add portN_vbus-supply property to usb-ehci bindings. As the number of
>>> ports
>>> depends on the ehci controller, and the port on which an external vbus
>>> supply depends on the platform, <portN> is used to make it generic.
>>>
>>> Signed-off-by: Amelie Delaunay <amelie.delaunay@st.com>
>>> ---
>>>   Documentation/devicetree/bindings/usb/usb-ehci.txt | 1 +
>>>   1 file changed, 1 insertion(+)
>>>
>>> diff --git a/Documentation/devicetree/bindings/usb/usb-ehci.txt
>>> b/Documentation/devicetree/bindings/usb/usb-ehci.txt
>>> index 3efde12..cd576db 100644
>>> --- a/Documentation/devicetree/bindings/usb/usb-ehci.txt
>>> +++ b/Documentation/devicetree/bindings/usb/usb-ehci.txt
>>> @@ -19,6 +19,7 @@ Optional properties:
>>>    - phys : phandle + phy specifier pair
>>>    - phy-names : "usb"
>>>    - resets : phandle + reset specifier pair
>>> + - portN_vbus-supply : phandle of regulator supplying vbus for port N
>>
>>
>> Just make this an array with the index being the port (and drop
>> "portN_").
>
>
> Does that still work if there is an external supply for port 1 but none for
> port 0? I believe that was brought up as a possibility before.

Yes, if you use 0 or -1 to skip over an index.

Really, this should go in the connector node instead because Vbus is
supplied to the connector, not the host controller. The connector
binding is on its way into mainline.

Rob
Amelie Delaunay March 20, 2018, 9:10 a.m. UTC | #4
On 03/06/2018 03:40 PM, Rob Herring wrote:
> On Tue, Mar 6, 2018 at 8:09 AM, Robin Murphy <robin.murphy@arm.com> wrote:
>> On 06/03/18 01:57, Rob Herring wrote:
>>>
>>> On Thu, Mar 01, 2018 at 10:51:38AM +0100, Amelie Delaunay wrote:
>>>>
>>>> On some boards, especially when vbus supply requires large current,
>>>> and the charge pump on the PHY isn't enough, an external vbus power
>>>> switch
>>>> per port may be used.
>>>> Add portN_vbus-supply property to usb-ehci bindings. As the number of
>>>> ports
>>>> depends on the ehci controller, and the port on which an external vbus
>>>> supply depends on the platform, <portN> is used to make it generic.
>>>>
>>>> Signed-off-by: Amelie Delaunay <amelie.delaunay@st.com>
>>>> ---
>>>>    Documentation/devicetree/bindings/usb/usb-ehci.txt | 1 +
>>>>    1 file changed, 1 insertion(+)
>>>>
>>>> diff --git a/Documentation/devicetree/bindings/usb/usb-ehci.txt
>>>> b/Documentation/devicetree/bindings/usb/usb-ehci.txt
>>>> index 3efde12..cd576db 100644
>>>> --- a/Documentation/devicetree/bindings/usb/usb-ehci.txt
>>>> +++ b/Documentation/devicetree/bindings/usb/usb-ehci.txt
>>>> @@ -19,6 +19,7 @@ Optional properties:
>>>>     - phys : phandle + phy specifier pair
>>>>     - phy-names : "usb"
>>>>     - resets : phandle + reset specifier pair
>>>> + - portN_vbus-supply : phandle of regulator supplying vbus for port N
>>>
>>>
>>> Just make this an array with the index being the port (and drop
>>> "portN_").
>>
>>
>> Does that still work if there is an external supply for port 1 but none for
>> port 0? I believe that was brought up as a possibility before.
> 
> Yes, if you use 0 or -1 to skip over an index.
> 
> Really, this should go in the connector node instead because Vbus is
> supplied to the connector, not the host controller. The connector
> binding is on its way into mainline.
> 
> Rob
> 

Not sure to catch what you mean by "make this an array" because 
regulator framework imposes <name>-supply: phandle to the regulator node.

I may have missed something around regulator consumers management ?

Do you meant something like
vbus-supply = <&reg_port0 &reg_port1>;
or in case there is an external supply for port 1 but none for port 0
vbus-supply = <-1 &reg_port1>;
?
If yes, a new API is needed in regulator framework to get an array of 
regulators ?


Regards,
Amelie
diff mbox

Patch

diff --git a/Documentation/devicetree/bindings/usb/usb-ehci.txt b/Documentation/devicetree/bindings/usb/usb-ehci.txt
index 3efde12..cd576db 100644
--- a/Documentation/devicetree/bindings/usb/usb-ehci.txt
+++ b/Documentation/devicetree/bindings/usb/usb-ehci.txt
@@ -19,6 +19,7 @@  Optional properties:
  - phys : phandle + phy specifier pair
  - phy-names : "usb"
  - resets : phandle + reset specifier pair
+ - portN_vbus-supply : phandle of regulator supplying vbus for port N
 
 Example (Sequoia 440EPx):
     ehci@e0000300 {