projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
38502ef
)
usb: chipidea: do charger detection in vbus session
author
Li Jun
<jun.li@nxp.com>
Mon, 4 Sep 2017 15:14:01 +0000
(23:14 +0800)
committer
Peter Chen
<peter.chen@nxp.com>
Thu, 21 Sep 2017 03:15:56 +0000
(11:15 +0800)
In case the usb phy has the capability to detect usb charger type,
do it when vbus is on.
Signed-off-by: Li Jun <jun.li@nxp.com>
Signed-off-by: Peter Chen <peter.chen@nxp.com>
drivers/usb/chipidea/udc.c
patch
|
blob
|
history
diff --git
a/drivers/usb/chipidea/udc.c
b/drivers/usb/chipidea/udc.c
index fe8a90543ea375b4931ef3b6fa02cdd8a3574aae..daffa5ed396d06743aaf72ba4ec1632f070cf5bc 100644
(file)
--- a/
drivers/usb/chipidea/udc.c
+++ b/
drivers/usb/chipidea/udc.c
@@
-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);