[PATCH 2/2] usb: imx: add overcurrent polarity handling on i.MX6

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Signed-off-by: Michael Grzeschik <m.grzeschik@xxxxxxxxxxxxxx>
---
 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@xxxxxxxxxxxxxxxxxxx
http://lists.infradead.org/mailman/listinfo/barebox



[Index of Archives]     [Linux Embedded]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux