summaryrefslogtreecommitdiff
path: root/drivers/usb/dwc3/core.c
diff options
context:
space:
mode:
authorFelipe Balbi <balbi@ti.com>2011-10-07 22:55:04 +0300
committerFelipe Balbi <balbi@ti.com>2011-12-12 11:48:10 +0200
commit6c167fc9b0c23ead791edb94cf4debb6b8e534b5 (patch)
tree1ee2f57ad99cc6a62085c0a433fbc56c17bbf284 /drivers/usb/dwc3/core.c
parentb2c2271c826589c5c5b285a5a32e158d36d263d9 (diff)
downloadlinux-3.10-6c167fc9b0c23ead791edb94cf4debb6b8e534b5.tar.gz
linux-3.10-6c167fc9b0c23ead791edb94cf4debb6b8e534b5.tar.bz2
linux-3.10-6c167fc9b0c23ead791edb94cf4debb6b8e534b5.zip
usb: dwc3: allow forcing a maximum speed
this is mainly for testing. In order to be able to test if we're enumerating correctly on all speeds, let that be controlled by a module parameter. Signed-off-by: Felipe Balbi <balbi@ti.com>
Diffstat (limited to 'drivers/usb/dwc3/core.c')
-rw-r--r--drivers/usb/dwc3/core.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/drivers/usb/dwc3/core.c b/drivers/usb/dwc3/core.c
index 717ebc9ff94..ca3b01f5fff 100644
--- a/drivers/usb/dwc3/core.c
+++ b/drivers/usb/dwc3/core.c
@@ -59,6 +59,10 @@
#include "debug.h"
+static char *maximum_speed = "super";
+module_param(maximum_speed, charp, 0);
+MODULE_PARM_DESC(maximum_speed, "Maximum supported speed.");
+
/**
* dwc3_core_soft_reset - Issues core soft reset and PHY reset
* @dwc: pointer to our context structure
@@ -370,6 +374,17 @@ static int __devinit dwc3_probe(struct platform_device *pdev)
dwc->dev = &pdev->dev;
dwc->irq = irq;
+ if (!strncmp("super", maximum_speed, 5))
+ dwc->maximum_speed = DWC3_DCFG_SUPERSPEED;
+ else if (!strncmp("high", maximum_speed, 4))
+ dwc->maximum_speed = DWC3_DCFG_HIGHSPEED;
+ else if (!strncmp("full", maximum_speed, 4))
+ dwc->maximum_speed = DWC3_DCFG_FULLSPEED1;
+ else if (!strncmp("low", maximum_speed, 3))
+ dwc->maximum_speed = DWC3_DCFG_LOWSPEED;
+ else
+ dwc->maximum_speed = DWC3_DCFG_SUPERSPEED;
+
pm_runtime_enable(&pdev->dev);
pm_runtime_get_sync(&pdev->dev);
pm_runtime_forbid(&pdev->dev);