[PATCH] usb: imx: implement support for "over-current-active-high" property
Uwe Kleine-König
u.kleine-koenig at pengutronix.de
Thu Oct 26 02:59:17 PDT 2017
This property is already documented in the bindings and supported by
Linux. As on i.MX25 the HW default is active high and up to now barebox
didn't force this to low (which is the default for e.g. i.MX6), add the
property to barebox' imx25.dtsi to keep existing behaviour. If on a
board the OC pin is active low, you need to add
/delete-property/ over-current-active-high;
in the board.dts.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig at pengutronix.de>
---
arch/arm/dts/imx25.dtsi | 8 ++++++++
drivers/usb/imx/chipidea-imx.c | 4 ++++
2 files changed, 12 insertions(+)
diff --git a/arch/arm/dts/imx25.dtsi b/arch/arm/dts/imx25.dtsi
index 13fbcc4f8da6..2e069e6f0314 100644
--- a/arch/arm/dts/imx25.dtsi
+++ b/arch/arm/dts/imx25.dtsi
@@ -29,3 +29,11 @@
&usbmisc {
status = "okay";
};
+
+&usbotg {
+ over-current-active-high;
+};
+
+&usbhost1 {
+ over-current-active-high;
+};
diff --git a/drivers/usb/imx/chipidea-imx.c b/drivers/usb/imx/chipidea-imx.c
index 309d5353037c..5f6988540fcb 100644
--- a/drivers/usb/imx/chipidea-imx.c
+++ b/drivers/usb/imx/chipidea-imx.c
@@ -160,6 +160,10 @@ static int imx_chipidea_probe_dt(struct imx_chipidea *ci)
"disable-over-current", NULL))
ci->flags |= MXC_EHCI_DISABLE_OVERCURRENT;
+ else if (!of_find_property(ci->dev->device_node,
+ "over-current-active-high", NULL))
+ ci->flags |= MXC_EHCI_OC_PIN_ACTIVE_LOW;
+
return 0;
}
--
2.11.0
More information about the barebox
mailing list