public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Serge Semin <fancer.lancer@gmail.com>
To: Richard Leitner <richard.leitner@skidata.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Serge Semin <Sergey.Semin@t-platforms.ru>,
	linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH 3/3] usb: usb251xb: Add US port lanes inversion property
Date: Thu, 25 Apr 2019 00:12:07 +0300	[thread overview]
Message-ID: <20190424211208.17499-4-fancer.lancer@gmail.com> (raw)
In-Reply-To: <20190424211208.17499-1-fancer.lancer@gmail.com>

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>
---
 drivers/usb/misc/usb251xb.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/usb/misc/usb251xb.c b/drivers/usb/misc/usb251xb.c
index 4ef34df948ad..56f0a10633fc 100644
--- a/drivers/usb/misc/usb251xb.c
+++ b/drivers/usb/misc/usb251xb.c
@@ -531,6 +531,8 @@ static int usb251xb_get_ofdata(struct usb251xb *hub,
 	hub->port_swap = USB251XB_DEF_PORT_SWAP;
 	usb251xb_get_ports_field(hub, "swap-dx-lanes", data->port_cnt,
 				 &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
 	 * may be as soon as needed.
-- 
2.21.0


  parent reply	other threads:[~2019-04-24 21:13 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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
2019-04-24 21:12 ` [PATCH 2/3] usb: usb251xb: Create a ports field collector method Serge Semin
2019-05-02  5:42   ` Richard Leitner
2019-04-24 21:12 ` Serge Semin [this message]
2019-05-02  5:42   ` [PATCH 3/3] usb: usb251xb: Add US port lanes inversion property Richard Leitner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190424211208.17499-4-fancer.lancer@gmail.com \
    --to=fancer.lancer@gmail.com \
    --cc=Sergey.Semin@t-platforms.ru \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=richard.leitner@skidata.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox