Skip to content
This repository has been archived by the owner on Oct 5, 2018. It is now read-only.

Commit

Permalink
usb: phy: msm: Fix state machine worker logic for OTG mode.
Browse files Browse the repository at this point in the history
Issue is that if the board is booted without micro usb cable and usb
device attached, kernel fails to populate the usb host and device.
The reason for this is that the state machine worker logic only checks
for USB_DR_MODE_PERIPHERAL and USB_DR_MODE_HOST modes to run worker
thread. However if the phy is configured in OTG mode it would fail
to run the state machine, resulting in failure to detect for very
first time.

This patch fixes by adding OTG checks in to the logic.

Issue is noticed on Qualcomm Dragon board DB410C.

Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
  • Loading branch information
Srinivas-Kandagatla authored and ndechesne committed Feb 5, 2016
1 parent 81b32c9 commit 15fddd0
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions drivers/usb/phy/phy-msm-usb.c
Original file line number Diff line number Diff line change
Expand Up @@ -765,7 +765,8 @@ static int msm_otg_set_host(struct usb_otg *otg, struct usb_bus *host)
* Kick the state machine work, if peripheral is not supported
* or peripheral is already registered with us.
*/
if (motg->pdata->mode == USB_DR_MODE_HOST || otg->gadget) {
if (motg->pdata->mode == USB_DR_MODE_HOST ||
motg->pdata->mode == USB_DR_MODE_OTG || otg->gadget) {
pm_runtime_get_sync(otg->usb_phy->dev);
schedule_work(&motg->sm_work);
}
Expand Down Expand Up @@ -835,7 +836,8 @@ static int msm_otg_set_peripheral(struct usb_otg *otg,
* Kick the state machine work, if host is not supported
* or host is already registered with us.
*/
if (motg->pdata->mode == USB_DR_MODE_PERIPHERAL || otg->host) {
if (motg->pdata->mode == USB_DR_MODE_PERIPHERAL ||
motg->pdata->mode == USB_DR_MODE_OTG || otg->host) {
pm_runtime_get_sync(otg->usb_phy->dev);
schedule_work(&motg->sm_work);
}
Expand Down

0 comments on commit 15fddd0

Please sign in to comment.