usb: dwc3: rockchip: set phy mode when change dr_mode

In the case u2phy control vbus, the driver of usb controller
must control the vbus through the interface of u2phy, this
patch change the mode of u2phy when change dr_mode.

Change-Id: I8447bffc55e3502bf53a2e8af841a74914571781
Signed-off-by: Meng Dongyang <daniel.meng@rock-chips.com>
This commit is contained in:
Meng Dongyang
2017-11-02 12:14:19 +08:00
committed by Tao Huang
parent 063cf42cac
commit 040b70d3cf

View File

@@ -142,6 +142,8 @@ static ssize_t dwc3_rockchip_force_mode_write(struct file *file,
flush_work(&rockchip->otg_work);
if (dwc->dr_mode == USB_DR_MODE_PERIPHERAL)
phy_set_mode(dwc->usb2_generic_phy, PHY_MODE_USB_DEVICE);
else if (dwc->dr_mode == USB_DR_MODE_HOST)
phy_set_mode(dwc->usb2_generic_phy, PHY_MODE_USB_HOST);
return count;
}