Skip to contentSkip to conversation

usb:ci_udc: Remove ULPI setting for i.MX OTG controller

PATCH Superseded Ye.Li 3 participants 3 messages Nov 9, 2015 USB

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore

Ye.Li

author
#0 lore raw

PATCH v2 1/1 usb:ci_udc: Remove ULPI setting for i.MX OTG controller

All the i.MX6, i.MX23 and i.MX28 OTG controllers only support UTMI interface. Set to ULPI is not correct, even the controller will reject this setting in PORTSC register.

---
Changes since v1:
- Add error handling for udc probe

 drivers/usb/gadget/ci_udc.c |   14 +++-----------
 1 files changed, 3 insertions(+), 11 deletions(-)
drivers/usb/gadget/ci_udc.c +3 -11
index 1ba5054..d93cba5 100644
@@ -1018,18 +1018,10 @@ int usb_gadget_register_driver(struct usb_gadget_driver *driver)
 		return ret;
 
 	ret = ci_udc_probe();
-#if defined(CONFIG_USB_EHCI_MX6) || defined(CONFIG_USB_EHCI_MXS)
-	/*
-	 * FIXME: usb_lowlevel_init()->ehci_hcd_init() should be doing all
-	 * HW-specific initialization, e.g. ULPI-vs-UTMI PHY selection
-	 */
-	if (!ret) {
-		struct ci_udc *udc = (struct ci_udc *)controller.ctrl->hcor;
-
-		/* select ULPI phy */
-		writel(PTS(PTS_ENABLE) | PFSC, &udc->portsc);
+    if (ret) {
+		DBG("udc probe failed, returned %d\n", ret);
+		return ret;
 	}
-#endif
 
 	ret = driver->bind(&controller.gadget);
 	if (ret) {
Signature · 1 line
1.7.4.1
#1 lore raw

PATCH v2 1/1 usb:ci_udc: Remove ULPI setting for i.MX OTG controller

Quoted 10 lines · Ye.Li

All the i.MX6, i.MX23 and i.MX28 OTG controllers only support UTMI interface. Set to ULPI is not correct, even the controller will reject this setting in PORTSC register.

drivers/usb/gadget/ci_udc.c +0 -0
@@ -1018,18 +1018,10 @@ int usb_gadget_register_driver(struct usb_gadget_driver *driver)
  		return ret;
 
  	ret = ci_udc_probe();

...

drivers/usb/gadget/ci_udc.c int usb_gadget_register_driver(struct usb_gadget_driver *driver) · line 1024

Quoted 4 lines
drivers/usb/gadget/ci_udc.c +3 -0
+    if (ret) {
+		DBG("udc probe failed, returned %d\n", ret);
+		return ret;
  	}

The indentation of the "if" line is incorrect.

#2 lore raw

PATCH v2 1/1 usb:ci_udc: Remove ULPI setting for i.MX OTG controller

Quoted 16 lines · Stephen Warren
Quoted 12 lines · Ye.Li

All the i.MX6, i.MX23 and i.MX28 OTG controllers only support UTMI interface. Set to ULPI is not correct, even the controller will reject this setting in PORTSC register.

drivers/usb/gadget/ci_udc.c +0 -0
@@ -1018,18 +1018,10 @@ int usb_gadget_register_driver(struct
 usb_gadget_driver *driver)
 
  		return ret;
 
  	ret = ci_udc_probe();

...

Quoted 7 lines

drivers/usb/gadget/ci_udc.c int usb_gadget_register_driver(struct usb_gadget_driver *driver)

Quoted 5 lines
drivers/usb/gadget/ci_udc.c +3 -0
+    if (ret) {
+		DBG("udc probe failed, returned %d\n", ret);
+		return ret;
 
  	}

The indentation of the "if" line is incorrect.

I'm also not quite fond of the DBG() statement, why not change it to plain debug() ?

Best regards,
Marek Vasut