Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 259301
b: refs/heads/master
c: ceaa0a6
h: refs/heads/master
i:
  259299: 9e1cfe1
v: v3
  • Loading branch information
Yoshihiro Shimoda authored and Felipe Balbi committed Jul 8, 2011
1 parent 8e4087e commit 2ad98be
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: 5154e9f126c1d2ee8f5f93d9954f83d82b2d5e64
refs/heads/master: ceaa0a6eeadfd2f53df121210d99a1f80ee7645e
23 changes: 22 additions & 1 deletion trunk/drivers/usb/gadget/m66592-udc.c
Original file line number Diff line number Diff line change
Expand Up @@ -691,6 +691,7 @@ static void init_controller(struct m66592 *m66592)

static void disable_controller(struct m66592 *m66592)
{
m66592_bclr(m66592, M66592_UTST, M66592_TESTMODE);
if (!m66592->pdata->on_chip) {
m66592_bclr(m66592, M66592_SCKE, M66592_SYSCFG);
udelay(1);
Expand Down Expand Up @@ -1048,10 +1049,30 @@ static void clear_feature(struct m66592 *m66592, struct usb_ctrlrequest *ctrl)

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

switch (ctrl->bRequestType & USB_RECIP_MASK) {
case USB_RECIP_DEVICE:
control_end(m66592, 1);
switch (le16_to_cpu(ctrl->wValue)) {
case USB_DEVICE_TEST_MODE:
control_end(m66592, 1);
/* Wait for the completion of status stage */
do {
tmp = m66592_read(m66592, M66592_INTSTS0) &
M66592_CTSQ;
udelay(1);
} while (tmp != M66592_CS_IDST || timeout-- > 0);

if (tmp == M66592_CS_IDST)
m66592_bset(m66592,
le16_to_cpu(ctrl->wIndex >> 8),
M66592_TESTMODE);
break;
default:
pipe_stall(m66592, 0);
break;
}
break;
case USB_RECIP_INTERFACE:
control_end(m66592, 1);
Expand Down

0 comments on commit 2ad98be

Please sign in to comment.