summaryrefslogtreecommitdiff
path: root/drivers/usb/dwc3/dwc3-msm.c
diff options
context:
space:
mode:
authorFenglin Wu <fenglinw@codeaurora.org>2017-04-25 21:45:08 +0800
committerAbhijeet Dharmapurikar <adharmap@codeaurora.org>2017-05-03 13:48:19 -0700
commit15a68a61bd49f0a7306aa89eba9800a1d2ef031e (patch)
treee0bc305e6e90153d827c289b14cd1194f9e1e4b5 /drivers/usb/dwc3/dwc3-msm.c
parent5d78c03af8ffb440d418cbc45ad0d68928354e48 (diff)
power: qcom: smb2: Add REAL_TYPE property for usb power_supply
Add POWER_SUPPLY_PROP_REAL_TYPE property for usb_psy to present its real charger type. POWER_SUPPLY_PROP_TYPE in usb_psy is always set to POWER_SUPPLY_TYPE_USB_PD for healthd to recognize it as an AC charger. Also add usb_port_psy with POWER_SUPPLY_TYPE_USB type is added for healthd to recognize it as an USB host. Their ONLINE properties will be updated according to the VBUS status, type-c mode and real charger type. With this type being set statically, update the usb phy and pd policy engine code to look at real type. Change-Id: I90aa69325cc82b09dfb513c0eeecbc61e092a57f Signed-off-by: Fenglin Wu <fenglinw@codeaurora.org> Signed-off-by: Abhijeet Dharmapurikar <adharmap@codeaurora.org>
Diffstat (limited to 'drivers/usb/dwc3/dwc3-msm.c')
-rw-r--r--drivers/usb/dwc3/dwc3-msm.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/usb/dwc3/dwc3-msm.c b/drivers/usb/dwc3/dwc3-msm.c
index e394f123f918..ad9d6cc4e23f 100644
--- a/drivers/usb/dwc3/dwc3-msm.c
+++ b/drivers/usb/dwc3/dwc3-msm.c
@@ -3597,7 +3597,8 @@ static int dwc3_msm_gadget_vbus_draw(struct dwc3_msm *mdwc, unsigned mA)
}
}
- power_supply_get_property(mdwc->usb_psy, POWER_SUPPLY_PROP_TYPE, &pval);
+ power_supply_get_property(mdwc->usb_psy,
+ POWER_SUPPLY_PROP_REAL_TYPE, &pval);
if (pval.intval != POWER_SUPPLY_TYPE_USB)
return 0;