Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1623856

[RFC][PATCH 2/3] usb: phy: msm: notify charger when power supply is unplugged

From Damien Riegel <damien.riegel@savoirfairelinux.com>
Newsgroups linux.kernel
Subject [RFC][PATCH 2/3] usb: phy: msm: notify charger when power supply is unplugged
Date 2017-04-14 20:50 +0200
Message-ID <twesb-4Ay-37@gated-at.bofh.it> (permalink)
References <twes9-4Ay-5@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


With the current code, msm_otg_notify_charger doesn't get called when a
power supply identified as a DCP is unplugged. To work around that,
update charger info and call the notify function when switching from
idle to host.

Signed-off-by: Damien Riegel <damien.riegel@savoirfairelinux.com>
---
 drivers/usb/phy/phy-msm-usb.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/usb/phy/phy-msm-usb.c b/drivers/usb/phy/phy-msm-usb.c
index c1460182bc56..f89a2a540f71 100644
--- a/drivers/usb/phy/phy-msm-usb.c
+++ b/drivers/usb/phy/phy-msm-usb.c
@@ -1349,6 +1349,9 @@ static void msm_otg_sm_work(struct work_struct *w)
 			writel(readl(USB_OTGSC) & ~OTGSC_BSVIE, USB_OTGSC);
 			msm_otg_start_host(otg->usb_phy, 1);
 			otg->state = OTG_STATE_A_HOST;
+			motg->chg_state = USB_CHG_STATE_UNDEFINED;
+			motg->chg_type = USB_INVALID_CHARGER;
+			msm_otg_notify_charger(motg, 0);
 		} else if (test_bit(B_SESS_VLD, &motg->inputs)) {
 			switch (motg->chg_state) {
 			case USB_CHG_STATE_UNDEFINED:
-- 
2.12.2

Back to linux.kernel | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

[RFC][PATCH 0/3] add EXTCON_CHG_USB_* cables to MSM USB phy Damien Riegel <damien.riegel@savoirfairelinux.com> - 2017-04-14 20:50 +0200
  [RFC][PATCH 1/3] usb: phy: msm: notify charger after setting charger info Damien Riegel <damien.riegel@savoirfairelinux.com> - 2017-04-14 20:50 +0200
  [RFC][PATCH 3/3] usb: phy: msm: use extcon to notify charger Damien Riegel <damien.riegel@savoirfairelinux.com> - 2017-04-14 20:50 +0200
  [RFC][PATCH 2/3] usb: phy: msm: notify charger when power supply is unplugged Damien Riegel <damien.riegel@savoirfairelinux.com> - 2017-04-14 20:50 +0200

csiph-web