usb: gadget: s3c-hsotg: stall ep0 in set_halt function
authorRobert Baldyga <r.baldyga@samsung.com>
Tue, 14 Jan 2014 07:36:00 +0000 (08:36 +0100)
committerFelipe Balbi <balbi@ti.com>
Tue, 18 Feb 2014 16:52:54 +0000 (10:52 -0600)
commitc9f721b2f3168a0a3b1cc29e92ad1f6f3d62e376
tree9956f1f5046a1bc14375d30901c1514a79aa23cf
parent7e98f60003df98026edd66916f282501eee075c4
usb: gadget: s3c-hsotg: stall ep0 in set_halt function

When s3c_hsotg_ep_sethalt() function is called for ep0 it should be stalled
in the same way that it is in s3c_hsotg_process_control() function, because
SET_HALT for ep0 is delayed response for setup request. Endpoint 0, if
halted, it doesn't need CLEAR_HALT because it clears "stalled" state
automatically when next setup request is received.

For this reason this patch moves code setting ep0 to "stalled" state to new
function named s3c_hsotg_stall_ep0() which is called in
s3c_hsotg_process_control() function as an immediate response for setup
request, and in s3c_hsotg_ep_sethalt() function as a delayed response for
setup request.

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