Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit fc5b920c authored by Li Jun's avatar Li Jun Committed by Peter Chen
Browse files

usb: chipidea: do charger detection in vbus session



In case the usb phy has the capability to detect usb charger type,
do it when vbus is on.

Signed-off-by: default avatarLi Jun <jun.li@nxp.com>
Signed-off-by: default avatarPeter Chen <peter.chen@nxp.com>
parent 38502ef4
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -1526,6 +1526,10 @@ static int ci_udc_vbus_session(struct usb_gadget *_gadget, int is_active)
		gadget_ready = 1;
	spin_unlock_irqrestore(&ci->lock, flags);

	if (ci->usb_phy)
		usb_phy_set_charger_state(ci->usb_phy, is_active ?
			USB_CHARGER_PRESENT : USB_CHARGER_ABSENT);

	if (gadget_ready) {
		if (is_active) {
			pm_runtime_get_sync(&_gadget->dev);