diff mbox

[2/4] doc: usb: ci-hdrc-usb2: add property over-current-polarity

Message ID 1468840547-17899-2-git-send-email-jun.li@nxp.com
State Changes Requested, archived
Headers show

Commit Message

Jun Li July 18, 2016, 11:15 a.m. UTC
Adding over-current-polarity to indicate the over current flag
is low active or high active.

Signed-off-by: Li Jun <jun.li@nxp.com>
---
 Documentation/devicetree/bindings/usb/ci-hdrc-usb2.txt | 2 ++
 1 file changed, 2 insertions(+)

Comments

Joshua Clayton July 18, 2016, 3:24 p.m. UTC | #1
Greetings,
On 07/18/2016 04:15 AM, Li Jun wrote:
> Adding over-current-polarity to indicate the over current flag
> is low active or high active.
>
> Signed-off-by: Li Jun <jun.li@nxp.com>
> ---
>  Documentation/devicetree/bindings/usb/ci-hdrc-usb2.txt | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/Documentation/devicetree/bindings/usb/ci-hdrc-usb2.txt b/Documentation/devicetree/bindings/usb/ci-hdrc-usb2.txt
> index 341dc67..c5d35f4 100644
> --- a/Documentation/devicetree/bindings/usb/ci-hdrc-usb2.txt
> +++ b/Documentation/devicetree/bindings/usb/ci-hdrc-usb2.txt
> @@ -81,6 +81,8 @@ i.mx specific properties
>  - fsl,usbmisc: phandler of non-core register device, with one
>    argument that indicate usb controller index
>  - disable-over-current: disable over current detect
> +- over-current-polarity: 0 if the over current signal polarity is low active,
> +  1 if the over current signal polarity is high active.
>  - external-vbus-divider: enables off-chip resistor divider for Vbus
>  
>  Example:
The gpio device bindings already have active low/ active high.
Could that be used here?

In the imx SPI subsystem, for instance, the developers used gpio rather than
MUXED spi chipselect lines for exactly this kind of flexibility.

If there is no magic happening in silicon (which would seem to be the case if we can
handle inverting polarity in the driver), I would suggest going the gpiod route.

Thanks,
Joshua
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Peter Chen July 19, 2016, 1:47 a.m. UTC | #2
On Mon, Jul 18, 2016 at 08:24:50AM -0700, Joshua Clayton wrote:
> Greetings,
> On 07/18/2016 04:15 AM, Li Jun wrote:
> > Adding over-current-polarity to indicate the over current flag
> > is low active or high active.
> >
> > Signed-off-by: Li Jun <jun.li@nxp.com>
> > ---
> >  Documentation/devicetree/bindings/usb/ci-hdrc-usb2.txt | 2 ++
> >  1 file changed, 2 insertions(+)
> >
> > diff --git a/Documentation/devicetree/bindings/usb/ci-hdrc-usb2.txt b/Documentation/devicetree/bindings/usb/ci-hdrc-usb2.txt
> > index 341dc67..c5d35f4 100644
> > --- a/Documentation/devicetree/bindings/usb/ci-hdrc-usb2.txt
> > +++ b/Documentation/devicetree/bindings/usb/ci-hdrc-usb2.txt
> > @@ -81,6 +81,8 @@ i.mx specific properties
> >  - fsl,usbmisc: phandler of non-core register device, with one
> >    argument that indicate usb controller index
> >  - disable-over-current: disable over current detect
> > +- over-current-polarity: 0 if the over current signal polarity is low active,
> > +  1 if the over current signal polarity is high active.
> >  - external-vbus-divider: enables off-chip resistor divider for Vbus
> >  
> >  Example:
> The gpio device bindings already have active low/ active high.
> Could that be used here?
> 

No, the over current pin is a dedicated pin for USB, you need
to configure it through pinmux. If we are using a gpio (even
the same pin as OC pin), the USB subsystem will not know
OC event. The polarity is for OC pin and configured through
USB register.

