phy: rockchip-inno-usb2: add vbus control when set phy mode

The vbus may need control by u2phy when force. This patch
control vbus when set phy mode.

Change-Id: I237e9e3688b257689c79040f19642cea5365d409
Signed-off-by: Meng Dongyang <daniel.meng@rock-chips.com>
This commit is contained in:
Meng Dongyang
2017-11-02 12:05:57 +08:00
committed by Tao Huang
parent a75fd68c1e
commit f8a05151b9

View File

@@ -754,9 +754,13 @@ static int rockchip_usb2phy_set_mode(struct phy *phy, enum phy_mode mode)
* fallthrough
*/
case PHY_MODE_USB_DEVICE:
gpiod_set_value_cansleep(rport->vbus_drv_gpio, 0);
extcon_set_state_sync(rphy->edev, EXTCON_USB_VBUS_EN, false);
vbus_det_en = true;
break;
case PHY_MODE_USB_HOST:
gpiod_set_value_cansleep(rport->vbus_drv_gpio, 1);
extcon_set_state_sync(rphy->edev, EXTCON_USB_VBUS_EN, true);
/* fallthrough */
case PHY_MODE_INVALID:
vbus_det_en = false;