diff options
author | Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> | 2011-11-24 20:27:50 -0500 |
---|---|---|
committer | Felipe Balbi <balbi@ti.com> | 2011-12-12 04:45:16 -0500 |
commit | ced6e09e6ec4f52c9bd76d6b8debd67517fdcc1c (patch) | |
tree | f46d864de03eb79656c898a09343826071591729 /drivers | |
parent | 9cf1b06e906d8590fc027264af30b37754bd8226 (diff) |
usb: renesas_usbhs: add basic USB_REQ_SET_FEATURE support
This patch adds basic set-feature support for chapter 9 test.
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/usb/renesas_usbhs/mod_gadget.c | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/drivers/usb/renesas_usbhs/mod_gadget.c b/drivers/usb/renesas_usbhs/mod_gadget.c index 9a9e36378e87..3130089eacff 100644 --- a/drivers/usb/renesas_usbhs/mod_gadget.c +++ b/drivers/usb/renesas_usbhs/mod_gadget.c | |||
@@ -282,6 +282,29 @@ struct usbhsg_recip_handle req_clear_feature = { | |||
282 | }; | 282 | }; |
283 | 283 | ||
284 | /* | 284 | /* |
285 | * USB_TYPE_STANDARD / set feature functions | ||
286 | */ | ||
287 | static int usbhsg_recip_handler_std_set_endpoint(struct usbhs_priv *priv, | ||
288 | struct usbhsg_uep *uep, | ||
289 | struct usb_ctrlrequest *ctrl) | ||
290 | { | ||
291 | struct usbhs_pipe *pipe = usbhsg_uep_to_pipe(uep); | ||
292 | |||
293 | usbhs_pipe_stall(pipe); | ||
294 | |||
295 | usbhsg_recip_handler_std_control_done(priv, uep, ctrl); | ||
296 | |||
297 | return 0; | ||
298 | } | ||
299 | |||
300 | struct usbhsg_recip_handle req_set_feature = { | ||
301 | .name = "set feature", | ||
302 | .device = usbhsg_recip_handler_std_control_done, | ||
303 | .interface = usbhsg_recip_handler_std_control_done, | ||
304 | .endpoint = usbhsg_recip_handler_std_set_endpoint, | ||
305 | }; | ||
306 | |||
307 | /* | ||
285 | * USB_TYPE handler | 308 | * USB_TYPE handler |
286 | */ | 309 | */ |
287 | static int usbhsg_recip_run_handle(struct usbhs_priv *priv, | 310 | static int usbhsg_recip_run_handle(struct usbhs_priv *priv, |
@@ -405,6 +428,9 @@ static int usbhsg_irq_ctrl_stage(struct usbhs_priv *priv, | |||
405 | case USB_REQ_CLEAR_FEATURE: | 428 | case USB_REQ_CLEAR_FEATURE: |
406 | recip_handler = &req_clear_feature; | 429 | recip_handler = &req_clear_feature; |
407 | break; | 430 | break; |
431 | case USB_REQ_SET_FEATURE: | ||
432 | recip_handler = &req_set_feature; | ||
433 | break; | ||
408 | } | 434 | } |
409 | } | 435 | } |
410 | 436 | ||