Commit 2f076077 authored by Alan Stern's avatar Alan Stern Committed by Greg Kroah-Hartman

USB: GADGET: optionally force full-speed for net2280 UDC

This patch (as1656) adds a module parameter to the net2280 UDC driver
to force full-speed operation.  It is intended for testing purposes,
where one wants to check how well a full-speed device performs when
attached to a high-speed bus.  Without this parameter it would be
necessary to interpose a full-speed hub; otherwise the net2280 would
connect at high speed.
Signed-off-by: default avatarAlan Stern <stern@rowland.harvard.edu>
Acked-by: default avatarFelipe Balbi <balbi@ti.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent d0b4652f
...@@ -116,6 +116,10 @@ static bool enable_suspend = 0; ...@@ -116,6 +116,10 @@ static bool enable_suspend = 0;
/* "modprobe net2280 enable_suspend=1" etc */ /* "modprobe net2280 enable_suspend=1" etc */
module_param (enable_suspend, bool, S_IRUGO); module_param (enable_suspend, bool, S_IRUGO);
/* force full-speed operation */
static bool full_speed;
module_param(full_speed, bool, 0444);
MODULE_PARM_DESC(full_speed, "force full-speed mode -- for testing only!");
#define DIR_STRING(bAddress) (((bAddress) & USB_DIR_IN) ? "in" : "out") #define DIR_STRING(bAddress) (((bAddress) & USB_DIR_IN) ? "in" : "out")
...@@ -1899,6 +1903,10 @@ static int net2280_start(struct usb_gadget *_gadget, ...@@ -1899,6 +1903,10 @@ static int net2280_start(struct usb_gadget *_gadget,
retval = device_create_file (&dev->pdev->dev, &dev_attr_queues); retval = device_create_file (&dev->pdev->dev, &dev_attr_queues);
if (retval) goto err_func; if (retval) goto err_func;
/* Enable force-full-speed testing mode, if desired */
if (full_speed)
writel(1 << FORCE_FULL_SPEED_MODE, &dev->usb->xcvrdiag);
/* ... then enable host detection and ep0; and we're ready /* ... then enable host detection and ep0; and we're ready
* for set_configuration as well as eventual disconnect. * for set_configuration as well as eventual disconnect.
*/ */
...@@ -1957,6 +1965,10 @@ static int net2280_stop(struct usb_gadget *_gadget, ...@@ -1957,6 +1965,10 @@ static int net2280_stop(struct usb_gadget *_gadget,
dev->driver = NULL; dev->driver = NULL;
net2280_led_active (dev, 0); net2280_led_active (dev, 0);
/* Disable full-speed test mode */
writel(0, &dev->usb->xcvrdiag);
device_remove_file (&dev->pdev->dev, &dev_attr_function); device_remove_file (&dev->pdev->dev, &dev_attr_function);
device_remove_file (&dev->pdev->dev, &dev_attr_queues); device_remove_file (&dev->pdev->dev, &dev_attr_queues);
...@@ -2841,6 +2853,9 @@ static void net2280_shutdown (struct pci_dev *pdev) ...@@ -2841,6 +2853,9 @@ static void net2280_shutdown (struct pci_dev *pdev)
/* disable the pullup so the host will think we're gone */ /* disable the pullup so the host will think we're gone */
writel (0, &dev->usb->usbctl); writel (0, &dev->usb->usbctl);
/* Disable full-speed test mode */
writel(0, &dev->usb->xcvrdiag);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment