usb: usb251xb: Add US port lanes inversion property

The driver bindings already declare the "swap-dx-lanes" property to
invert the downstream ports lanes polarity. The similar config
can be defined for a single upstream port - "swap-us-lanes". It's
going to be boolean since there is only one upstream port
on the hub.

Signed-off-by: Serge Semin <fancer.lancer@gmail.com>
Acked-by: Richard Leitner <richard.leitner@skidata.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
Serge Semin 2019-04-25 00:12:07 +03:00 committed by Greg Kroah-Hartman
parent 73d31def1a
commit 6e7adf3ea6
1 changed files with 2 additions and 0 deletions

View File

@ -574,6 +574,8 @@ static int usb251xb_get_ofdata(struct usb251xb *hub,
hub->port_swap = USB251XB_DEF_PORT_SWAP; hub->port_swap = USB251XB_DEF_PORT_SWAP;
usb251xb_get_ports_field(hub, "swap-dx-lanes", data->port_cnt, usb251xb_get_ports_field(hub, "swap-dx-lanes", data->port_cnt,
&hub->port_swap); &hub->port_swap);
if (of_get_property(np, "swap-us-lanes", NULL))
hub->port_swap |= BIT(0);
/* The following parameters are currently not exposed to devicetree, but /* The following parameters are currently not exposed to devicetree, but
* may be as soon as needed. * may be as soon as needed.