From: Sascha Hauer <s.hauer@pengutronix.de>
To: barebox@lists.infradead.org
Subject: [PATCH 7/7] USB ehci: Add powerup fixup for EfikaSB
Date: Thu, 13 Dec 2012 22:49:10 +0100 [thread overview]
Message-ID: <1355435350-20348-8-git-send-email-s.hauer@pengutronix.de> (raw)
In-Reply-To: <1355435350-20348-1-git-send-email-s.hauer@pengutronix.de>
The EfikaSB has a bug requiring to write to an ULPI register after
powerup. It doesn't seem that this this bug is present on any other
hardware, so add a workaround directly into the driver.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
drivers/usb/host/ehci-hcd.c | 23 ++++++++++++++++++++++-
1 file changed, 22 insertions(+), 1 deletion(-)
diff --git a/drivers/usb/host/ehci-hcd.c b/drivers/usb/host/ehci-hcd.c
index 02ec714..9b9e049 100644
--- a/drivers/usb/host/ehci-hcd.c
+++ b/drivers/usb/host/ehci-hcd.c
@@ -426,6 +426,27 @@ static inline int min3(int a, int b, int c)
return a;
}
+#ifdef CONFIG_MACH_EFIKA_MX_SMARTBOOK
+#include <usb/ulpi.h>
+/*
+ * Add support for setting CHRGVBUS to workaround a hardware bug on efika mx/sb
+ * boards.
+ * See http://lists.infradead.org/pipermail/linux-arm-kernel/2011-January/037341.html
+ */
+void ehci_powerup_fixup(struct ehci_priv *ehci)
+{
+ void *viewport = (void *)ehci->hcor + 0x30;
+
+ if (ehci->dev->id > 0)
+ ulpi_write(ULPI_OTG_CHRG_VBUS, ULPI_OTGCTL + ULPI_REG_SET,
+ viewport);
+}
+#else
+static inline void ehci_powerup_fixup(struct ehci_priv *ehci)
+{
+}
+#endif
+
static int
ehci_submit_root(struct usb_device *dev, unsigned long pipe, void *buffer,
int length, struct devrequest *req)
@@ -611,7 +632,7 @@ ehci_submit_root(struct usb_device *dev, unsigned long pipe, void *buffer,
* usb 2.0 specification say 50 ms resets on
* root
*/
- ehci_powerup_fixup(ehci->dev, ®);
+ ehci_powerup_fixup(ehci);
wait_ms(50);
--
1.7.10.4
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
prev parent reply other threads:[~2012-12-13 21:49 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-12-13 21:49 [PATCH] Efika MX Smartbook support Sascha Hauer
2012-12-13 21:49 ` [PATCH 1/7] ata sff: set device pointer in ata port Sascha Hauer
2012-12-13 21:49 ` [PATCH 2/7] mci: Allow to specify device name Sascha Hauer
2012-12-13 21:49 ` [PATCH 3/7] mci i.MX esdhc: Allow to specify devicename from platformdata Sascha Hauer
2012-12-13 21:49 ` [PATCH 4/7] mfd mc13893: Add register defines Sascha Hauer
2012-12-13 21:49 ` [PATCH 5/7] ARM i.MX51: Add support for the Efika MX Smartbook Sascha Hauer
2012-12-15 9:00 ` Sascha Hauer
2012-12-17 11:15 ` Peter Korsgaard
2012-12-19 20:26 ` Sascha Hauer
2012-12-13 21:49 ` [PATCH 6/7] ARM: Add defconfig for Efika MX smartbook Sascha Hauer
2012-12-13 21:49 ` Sascha Hauer [this message]
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=1355435350-20348-8-git-send-email-s.hauer@pengutronix.de \
--to=s.hauer@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