]> git.openfabrics.org - ~shefty/rdma-dev.git/commitdiff
usb: gadget: renesas_usbhs: add usbhs_dcp_dir_for_host()
authorKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Tue, 11 Oct 2011 05:02:57 +0000 (22:02 -0700)
committerFelipe Balbi <balbi@ti.com>
Thu, 13 Oct 2011 17:41:41 +0000 (20:41 +0300)
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>
drivers/usb/renesas_usbhs/fifo.c
drivers/usb/renesas_usbhs/pipe.c
drivers/usb/renesas_usbhs/pipe.h

index 328238c373f67a894dcf778012b3fb91c3b4fbf6..b9ab8aefcae02f6c5c5428cc276c5c5b89fcec18 100644 (file)
@@ -291,9 +291,13 @@ static int usbhsf_fifo_select(struct usbhs_pipe *pipe,
            usbhsf_fifo_is_busy(fifo))
                return -EBUSY;
 
-       if (usbhs_pipe_is_dcp(pipe))
+       if (usbhs_pipe_is_dcp(pipe)) {
                base |= (1 == write) << 5;      /* ISEL */
 
+               if (usbhs_mod_is_host(priv))
+                       usbhs_dcp_dir_for_host(pipe, write);
+       }
+
        /* "base" will be used below  */
        usbhs_write(priv, fifo->sel, base | MBW_32);
 
index ff97a8e4fcda977ed85dd8ed665373768dbbd85f..5238287dc2cbec8cc1f6834d9aa46e0f6cfb1a37 100644 (file)
@@ -630,6 +630,12 @@ void usbhs_dcp_control_transfer_done(struct usbhs_pipe *pipe)
        usbhsp_pipectrl_set(pipe, CCPL, CCPL);
 }
 
+void usbhs_dcp_dir_for_host(struct usbhs_pipe *pipe, int dir_out)
+{
+       usbhsp_pipe_cfg_set(pipe, DIR_OUT,
+                           dir_out ? DIR_OUT : 0);
+}
+
 /*
  *             pipe module function
  */
index 8120fad73b2d1c6091c700f1da25c7c2077b9eb0..6073a5c77740e0d5ba2f988f6aac8b010a91744d 100644 (file)
@@ -106,5 +106,6 @@ void usbhs_pipe_config_update(struct usbhs_pipe *pipe, u16 epnum, u16 maxp);
  */
 struct usbhs_pipe *usbhs_dcp_malloc(struct usbhs_priv *priv);
 void usbhs_dcp_control_transfer_done(struct usbhs_pipe *pipe);
+void usbhs_dcp_dir_for_host(struct usbhs_pipe *pipe, int dir_out);
 
 #endif /* RENESAS_USB_PIPE_H */