Skip to contentSkip to conversation

usb: chipidea: usbmisc: evdo can be set e/o reset

RFC New Peter Chen 1 participant 1 message Jan 15, 2018 USB

lore
Share & tools
lore

Peter Chen

author
#0 lore raw

RFC 2/3 usb: chipidea: usbmisc: evdo can be set e/o reset

Quoted 26 lines · Michael Trimarchi

evdo bit can be set or reset. We can not trust evdo bit status after bootloader stage

---
 drivers/usb/chipidea/usbmisc_imx.c | 20 ++++++++++++--------
 1 file changed, 12 insertions(+), 8 deletions(-)
drivers/usb/chipidea/usbmisc_imx.c +2 -8
index a52f5a8..1f47ef6 100644
@@ -151,14 +151,18 @@ static int usbmisc_imx25_post(struct imx_usbmisc_data *data)
 	if (data->index)
 		return 0;
 
-	if (data->evdo) {
-		spin_lock_irqsave(&usbmisc->lock, flags);
-		reg = usbmisc->base + MX25_USB_PHY_CTRL_OFFSET;
-		val = readl(reg);
-		writel(val | MX25_BM_EXTERNAL_VBUS_DIVIDER, reg);
-		spin_unlock_irqrestore(&usbmisc->lock, flags);
-		usleep_range(5000, 10000); /* needed to stabilize voltage */
-	}
+	spin_lock_irqsave(&usbmisc->lock, flags);
+	reg = usbmisc->base + MX25_USB_PHY_CTRL_OFFSET;

drivers/usb/chipidea/usbmisc_imx.c static int usbmisc_imx25_post(struct imx_usbmisc_data *data) · line 165

Quoted 10 lines
drivers/usb/chipidea/usbmisc_imx.c +10 -0
+	val = readl(reg);
+
+	if (data->evdo)
+		val |= MX25_BM_EXTERNAL_VBUS_DIVIDER;
+	else
+		val &= ~MX25_BM_EXTERNAL_VBUS_DIVIDER;
+
+	writel(val, reg);
+	spin_unlock_irqrestore(&usbmisc->lock, flags);
+	usleep_range(5000, 10000); /* needed to stabilize voltage */

Peter
---
To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html