Commit 51b8a021 authored by Kuninori Morimoto's avatar Kuninori Morimoto Committed by Felipe Balbi

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: default avatarKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: default avatarFelipe Balbi <balbi@ti.com>
parent ca8a282a
...@@ -118,7 +118,13 @@ struct usbhs_pkt *usbhs_pkt_pop(struct usbhs_pipe *pipe, struct usbhs_pkt *pkt) ...@@ -118,7 +118,13 @@ struct usbhs_pkt *usbhs_pkt_pop(struct usbhs_pipe *pipe, struct usbhs_pkt *pkt)
return pkt; return pkt;
} }
int __usbhs_pkt_handler(struct usbhs_pipe *pipe, int type) enum {
USBHSF_PKT_PREPARE,
USBHSF_PKT_TRY_RUN,
USBHSF_PKT_DMA_DONE,
};
static int usbhsf_pkt_handler(struct usbhs_pipe *pipe, int type)
{ {
struct usbhs_priv *priv = usbhs_pipe_to_priv(pipe); struct usbhs_priv *priv = usbhs_pipe_to_priv(pipe);
struct usbhs_pipe_info *info = usbhs_priv_to_pipeinfo(priv); struct usbhs_pipe_info *info = usbhs_priv_to_pipeinfo(priv);
...@@ -168,6 +174,11 @@ int __usbhs_pkt_handler(struct usbhs_pipe *pipe, int type) ...@@ -168,6 +174,11 @@ int __usbhs_pkt_handler(struct usbhs_pipe *pipe, int type)
return ret; return ret;
} }
void usbhs_pkt_start(struct usbhs_pipe *pipe)
{
usbhsf_pkt_handler(pipe, USBHSF_PKT_PREPARE);
}
/* /*
* irq enable/disable function * irq enable/disable function
*/ */
...@@ -884,7 +895,7 @@ static int usbhsf_irq_empty(struct usbhs_priv *priv, ...@@ -884,7 +895,7 @@ static int usbhsf_irq_empty(struct usbhs_priv *priv,
if (!(irq_state->bempsts & (1 << i))) if (!(irq_state->bempsts & (1 << i)))
continue; continue;
ret = usbhs_pkt_run(pipe); ret = usbhsf_pkt_handler(pipe, USBHSF_PKT_TRY_RUN);
if (ret < 0) if (ret < 0)
dev_err(dev, "irq_empty run_error %d : %d\n", i, ret); dev_err(dev, "irq_empty run_error %d : %d\n", i, ret);
} }
...@@ -914,7 +925,7 @@ static int usbhsf_irq_ready(struct usbhs_priv *priv, ...@@ -914,7 +925,7 @@ static int usbhsf_irq_ready(struct usbhs_priv *priv,
if (!(irq_state->brdysts & (1 << i))) if (!(irq_state->brdysts & (1 << i)))
continue; continue;
ret = usbhs_pkt_run(pipe); ret = usbhsf_pkt_handler(pipe, USBHSF_PKT_TRY_RUN);
if (ret < 0) if (ret < 0)
dev_err(dev, "irq_ready run_error %d : %d\n", i, ret); dev_err(dev, "irq_ready run_error %d : %d\n", i, ret);
} }
...@@ -929,7 +940,7 @@ static void usbhsf_dma_complete(void *arg) ...@@ -929,7 +940,7 @@ static void usbhsf_dma_complete(void *arg)
struct device *dev = usbhs_priv_to_dev(priv); struct device *dev = usbhs_priv_to_dev(priv);
int ret; int ret;
ret = usbhs_pkt_dmadone(pipe); ret = usbhsf_pkt_handler(pipe, USBHSF_PKT_DMA_DONE);
if (ret < 0) if (ret < 0)
dev_err(dev, "dma_complete run_error %d : %d\n", dev_err(dev, "dma_complete run_error %d : %d\n",
usbhs_pipe_number(pipe), ret); usbhs_pipe_number(pipe), ret);
......
...@@ -76,12 +76,6 @@ void usbhs_fifo_quit(struct usbhs_priv *priv); ...@@ -76,12 +76,6 @@ void usbhs_fifo_quit(struct usbhs_priv *priv);
/* /*
* packet info * packet info
*/ */
enum {
USBHSF_PKT_PREPARE,
USBHSF_PKT_TRY_RUN,
USBHSF_PKT_DMA_DONE,
};
extern struct usbhs_pkt_handle usbhs_fifo_pio_push_handler; extern struct usbhs_pkt_handle usbhs_fifo_pio_push_handler;
extern struct usbhs_pkt_handle usbhs_fifo_pio_pop_handler; extern struct usbhs_pkt_handle usbhs_fifo_pio_pop_handler;
extern struct usbhs_pkt_handle usbhs_ctrl_stage_end_handler; extern 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,10 +89,6 @@ void usbhs_pkt_push(struct usbhs_pipe *pipe, struct usbhs_pkt *pkt,
struct usbhs_pkt_handle *handler, struct usbhs_pkt_handle *handler,
void *buf, int len, int zero); void *buf, int len, int zero);
struct usbhs_pkt *usbhs_pkt_pop(struct usbhs_pipe *pipe, struct usbhs_pkt *pkt); struct usbhs_pkt *usbhs_pkt_pop(struct usbhs_pipe *pipe, struct usbhs_pkt *pkt);
int __usbhs_pkt_handler(struct usbhs_pipe *pipe, int type); void usbhs_pkt_start(struct usbhs_pipe *pipe);
#define usbhs_pkt_start(p) __usbhs_pkt_handler(p, USBHSF_PKT_PREPARE)
#define usbhs_pkt_run(p) __usbhs_pkt_handler(p, USBHSF_PKT_TRY_RUN)
#define usbhs_pkt_dmadone(p) __usbhs_pkt_handler(p, USBHSF_PKT_DMA_DONE)
#endif /* RENESAS_USB_FIFO_H */ #endif /* RENESAS_USB_FIFO_H */
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment