|
|
@@ -1836,6 +1836,85 @@ int usb_set_configuration(struct usb_device *dev, int configuration) |
|
|
if (cp->string == NULL && |
|
|
!(dev->quirks & USB_QUIRK_CONFIG_INTF_STRINGS)) |
|
|
cp->string = usb_cache_string(dev, cp->desc.iConfiguration); |
|
|
/* Uncomment this define to enable the HS Electrical Test support */ |
|
|
#define DWC_HS_ELECT_TST 1 |
|
|
#ifdef DWC_HS_ELECT_TST |
|
|
/* Here we implement the HS Electrical Test support. The |
|
|
* tester uses a vendor ID of 0x1A0A to indicate we should |
|
|
* run a special test sequence. The product ID tells us |
|
|
* which sequence to run. We invoke the test sequence by |
|
|
* sending a non-standard SetFeature command to our root |
|
|
* hub port. Our dwc_otg_hcd_hub_control() routine will |
|
|
* recognize the command and perform the desired test |
|
|
* sequence. |
|
|
*/ |
|
|
if (dev->descriptor.idVendor == 0x1A0A) { |
|
|
/* HSOTG Electrical Test */ |
|
|
dev_warn(&dev->dev, "VID from HSOTG Electrical Test Fixture\n"); |
|
|
|
|
|
if (dev->bus && dev->bus->root_hub) { |
|
|
struct usb_device *hdev = dev->bus->root_hub; |
|
|
dev_warn(&dev->dev, "Got PID 0x%x\n", dev->descriptor.idProduct); |
|
|
|
|
|
switch (dev->descriptor.idProduct) { |
|
|
case 0x0101: /* TEST_SE0_NAK */ |
|
|
dev_warn(&dev->dev, "TEST_SE0_NAK\n"); |
|
|
usb_control_msg(hdev, usb_sndctrlpipe(hdev, 0), |
|
|
USB_REQ_SET_FEATURE, USB_RT_PORT, |
|
|
USB_PORT_FEAT_TEST, 0x300, NULL, 0, HZ); |
|
|
break; |
|
|
|
|
|
case 0x0102: /* TEST_J */ |
|
|
dev_warn(&dev->dev, "TEST_J\n"); |
|
|
usb_control_msg(hdev, usb_sndctrlpipe(hdev, 0), |
|
|
USB_REQ_SET_FEATURE, USB_RT_PORT, |
|
|
USB_PORT_FEAT_TEST, 0x100, NULL, 0, HZ); |
|
|
break; |
|
|
|
|
|
case 0x0103: /* TEST_K */ |
|
|
dev_warn(&dev->dev, "TEST_K\n"); |
|
|
usb_control_msg(hdev, usb_sndctrlpipe(hdev, 0), |
|
|
USB_REQ_SET_FEATURE, USB_RT_PORT, |
|
|
USB_PORT_FEAT_TEST, 0x200, NULL, 0, HZ); |
|
|
break; |
|
|
|
|
|
case 0x0104: /* TEST_PACKET */ |
|
|
dev_warn(&dev->dev, "TEST_PACKET\n"); |
|
|
usb_control_msg(hdev, usb_sndctrlpipe(hdev, 0), |
|
|
USB_REQ_SET_FEATURE, USB_RT_PORT, |
|
|
USB_PORT_FEAT_TEST, 0x400, NULL, 0, HZ); |
|
|
break; |
|
|
|
|
|
case 0x0105: /* TEST_FORCE_ENABLE */ |
|
|
dev_warn(&dev->dev, "TEST_FORCE_ENABLE\n"); |
|
|
usb_control_msg(hdev, usb_sndctrlpipe(hdev, 0), |
|
|
USB_REQ_SET_FEATURE, USB_RT_PORT, |
|
|
USB_PORT_FEAT_TEST, 0x500, NULL, 0, HZ); |
|
|
break; |
|
|
|
|
|
case 0x0106: /* HS_HOST_PORT_SUSPEND_RESUME */ |
|
|
dev_warn(&dev->dev, "HS_HOST_PORT_SUSPEND_RESUME\n"); |
|
|
usb_control_msg(hdev, usb_sndctrlpipe(hdev, 0), |
|
|
USB_REQ_SET_FEATURE, USB_RT_PORT, |
|
|
USB_PORT_FEAT_TEST, 0x600, NULL, 0, 40 * HZ); |
|
|
break; |
|
|
|
|
|
case 0x0107: /* SINGLE_STEP_GET_DEVICE_DESCRIPTOR setup */ |
|
|
dev_warn(&dev->dev, "SINGLE_STEP_GET_DEVICE_DESCRIPTOR setup\n"); |
|
|
usb_control_msg(hdev, usb_sndctrlpipe(hdev, 0), |
|
|
USB_REQ_SET_FEATURE, USB_RT_PORT, |
|
|
USB_PORT_FEAT_TEST, 0x700, NULL, 0, 40 * HZ); |
|
|
break; |
|
|
|
|
|
case 0x0108: /* SINGLE_STEP_GET_DEVICE_DESCRIPTOR execute */ |
|
|
dev_warn(&dev->dev, "SINGLE_STEP_GET_DEVICE_DESCRIPTOR execute\n"); |
|
|
usb_control_msg(hdev, usb_sndctrlpipe(hdev, 0), |
|
|
USB_REQ_SET_FEATURE, USB_RT_PORT, |
|
|
USB_PORT_FEAT_TEST, 0x800, NULL, 0, 40 * HZ); |
|
|
} |
|
|
} |
|
|
} |
|
|
#endif /* DWC_HS_ELECT_TST */ |
|
|
|
|
|
/* Now that all the interfaces are set up, register them |
|
|
* to trigger binding of drivers to interfaces. probe() |
|
|
|
This comment has been minimized.
c2eaacdYour patch for drivers/usb/gadget/Kconfig has duplicates.