diff options
author | Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> | 2011-10-11 01:04:00 -0400 |
---|---|---|
committer | Felipe Balbi <balbi@ti.com> | 2011-10-13 13:41:42 -0400 |
commit | bc6fbf59df75c4e3533d0daf7873f783c835bd53 (patch) | |
tree | 5777c3d881adcf221f8ea5b181e2a90662bb74cd | |
parent | 2cc971978c0cabcd7760f4431270088cda72d8df (diff) |
usb: gadget: renesas_usbhs: add device select support in usbhs_pipe_config_update()
device select method will be used on mod_host
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
-rw-r--r-- | drivers/usb/renesas_usbhs/mod_gadget.c | 4 | ||||
-rw-r--r-- | drivers/usb/renesas_usbhs/pipe.c | 16 | ||||
-rw-r--r-- | drivers/usb/renesas_usbhs/pipe.h | 3 |
3 files changed, 18 insertions, 5 deletions
diff --git a/drivers/usb/renesas_usbhs/mod_gadget.c b/drivers/usb/renesas_usbhs/mod_gadget.c index dd4ca37fbab3..d5f80c4457e5 100644 --- a/drivers/usb/renesas_usbhs/mod_gadget.c +++ b/drivers/usb/renesas_usbhs/mod_gadget.c | |||
@@ -489,7 +489,7 @@ static int usbhsg_ep_enable(struct usb_ep *ep, | |||
489 | pipe->mod_private = uep; | 489 | pipe->mod_private = uep; |
490 | 490 | ||
491 | /* set epnum / maxp */ | 491 | /* set epnum / maxp */ |
492 | usbhs_pipe_config_update(pipe, | 492 | usbhs_pipe_config_update(pipe, 0, |
493 | usb_endpoint_num(desc), | 493 | usb_endpoint_num(desc), |
494 | usb_endpoint_maxp(desc)); | 494 | usb_endpoint_maxp(desc)); |
495 | 495 | ||
@@ -672,7 +672,7 @@ static int usbhsg_try_start(struct usbhs_priv *priv, u32 status) | |||
672 | /* dcp init */ | 672 | /* dcp init */ |
673 | dcp->pipe = usbhs_dcp_malloc(priv); | 673 | dcp->pipe = usbhs_dcp_malloc(priv); |
674 | dcp->pipe->mod_private = dcp; | 674 | dcp->pipe->mod_private = dcp; |
675 | usbhs_pipe_config_update(dcp->pipe, 0, 64); | 675 | usbhs_pipe_config_update(dcp->pipe, 0, 0, 64); |
676 | 676 | ||
677 | /* | 677 | /* |
678 | * system config enble | 678 | * system config enble |
diff --git a/drivers/usb/renesas_usbhs/pipe.c b/drivers/usb/renesas_usbhs/pipe.c index 08d11b0cab43..4235a2ecebf9 100644 --- a/drivers/usb/renesas_usbhs/pipe.c +++ b/drivers/usb/renesas_usbhs/pipe.c | |||
@@ -418,14 +418,26 @@ static u16 usbhsp_setup_pipebuff(struct usbhs_pipe *pipe) | |||
418 | (0xff & bufnmb) << 0; | 418 | (0xff & bufnmb) << 0; |
419 | } | 419 | } |
420 | 420 | ||
421 | void usbhs_pipe_config_update(struct usbhs_pipe *pipe, u16 epnum, u16 maxp) | 421 | void usbhs_pipe_config_update(struct usbhs_pipe *pipe, u16 devsel, |
422 | u16 epnum, u16 maxp) | ||
422 | { | 423 | { |
424 | if (devsel > 0xA) { | ||
425 | struct usbhs_priv *priv = usbhs_pipe_to_priv(pipe); | ||
426 | struct device *dev = usbhs_priv_to_dev(priv); | ||
427 | |||
428 | dev_err(dev, "devsel error %d\n", devsel); | ||
429 | |||
430 | devsel = 0; | ||
431 | } | ||
432 | |||
423 | usbhsp_pipe_barrier(pipe); | 433 | usbhsp_pipe_barrier(pipe); |
424 | 434 | ||
425 | pipe->maxp = maxp; | 435 | pipe->maxp = maxp; |
426 | 436 | ||
427 | usbhsp_pipe_select(pipe); | 437 | usbhsp_pipe_select(pipe); |
428 | usbhsp_pipe_maxp_set(pipe, 0xFFFF, maxp); | 438 | usbhsp_pipe_maxp_set(pipe, 0xFFFF, |
439 | (devsel << 12) | | ||
440 | maxp); | ||
429 | 441 | ||
430 | if (!usbhs_pipe_is_dcp(pipe)) | 442 | if (!usbhs_pipe_is_dcp(pipe)) |
431 | usbhsp_pipe_cfg_set(pipe, 0x000F, epnum); | 443 | usbhsp_pipe_cfg_set(pipe, 0x000F, epnum); |
diff --git a/drivers/usb/renesas_usbhs/pipe.h b/drivers/usb/renesas_usbhs/pipe.h index 05b706a09e56..aff8bfa207d3 100644 --- a/drivers/usb/renesas_usbhs/pipe.h +++ b/drivers/usb/renesas_usbhs/pipe.h | |||
@@ -91,7 +91,8 @@ void usbhs_pipe_enable(struct usbhs_pipe *pipe); | |||
91 | void usbhs_pipe_disable(struct usbhs_pipe *pipe); | 91 | void usbhs_pipe_disable(struct usbhs_pipe *pipe); |
92 | void usbhs_pipe_stall(struct usbhs_pipe *pipe); | 92 | void usbhs_pipe_stall(struct usbhs_pipe *pipe); |
93 | void usbhs_pipe_select_fifo(struct usbhs_pipe *pipe, struct usbhs_fifo *fifo); | 93 | void usbhs_pipe_select_fifo(struct usbhs_pipe *pipe, struct usbhs_fifo *fifo); |
94 | void usbhs_pipe_config_update(struct usbhs_pipe *pipe, u16 epnum, u16 maxp); | 94 | void usbhs_pipe_config_update(struct usbhs_pipe *pipe, u16 devsel, |
95 | u16 epnum, u16 maxp); | ||
95 | 96 | ||
96 | #define usbhs_pipe_to_priv(p) ((p)->priv) | 97 | #define usbhs_pipe_to_priv(p) ((p)->priv) |
97 | #define usbhs_pipe_number(p) (int)((p) - (p)->priv->pipe_info.pipe) | 98 | #define usbhs_pipe_number(p) (int)((p) - (p)->priv->pipe_info.pipe) |