usb: ci13xxx_udc: stop charging upon reset
USB CV tool may send reset to measure the unconfigure current.
Hence stop charging by reducing the charging current to 0mA to meet the
compliance requirement.
Change-Id: Ia4e0d6471bd21a632625753da99d5f0b3aad9480
CRs-fixed: 313277
Signed-off-by: Anji jonnala <anjir@codeaurora.org>
diff --git a/drivers/usb/gadget/ci13xxx_udc.c b/drivers/usb/gadget/ci13xxx_udc.c
index 7dc7377..11bfe9f 100644
--- a/drivers/usb/gadget/ci13xxx_udc.c
+++ b/drivers/usb/gadget/ci13xxx_udc.c
@@ -1857,6 +1857,11 @@
dbg_event(0xFF, "BUS RST", 0);
spin_unlock(udc->lock);
+
+ /*stop charging upon reset */
+ if (udc->transceiver)
+ otg_set_power(udc->transceiver, 0);
+
retval = _gadget_stop_activity(&udc->gadget);
if (retval)
goto done;