Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 163479
b: refs/heads/master
c: 9e7291c
h: refs/heads/master
i:
  163477: ed48022
  163475: eab6923
  163471: fb073ec
v: v3
  • Loading branch information
Yoshihiro Shimoda authored and Paul Mundt committed Aug 20, 2009
1 parent 42c7a52 commit c7a358c
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 3 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: a81bec7653a098349af247926bb19c2889dde803
refs/heads/master: 9e7291c1124655980ab05fc89930de8e218c7d64
28 changes: 26 additions & 2 deletions trunk/drivers/usb/gadget/r8a66597-udc.c
Original file line number Diff line number Diff line change
Expand Up @@ -966,8 +966,13 @@ static void clear_feature(struct r8a66597 *r8a66597,
u16 w_index = le16_to_cpu(ctrl->wIndex);

ep = r8a66597->epaddr2ep[w_index & USB_ENDPOINT_NUMBER_MASK];
pipe_stop(r8a66597, ep->pipenum);
control_reg_sqclr(r8a66597, ep->pipenum);
if (!ep->wedge) {
pipe_stop(r8a66597, ep->pipenum);
control_reg_sqclr(r8a66597, ep->pipenum);
spin_unlock(&r8a66597->lock);
usb_ep_clear_halt(&ep->ep);
spin_lock(&r8a66597->lock);
}

control_end(r8a66597, 1);

Expand Down Expand Up @@ -1340,6 +1345,7 @@ static int r8a66597_set_halt(struct usb_ep *_ep, int value)
pipe_stall(ep->r8a66597, ep->pipenum);
} else {
ep->busy = 0;
ep->wedge = 0;
pipe_stop(ep->r8a66597, ep->pipenum);
}

Expand All @@ -1348,6 +1354,23 @@ static int r8a66597_set_halt(struct usb_ep *_ep, int value)
return ret;
}

static int r8a66597_set_wedge(struct usb_ep *_ep)
{
struct r8a66597_ep *ep;
unsigned long flags;

ep = container_of(_ep, struct r8a66597_ep, ep);

if (!ep || !ep->desc)
return -EINVAL;

spin_lock_irqsave(&ep->r8a66597->lock, flags);
ep->wedge = 1;
spin_unlock_irqrestore(&ep->r8a66597->lock, flags);

return usb_ep_set_halt(_ep);
}

static void r8a66597_fifo_flush(struct usb_ep *_ep)
{
struct r8a66597_ep *ep;
Expand All @@ -1373,6 +1396,7 @@ static struct usb_ep_ops r8a66597_ep_ops = {
.dequeue = r8a66597_dequeue,

.set_halt = r8a66597_set_halt,
.set_wedge = r8a66597_set_wedge,
.fifo_flush = r8a66597_fifo_flush,
};

Expand Down
1 change: 1 addition & 0 deletions trunk/drivers/usb/gadget/r8a66597-udc.h
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ struct r8a66597_ep {

struct list_head queue;
unsigned busy:1;
unsigned wedge:1;
unsigned internal_ccpl:1; /* use only control */

/* this member can able to after r8a66597_enable */
Expand Down

0 comments on commit c7a358c

Please sign in to comment.