usb: renesas_usbhs: add usbhs_pipe_is_stall()
authorKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Fri, 25 Nov 2011 01:27:32 +0000 (17:27 -0800)
committerFelipe Balbi <balbi@ti.com>
Mon, 12 Dec 2011 09:45:15 +0000 (11:45 +0200)
This is preparation for chapter 9 test

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
drivers/usb/renesas_usbhs/pipe.c
drivers/usb/renesas_usbhs/pipe.h

index c74389ce2177e9da4b75c77bfdd789500af351b4..c36ad4c3a25988fe91ec1f192fadbc6601606e72 100644 (file)
@@ -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
  */
index 6334fc644cc08f425893da7e7c4170e1abd4e7c8..fa18b7dc2b2aff8e63cd04190c18288d44ca3c6c 100644 (file)
@@ -87,6 +87,7 @@ int usbhs_pipe_is_accessible(struct usbhs_pipe *pipe);
 void usbhs_pipe_enable(struct usbhs_pipe *pipe);
 void usbhs_pipe_disable(struct usbhs_pipe *pipe);
 void usbhs_pipe_stall(struct usbhs_pipe *pipe);
+int usbhs_pipe_is_stall(struct usbhs_pipe *pipe);
 void usbhs_pipe_select_fifo(struct usbhs_pipe *pipe, struct usbhs_fifo *fifo);
 void usbhs_pipe_config_update(struct usbhs_pipe *pipe, u16 devsel,
                              u16 epnum, u16 maxp);