Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 280806
b: refs/heads/master
c: 6c167fc
h: refs/heads/master
v: v3
  • Loading branch information
Felipe Balbi committed Dec 12, 2011
1 parent d93daa6 commit f53f7fe
Show file tree
Hide file tree
Showing 4 changed files with 19 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: b2c2271c826589c5c5b285a5a32e158d36d263d9
refs/heads/master: 6c167fc9b0c23ead791edb94cf4debb6b8e534b5
15 changes: 15 additions & 0 deletions trunk/drivers/usb/dwc3/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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);
Expand Down
2 changes: 2 additions & 0 deletions trunk/drivers/usb/dwc3/core.h
Original file line number Diff line number Diff line change
Expand Up @@ -555,6 +555,7 @@ struct dwc3_hwparams {
* @regs: base address for our registers
* @regs_size: address space size
* @irq: IRQ number
* @maximum_speed: maximum speed requested (mainly for testing purposes)
* @revision: revision register contents
* @is_selfpowered: true when we are selfpowered
* @three_stage_setup: set if we perform a three phase setup
Expand Down Expand Up @@ -595,6 +596,7 @@ struct dwc3 {

int irq;

u32 maximum_speed;
u32 revision;

#define DWC3_REVISION_173A 0x5533173a
Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/usb/dwc3/gadget.c
Original file line number Diff line number Diff line change
Expand Up @@ -1183,7 +1183,7 @@ static int dwc3_gadget_start(struct usb_gadget *g,

reg = dwc3_readl(dwc->regs, DWC3_DCFG);
reg &= ~(DWC3_DCFG_SPEED_MASK);
reg |= DWC3_DCFG_SUPERSPEED;
reg |= dwc->maximum_speed;
dwc3_writel(dwc->regs, DWC3_DCFG, reg);

dwc->start_config_issued = false;
Expand Down

0 comments on commit f53f7fe

Please sign in to comment.