Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 265083
b: refs/heads/master
c: 51b8a02
h: refs/heads/master
i:
  265081: 918643e
  265079: 4e1e013
v: v3
  • Loading branch information
Kuninori Morimoto authored and Felipe Balbi committed Oct 13, 2011
1 parent 614f611 commit 5290786
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 16 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: ca8a282a5373f96d0ea002d97a168211448e8526
refs/heads/master: 51b8a0218b885b5e527da776e20022273a838893
19 changes: 15 additions & 4 deletions trunk/drivers/usb/renesas_usbhs/fifo.c
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,13 @@ struct usbhs_pkt *usbhs_pkt_pop(struct usbhs_pipe *pipe, struct usbhs_pkt *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_pipe_info *info = usbhs_priv_to_pipeinfo(priv);
Expand Down Expand Up @@ -168,6 +174,11 @@ int __usbhs_pkt_handler(struct usbhs_pipe *pipe, int type)
return ret;
}

void usbhs_pkt_start(struct usbhs_pipe *pipe)
{
usbhsf_pkt_handler(pipe, USBHSF_PKT_PREPARE);
}

/*
* irq enable/disable function
*/
Expand Down Expand Up @@ -884,7 +895,7 @@ static int usbhsf_irq_empty(struct usbhs_priv *priv,
if (!(irq_state->bempsts & (1 << i)))
continue;

ret = usbhs_pkt_run(pipe);
ret = usbhsf_pkt_handler(pipe, USBHSF_PKT_TRY_RUN);
if (ret < 0)
dev_err(dev, "irq_empty run_error %d : %d\n", i, ret);
}
Expand Down Expand Up @@ -914,7 +925,7 @@ static int usbhsf_irq_ready(struct usbhs_priv *priv,
if (!(irq_state->brdysts & (1 << i)))
continue;

ret = usbhs_pkt_run(pipe);
ret = usbhsf_pkt_handler(pipe, USBHSF_PKT_TRY_RUN);
if (ret < 0)
dev_err(dev, "irq_ready run_error %d : %d\n", i, ret);
}
Expand All @@ -929,7 +940,7 @@ static void usbhsf_dma_complete(void *arg)
struct device *dev = usbhs_priv_to_dev(priv);
int ret;

ret = usbhs_pkt_dmadone(pipe);
ret = usbhsf_pkt_handler(pipe, USBHSF_PKT_DMA_DONE);
if (ret < 0)
dev_err(dev, "dma_complete run_error %d : %d\n",
usbhs_pipe_number(pipe), ret);
Expand Down
12 changes: 1 addition & 11 deletions trunk/drivers/usb/renesas_usbhs/fifo.h
Original file line number Diff line number Diff line change
Expand Up @@ -76,12 +76,6 @@ void usbhs_fifo_quit(struct usbhs_priv *priv);
/*
* 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_pop_handler;
extern struct usbhs_pkt_handle usbhs_ctrl_stage_end_handler;
Expand All @@ -95,10 +89,6 @@ void usbhs_pkt_push(struct usbhs_pipe *pipe, struct usbhs_pkt *pkt,
struct usbhs_pkt_handle *handler,
void *buf, int len, int zero);
struct usbhs_pkt *usbhs_pkt_pop(struct usbhs_pipe *pipe, struct usbhs_pkt *pkt);
int __usbhs_pkt_handler(struct usbhs_pipe *pipe, int type);

#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)
void usbhs_pkt_start(struct usbhs_pipe *pipe);

#endif /* RENESAS_USB_FIFO_H */

0 comments on commit 5290786

Please sign in to comment.