]> git.baikalelectronics.ru Git - kernel.git/commit
usb: gadget: s3c-hsotg: fix disconnect handling
authorRobert Baldyga <r.baldyga@samsung.com>
Thu, 21 Nov 2013 12:49:18 +0000 (13:49 +0100)
committerFelipe Balbi <balbi@ti.com>
Mon, 25 Nov 2013 16:25:58 +0000 (10:25 -0600)
commite9497a9bf821d6b7325afbcf9af5970ad5a3e637
tree5ca266e3d42770884c722afc93b3b1cbd3cff4ea
parent04c0d165a58bfc0411feadecbf812ee58f509303
usb: gadget: s3c-hsotg: fix disconnect handling

This patch moves s3c_hsotg_disconnect function call from USBSusp interrupt
handler to SET_ADDRESS request handler.

It's because disconnected state can't be detected directly, because this
hardware doesn't support Disconnected interrupt for device mode. For both
Suspend and Disconnect events there is one interrupt USBSusp, but calling
s3c_hsotg_disconnect from this interrupt handler causes config reset in
composite layer, which is not undesirable for Suspended state.

For this reason s3c_hsotg_disconnect is called from SET_ADDRESS request
handler, which occurs always after disconnection, so we do disconnect
immediately before we are connected again. It's probably only way we
can do handle disconnection correctly.

Signed-off-by: Robert Baldyga <r.baldyga@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
drivers/usb/gadget/s3c-hsotg.c