Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 259302
b: refs/heads/master
c: 96fe53e
h: refs/heads/master
v: v3
  • Loading branch information
Yoshihiro Shimoda authored and Felipe Balbi committed Jul 8, 2011
1 parent 2ad98be commit d7b2bb2
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 2 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: ceaa0a6eeadfd2f53df121210d99a1f80ee7645e
refs/heads/master: 96fe53ef5498ba130b2f054f2de38e090ddaa55f
23 changes: 22 additions & 1 deletion trunk/drivers/usb/gadget/r8a66597-udc.c
Original file line number Diff line number Diff line change
Expand Up @@ -622,6 +622,7 @@ static void disable_controller(struct r8a66597 *r8a66597)
{
if (r8a66597->pdata->on_chip) {
r8a66597_bset(r8a66597, SCKE, SYSCFG0);
r8a66597_bclr(r8a66597, UTST, TESTMODE);

/* disable interrupts */
r8a66597_write(r8a66597, 0, INTENB0);
Expand All @@ -639,6 +640,7 @@ static void disable_controller(struct r8a66597 *r8a66597)
r8a66597_bclr(r8a66597, SCKE, SYSCFG0);

} else {
r8a66597_bclr(r8a66597, UTST, TESTMODE);
r8a66597_bclr(r8a66597, SCKE, SYSCFG0);
udelay(1);
r8a66597_bclr(r8a66597, PLLC, SYSCFG0);
Expand Down Expand Up @@ -1003,10 +1005,29 @@ static void clear_feature(struct r8a66597 *r8a66597,

static void set_feature(struct r8a66597 *r8a66597, struct usb_ctrlrequest *ctrl)
{
u16 tmp;
int timeout = 3000;

switch (ctrl->bRequestType & USB_RECIP_MASK) {
case USB_RECIP_DEVICE:
control_end(r8a66597, 1);
switch (le16_to_cpu(ctrl->wValue)) {
case USB_DEVICE_TEST_MODE:
control_end(r8a66597, 1);
/* Wait for the completion of status stage */
do {
tmp = r8a66597_read(r8a66597, INTSTS0) & CTSQ;
udelay(1);
} while (tmp != CS_IDST || timeout-- > 0);

if (tmp == CS_IDST)
r8a66597_bset(r8a66597,
le16_to_cpu(ctrl->wIndex >> 8),
TESTMODE);
break;
default:
pipe_stall(r8a66597, 0);
break;
}
break;
case USB_RECIP_INTERFACE:
control_end(r8a66597, 1);
Expand Down

0 comments on commit d7b2bb2

Please sign in to comment.