usb: dwc2: gadget: manage ep0 state in software
authorMian Yousaf Kaukab <yousaf.kaukab@intel.com>
Fri, 9 Jan 2015 12:38:58 +0000 (13:38 +0100)
committerFelipe Balbi <balbi@ti.com>
Mon, 12 Jan 2015 21:34:03 +0000 (15:34 -0600)
commitfe0b94abcdf6d80bd575e91baf1e0f85a4978d49
treee25d3f5ab252d451f1111063a5c59b0cc7e236b0
parent1141ea01d5faa82f4910b4a8f896d10490860f24
usb: dwc2: gadget: manage ep0 state in software

Manage ep0 state in software to add handling of status OUT stage.
Just toggling hsotg->setup in s3c_hsotg_handle_outdone leaves it in
wrong state in 2-stage control transfers.
Moreover, ensure that for setup-packet s3c_hsotg_handle_outdone is
called either from SetupDone or OutDone but not both. Dwc2 ip v3.00a
generates both SetupDone and OutDone on setup packets.

Tested-by: Robert Baldyga <r.baldyga@samsung.com>
Acked-by: Paul Zimmerman <paulz@synopsys.com>
Signed-off-by: Mian Yousaf Kaukab <yousaf.kaukab@intel.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
drivers/usb/dwc2/core.h
drivers/usb/dwc2/gadget.c