Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1736929

Re: [PATCH 8/9 v2] usb: usb251xb: Add max power/current dts property support

From Serge Semin <fancer.lancer@gmail.com>
Newsgroups linux.kernel
Subject Re: [PATCH 8/9 v2] usb: usb251xb: Add max power/current dts property support
Date 2017-09-21 19:20 +0200
Message-ID <usdiQ-3Se-65@gated-at.bofh.it> (permalink)
References (1 earlier) <uqiPD-kz-3@gated-at.bofh.it> <uqiPD-kz-15@gated-at.bofh.it> <urUg9-855-13@gated-at.bofh.it> <urUJb-8w7-7@gated-at.bofh.it> <uscwp-3m1-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Thu, Sep 21, 2017 at 11:26:04AM -0500, Rob Herring <robh@kernel.org> wrote:
> On Wed, Sep 20, 2017 at 4:27 PM, Serge Semin <fancer.lancer@gmail.com> wrote:
> > On Wed, Sep 20, 2017 at 03:52:55PM -0500, Rob Herring <robh@kernel.org> wrote:
> >> On Sat, Sep 16, 2017 at 01:42:19PM +0300, Serge Semin wrote:
> >> > This parameters may be varied in accordance with hardware specifics.
> >> > So lets add the corresponding settings to the usb251x driver dts
> >> > specification.
> >> >
> >> > Signed-off-by: Serge Semin <fancer.lancer@gmail.com>
> >> > ---
> >> >  Documentation/devicetree/bindings/usb/usb251xb.txt   |  6 ++++++
> >> >  drivers/usb/misc/usb251xb.c                          | 20 ++++++++++++++++----
> >> >  2 files changed, 22 insertions(+), 4 deletions(-)
> >> >
> >> > diff --git a/Documentation/devicetree/bindings/usb/usb251xb.txt b/Documentation/devicetree/bindings/usb/usb251xb.txt
> >> > index 3d84626d3..dd59a32e7 100644
> >> > --- a/Documentation/devicetree/bindings/usb/usb251xb.txt
> >> > +++ b/Documentation/devicetree/bindings/usb/usb251xb.txt
> >> > @@ -44,6 +44,12 @@ Optional properties :
> >> >     device connected.
> >> >   - sp-disabled-ports : Specifies the ports which will be self-power disabled
> >> >   - bp-disabled-ports : Specifies the ports which will be bus-power disabled
> >> > + - sp-max-{power,current} : Indicates the power/current consumed by hub from
> >> > +   an upstream port (VBUS) when operation as a self-powered hub. The value
> >> > +   is given in mA in a 0 - 100 range (default is 1mA).
> >> > + - bp-max-{power,current} : Indicates the power/current consumed by hub from
> >> > +   an upstream port (VBUS) when operation as a bus-powered hub. The value
> >> > +   is given in mA in a 0 - 510 range (default is 100mA).
> >>
> >> These need units as defined in property-units.txt.
> >>
> >
> > Ok.
> >
> >> Why do you need power and current? Can't you calculate power?
> >>
> >
> > These are different parameters of the device. They got different configuration
> > registers and descriptions:
> > max_power* - ... This value also includes the power consumption of a
> > permanently attached peripheral if the hub is configured as a compound
> > device, and the embedded peripheral reports 0mA in its descriptors.
> > max_current* - ... This value does NOT include the power consumption of a
> > permanently attached peripheral if the hub is configured as a compound
> > device.
> 
> Then the names here should somehow reflect the above. Perhaps
> "composite-current" and "hub-current" or something like that.
> 

I left the naming in accordance with the device datasheet. I thought it would be
better since the driver user would still need to consult with the device
documentation to properly set them. I don't really get how the difference is reflected
with the naming declared there though. So what naming would you prefer then? Might be
something like:
{sp,bp}-max-total-current - for so named {sp,bp}-max-power, since it includes all the
permanently attached peripherals.
{sp,bp}-max-removable-current - for so named {sp,bp}-max-current, since it doesn't
include the permanently attached peripherals.

Or is it better to leave it in compliance with the documentation naming?

> >
> > Additionally as you can see, they both are measured in "mA", so it isn't
> > a real physical power.
> 
> Well, I can't because there's no units.
> 

What this line means then?
- sp-max-{power,current} : ... The value is given in mA in a 0 - 100 range (default is 1mA).
- bp-max-{power,current} : ... The value is given in mA in a 0 - 510 range (default is 100mA).

Maybe I don't know something and the description line should state the units somehow
clearer?

