diff options
author | Vivek Gautam <gautam.vivek@samsung.com> | 2013-03-02 14:25:24 +0100 |
---|---|---|
committer | Felipe Balbi <balbi@ti.com> | 2013-03-18 10:18:00 +0100 |
commit | cd051da2c81c8a86f331b4caa0c135c33d3ea3f6 (patch) | |
tree | cb8a63206a92236b50d4f69ee87f727680a2c26c /drivers/usb/dwc3 | |
parent | usb: phy: mxs: use readl(), writel() instead of the _relaxed() versions (diff) | |
download | linux-cd051da2c81c8a86f331b4caa0c135c33d3ea3f6.tar.xz linux-cd051da2c81c8a86f331b4caa0c135c33d3ea3f6.zip |
usb: dwc3: set 'mode' based on selected Kconfig choices
Now that machines may select dwc3's working mode (HOST only,
GADGET only or DUAL_ROLE) via Kconfig, let's set dwc3's mode
based on that, rather than fixing it to whatever hardware
says.
This way we can skip initializing Gadget/Host in case
we are using Host-only/Gadget-only mode respectively.
Signed-off-by: Vivek Gautam <gautam.vivek@samsung.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Diffstat (limited to 'drivers/usb/dwc3')
-rw-r--r-- | drivers/usb/dwc3/core.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/usb/dwc3/core.c b/drivers/usb/dwc3/core.c index b81b3357f007..c6a46e0efe4f 100644 --- a/drivers/usb/dwc3/core.c +++ b/drivers/usb/dwc3/core.c @@ -479,7 +479,12 @@ static int dwc3_probe(struct platform_device *pdev) goto err1; } - mode = DWC3_MODE(dwc->hwparams.hwparams0); + if (IS_ENABLED(CONFIG_USB_DWC3_HOST)) + mode = DWC3_MODE_HOST; + else if (IS_ENABLED(CONFIG_USB_DWC3_GADGET)) + mode = DWC3_MODE_DEVICE; + else + mode = DWC3_MODE_DRD; switch (mode) { case DWC3_MODE_DEVICE: |