> In the imx SPI subsystem, for instance, the developers used gpio rather than
> MUXED spi chipselect lines for exactly this kind of flexibility.
> 
> If there is no magic happening in silicon (which would seem to be the case if we can
> handle inverting polarity in the driver), I would suggest going the gpiod route.
>
Jun Li July 19, 2016, 2:56 a.m. UTC | #3
Hi,
> -----Original Message-----
> From: Peter Chen [mailto:hzpeterchen@gmail.com]
> Sent: Tuesday, July 19, 2016 9:47 AM
> To: Joshua Clayton <stillcompiling@gmail.com>
> Cc: Jun Li <jun.li@nxp.com>; Peter Chen <peter.chen@nxp.com>;
> robh+dt@kernel.org; shawnguo@kernel.org; devicetree@vger.kernel.org;
> linux-usb@vger.kernel.org; linux-arm-kernel@lists.infradead.org
> Subject: Re: [PATCH 2/4] doc: usb: ci-hdrc-usb2: add property over-
> current-polarity
> 
> On Mon, Jul 18, 2016 at 08:24:50AM -0700, Joshua Clayton wrote:
> > Greetings,
> > On 07/18/2016 04:15 AM, Li Jun wrote:
> > > Adding over-current-polarity to indicate the over current flag is
> > > low active or high active.
> > >
> > > Signed-off-by: Li Jun <jun.li@nxp.com>
> > > ---
> > >  Documentation/devicetree/bindings/usb/ci-hdrc-usb2.txt | 2 ++
> > >  1 file changed, 2 insertions(+)
> > >
> > > diff --git a/Documentation/devicetree/bindings/usb/ci-hdrc-usb2.txt
> > > b/Documentation/devicetree/bindings/usb/ci-hdrc-usb2.txt
> > > index 341dc67..c5d35f4 100644
> > > --- a/Documentation/devicetree/bindings/usb/ci-hdrc-usb2.txt
> > > +++ b/Documentation/devicetree/bindings/usb/ci-hdrc-usb2.txt
> > > @@ -81,6 +81,8 @@ i.mx specific properties
> > >  - fsl,usbmisc: phandler of non-core register device, with one
> > >    argument that indicate usb controller index
> > >  - disable-over-current: disable over current detect
> > > +- over-current-polarity: 0 if the over current signal polarity is
> > > +low active,
> > > +  1 if the over current signal polarity is high active.
> > >  - external-vbus-divider: enables off-chip resistor divider for Vbus
> > >
> > >  Example:
> > The gpio device bindings already have active low/ active high.
> > Could that be used here?
> >
> 
> No, the over current pin is a dedicated pin for USB, you need to configure
> it through pinmux. If we are using a gpio (even the same pin as OC pin),
> the USB subsystem will not know OC event. The polarity is for OC pin and
> configured through USB register.

Agree with Peter, there is do have magic in silicon of usb controller,
which is part of ehci spec so ehci host driver can take care of it as
a standard usb event.

> 
> > In the imx SPI subsystem, for instance, the developers used gpio
> > rather than MUXED spi chipselect lines for exactly this kind of
> flexibility.

I guess your SPI example is not a normal usage, but by that way to
workaround some silicon issue.

Li Jun
  
> >
> > If there is no magic happening in silicon (which would seem to be the
> > case if we can handle inverting polarity in the driver), I would suggest
> going the gpiod route.
> >
> 
> --
> 
> Best Regards,
> Peter Chen
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Rob Herring July 20, 2016, 1:09 a.m. UTC | #4
On Mon, Jul 18, 2016 at 07:15:45PM +0800, Li Jun wrote:
> Adding over-current-polarity to indicate the over current flag
> is low active or high active.
> 
> Signed-off-by: Li Jun <jun.li@nxp.com>
> ---
>  Documentation/devicetree/bindings/usb/ci-hdrc-usb2.txt | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/Documentation/devicetree/bindings/usb/ci-hdrc-usb2.txt b/Documentation/devicetree/bindings/usb/ci-hdrc-usb2.txt
> index 341dc67..c5d35f4 100644
> --- a/Documentation/devicetree/bindings/usb/ci-hdrc-usb2.txt
> +++ b/Documentation/devicetree/bindings/usb/ci-hdrc-usb2.txt
> @@ -81,6 +81,8 @@ i.mx specific properties
>  - fsl,usbmisc: phandler of non-core register device, with one
>    argument that indicate usb controller index
>  - disable-over-current: disable over current detect
> +- over-current-polarity: 0 if the over current signal polarity is low active,
> +  1 if the over current signal polarity is high active.

Make the common case be no property and make this bool. So if typically 
active high, the property is "over-current-active-low".

Rob
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/Documentation/devicetree/bindings/usb/ci-hdrc-usb2.txt b/Documentation/devicetree/bindings/usb/ci-hdrc-usb2.txt
index 341dc67..c5d35f4 100644
--- a/Documentation/devicetree/bindings/usb/ci-hdrc-usb2.txt
+++ b/Documentation/devicetree/bindings/usb/ci-hdrc-usb2.txt
@@ -81,6 +81,8 @@  i.mx specific properties
 - fsl,usbmisc: phandler of non-core register device, with one
   argument that indicate usb controller index
 - disable-over-current: disable over current detect
+- over-current-polarity: 0 if the over current signal polarity is low active,
+  1 if the over current signal polarity is high active.
 - external-vbus-divider: enables off-chip resistor divider for Vbus
 
 Example: