Skip to content

Commit

Permalink
usb: chipidea: host: vbus control change for OTG HNP
Browse files Browse the repository at this point in the history
Leave vbus on/off hanlded by OTG fsm if in OTG mode.

Signed-off-by: Peter Chen <peter.chen@freescale.com>
Signed-off-by: Li Jun <b47624@freescale.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Li Jun authored and Greg Kroah-Hartman committed Apr 24, 2014
1 parent 57677be commit 8a28b90
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions drivers/usb/chipidea/host.c
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,11 @@ static int host_start(struct ci_hdrc *ci)
ehci->has_tdi_phy_lpm = ci->hw_bank.lpm;
ehci->imx28_write_fix = ci->imx28_write_fix;

if (ci->platdata->reg_vbus) {
/*
* vbus is always on if host is not in OTG FSM mode,
* otherwise should be controlled by OTG FSM
*/
if (ci->platdata->reg_vbus && !ci_otg_is_fsm_mode(ci)) {
ret = regulator_enable(ci->platdata->reg_vbus);
if (ret) {
dev_err(ci->dev,
Expand All @@ -89,7 +93,7 @@ static int host_start(struct ci_hdrc *ci)
return ret;

disable_reg:
if (ci->platdata->reg_vbus)
if (ci->platdata->reg_vbus && !ci_otg_is_fsm_mode(ci))
regulator_disable(ci->platdata->reg_vbus);

put_hcd:
Expand All @@ -105,7 +109,7 @@ static void host_stop(struct ci_hdrc *ci)
if (hcd) {
usb_remove_hcd(hcd);
usb_put_hcd(hcd);
if (ci->platdata->reg_vbus)
if (ci->platdata->reg_vbus && !ci_otg_is_fsm_mode(ci))
regulator_disable(ci->platdata->reg_vbus);
}
}
Expand Down

0 comments on commit 8a28b90

Please sign in to comment.