All of lore.kernel.org
 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   ` [1/3] " Serge Semin
                   ` (2 more replies)
  0 siblings, 3 replies; 16+ 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] 16+ messages in thread

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

Thread overview: 16+ 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-04-24 21:12   ` [1/3] " Serge Semin
2019-05-02  0:32   ` [PATCH 1/3] " Rob Herring
2019-05-02  0:32     ` [1/3] " Rob Herring
2019-05-02  5:42   ` [PATCH 1/3] " Richard Leitner
2019-05-02  5:42     ` [1/3] " Richard Leitner
2019-05-02  5:42     ` [PATCH 1/3] " Richard Leitner
2019-04-24 21:12 ` [PATCH 2/3] usb: usb251xb: Create a ports field collector method Serge Semin
2019-04-24 21:12   ` [2/3] " Serge Semin
2019-05-02  5:42   ` [PATCH 2/3] " Richard Leitner
2019-05-02  5:42     ` [2/3] " Richard Leitner
2019-04-24 21:12 ` [PATCH 3/3] usb: usb251xb: Add US port lanes inversion property Serge Semin
2019-04-24 21:12   ` [3/3] " Serge Semin
2019-05-02  5:42   ` [PATCH 3/3] " Richard Leitner
2019-05-02  5:42     ` [3/3] " Richard Leitner

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.