Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 163462
b: refs/heads/master
c: ef5ce3b
h: refs/heads/master
v: v3
  • Loading branch information
Magnus Damm authored and Paul Mundt committed Aug 20, 2009
1 parent 6d133e4 commit 1616dca
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 23 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: d2e27bdf2870e507dd4abba1f56ca84ee6ae7232
refs/heads/master: ef5ce3b69028ea32aa87e98c9a3802e7c9f824b6
32 changes: 11 additions & 21 deletions trunk/drivers/usb/gadget/r8a66597-udc.c
Original file line number Diff line number Diff line change
Expand Up @@ -252,24 +252,27 @@ static int pipe_buffer_setting(struct r8a66597 *r8a66597,
buf_bsize = 0;
break;
case R8A66597_BULK:
bufnum = r8a66597->bi_bufnum +
(info->pipe - R8A66597_BASE_PIPENUM_BULK) * 16;
r8a66597->bi_bufnum += 16;
/* isochronous pipes may be used as bulk pipes */
if (info->pipe > R8A66597_BASE_PIPENUM_BULK)
bufnum = info->pipe - R8A66597_BASE_PIPENUM_BULK;
else
bufnum = info->pipe - R8A66597_BASE_PIPENUM_ISOC;

bufnum = R8A66597_BASE_BUFNUM + (bufnum * 16);
buf_bsize = 7;
pipecfg |= R8A66597_DBLB;
if (!info->dir_in)
pipecfg |= R8A66597_SHTNAK;
break;
case R8A66597_ISO:
bufnum = r8a66597->bi_bufnum +
bufnum = R8A66597_BASE_BUFNUM +
(info->pipe - R8A66597_BASE_PIPENUM_ISOC) * 16;
r8a66597->bi_bufnum += 16;
buf_bsize = 7;
break;
}
if (r8a66597->bi_bufnum > R8A66597_MAX_BUFNUM) {
printk(KERN_ERR "r8a66597 pipe memory is insufficient(%d)\n",
r8a66597->bi_bufnum);

if (buf_bsize && ((bufnum + 16) >= R8A66597_MAX_BUFNUM)) {
pr_err(KERN_ERR "r8a66597 pipe memory is insufficient\n");
return -ENOMEM;
}

Expand All @@ -289,17 +292,6 @@ static void pipe_buffer_release(struct r8a66597 *r8a66597,
if (info->pipe == 0)
return;

switch (info->type) {
case R8A66597_BULK:
if (is_bulk_pipe(info->pipe))
r8a66597->bi_bufnum -= 16;
break;
case R8A66597_ISO:
if (is_isoc_pipe(info->pipe))
r8a66597->bi_bufnum -= 16;
break;
}

if (is_bulk_pipe(info->pipe))
r8a66597->bulk--;
else if (is_interrupt_pipe(info->pipe))
Expand Down Expand Up @@ -1553,8 +1545,6 @@ static int __init r8a66597_probe(struct platform_device *pdev)
r8a66597->timer.data = (unsigned long)r8a66597;
r8a66597->reg = (unsigned long)reg;

r8a66597->bi_bufnum = R8A66597_BASE_BUFNUM;

#ifdef CONFIG_HAVE_CLK
if (r8a66597->pdata->on_chip) {
snprintf(clk_name, sizeof(clk_name), "usb%d", pdev->id);
Expand Down
1 change: 0 additions & 1 deletion trunk/drivers/usb/gadget/r8a66597-udc.h
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,6 @@ struct r8a66597 {
u16 old_dvsq;

/* pipe config */
unsigned short bi_bufnum; /* bulk and isochronous's bufnum */
unsigned char bulk;
unsigned char interrupt;
unsigned char isochronous;
Expand Down

0 comments on commit 1616dca

Please sign in to comment.