aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/chipidea/core.c
diff options
context:
space:
mode:
authorStephen Boyd <stephen.boyd@linaro.org>2017-01-25 17:32:43 -0500
committerPeter Chen <peter.chen@nxp.com>2017-02-03 03:48:33 -0500
commit490b63e6de63d13e82110f4cb5f1aa31dd27245a (patch)
tree1d45dd8d07addd4a1ea85de080197f1f93b4ca43 /drivers/usb/chipidea/core.c
parent30a9566a4f6071ef159f83e18f8c15a66ee08c2d (diff)
usb: chipidea: Configure phy for appropriate mode
When the qcom chipidea controller is used with an extcon, we need to signal device mode or host mode to the phy so it can configure itself for the correct mode. This should be done after the phy is powered up, so that the register writes work correctly. Add in the appropriate phy_set_mode() call here. Cc: Peter Chen <peter.chen@nxp.com> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Stephen Boyd <stephen.boyd@linaro.org> Signed-off-by: Peter Chen <peter.chen@nxp.com>
Diffstat (limited to 'drivers/usb/chipidea/core.c')
-rw-r--r--drivers/usb/chipidea/core.c20
1 files changed, 14 insertions, 6 deletions
diff --git a/drivers/usb/chipidea/core.c b/drivers/usb/chipidea/core.c
index bcb3a9c360d4..79ad8e91632e 100644
--- a/drivers/usb/chipidea/core.c
+++ b/drivers/usb/chipidea/core.c
@@ -427,13 +427,21 @@ void ci_platform_configure(struct ci_hdrc *ci)
427 is_device_mode = hw_read(ci, OP_USBMODE, USBMODE_CM) == USBMODE_CM_DC; 427 is_device_mode = hw_read(ci, OP_USBMODE, USBMODE_CM) == USBMODE_CM_DC;
428 is_host_mode = hw_read(ci, OP_USBMODE, USBMODE_CM) == USBMODE_CM_HC; 428 is_host_mode = hw_read(ci, OP_USBMODE, USBMODE_CM) == USBMODE_CM_HC;
429 429
430 if (is_device_mode && 430 if (is_device_mode) {
431 (ci->platdata->flags & CI_HDRC_DISABLE_DEVICE_STREAMING)) 431 phy_set_mode(ci->phy, PHY_MODE_USB_DEVICE);
432 hw_write(ci, OP_USBMODE, USBMODE_CI_SDIS, USBMODE_CI_SDIS);
433 432
434 if (is_host_mode && 433 if (ci->platdata->flags & CI_HDRC_DISABLE_DEVICE_STREAMING)
435 (ci->platdata->flags & CI_HDRC_DISABLE_HOST_STREAMING)) 434 hw_write(ci, OP_USBMODE, USBMODE_CI_SDIS,
436 hw_write(ci, OP_USBMODE, USBMODE_CI_SDIS, USBMODE_CI_SDIS); 435 USBMODE_CI_SDIS);
436 }
437
438 if (is_host_mode) {
439 phy_set_mode(ci->phy, PHY_MODE_USB_HOST);
440
441 if (ci->platdata->flags & CI_HDRC_DISABLE_HOST_STREAMING)
442 hw_write(ci, OP_USBMODE, USBMODE_CI_SDIS,
443 USBMODE_CI_SDIS);
444 }
437 445
438 if (ci->platdata->flags & CI_HDRC_FORCE_FULLSPEED) { 446 if (ci->platdata->flags & CI_HDRC_FORCE_FULLSPEED) {
439 if (ci->hw_bank.lpm) 447 if (ci->hw_bank.lpm)