All of lore.kernel.org
 help / color / mirror / Atom feed
From: Serge Semin <fancer.lancer-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: Rob Herring <robh-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
Cc: Richard Leitner
	<richard.leitner-WcANXNA0UjBBDgjK7y7TUQ@public.gmane.org>,
	Greg Kroah-Hartman
	<gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r@public.gmane.org>,
	Mark Rutland <mark.rutland-5wv7dgnIgG8@public.gmane.org>,
	Sergey.Semin-vHJ8rsvMqnUPfZBKTuL5GA@public.gmane.org,
	Linux USB List
	<linux-usb-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	"devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
	<devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	"linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
	<linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>
Subject: Re: [PATCH 8/9 v2] usb: usb251xb: Add max power/current dts property support
Date: Thu, 21 Sep 2017 20:10:22 +0300	[thread overview]
Message-ID: <20170921171022.GA13721@mobilestation> (raw)
In-Reply-To: <CAL_Jsq+ftbGSQOOor_1L9NO9h7rjYm9nB26PxNOPgyHU6k3j_A-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>

On Thu, Sep 21, 2017 at 11:26:04AM -0500, Rob Herring <robh-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org> wrote:
> On Wed, Sep 20, 2017 at 4:27 PM, Serge Semin <fancer.lancer-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
> > On Wed, Sep 20, 2017 at 03:52:55PM -0500, Rob Herring <robh-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.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-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
> >> > ---
> >> >  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
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

WARNING: multiple messages have this Message-ID (diff)
From: Serge Semin <fancer.lancer@gmail.com>
To: Rob Herring <robh@kernel.org>
Cc: Richard Leitner <richard.leitner@skidata.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Mark Rutland <mark.rutland@arm.com>,
	Sergey.Semin@t-platforms.ru,
	Linux USB List <linux-usb@vger.kernel.org>,
	"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 8/9 v2] usb: usb251xb: Add max power/current dts property support
Date: Thu, 21 Sep 2017 20:10:22 +0300	[thread overview]
Message-ID: <20170921171022.GA13721@mobilestation> (raw)
In-Reply-To: <CAL_Jsq+ftbGSQOOor_1L9NO9h7rjYm9nB26PxNOPgyHU6k3j_A@mail.gmail.com>

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

  parent reply	other threads:[~2017-09-21 17:10 UTC|newest]

Thread overview: 86+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-15 23:31 [PATCH 0/5] usb: usb251xb: Add USB2517i hub support and fix some bugs Serge Semin
2017-09-15 23:31 ` Serge Semin
2017-09-15 23:31 ` [PATCH 1/5] usb: usb251xb: Add USB2517/i hub support Serge Semin
2017-09-15 23:45   ` Greg KH
     [not found]     ` <20170915234514.GA8407-U8xfFu+wG4EAvxtiuMwx3w@public.gmane.org>
2017-09-15 23:55       ` Serge Semin
2017-09-15 23:55         ` Serge Semin
2017-09-20 20:52   ` Rob Herring
2017-09-20 21:15     ` Serge Semin
2017-09-21 16:53       ` Rob Herring
     [not found]         ` <CAL_Jsq+8RqmOzwrH7U=F7Fh9aUHALK-SpJQWfdOR-0J8Pna23g-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-09-21 17:40           ` Serge Semin
2017-09-21 17:40             ` Serge Semin
2017-09-15 23:31 ` [PATCH 2/5] usb: usb251xb: Fix property_u32 NULL pointer dereference Serge Semin
2017-09-15 23:31 ` [PATCH 3/5] usb: usb251xb: Add max power/current dts nodes Serge Semin
2017-09-15 23:31 ` [PATCH 4/5] usb: usb251xb: Use GPIO descriptor consumer interface Serge Semin
2017-09-15 23:31 ` [PATCH 5/5] usb: usb251xb: Add copyrights Serge Semin
     [not found]   ` <20170915233113.17855-6-fancer.lancer-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2017-09-15 23:40     ` Greg KH
2017-09-15 23:40       ` Greg KH
     [not found]       ` <20170915234028.GA7681-U8xfFu+wG4EAvxtiuMwx3w@public.gmane.org>
2017-09-15 23:42         ` Greg KH
2017-09-15 23:42           ` Greg KH
2017-09-15 23:45         ` Serge Semin
2017-09-15 23:45           ` Serge Semin
2017-09-15 23:53           ` Greg KH
2017-09-15 23:53             ` Greg KH
2017-09-16  0:11             ` Serge Semin
     [not found] ` <20170915233113.17855-1-fancer.lancer-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2017-09-16 10:42   ` [PATCH 0/9 v2] usb: usb251xb: Add USB2517i hub support and fix some bugs Serge Semin
2017-09-16 10:42     ` Serge Semin
2017-09-16 10:42     ` [PATCH 1/9 v2] usb: usb251xb: Add USB2517i specific struct and IDs Serge Semin
     [not found]       ` <20170916104220.3742-2-fancer.lancer-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2017-10-04  7:39         ` Richard Leitner
2017-10-04  7:39           ` Richard Leitner
2017-09-16 10:42     ` [PATCH 2/9 v2] usb: usb251xb: Add USB251x specific port count setting Serge Semin
     [not found]       ` <20170916104220.3742-3-fancer.lancer-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2017-10-04  7:27         ` Richard Leitner
2017-10-04  7:27           ` Richard Leitner
2017-09-16 10:42     ` [PATCH 3/9 v2] usb: usb251xb: Add 5,6,7 ports mapping def setting Serge Semin
2017-10-04  7:51       ` Richard Leitner
2017-10-04  7:51         ` Richard Leitner
2017-09-16 10:42     ` [PATCH 5/9 v2] usb: usb251xb: Add battery enable setting flag Serge Semin
2017-09-16 10:42     ` [PATCH 6/9 v2] usb: usb251xb: Add USB2517 LED settings Serge Semin
2017-09-16 10:42     ` [PATCH 7/9 v2] usb: usb251xb: Fix property_u32 NULL pointer dereference Serge Semin
     [not found]     ` <20170916104220.3742-1-fancer.lancer-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2017-09-16 10:42       ` [PATCH 4/9 v2] usb: usb251xb: Add 5,6,7 ports boost settings Serge Semin
