Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 226929
b: refs/heads/master
c: 7fc56f0
h: refs/heads/master
i:
  226927: 660c29b
v: v3
  • Loading branch information
Luo Andy authored and Greg Kroah-Hartman committed Dec 1, 2010
1 parent d89ff7b commit a8c5ad3
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: b23f2f94136884ebeb1b5e2196f4a53086444afa
refs/heads/master: 7fc56f0d9908fe140a01387d59954e3d0a2e7744
23 changes: 23 additions & 0 deletions trunk/drivers/usb/gadget/langwell_udc.c
Original file line number Diff line number Diff line change
Expand Up @@ -2225,6 +2225,7 @@ static void handle_setup_packet(struct langwell_udc *dev,
u16 wValue = le16_to_cpu(setup->wValue);
u16 wIndex = le16_to_cpu(setup->wIndex);
u16 wLength = le16_to_cpu(setup->wLength);
u32 portsc1;

dev_vdbg(&dev->pdev->dev, "---> %s()\n", __func__);

Expand Down Expand Up @@ -2313,6 +2314,28 @@ static void handle_setup_packet(struct langwell_udc *dev,
dev->dev_status &= ~(1 << wValue);
}
break;
case USB_DEVICE_TEST_MODE:
dev_dbg(&dev->pdev->dev, "SETUP: TEST MODE\n");
if ((wIndex & 0xff) ||
(dev->gadget.speed != USB_SPEED_HIGH))
ep0_stall(dev);

switch (wIndex >> 8) {
case TEST_J:
case TEST_K:
case TEST_SE0_NAK:
case TEST_PACKET:
case TEST_FORCE_EN:
if (prime_status_phase(dev, EP_DIR_IN))
ep0_stall(dev);
portsc1 = readl(&dev->op_regs->portsc1);
portsc1 |= (wIndex & 0xf00) << 8;
writel(portsc1, &dev->op_regs->portsc1);
goto end;
default:
rc = -EOPNOTSUPP;
}
break;
default:
rc = -EOPNOTSUPP;
break;
Expand Down
10 changes: 10 additions & 0 deletions trunk/include/linux/usb/ch9.h
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,16 @@
#define USB_DEVICE_A_ALT_HNP_SUPPORT 5 /* (otg) other RH port does */
#define USB_DEVICE_DEBUG_MODE 6 /* (special devices only) */

/*
* Test Mode Selectors
* See USB 2.0 spec Table 9-7
*/
#define TEST_J 1
#define TEST_K 2
#define TEST_SE0_NAK 3
#define TEST_PACKET 4
#define TEST_FORCE_EN 5

/*
* New Feature Selectors as added by USB 3.0
* See USB 3.0 spec Table 9-6
Expand Down

0 comments on commit a8c5ad3

Please sign in to comment.