From fc5b920c3b9bbe9bf05aeb1c497643608ecb656b Mon Sep 17 00:00:00 2001 From: Li Jun Date: Mon, 4 Sep 2017 23:14:01 +0800 Subject: 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: Li Jun Signed-off-by: Peter Chen --- drivers/usb/chipidea/udc.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/usb/chipidea/udc.c b/drivers/usb/chipidea/udc.c index fe8a90543ea3..daffa5ed396d 100644 --- 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); -- cgit v1.2.3 From 2a53e060a053d5d7627dcde5b06b5950902d9ce6 Mon Sep 17 00:00:00 2001 From: Christoph Fritz Date: Tue, 24 Oct 2017 12:15:50 +0200 Subject: usb: chipidea: fix trivial typo in Kconfig This patch fixes a trivial typo to get the module name ci_hdrc.ko correct. Signed-off-by: Christoph Fritz Signed-off-by: Peter Chen --- drivers/usb/chipidea/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/usb/chipidea/Kconfig b/drivers/usb/chipidea/Kconfig index 51f4157bbecf..785f0ed037f7 100644 --- a/drivers/usb/chipidea/Kconfig +++ b/drivers/usb/chipidea/Kconfig @@ -9,7 +9,7 @@ config USB_CHIPIDEA Dual-role switch (ID, OTG FSM, sysfs), Host-only, and Peripheral-only. - When compiled dynamically, the module will be called ci-hdrc.ko. + When compiled dynamically, the module will be called ci_hdrc.ko. if USB_CHIPIDEA -- cgit v1.2.3