renesas_usbhs: cleanup quoted includes
[cascardo/linux.git] / drivers / usb / renesas_usbhs / pipe.c
index c74389c..122526c 100644 (file)
@@ -16,8 +16,8 @@
  */
 #include <linux/delay.h>
 #include <linux/slab.h>
-#include "./common.h"
-#include "./pipe.h"
+#include "common.h"
+#include "pipe.h"
 
 /*
  *             macros
@@ -257,6 +257,13 @@ void usbhs_pipe_stall(struct usbhs_pipe *pipe)
        }
 }
 
+int usbhs_pipe_is_stall(struct usbhs_pipe *pipe)
+{
+       u16 pid = usbhsp_pipectrl_get(pipe) & PID_MASK;
+
+       return (int)(pid == PID_STALL10 || pid == PID_STALL11);
+}
+
 /*
  *             pipe setup
  */
@@ -323,8 +330,7 @@ static u16 usbhsp_setup_pipecfg(struct usbhs_pipe *pipe,
        if (dir_in)
                usbhsp_flags_set(pipe, IS_DIR_HOST);
 
-       if ((is_host  && !dir_in) ||
-           (!is_host && dir_in))
+       if (!!is_host ^ !!dir_in)
                dir |= DIR_OUT;
 
        if (!dir)
@@ -471,10 +477,27 @@ int usbhs_pipe_is_dir_host(struct usbhs_pipe *pipe)
        return usbhsp_flags_has(pipe, IS_DIR_HOST);
 }
 
-void usbhs_pipe_data_sequence(struct usbhs_pipe *pipe, int data)
+void usbhs_pipe_data_sequence(struct usbhs_pipe *pipe, int sequence)
 {
        u16 mask = (SQCLR | SQSET);
-       u16 val = (data) ? SQSET : SQCLR;
+       u16 val;
+
+       /*
+        * sequence
+        *  0  : data0
+        *  1  : data1
+        *  -1 : no change
+        */
+       switch (sequence) {
+       case 0:
+               val = SQCLR;
+               break;
+       case 1:
+               val = SQSET;
+               break;
+       default:
+               return;
+       }
 
        usbhsp_pipectrl_set(pipe, mask, val);
 }