Skip to contentSkip to conversation

ARM: OMAP4/5: Add alternative method for HSIC USB devices reset

RFC PATCH New Lubomir Popov 1 participant 1 message Dec 19, 2013

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

RFC PATCH v4 1/2 ARM: OMAP4/5: Add alternative method for HSIC USB devices reset

Add option for individual reset of HSIC-connected USB devices by the ehci-hcd.c driver upon applying port power, with per-device configurable reset hold and delay times. This may replace the reset functionality via usb_hub.c and board file (which does not work on some boards).

Make HSIC work on all OMAP543x-ES1.0 ports.

---
V4 is just a resend from another machine. V1/2/3 were corrupted during transmission.

 drivers/usb/host/ehci-hcd.c  |  15 ++++
 drivers/usb/host/ehci-omap.c | 174 ++++++++++++++++++++++++++++++++++++++-----
 2 files changed, 170 insertions(+), 19 deletions(-)
drivers/usb/host/ehci-hcd.c +15 -0
index 8bd1eb8..17efb69 100644
@@ -119,6 +119,12 @@ static struct descriptor {
 #define ehci_is_TDI()	(0)
 #endif
 
+/* OMAP HSIC workaround option: */
+__weak void omap_ehci_hsic_reset_device(int port)
+{
+	return;
+}
+
 int __ehci_get_port_speed(struct ehci_hcor *hcor, uint32_t reg)
 {
 	return PORTSC_PSPD(reg);
@@ -803,6 +809,15 @@ ehci_submit_root(struct usb_device *dev, unsigned long pipe, void *buffer,
 			if (HCS_PPC(ehci_readl(&ctrl->hccr->cr_hcsparams))) {
 				reg |= EHCI_PS_PP;
 				ehci_writel(status_reg, reg);
+				/*
+				 * OMAP4/5: Reset device for 'fail to connect'
+				 * workaround. Weak function, actual reset
+				 * should happen in ehci-omap.c and only if we
+				 * have defined HSIC devices (in the board file)
+				 * that we want to reset at this moment.
+				 */
+				omap_ehci_hsic_reset_device(
+						le16_to_cpu(req->index));
 			}
 			break;
 		case USB_PORT_FEAT_RESET:
drivers/usb/host/ehci-omap.c +155 -19

238 lines not on this page · raw message

Signature · 1 line
1.7.12.4 (Apple Git-37)