Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 163308
b: refs/heads/master
c: 4048e5c
h: refs/heads/master
v: v3
  • Loading branch information
Magnus Damm authored and Paul Mundt committed Jul 4, 2009
1 parent 976ece4 commit 46ac653
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 24 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: 5084f61a4d6c9c7bfd3be07fbb5253c1a08cd568
refs/heads/master: 4048e5ca29afbd747a16245f2bc4d1d521a6d0d0
34 changes: 12 additions & 22 deletions trunk/drivers/usb/gadget/m66592-udc.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ MODULE_LICENSE("GPL");
MODULE_AUTHOR("Yoshihiro Shimoda");
MODULE_ALIAS("platform:m66592_udc");

#define DRIVER_VERSION "18 Oct 2007"
#define DRIVER_VERSION "26 Jun 2009"

/* module parameters */
#if defined(CONFIG_SUPERH_BUILT_IN_M66592)
Expand Down Expand Up @@ -276,24 +276,27 @@ static int pipe_buffer_setting(struct m66592 *m66592,
buf_bsize = 0;
break;
case M66592_BULK:
bufnum = m66592->bi_bufnum +
(info->pipe - M66592_BASE_PIPENUM_BULK) * 16;
m66592->bi_bufnum += 16;
/* isochronous pipes may be used as bulk pipes */
if (info->pipe > M66592_BASE_PIPENUM_BULK)
bufnum = info->pipe - M66592_BASE_PIPENUM_BULK;
else
bufnum = info->pipe - M66592_BASE_PIPENUM_ISOC;

bufnum = M66592_BASE_BUFNUM + (bufnum * 16);
buf_bsize = 7;
pipecfg |= M66592_DBLB;
if (!info->dir_in)
pipecfg |= M66592_SHTNAK;
break;
case M66592_ISO:
bufnum = m66592->bi_bufnum +
bufnum = M66592_BASE_BUFNUM +
(info->pipe - M66592_BASE_PIPENUM_ISOC) * 16;
m66592->bi_bufnum += 16;
buf_bsize = 7;
break;
}
if (m66592->bi_bufnum > M66592_MAX_BUFNUM) {
pr_err("m66592 pipe memory is insufficient(%d)\n",
m66592->bi_bufnum);

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

Expand All @@ -313,17 +316,6 @@ static void pipe_buffer_release(struct m66592 *m66592,
if (info->pipe == 0)
return;

switch (info->type) {
case M66592_BULK:
if (is_bulk_pipe(info->pipe))
m66592->bi_bufnum -= 16;
break;
case M66592_ISO:
if (is_isoc_pipe(info->pipe))
m66592->bi_bufnum -= 16;
break;
}

if (is_bulk_pipe(info->pipe)) {
m66592->bulk--;
} else if (is_interrupt_pipe(info->pipe))
Expand Down Expand Up @@ -1603,8 +1595,6 @@ static int __init m66592_probe(struct platform_device *pdev)
m66592->timer.data = (unsigned long)m66592;
m66592->reg = reg;

m66592->bi_bufnum = M66592_BASE_BUFNUM;

ret = request_irq(irq, m66592_irq, IRQF_DISABLED | IRQF_SHARED,
udc_name, m66592);
if (ret < 0) {
Expand Down
1 change: 0 additions & 1 deletion trunk/drivers/usb/gadget/m66592-udc.h
Original file line number Diff line number Diff line change
Expand Up @@ -506,7 +506,6 @@ struct m66592 {
int interrupt;
int isochronous;
int num_dma;
int bi_bufnum; /* bulk and isochronous's bufnum */
};

#define gadget_to_m66592(_gadget) container_of(_gadget, struct m66592, gadget)
Expand Down

0 comments on commit 46ac653

Please sign in to comment.