> Rob

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 0/5] usb: usb251xb: Add USB2517i hub support and fix some bugs Serge Semin <fancer.lancer@gmail.com> - 2017-09-16 01:40 +0200
  [PATCH 3/5] usb: usb251xb: Add max power/current dts nodes Serge Semin <fancer.lancer@gmail.com> - 2017-09-16 01:40 +0200
  [PATCH 1/5] usb: usb251xb: Add USB2517/i hub support Serge Semin <fancer.lancer@gmail.com> - 2017-09-16 01:40 +0200
    Re: [PATCH 1/5] usb: usb251xb: Add USB2517/i hub support Greg KH <gregkh@linuxfoundation.org> - 2017-09-16 01:50 +0200
      Re: [PATCH 1/5] usb: usb251xb: Add USB2517/i hub support Serge Semin <fancer.lancer@gmail.com> - 2017-09-16 02:00 +0200
    Re: [PATCH 1/5] usb: usb251xb: Add USB2517/i hub support Rob Herring <robh@kernel.org> - 2017-09-20 23:10 +0200
      Re: [PATCH 1/5] usb: usb251xb: Add USB2517/i hub support Serge Semin <fancer.lancer@gmail.com> - 2017-09-20 23:20 +0200
        Re: [PATCH 1/5] usb: usb251xb: Add USB2517/i hub support Rob Herring <robh@kernel.org> - 2017-09-21 19:00 +0200
          Re: [PATCH 1/5] usb: usb251xb: Add USB2517/i hub support Serge Semin <fancer.lancer@gmail.com> - 2017-09-21 19:50 +0200
  [PATCH 4/5] usb: usb251xb: Use GPIO descriptor consumer interface Serge Semin <fancer.lancer@gmail.com> - 2017-09-16 01:40 +0200
  [PATCH 5/5] usb: usb251xb: Add copyrights Serge Semin <fancer.lancer@gmail.com> - 2017-09-16 01:40 +0200
    Re: [PATCH 5/5] usb: usb251xb: Add copyrights Serge Semin <fancer.lancer@gmail.com> - 2017-09-16 01:50 +0200
      Re: [PATCH 5/5] usb: usb251xb: Add copyrights Greg KH <gregkh@linuxfoundation.org> - 2017-09-16 02:00 +0200
        Re: [PATCH 5/5] usb: usb251xb: Add copyrights Serge Semin <fancer.lancer@gmail.com> - 2017-09-16 02:20 +0200
    Re: [PATCH 5/5] usb: usb251xb: Add copyrights Greg KH <gregkh@linuxfoundation.org> - 2017-09-16 01:50 +0200
    Re: [PATCH 5/5] usb: usb251xb: Add copyrights Greg KH <gregkh@linuxfoundation.org> - 2017-09-16 01:50 +0200
  [PATCH 2/5] usb: usb251xb: Fix property_u32 NULL pointer dereference Serge Semin <fancer.lancer@gmail.com> - 2017-09-16 01:40 +0200
  [PATCH 7/9 v2] usb: usb251xb: Fix property_u32 NULL pointer dereference Serge Semin <fancer.lancer@gmail.com> - 2017-09-16 12:50 +0200
  [PATCH 4/9 v2] usb: usb251xb: Add 5,6,7 ports boost settings Serge Semin <fancer.lancer@gmail.com> - 2017-09-16 12:50 +0200
  [PATCH 3/9 v2] usb: usb251xb: Add 5,6,7 ports mapping def setting Serge Semin <fancer.lancer@gmail.com> - 2017-09-16 12:50 +0200
  [PATCH 9/9 v2] usb: usb251xb: Use GPIO descriptor consumer interface Serge Semin <fancer.lancer@gmail.com> - 2017-09-16 12:50 +0200
    Re: [PATCH 9/9 v2] usb: usb251xb: Use GPIO descriptor consumer  interface Rob Herring <robh@kernel.org> - 2017-09-20 23:00 +0200
      Re: [PATCH 9/9 v2] usb: usb251xb: Use GPIO descriptor consumer  interface Serge Semin <fancer.lancer@gmail.com> - 2017-09-20 23:30 +0200
    Re: [PATCH 9/9 v2] usb: usb251xb: Use GPIO descriptor consumer  interface Greg KH <gregkh@linuxfoundation.org> - 2017-09-21 10:30 +0200
      Re: [PATCH 9/9 v2] usb: usb251xb: Use GPIO descriptor consumer  interface Serge Semin <fancer.lancer@gmail.com> - 2017-09-21 17:00 +0200
        Re: [PATCH 9/9 v2] usb: usb251xb: Use GPIO descriptor consumer  interface Greg KH <gregkh@linuxfoundation.org> - 2017-09-21 17:10 +0200
          Re: [PATCH 9/9 v2] usb: usb251xb: Use GPIO descriptor consumer  interface Serge Semin <fancer.lancer@gmail.com> - 2017-09-22 17:30 +0200
            Re: [PATCH 9/9 v2] usb: usb251xb: Use GPIO descriptor consumer  interface Greg KH <gregkh@linuxfoundation.org> - 2017-09-22 18:10 +0200
  [PATCH 5/9 v2] usb: usb251xb: Add battery enable setting flag Serge Semin <fancer.lancer@gmail.com> - 2017-09-16 12:50 +0200
  [PATCH 0/9 v2] usb: usb251xb: Add USB2517i hub support and fix some bugs Serge Semin <fancer.lancer@gmail.com> - 2017-09-16 12:50 +0200
    [PATCH 2/9 v2] usb: usb251xb: Add USB251x specific port count setting Serge Semin <fancer.lancer@gmail.com> - 2017-09-16 12:50 +0200
    [PATCH 8/9 v2] usb: usb251xb: Add max power/current dts property support Serge Semin <fancer.lancer@gmail.com> - 2017-09-16 12:50 +0200
      Re: [PATCH 8/9 v2] usb: usb251xb: Add max power/current dts property  support Rob Herring <robh@kernel.org> - 2017-09-20 23:00 +0200
        Re: [PATCH 8/9 v2] usb: usb251xb: Add max power/current dts property  support Serge Semin <fancer.lancer@gmail.com> - 2017-09-20 23:30 +0200
          Re: [PATCH 8/9 v2] usb: usb251xb: Add max power/current dts property support Rob Herring <robh@kernel.org> - 2017-09-21 18:30 +0200
            Re: [PATCH 8/9 v2] usb: usb251xb: Add max power/current dts property  support Serge Semin <fancer.lancer@gmail.com> - 2017-09-21 19:20 +0200
    [PATCH 6/9 v2] usb: usb251xb: Add USB2517 LED settings Serge Semin <fancer.lancer@gmail.com> - 2017-09-16 12:50 +0200
    [PATCH 1/9 v2] usb: usb251xb: Add USB2517i specific struct and IDs Serge Semin <fancer.lancer@gmail.com> - 2017-09-16 12:50 +0200

csiph-web