From: Michael Grzeschik <m.grzeschik@pengutronix.de>
To: barebox@lists.infradead.org
Subject: [PATCH 2/2] usb: imx: add overcurrent polarity handling on i.MX6
Date: Tue, 2 Feb 2021 19:54:13 +0100 [thread overview]
Message-ID: <20210202185413.18332-2-m.grzeschik@pengutronix.de> (raw)
In-Reply-To: <20210202185413.18332-1-m.grzeschik@pengutronix.de>
Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de>
---
drivers/usb/imx/imx-usb-misc.c | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/drivers/usb/imx/imx-usb-misc.c b/drivers/usb/imx/imx-usb-misc.c
index 660ebecd78..c16b4cf0ab 100644
--- a/drivers/usb/imx/imx-usb-misc.c
+++ b/drivers/usb/imx/imx-usb-misc.c
@@ -379,8 +379,15 @@ static __maybe_unused int mx6_initialize_usb_hw(void __iomem *base, int port,
case 0:
case 1:
val = readl(base + MX6_USB_CTRL(port));
- if (flags & MXC_EHCI_DISABLE_OVERCURRENT)
+ if (flags & MXC_EHCI_DISABLE_OVERCURRENT) {
val |= MX6_USB_CTRL_OVER_CUR_DIS;
+ } else {
+ val &= ~MX6_USB_CTRL_OVER_CUR_DIS;
+ if (flags & MXC_EHCI_OC_PIN_ACTIVE_LOW)
+ val |= MX6_USB_CTRL_OVER_CUR_ACT_LOW;
+ else
+ val &= ~MX6_USB_CTRL_OVER_CUR_ACT_LOW;
+ }
if (flags & MXC_EHCI_PWR_PIN_ACTIVE_HIGH)
val |= MX6_USB_CTRL_PWR_POLARITY;
writel(val, base + MX6_USB_CTRL(port));
--
2.30.0
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
next prev parent reply other threads:[~2021-02-02 18:54 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-02-02 18:54 [PATCH 1/2] usb: imx: fix overcurrent polarity handling on i.MX7 Michael Grzeschik
2021-02-02 18:54 ` Michael Grzeschik [this message]
2021-02-04 10:28 ` Sascha Hauer
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=20210202185413.18332-2-m.grzeschik@pengutronix.de \
--to=m.grzeschik@pengutronix.de \
--cc=barebox@lists.infradead.org \
/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