mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: "Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>
To: barebox@lists.infradead.org
Subject: [PATCH] usb: imx: implement support for "over-current-active-high" property
Date: Thu, 26 Oct 2017 11:59:17 +0200	[thread overview]
Message-ID: <20171026095917.2688-1-u.kleine-koenig@pengutronix.de> (raw)

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@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


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

             reply	other threads:[~2017-10-26  9:59 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-26  9:59 Uwe Kleine-König [this message]
2017-10-27  8:47 ` 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=20171026095917.2688-1-u.kleine-koenig@pengutronix.de \
    --to=u.kleine-koenig@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