Skip to content

usb: usb251xb: Add upstream port lanes polarity inversion

Serge Semin linux-devicetree linux-usb lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest3 patches 4 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3usb: usb251xb: Add US lanes inversion dts-bindingsDocumentation/devicetree/bindings/usb/usb251xb.txt+4 -22 replies
2/3usb: usb251xb: Create a ports field collector methoddrivers/usb/misc/usb251xb.c+26 -451 reply
3/3usb: usb251xb: Add US port lanes inversion propertydrivers/usb/misc/usb251xb.c+2 -01 reply

Reviews trailers per patch

All 3 patches have a Reviewed-by or Acked-by.

PatchRob HerringRichard Leitner
1/3R-b A-b
2/3A-b
3/3A-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH 0/3] usb: usb251xb: Add upstream port lanes polarity inversion

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(-)
Signature · 1 line
2.21.0