devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/3] usb: usb251xb: Add upstream port lanes polarity inversion
@ 2019-04-24 21:12 Serge Semin
  2019-04-24 21:12 ` [PATCH 1/3] usb: usb251xb: Add US lanes inversion dts-bindings Serge Semin
  0 siblings, 1 reply; 4+ messages in thread
From: Serge Semin @ 2019-04-24 21:12 UTC (permalink / raw)
  To: Richard Leitner, Greg Kroah-Hartman, Rob Herring, Mark Rutland
  Cc: Serge Semin, linux-usb, devicetree, linux-kernel

A while ago I created an original patchset with functionality of any ports
inversion setting implemented. But while I was busy with another work,
Marco' version of the similar code has already been upstreamed.
So I decided to at least refactor my patchset extracting alterations,
which I think might be useful in the driver.

Even though the Marco' implementation was correct in general, it lacked a
small specific detail. The polarity inversion property might be setup for
downstream and upstream ports. Both of these cases are covered by current
'swap-dx-lanes' property implementation, but there is no any mentioning
about number 0 being considered as Upstream port of the hub. This might be
confusing seeing the rest of the port-related properties accept
only the ports starting from 1 (which is starting number of downstream
ports) and don't support number 0. So in order to unify the 'swap-dx-lanes'
property with the rest port-related ones, I'd suggest to make it being
responsible for downstream ports only, while upstream port lanes inversion
would be enabled by setting a new 'swap-us-lanes' boolean property. Current
property names mnemonic also fits quiet well for this update.

In addition the usb251xb_get_ofdata() method is getting to be too
complicated with obvious identical peaces of code. In particular it
concerns the ports-related properties like 'non-removable-ports',
'sp-disabled-ports' and 'bp-disabled-ports'. We can simplify the code
responsible for the properties handling by moving a common part into
a dedicated method. Needless to say that in case if the suggestion made
above regarding the 'swap-dx-lanes' property alteration is accepted,
the same could be done for parsing it' code as well.

So all of these updates are implemented in the patches of this small
series.


Serge Semin (3):
  usb: usb251xb: Add US lanes inversion dts-bindings
  usb: usb251xb: Create a ports field collector method
  usb: usb251xb: Add US port lanes inversion property

 .../devicetree/bindings/usb/usb251xb.txt      |  6 +-
 drivers/usb/misc/usb251xb.c                   | 73 +++++++------------
 2 files changed, 32 insertions(+), 47 deletions(-)

-- 
2.21.0

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH 1/3] usb: usb251xb: Add US lanes inversion dts-bindings
  2019-04-24 21:12 [PATCH 0/3] usb: usb251xb: Add upstream port lanes polarity inversion Serge Semin
@ 2019-04-24 21:12 ` Serge Semin
  2019-05-02  0:32   ` Rob Herring
  2019-05-02  5:42   ` Richard Leitner
  0 siblings, 2 replies; 4+ messages in thread
From: Serge Semin @ 2019-04-24 21:12 UTC (permalink / raw)
  To: Richard Leitner, Greg Kroah-Hartman, Rob Herring, Mark Rutland
  Cc: Serge Semin, linux-usb, devicetree, linux-kernel

Since a separate US ports lanes polarity inversion property is going to
be available the bindings doc-file should be updated with information
about swap-us-lanes bool property, which will be responsible for it.

Signed-off-by: Serge Semin <fancer.lancer@gmail.com>
---
 Documentation/devicetree/bindings/usb/usb251xb.txt | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/Documentation/devicetree/bindings/usb/usb251xb.txt b/Documentation/devicetree/bindings/usb/usb251xb.txt
index 17915f64b8ee..bc7945e9dbfe 100644
--- a/Documentation/devicetree/bindings/usb/usb251xb.txt
+++ b/Documentation/devicetree/bindings/usb/usb251xb.txt
@@ -64,8 +64,10 @@ Optional properties :
  - power-on-time-ms : Specifies the time it takes from the time the host
 	initiates the power-on sequence to a port until the port has adequate
 	power. The value is given in ms in a 0 - 510 range (default is 100ms).
- - swap-dx-lanes : Specifies the ports which will swap the differential-pair
-	(D+/D-), default is not-swapped.
+ - swap-dx-lanes : Specifies the downstream ports which will swap the
+	differential-pair (D+/D-), default is not-swapped.
+ - swap-us-lanes : Selects the upstream port differential-pair (D+/D-)
+	swapping (boolean, default is not-swapped)
 
 Examples:
 	usb2512b@2c {
-- 
2.21.0

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH 1/3] usb: usb251xb: Add US lanes inversion dts-bindings
  2019-04-24 21:12 ` [PATCH 1/3] usb: usb251xb: Add US lanes inversion dts-bindings Serge Semin
@ 2019-05-02  0:32   ` Rob Herring
  2019-05-02  5:42   ` Richard Leitner
  1 sibling, 0 replies; 4+ messages in thread
From: Rob Herring @ 2019-05-02  0:32 UTC (permalink / raw)
  To: Serge Semin
  Cc: Richard Leitner, Greg Kroah-Hartman, Mark Rutland, Serge Semin,
	linux-usb, devicetree, linux-kernel

On Thu, 25 Apr 2019 00:12:05 +0300, Serge Semin wrote:
> Since a separate US ports lanes polarity inversion property is going to
> be available the bindings doc-file should be updated with information
> about swap-us-lanes bool property, which will be responsible for it.
> 
> Signed-off-by: Serge Semin <fancer.lancer@gmail.com>
> ---
>  Documentation/devicetree/bindings/usb/usb251xb.txt | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
> 

Reviewed-by: Rob Herring <robh@kernel.org>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH 1/3] usb: usb251xb: Add US lanes inversion dts-bindings
  2019-04-24 21:12 ` [PATCH 1/3] usb: usb251xb: Add US lanes inversion dts-bindings Serge Semin
  2019-05-02  0:32   ` Rob Herring
@ 2019-05-02  5:42   ` Richard Leitner
  1 sibling, 0 replies; 4+ messages in thread
From: Richard Leitner @ 2019-05-02  5:42 UTC (permalink / raw)
  To: Serge Semin, Greg Kroah-Hartman, Rob Herring, Mark Rutland
  Cc: Serge Semin, linux-usb, devicetree, linux-kernel


On 24/04/2019 23:12, Serge Semin wrote:
> Since a separate US ports lanes polarity inversion property is going to
> be available the bindings doc-file should be updated with information
> about swap-us-lanes bool property, which will be responsible for it.
> 
> Signed-off-by: Serge Semin <fancer.lancer@gmail.com>
> ---
>   Documentation/devicetree/bindings/usb/usb251xb.txt | 6 ++++--
>   1 file changed, 4 insertions(+), 2 deletions(-)
> 

Acked-by: Richard Leitner <richard.leitner@skidata.com>

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2019-05-02  5:42 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-04-24 21:12 [PATCH 0/3] usb: usb251xb: Add upstream port lanes polarity inversion Serge Semin
2019-04-24 21:12 ` [PATCH 1/3] usb: usb251xb: Add US lanes inversion dts-bindings Serge Semin
2019-05-02  0:32   ` Rob Herring
2019-05-02  5:42   ` Richard Leitner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).