Commit 22ffd399 authored by Michael Grzeschik's avatar Michael Grzeschik Committed by Greg Kroah-Hartman

usb: chipidea: move ci_ulpi_init after the phy initialization

The function ci_usb_phy_init is already handling the
hw_phymode_configure path which is also only possible after we have
a valid phy. So we move the ci_ulpi_init after the phy initialization
to be really sure to be able to communicate with the ulpi phy.
Signed-off-by: default avatarMichael Grzeschik <m.grzeschik@pengutronix.de>
Acked-by: default avatarPeter Chen <peter.chen@kernel.org>
Link: https://lore.kernel.org/r/20240328-chipidea-phy-misc-v1-1-907d9de5d4df@pengutronix.deSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 00bca465
...@@ -1084,10 +1084,6 @@ static int ci_hdrc_probe(struct platform_device *pdev) ...@@ -1084,10 +1084,6 @@ static int ci_hdrc_probe(struct platform_device *pdev)
return -ENODEV; return -ENODEV;
} }
ret = ci_ulpi_init(ci);
if (ret)
return ret;
if (ci->platdata->phy) { if (ci->platdata->phy) {
ci->phy = ci->platdata->phy; ci->phy = ci->platdata->phy;
} else if (ci->platdata->usb_phy) { } else if (ci->platdata->usb_phy) {
...@@ -1142,6 +1138,10 @@ static int ci_hdrc_probe(struct platform_device *pdev) ...@@ -1142,6 +1138,10 @@ static int ci_hdrc_probe(struct platform_device *pdev)
goto ulpi_exit; goto ulpi_exit;
} }
ret = ci_ulpi_init(ci);
if (ret)
return ret;
ci->hw_bank.phys = res->start; ci->hw_bank.phys = res->start;
ci->irq = platform_get_irq(pdev, 0); ci->irq = platform_get_irq(pdev, 0);
......
...@@ -68,11 +68,6 @@ int ci_ulpi_init(struct ci_hdrc *ci) ...@@ -68,11 +68,6 @@ int ci_ulpi_init(struct ci_hdrc *ci)
if (ci->platdata->phy_mode != USBPHY_INTERFACE_MODE_ULPI) if (ci->platdata->phy_mode != USBPHY_INTERFACE_MODE_ULPI)
return 0; return 0;
/*
* Set PORTSC correctly so we can read/write ULPI registers for
* identification purposes
*/
hw_phymode_configure(ci);
ci->ulpi_ops.read = ci_ulpi_read; ci->ulpi_ops.read = ci_ulpi_read;
ci->ulpi_ops.write = ci_ulpi_write; ci->ulpi_ops.write = ci_ulpi_write;
......
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