Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 265085
b: refs/heads/master
c: 7fd097e
h: refs/heads/master
i:
  265083: 5290786
v: v3
  • Loading branch information
Kuninori Morimoto authored and Felipe Balbi committed Oct 13, 2011
1 parent 2b8543f commit 51c42e9
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 22 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: f5aa889f725b56934171f9845cf00a17de9cc76c
refs/heads/master: 7fd097e727466cda1b22beca6cb11096b8be88d2
29 changes: 8 additions & 21 deletions trunk/drivers/usb/renesas_usbhs/pipe.c
Original file line number Diff line number Diff line change
Expand Up @@ -106,17 +106,6 @@ static void __usbhsp_pipe_xxx_set(struct usbhs_pipe *pipe,
usbhs_bset(priv, pipe_reg, mask, val);
}

static u16 __usbhsp_pipe_xxx_get(struct usbhs_pipe *pipe,
u16 dcp_reg, u16 pipe_reg)
{
struct usbhs_priv *priv = usbhs_pipe_to_priv(pipe);

if (usbhs_pipe_is_dcp(pipe))
return usbhs_read(priv, dcp_reg);
else
return usbhs_read(priv, pipe_reg);
}

/*
* DCPCFG/PIPECFG functions
*/
Expand Down Expand Up @@ -144,11 +133,6 @@ static void usbhsp_pipe_maxp_set(struct usbhs_pipe *pipe, u16 mask, u16 val)
__usbhsp_pipe_xxx_set(pipe, DCPMAXP, PIPEMAXP, mask, val);
}

static u16 usbhsp_pipe_maxp_get(struct usbhs_pipe *pipe)
{
return __usbhsp_pipe_xxx_get(pipe, DCPMAXP, PIPEMAXP);
}

/*
* pipe control functions
*/
Expand Down Expand Up @@ -465,6 +449,8 @@ void usbhs_pipe_config_update(struct usbhs_pipe *pipe, u16 epnum, u16 maxp)
{
usbhsp_pipe_barrier(pipe);

pipe->maxp = maxp;

usbhsp_pipe_select(pipe);
usbhsp_pipe_maxp_set(pipe, 0xFFFF, maxp);

Expand All @@ -477,11 +463,12 @@ void usbhs_pipe_config_update(struct usbhs_pipe *pipe, u16 epnum, u16 maxp)
*/
int usbhs_pipe_get_maxpacket(struct usbhs_pipe *pipe)
{
u16 mask = usbhs_pipe_is_dcp(pipe) ? DCP_MAXP_MASK : PIPE_MAXP_MASK;

usbhsp_pipe_select(pipe);

return (int)(usbhsp_pipe_maxp_get(pipe) & mask);
/*
* see
* usbhs_pipe_config_update()
* usbhs_dcp_malloc()
*/
return pipe->maxp;
}

int usbhs_pipe_is_dir_in(struct usbhs_pipe *pipe)
Expand Down
2 changes: 2 additions & 0 deletions trunk/drivers/usb/renesas_usbhs/pipe.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ struct usbhs_pipe {
struct usbhs_fifo *fifo;
struct list_head list;

int maxp;

u32 flags;
#define USBHS_PIPE_FLAGS_IS_USED (1 << 0)
#define USBHS_PIPE_FLAGS_IS_DIR_IN (1 << 1)
Expand Down

0 comments on commit 51c42e9

Please sign in to comment.