mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-09 04:10:18 +09:00
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 <daniel.meng@rock-chips.com> Signed-off-by: Frank Wang <frank.wang@rock-chips.com>
This commit is contained in:
@@ -80,6 +80,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,
|
||||
@@ -1042,13 +1043,16 @@ static irqreturn_t rockchip_usb2phy_id_irq(int irq, void *data)
|
||||
property_enable(rphy->grf, &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->grf, &rport->port_cfg->idrise_det_st)) {
|
||||
property_enable(rphy->grf, &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);
|
||||
|
||||
@@ -1211,8 +1215,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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user