aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKuninori Morimoto <kuninori.morimoto.gx@renesas.com>2011-10-11 01:02:57 -0400
committerFelipe Balbi <balbi@ti.com>2011-10-13 13:41:41 -0400
commit923520715b5a698271f8763e97eee65e21d5561e (patch)
tree6acf86bdf6ea20832695cd227c39050f1c9d4851
parent0deb3e77025688e0650e1af672d3e42e15cd8916 (diff)
usb: gadget: renesas_usbhs: add usbhs_dcp_dir_for_host()
renesas_usbhs device needs special bit settings if it was mod_host and dcp pipe. This patch support it. 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/fifo.c6
-rw-r--r--drivers/usb/renesas_usbhs/pipe.c6
-rw-r--r--drivers/usb/renesas_usbhs/pipe.h1
3 files changed, 12 insertions, 1 deletions
diff --git a/drivers/usb/renesas_usbhs/fifo.c b/drivers/usb/renesas_usbhs/fifo.c
index 328238c373f..b9ab8aefcae 100644
--- a/drivers/usb/renesas_usbhs/fifo.c
+++ b/drivers/usb/renesas_usbhs/fifo.c
@@ -291,9 +291,13 @@ static int usbhsf_fifo_select(struct usbhs_pipe *pipe,
291 usbhsf_fifo_is_busy(fifo)) 291 usbhsf_fifo_is_busy(fifo))
292 return -EBUSY; 292 return -EBUSY;
293 293
294 if (usbhs_pipe_is_dcp(pipe)) 294 if (usbhs_pipe_is_dcp(pipe)) {
295 base |= (1 == write) << 5; /* ISEL */ 295 base |= (1 == write) << 5; /* ISEL */
296 296
297 if (usbhs_mod_is_host(priv))
298 usbhs_dcp_dir_for_host(pipe, write);
299 }
300
297 /* "base" will be used below */ 301 /* "base" will be used below */
298 usbhs_write(priv, fifo->sel, base | MBW_32); 302 usbhs_write(priv, fifo->sel, base | MBW_32);
299 303
diff --git a/drivers/usb/renesas_usbhs/pipe.c b/drivers/usb/renesas_usbhs/pipe.c
index ff97a8e4fcd..5238287dc2c 100644
--- a/drivers/usb/renesas_usbhs/pipe.c
+++ b/drivers/usb/renesas_usbhs/pipe.c
@@ -630,6 +630,12 @@ void usbhs_dcp_control_transfer_done(struct usbhs_pipe *pipe)
630 usbhsp_pipectrl_set(pipe, CCPL, CCPL); 630 usbhsp_pipectrl_set(pipe, CCPL, CCPL);
631} 631}
632 632
633void usbhs_dcp_dir_for_host(struct usbhs_pipe *pipe, int dir_out)
634{
635 usbhsp_pipe_cfg_set(pipe, DIR_OUT,
636 dir_out ? DIR_OUT : 0);
637}
638
633/* 639/*
634 * pipe module function 640 * pipe module function
635 */ 641 */
diff --git a/drivers/usb/renesas_usbhs/pipe.h b/drivers/usb/renesas_usbhs/pipe.h
index 8120fad73b2..6073a5c7774 100644
--- a/drivers/usb/renesas_usbhs/pipe.h
+++ b/drivers/usb/renesas_usbhs/pipe.h
@@ -106,5 +106,6 @@ void usbhs_pipe_config_update(struct usbhs_pipe *pipe, u16 epnum, u16 maxp);
106 */ 106 */
107struct usbhs_pipe *usbhs_dcp_malloc(struct usbhs_priv *priv); 107struct usbhs_pipe *usbhs_dcp_malloc(struct usbhs_priv *priv);
108void usbhs_dcp_control_transfer_done(struct usbhs_pipe *pipe); 108void usbhs_dcp_control_transfer_done(struct usbhs_pipe *pipe);
109void usbhs_dcp_dir_for_host(struct usbhs_pipe *pipe, int dir_out);
109 110
110#endif /* RENESAS_USB_PIPE_H */ 111#endif /* RENESAS_USB_PIPE_H */