2017-09-16 10:42         ` Serge Semin
     [not found]         ` <20170916104220.3742-5-fancer.lancer-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2017-10-04  7:57           ` Richard Leitner
2017-10-04  7:57             ` Richard Leitner
2017-09-16 10:42       ` [PATCH 8/9 v2] usb: usb251xb: Add max power/current dts property support Serge Semin
2017-09-16 10:42         ` Serge Semin
2017-09-20 20:52         ` Rob Herring
2017-09-20 21:27           ` Serge Semin
2017-09-21 16:26             ` Rob Herring
2017-09-21 16:26               ` Rob Herring
     [not found]               ` <CAL_Jsq+ftbGSQOOor_1L9NO9h7rjYm9nB26PxNOPgyHU6k3j_A-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-09-21 17:10                 ` Serge Semin [this message]
2017-09-21 17:10                   ` Serge Semin
2017-10-04  8:12                   ` Richard Leitner
2017-10-04  8:12                     ` Richard Leitner
     [not found]                     ` <53559bc4-5faa-6797-7c12-f635049f1411-WcANXNA0UjBBDgjK7y7TUQ@public.gmane.org>
2017-10-04 13:44                       ` Rob Herring
2017-10-04 13:44                         ` Rob Herring
2017-10-22 20:38       ` [PATCH 00/10 v3] usb: usb251xb: Add USB2517i hub support and fix some bugs Serge Semin
2017-10-22 20:38         ` Serge Semin
2017-10-22 20:38         ` [PATCH 01/10 v3] usb: usb251xb: Update usb251xb bindings Serge Semin
     [not found]           ` <20171022203812.9379-2-fancer.lancer-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2017-10-27  3:21             ` Rob Herring
2017-10-27  3:21               ` Rob Herring
2017-10-22 20:38         ` [PATCH 02/10 v3] usb: usb251xb: Add USB2517i specific struct and IDs Serge Semin
     [not found]           ` <20171022203812.9379-3-fancer.lancer-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2017-10-23 21:47             ` Richard Leitner
2017-10-23 21:47               ` Richard Leitner
     [not found]         ` <20171022203812.9379-1-fancer.lancer-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2017-10-22 20:38           ` [PATCH 03/10 v3] usb: usb251xb: Add USB251x specific port count setting Serge Semin
2017-10-22 20:38             ` Serge Semin
     [not found]             ` <20171022203812.9379-4-fancer.lancer-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2017-10-23 21:36               ` Richard Leitner
2017-10-23 21:36                 ` Richard Leitner
2017-10-22 20:38           ` [PATCH 10/10 v3] usb: usb251xb: Use GPIO descriptor consumer interface Serge Semin
2017-10-22 20:38             ` Serge Semin
2017-10-22 20:38         ` [PATCH 04/10 v3] usb: usb251xb: Add 5,6,7 ports mapping def setting Serge Semin
2017-10-22 20:38         ` [PATCH 05/10 v3] usb: usb251xb: Add 5,6,7 ports boost settings Serge Semin
2017-10-22 20:38         ` [PATCH 06/10 v3] usb: usb251xb: Add battery enable setting flag Serge Semin
2017-10-22 20:38         ` [PATCH 07/10 v3] usb: usb251xb: Add USB2517 LED settings Serge Semin
2017-10-22 20:38         ` [PATCH 08/10 v3] usb: usb251xb: Fix property_u32 NULL pointer dereference Serge Semin
2017-10-22 20:38         ` [PATCH 09/10 v3] usb: usb251xb: Add max power/current dts property support Serge Semin
     [not found]           ` <20171022203812.9379-10-fancer.lancer-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2017-10-23 21:55             ` Richard Leitner
2017-10-23 21:55               ` Richard Leitner
2017-09-16 10:42     ` [PATCH 9/9 v2] usb: usb251xb: Use GPIO descriptor consumer interface Serge Semin
2017-09-20 20:52       ` Rob Herring
2017-09-20 21:29         ` Serge Semin
2017-09-21  8:23       ` Greg KH
     [not found]         ` <20170921082338.GA30669-U8xfFu+wG4EAvxtiuMwx3w@public.gmane.org>
2017-09-21 14:51           ` Serge Semin
2017-09-21 14:51             ` Serge Semin
2017-09-21 15:07             ` Greg KH
     [not found]               ` <20170921150714.GA7791-U8xfFu+wG4EAvxtiuMwx3w@public.gmane.org>
2017-09-22 15:26                 ` Serge Semin
2017-09-22 15:26                   ` Serge Semin
2017-09-22 16:05                   ` Greg KH

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170921171022.GA13721@mobilestation \
    --to=fancer.lancer-re5jqeeqqe8avxtiumwx3w@public.gmane.org \
    --cc=Sergey.Semin-vHJ8rsvMqnUPfZBKTuL5GA@public.gmane.org \
    --cc=devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r@public.gmane.org \
    --cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-usb-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=mark.rutland-5wv7dgnIgG8@public.gmane.org \
    --cc=richard.leitner-WcANXNA0UjBBDgjK7y7TUQ@public.gmane.org \
    --cc=robh-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.