Commit 2f0e40ab authored by Valentin Longchamp's avatar Valentin Longchamp Committed by Greg Kroah-Hartman

USB: fix occasional ULPI timeouts with ehci-mxc

On various mxc boards, the intial ULPI reads resulted in a timeout
which prevented the transceiver to be identified and thus the ehci
device to be probed.

Initializing the hardware lines connected to the transceiver (through
pdata->init call) before actually enabling clocks and configuring
registers in the devices fixes this problem.
Signed-off-by: default avatarValentin Longchamp <valentin.longchamp@epfl.ch>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent cabe6cc2
...@@ -162,6 +162,17 @@ static int ehci_mxc_drv_probe(struct platform_device *pdev) ...@@ -162,6 +162,17 @@ static int ehci_mxc_drv_probe(struct platform_device *pdev)
goto err_ioremap; goto err_ioremap;
} }
/* call platform specific init function */
if (pdata->init) {
ret = pdata->init(pdev);
if (ret) {
dev_err(dev, "platform init failed\n");
goto err_init;
}
/* platforms need some time to settle changed IO settings */
mdelay(10);
}
/* enable clocks */ /* enable clocks */
priv->usbclk = clk_get(dev, "usb"); priv->usbclk = clk_get(dev, "usb");
if (IS_ERR(priv->usbclk)) { if (IS_ERR(priv->usbclk)) {
...@@ -192,18 +203,6 @@ static int ehci_mxc_drv_probe(struct platform_device *pdev) ...@@ -192,18 +203,6 @@ static int ehci_mxc_drv_probe(struct platform_device *pdev)
if (ret < 0) if (ret < 0)
goto err_init; goto err_init;
/* call platform specific init function */
if (pdata->init) {
ret = pdata->init(pdev);
if (ret) {
dev_err(dev, "platform init failed\n");
goto err_init;
}
}
/* most platforms need some time to settle changed IO settings */
mdelay(10);
/* Initialize the transceiver */ /* Initialize the transceiver */
if (pdata->otg) { if (pdata->otg) {
pdata->otg->io_priv = hcd->regs + ULPI_VIEWPORT_OFFSET; pdata->otg->io_priv = hcd->regs + ULPI_VIEWPORT_OFFSET;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment