summaryrefslogtreecommitdiff
path: root/drivers/usb
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
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')
-rw-r--r--drivers/usb/dwc3/dwc3-msm.c3
-rw-r--r--drivers/usb/pd/policy_engine.c2
2 files changed, 3 insertions, 2 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;
diff --git a/drivers/usb/pd/policy_engine.c b/drivers/usb/pd/policy_engine.c
index c76ca5a94557..055c6203577a 100644
--- a/drivers/usb/pd/policy_engine.c
+++ b/drivers/usb/pd/policy_engine.c
@@ -2365,7 +2365,7 @@ static int psy_changed(struct notifier_block *nb, unsigned long evt, void *ptr)
pd->vbus_present = val.intval;
ret = power_supply_get_property(pd->usb_psy,
- POWER_SUPPLY_PROP_TYPE, &val);
+ POWER_SUPPLY_PROP_REAL_TYPE, &val);
if (ret) {
usbpd_err(&pd->dev, "Unable to read USB TYPE: %d\n", ret);
return ret;