aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/renesas_usbhs/pipe.c
diff options
context:
space:
mode:
authorKuninori Morimoto <kuninori.morimoto.gx@renesas.com>2011-12-08 21:28:54 -0500
committerFelipe Balbi <balbi@ti.com>2011-12-13 06:06:26 -0500
commit3edeee3893b107364fe4ed8535245773b1e1e72b (patch)
treec2207d91e769635857b8f9b14e36ed686a6e8a32 /drivers/usb/renesas_usbhs/pipe.c
parente5679d07a6ca5512070fb5e65dcc66eeb5087d0d (diff)
usb: renesas_usbhs: care pipe sequence
driver has to re-use the limited pipe for each device/endpoint when it is USB host hub mode, since number of pipe has limitation. Then, each pipe should care own pipe sequence for next packet. This patch adds sequence control. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
Diffstat (limited to 'drivers/usb/renesas_usbhs/pipe.c')
-rw-r--r--drivers/usb/renesas_usbhs/pipe.c21
1 files changed, 19 insertions, 2 deletions
diff --git a/drivers/usb/renesas_usbhs/pipe.c b/drivers/usb/renesas_usbhs/pipe.c
index c36ad4c3a259..c2559e80d41f 100644
--- a/drivers/usb/renesas_usbhs/pipe.c
+++ b/drivers/usb/renesas_usbhs/pipe.c
@@ -478,10 +478,27 @@ int usbhs_pipe_is_dir_host(struct usbhs_pipe *pipe)
478 return usbhsp_flags_has(pipe, IS_DIR_HOST); 478 return usbhsp_flags_has(pipe, IS_DIR_HOST);
479} 479}
480 480
481void usbhs_pipe_data_sequence(struct usbhs_pipe *pipe, int data) 481void usbhs_pipe_data_sequence(struct usbhs_pipe *pipe, int sequence)
482{ 482{
483 u16 mask = (SQCLR | SQSET); 483 u16 mask = (SQCLR | SQSET);
484 u16 val = (data) ? SQSET : SQCLR; 484 u16 val;
485
486 /*
487 * sequence
488 * 0 : data0
489 * 1 : data1
490 * -1 : no change
491 */
492 switch (sequence) {
493 case 0:
494 val = SQCLR;
495 break;
496 case 1:
497 val = SQSET;
498 break;
499 default:
500 return;
501 }
485 502
486 usbhsp_pipectrl_set(pipe, mask, val); 503 usbhsp_pipectrl_set(pipe, mask, val);
487} 504}