From: Meng Dongyang Date: Wed, 12 Oct 2016 11:26:10 +0000 (+0800) Subject: usb: rockchip-inno-usb2: use EXTCON_USB_VBUS_EN to control vbus X-Git-Tag: firefly_0821_release~1408 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=25a6f3608b293bffb079b883754ce299b35a1494;p=firefly-linux-kernel-4.4.55.git usb: rockchip-inno-usb2: use EXTCON_USB_VBUS_EN to control vbus Add EXTCON_USB_VBUS_EN cable and change EXTCON_USB_HOST to EXTCON_USB_VBUS_EN cable to control vbus. Change-Id: I2e7c6111f723e425bd4c156e803cb6a1a9f17511 Signed-off-by: Meng Dongyang --- diff --git a/drivers/phy/phy-rockchip-inno-usb2.c b/drivers/phy/phy-rockchip-inno-usb2.c index 9da2af7740b0..e9a5f51c9146 100644 --- a/drivers/phy/phy-rockchip-inno-usb2.c +++ b/drivers/phy/phy-rockchip-inno-usb2.c @@ -81,6 +81,7 @@ enum usb_chg_state { static const unsigned int rockchip_usb2phy_extcon_cable[] = { EXTCON_USB, EXTCON_USB_HOST, + EXTCON_USB_VBUS_EN, EXTCON_CHG_USB_SDP, EXTCON_CHG_USB_CDP, EXTCON_CHG_USB_DCP, @@ -1011,13 +1012,16 @@ static irqreturn_t rockchip_usb2phy_id_irq(int irq, void *data) property_enable(rphy, &rport->port_cfg->idfall_det_clr, true); extcon_set_state(rphy->edev, EXTCON_USB_HOST, true); + extcon_set_state(rphy->edev, EXTCON_USB_VBUS_EN, true); } else if (property_enabled(rphy, &rport->port_cfg->idrise_det_st)) { property_enable(rphy, &rport->port_cfg->idrise_det_clr, true); extcon_set_state(rphy->edev, EXTCON_USB_HOST, false); + extcon_set_state(rphy->edev, EXTCON_USB_VBUS_EN, false); } extcon_sync(rphy->edev, EXTCON_USB_HOST); + extcon_sync(rphy->edev, EXTCON_USB_VBUS_EN); mutex_unlock(&rport->mutex); @@ -1135,8 +1139,10 @@ static int rockchip_usb2phy_otg_port_init(struct rockchip_usb2phy *rphy, if (!iddig) { extcon_set_state(rphy->edev, EXTCON_USB, false); extcon_set_state(rphy->edev, EXTCON_USB_HOST, true); + extcon_set_state(rphy->edev, EXTCON_USB_VBUS_EN, true); } else { extcon_set_state(rphy->edev, EXTCON_USB_HOST, false); + extcon_set_state(rphy->edev, EXTCON_USB_VBUS_EN, false); } }