From 040b70d3cfd01366db122ab476a8dc3958cc0178 Mon Sep 17 00:00:00 2001 From: Meng Dongyang Date: Thu, 2 Nov 2017 12:14:19 +0800 Subject: [PATCH] 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 --- drivers/usb/dwc3/dwc3-rockchip.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/usb/dwc3/dwc3-rockchip.c b/drivers/usb/dwc3/dwc3-rockchip.c index a6e5cbd27ba8..f52d8540e5bb 100644 --- a/drivers/usb/dwc3/dwc3-rockchip.c +++ b/drivers/usb/dwc3/dwc3-rockchip.c @@ -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; }