Commit 2cc97197 authored by Kuninori Morimoto's avatar Kuninori Morimoto Committed by Felipe Balbi

usb: gadget: renesas_usbhs: add struct usbhs_priv to packet done function

There was no method to get struct usbhs_priv when
packet transfer done function was called.
This patch allow that callback function receive it.
Signed-off-by: default avatarKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: default avatarFelipe Balbi <balbi@ti.com>
parent 92352071
...@@ -171,7 +171,7 @@ static int usbhsf_pkt_handler(struct usbhs_pipe *pipe, int type) ...@@ -171,7 +171,7 @@ static int usbhsf_pkt_handler(struct usbhs_pipe *pipe, int type)
/******************** spin unlock ******************/ /******************** spin unlock ******************/
if (is_done) { if (is_done) {
info->done(pkt); info->done(priv, pkt);
usbhs_pkt_start(pipe); usbhs_pkt_start(pipe);
} }
......
...@@ -159,7 +159,7 @@ static void usbhsg_queue_pop(struct usbhsg_uep *uep, ...@@ -159,7 +159,7 @@ static void usbhsg_queue_pop(struct usbhsg_uep *uep,
ureq->req.complete(&uep->ep, &ureq->req); ureq->req.complete(&uep->ep, &ureq->req);
} }
static void usbhsg_queue_done(struct usbhs_pkt *pkt) static void usbhsg_queue_done(struct usbhs_priv *priv, struct usbhs_pkt *pkt)
{ {
struct usbhs_pipe *pipe = pkt->pipe; struct usbhs_pipe *pipe = pkt->pipe;
struct usbhsg_uep *uep = usbhsg_pipe_to_uep(pipe); struct usbhsg_uep *uep = usbhsg_pipe_to_uep(pipe);
......
...@@ -497,7 +497,8 @@ static struct usbhs_pipe *usbhsp_get_pipe(struct usbhs_priv *priv, u32 type) ...@@ -497,7 +497,8 @@ static struct usbhs_pipe *usbhsp_get_pipe(struct usbhs_priv *priv, u32 type)
} }
void usbhs_pipe_init(struct usbhs_priv *priv, void usbhs_pipe_init(struct usbhs_priv *priv,
void (*done)(struct usbhs_pkt *pkt), void (*done)(struct usbhs_priv *priv,
struct usbhs_pkt *pkt),
int (*dma_map_ctrl)(struct usbhs_pkt *pkt, int map)) int (*dma_map_ctrl)(struct usbhs_pkt *pkt, int map))
{ {
struct usbhs_pipe_info *info = usbhs_priv_to_pipeinfo(priv); struct usbhs_pipe_info *info = usbhs_priv_to_pipeinfo(priv);
......
...@@ -47,7 +47,7 @@ struct usbhs_pipe_info { ...@@ -47,7 +47,7 @@ struct usbhs_pipe_info {
int size; /* array size of "pipe" */ int size; /* array size of "pipe" */
int bufnmb_last; /* FIXME : driver needs good allocator */ int bufnmb_last; /* FIXME : driver needs good allocator */
void (*done)(struct usbhs_pkt *pkt); void (*done)(struct usbhs_priv *priv, struct usbhs_pkt *pkt);
int (*dma_map_ctrl)(struct usbhs_pkt *pkt, int map); int (*dma_map_ctrl)(struct usbhs_pkt *pkt, int map);
}; };
...@@ -80,7 +80,8 @@ void usbhs_pipe_remove(struct usbhs_priv *priv); ...@@ -80,7 +80,8 @@ void usbhs_pipe_remove(struct usbhs_priv *priv);
int usbhs_pipe_is_dir_in(struct usbhs_pipe *pipe); int usbhs_pipe_is_dir_in(struct usbhs_pipe *pipe);
int usbhs_pipe_is_dir_host(struct usbhs_pipe *pipe); int usbhs_pipe_is_dir_host(struct usbhs_pipe *pipe);
void usbhs_pipe_init(struct usbhs_priv *priv, void usbhs_pipe_init(struct usbhs_priv *priv,
void (*done)(struct usbhs_pkt *pkt), void (*done)(struct usbhs_priv *priv,
struct usbhs_pkt *pkt),
int (*dma_map_ctrl)(struct usbhs_pkt *pkt, int map)); int (*dma_map_ctrl)(struct usbhs_pkt *pkt, int map));
int usbhs_pipe_get_maxpacket(struct usbhs_pipe *pipe); int usbhs_pipe_get_maxpacket(struct usbhs_pipe *pipe);
void usbhs_pipe_clear_sequence(struct usbhs_pipe *pipe); void usbhs_pipe_clear_sequence(struct usbhs_pipe *pipe);
......
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