usb: renesas_usbhs: modify data transfer interrupt
[pandora-kernel.git] / drivers / usb / renesas_usbhs / pipe.c
index 75e9e3c..56137d5 100644 (file)
@@ -531,12 +531,19 @@ static struct usbhs_pipe *usbhsp_get_pipe(struct usbhs_priv *priv, u32 type)
        return pipe;
 }
 
-void usbhs_pipe_init(struct usbhs_priv *priv)
+void usbhs_pipe_init(struct usbhs_priv *priv,
+                    void (*done)(struct usbhs_pkt *pkt))
 {
        struct usbhs_pipe_info *info = usbhs_priv_to_pipeinfo(priv);
+       struct device *dev = usbhs_priv_to_dev(priv);
        struct usbhs_pipe *pipe;
        int i;
 
+       if (!done) {
+               dev_err(dev, "no done function\n");
+               return;
+       }
+
        /*
         * FIXME
         *
@@ -556,11 +563,14 @@ void usbhs_pipe_init(struct usbhs_priv *priv)
 
                usbhsp_flags_init(pipe);
                pipe->mod_private = NULL;
+               INIT_LIST_HEAD(&pipe->list);
 
                /* pipe force init */
                usbhsp_pipectrl_set(pipe, ACLRM, ACLRM);
                usbhsp_pipectrl_set(pipe, ACLRM, 0);
        }
+
+       info->done = done;
 }
 
 struct usbhs_pipe *usbhs_pipe_malloc(struct usbhs_priv *priv,
@@ -580,6 +590,8 @@ struct usbhs_pipe *usbhs_pipe_malloc(struct usbhs_priv *priv,
                return NULL;
        }
 
+       INIT_LIST_HEAD(&pipe->list);
+
        usbhs_pipe_disable(pipe);
 
        /* make sure pipe is not busy */
@@ -627,6 +639,7 @@ struct usbhs_pipe *usbhs_dcp_malloc(struct usbhs_priv *priv)
 
        usbhsp_pipe_select(pipe);
        usbhs_pipe_clear_sequence(pipe);
+       INIT_LIST_HEAD(&pipe->list);
 
        return pipe;
 }
@@ -639,7 +652,6 @@ void usbhs_dcp_control_transfer_done(struct usbhs_pipe *pipe)
        usbhsp_pipectrl_set(pipe, CCPL, CCPL);
 }
 
-
 /*
  *             pipe module function
  */