usb: dwc2: gadget: Prevent wrong extcon notification
authorDongwoo Lee <dwoo08.lee@samsung.com>
Mon, 6 Nov 2017 07:11:08 +0000 (16:11 +0900)
committerJaehoon Chung <jh80.chung@samsung.com>
Tue, 29 Jan 2019 02:25:34 +0000 (11:25 +0900)
commit9d9d7526c1fa8137da6f744412747e4510e25b76
treef5f1ae55adfca775b9c99dcc7569db3f5955af94
parent48aba373372de72ce63c016c8237335ae95b7a7e
usb: dwc2: gadget: Prevent wrong extcon notification

In sometimes, USB disconnection triggers enumeration-done interrupt
even though it is false state. Actually, this interrupt is ignored by
dwc2 irq handler, but extcon notfication can be mis-delivered to
user-space. Thus, this patch make worker determined the current state
by itself, and it also prevent some cases which have chance for wrong
notification such as repeatedly connect/disconnecting usb cable.

Change-Id: Iff88cf2c030b627f3d2da23930b10e9f3a84c8e1
Signed-off-by: Dongwoo Lee <dwoo08.lee@samsung.com>
drivers/usb/dwc2/core.h
drivers/usb/dwc2/gadget.c