aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/renesas_usbhs
diff options
context:
space:
mode:
authorKuninori Morimoto <kuninori.morimoto.gx@renesas.com>2011-10-11 00:58:45 -0400
committerFelipe Balbi <balbi@ti.com>2011-10-13 13:40:01 -0400
commit51b8a0218b885b5e527da776e20022273a838893 (patch)
tree4a05c520206e863571da491916346f678a0b9a58 /drivers/usb/renesas_usbhs
parentca8a282a5373f96d0ea002d97a168211448e8526 (diff)
usb: gadget: renesas_usbhs: move USBHSF_PKT_xxx to pipe.c
There is no longer necessity that USBHSF_PKT_xxx are in fifo.h. it are used in only fifo.c now. This patch move it. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
Diffstat (limited to 'drivers/usb/renesas_usbhs')
-rw-r--r--drivers/usb/renesas_usbhs/fifo.c19
-rw-r--r--drivers/usb/renesas_usbhs/fifo.h12
2 files changed, 16 insertions, 15 deletions
diff --git a/drivers/usb/renesas_usbhs/fifo.c b/drivers/usb/renesas_usbhs/fifo.c
index a34430f55fb7..7eacacda8589 100644
--- a/drivers/usb/renesas_usbhs/fifo.c
+++ b/drivers/usb/renesas_usbhs/fifo.c
@@ -118,7 +118,13 @@ struct usbhs_pkt *usbhs_pkt_pop(struct usbhs_pipe *pipe, struct usbhs_pkt *pkt)
118 return pkt; 118 return pkt;
119} 119}
120 120
121int __usbhs_pkt_handler(struct usbhs_pipe *pipe, int type) 121enum {
122 USBHSF_PKT_PREPARE,
123 USBHSF_PKT_TRY_RUN,
124 USBHSF_PKT_DMA_DONE,
125};
126
127static int usbhsf_pkt_handler(struct usbhs_pipe *pipe, int type)
122{ 128{
123 struct usbhs_priv *priv = usbhs_pipe_to_priv(pipe); 129 struct usbhs_priv *priv = usbhs_pipe_to_priv(pipe);
124 struct usbhs_pipe_info *info = usbhs_priv_to_pipeinfo(priv); 130 struct usbhs_pipe_info *info = usbhs_priv_to_pipeinfo(priv);
@@ -168,6 +174,11 @@ __usbhs_pkt_handler_end:
168 return ret; 174 return ret;
169} 175}
170 176
177void usbhs_pkt_start(struct usbhs_pipe *pipe)
178{
179 usbhsf_pkt_handler(pipe, USBHSF_PKT_PREPARE);
180}
181
171/* 182/*
172 * irq enable/disable function 183 * irq enable/disable function
173 */ 184 */
@@ -884,7 +895,7 @@ static int usbhsf_irq_empty(struct usbhs_priv *priv,
884 if (!(irq_state->bempsts & (1 << i))) 895 if (!(irq_state->bempsts & (1 << i)))
885 continue; 896 continue;
886 897
887 ret = usbhs_pkt_run(pipe); 898 ret = usbhsf_pkt_handler(pipe, USBHSF_PKT_TRY_RUN);
888 if (ret < 0) 899 if (ret < 0)
889 dev_err(dev, "irq_empty run_error %d : %d\n", i, ret); 900 dev_err(dev, "irq_empty run_error %d : %d\n", i, ret);
890 } 901 }
@@ -914,7 +925,7 @@ static int usbhsf_irq_ready(struct usbhs_priv *priv,
914 if (!(irq_state->brdysts & (1 << i))) 925 if (!(irq_state->brdysts & (1 << i)))
915 continue; 926 continue;
916 927
917 ret = usbhs_pkt_run(pipe); 928 ret = usbhsf_pkt_handler(pipe, USBHSF_PKT_TRY_RUN);
918 if (ret < 0) 929 if (ret < 0)
919 dev_err(dev, "irq_ready run_error %d : %d\n", i, ret); 930 dev_err(dev, "irq_ready run_error %d : %d\n", i, ret);
920 } 931 }
@@ -929,7 +940,7 @@ static void usbhsf_dma_complete(void *arg)
929 struct device *dev = usbhs_priv_to_dev(priv); 940 struct device *dev = usbhs_priv_to_dev(priv);
930 int ret; 941 int ret;
931 942
932 ret = usbhs_pkt_dmadone(pipe); 943 ret = usbhsf_pkt_handler(pipe, USBHSF_PKT_DMA_DONE);
933 if (ret < 0) 944 if (ret < 0)
934 dev_err(dev, "dma_complete run_error %d : %d\n", 945 dev_err(dev, "dma_complete run_error %d : %d\n",
935 usbhs_pipe_number(pipe), ret); 946 usbhs_pipe_number(pipe), ret);
diff --git a/drivers/usb/renesas_usbhs/fifo.h b/drivers/usb/renesas_usbhs/fifo.h
index ed6d8e56c13c..7a78440e7647 100644
--- a/drivers/usb/renesas_usbhs/fifo.h
+++ b/drivers/usb/renesas_usbhs/fifo.h
@@ -76,12 +76,6 @@ void usbhs_fifo_quit(struct usbhs_priv *priv);
76/* 76/*
77 * packet info 77 * packet info
78 */ 78 */
79enum {
80 USBHSF_PKT_PREPARE,
81 USBHSF_PKT_TRY_RUN,
82 USBHSF_PKT_DMA_DONE,
83};
84
85extern struct usbhs_pkt_handle usbhs_fifo_pio_push_handler; 79extern struct usbhs_pkt_handle usbhs_fifo_pio_push_handler;
86extern struct usbhs_pkt_handle usbhs_fifo_pio_pop_handler; 80extern struct usbhs_pkt_handle usbhs_fifo_pio_pop_handler;
87extern struct usbhs_pkt_handle usbhs_ctrl_stage_end_handler; 81extern struct usbhs_pkt_handle usbhs_ctrl_stage_end_handler;
@@ -95,10 +89,6 @@ void usbhs_pkt_push(struct usbhs_pipe *pipe, struct usbhs_pkt *pkt,
95 struct usbhs_pkt_handle *handler, 89 struct usbhs_pkt_handle *handler,
96 void *buf, int len, int zero); 90 void *buf, int len, int zero);
97struct usbhs_pkt *usbhs_pkt_pop(struct usbhs_pipe *pipe, struct usbhs_pkt *pkt); 91struct usbhs_pkt *usbhs_pkt_pop(struct usbhs_pipe *pipe, struct usbhs_pkt *pkt);
98int __usbhs_pkt_handler(struct usbhs_pipe *pipe, int type); 92void usbhs_pkt_start(struct usbhs_pipe *pipe);
99
100#define usbhs_pkt_start(p) __usbhs_pkt_handler(p, USBHSF_PKT_PREPARE)
101#define usbhs_pkt_run(p) __usbhs_pkt_handler(p, USBHSF_PKT_TRY_RUN)
102#define usbhs_pkt_dmadone(p) __usbhs_pkt_handler(p, USBHSF_PKT_DMA_DONE)
103 93
104#endif /* RENESAS_USB_FIFO_H */ 94#endif /* RENESAS_USB_FIFO_H */