diff options
author | Dinh Nguyen <dinguyen@opensource.altera.com> | 2014-11-11 12:13:40 -0500 |
---|---|---|
committer | Felipe Balbi <balbi@ti.com> | 2014-11-14 16:00:07 -0500 |
commit | 5ee80705a5339270538119d1e8721b365eac5202 (patch) | |
tree | cef317f44c3567dbad7e2a0a2fa8a0dd75996bed /drivers/usb | |
parent | f5500ecc90a887d7e65274817733fbe477070559 (diff) |
usb: dwc2: Update Kconfig to support dual-role
Update DWC2 kconfig and makefile to support dual-role mode. The platform
file will always get compiled for the case where the controller is directly
connected to the CPU. So for loadable modules, dwc2.ko is built for host,
peripheral, and dual-role mode. The PCI bus interface will be called
dwc2_pci.ko and the platform interface module will be called dwc2_platform.ko.
Signed-off-by: Dinh Nguyen <dinguyen@opensource.altera.com>
Acked-by: Paul Zimmerman <paulz@synopsys.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Diffstat (limited to 'drivers/usb')
-rw-r--r-- | drivers/usb/dwc2/Kconfig | 66 | ||||
-rw-r--r-- | drivers/usb/dwc2/Makefile | 32 |
2 files changed, 55 insertions, 43 deletions
diff --git a/drivers/usb/dwc2/Kconfig b/drivers/usb/dwc2/Kconfig index 4d027180cea1..b323c4c11b0a 100644 --- a/drivers/usb/dwc2/Kconfig +++ b/drivers/usb/dwc2/Kconfig | |||
@@ -1,5 +1,5 @@ | |||
1 | config USB_DWC2 | 1 | config USB_DWC2 |
2 | bool "DesignWare USB2 DRD Core Support" | 2 | tristate "DesignWare USB2 DRD Core Support" |
3 | depends on USB || USB_GADGET | 3 | depends on USB || USB_GADGET |
4 | help | 4 | help |
5 | Say Y here if your system has a Dual Role Hi-Speed USB | 5 | Say Y here if your system has a Dual Role Hi-Speed USB |
@@ -10,49 +10,61 @@ config USB_DWC2 | |||
10 | bus interface module (if you have a PCI bus system) will be | 10 | bus interface module (if you have a PCI bus system) will be |
11 | called dwc2_pci.ko, and the platform interface module (for | 11 | called dwc2_pci.ko, and the platform interface module (for |
12 | controllers directly connected to the CPU) will be called | 12 | controllers directly connected to the CPU) will be called |
13 | dwc2_platform.ko. For gadget mode, there will be a single | 13 | dwc2_platform.ko. For all modes(host, gadget and dual-role), there |
14 | module called dwc2_gadget.ko. | 14 | will be an additional module named dwc2.ko. |
15 | |||
16 | NOTE: The s3c-hsotg driver is now renamed to dwc2_gadget. The | ||
17 | host and gadget drivers are still currently separate drivers. | ||
18 | There are plans to merge the dwc2_gadget driver with the dwc2 | ||
19 | host driver in the near future to create a dual-role driver. | ||
20 | 15 | ||
21 | if USB_DWC2 | 16 | if USB_DWC2 |
22 | 17 | ||
18 | choice | ||
19 | bool "DWC2 Mode Selection" | ||
20 | default USB_DWC2_DUAL_ROLE if (USB && USB_GADGET) | ||
21 | default USB_DWC2_HOST if (USB && !USB_GADGET) | ||
22 | default USB_DWC2_PERIPHERAL if (!USB && USB_GADGET) | ||
23 | |||
23 | config USB_DWC2_HOST | 24 | config USB_DWC2_HOST |
24 | tristate "Host only mode" | 25 | bool "Host only mode" |
25 | depends on USB | 26 | depends on USB |
26 | help | 27 | help |
27 | The Designware USB2.0 high-speed host controller | 28 | The Designware USB2.0 high-speed host controller |
28 | integrated into many SoCs. | 29 | integrated into many SoCs. Select this option if you want the |
30 | driver to operate in Host-only mode. | ||
29 | 31 | ||
30 | config USB_DWC2_PLATFORM | 32 | comment "Gadget/Dual-role mode requires USB Gadget support to be enabled" |
31 | bool "DWC2 Platform" | 33 | |
32 | depends on USB_DWC2_HOST | 34 | config USB_DWC2_PERIPHERAL |
33 | default USB_DWC2_HOST | 35 | bool "Gadget only mode" |
36 | depends on USB_GADGET=y || USB_GADGET=USB_DWC2 | ||
37 | help | ||
38 | The Designware USB2.0 high-speed gadget controller | ||
39 | integrated into many SoCs. Select this option if you want the | ||
40 | driver to operate in Peripheral-only mode. This option requires | ||
41 | USB_GADGET to be enabled. | ||
42 | |||
43 | config USB_DWC2_DUAL_ROLE | ||
44 | bool "Dual Role mode" | ||
45 | depends on (USB=y || USB=USB_DWC2) && (USB_GADGET=y || USB_GADGET=USB_DWC2) | ||
34 | help | 46 | help |
35 | The Designware USB2.0 platform interface module for | 47 | Select this option if you want the driver to work in a dual-role |
36 | controllers directly connected to the CPU. This is only | 48 | mode. In this mode both host and gadget features are enabled, and |
37 | used for host mode. | 49 | the role will be determined by the cable that gets plugged-in. This |
50 | option requires USB_GADGET to be enabled. | ||
51 | endchoice | ||
52 | |||
53 | config USB_DWC2_PLATFORM | ||
54 | tristate "DWC2 Platform" | ||
55 | default USB_DWC2_HOST || USB_DWC2_PERIPHERAL | ||
56 | help | ||
57 | The Designware USB2.0 platform interface module for | ||
58 | controllers directly connected to the CPU. | ||
38 | 59 | ||
39 | config USB_DWC2_PCI | 60 | config USB_DWC2_PCI |
40 | bool "DWC2 PCI" | 61 | tristate "DWC2 PCI" |
41 | depends on USB_DWC2_HOST && PCI | 62 | depends on USB_DWC2_HOST && PCI |
42 | default USB_DWC2_HOST | 63 | default USB_DWC2_HOST |
43 | help | 64 | help |
44 | The Designware USB2.0 PCI interface module for controllers | 65 | The Designware USB2.0 PCI interface module for controllers |
45 | connected to a PCI bus. This is only used for host mode. | 66 | connected to a PCI bus. This is only used for host mode. |
46 | 67 | ||
47 | comment "Gadget mode requires USB Gadget support to be enabled" | ||
48 | |||
49 | config USB_DWC2_PERIPHERAL | ||
50 | tristate "Gadget only mode" | ||
51 | depends on USB_GADGET | ||
52 | help | ||
53 | The Designware USB2.0 high-speed gadget controller | ||
54 | integrated into many SoCs. | ||
55 | |||
56 | config USB_DWC2_DEBUG | 68 | config USB_DWC2_DEBUG |
57 | bool "Enable Debugging Messages" | 69 | bool "Enable Debugging Messages" |
58 | help | 70 | help |
diff --git a/drivers/usb/dwc2/Makefile b/drivers/usb/dwc2/Makefile index b73d2a527970..8f752679752a 100644 --- a/drivers/usb/dwc2/Makefile +++ b/drivers/usb/dwc2/Makefile | |||
@@ -1,28 +1,28 @@ | |||
1 | ccflags-$(CONFIG_USB_DWC2_DEBUG) += -DDEBUG | 1 | ccflags-$(CONFIG_USB_DWC2_DEBUG) += -DDEBUG |
2 | ccflags-$(CONFIG_USB_DWC2_VERBOSE) += -DVERBOSE_DEBUG | 2 | ccflags-$(CONFIG_USB_DWC2_VERBOSE) += -DVERBOSE_DEBUG |
3 | 3 | ||
4 | obj-$(CONFIG_USB_DWC2_HOST) += dwc2.o | 4 | obj-$(CONFIG_USB_DWC2) += dwc2.o |
5 | dwc2-y := core.o core_intr.o | 5 | dwc2-y := core.o core_intr.o |
6 | dwc2-y += hcd.o hcd_intr.o | 6 | |
7 | dwc2-y += hcd_queue.o hcd_ddma.o | 7 | ifneq ($(filter y,$(CONFIG_USB_DWC2_HOST) $(CONFIG_USB_DWC2_DUAL_ROLE)),) |
8 | dwc2-y += hcd.o hcd_intr.o | ||
9 | dwc2-y += hcd_queue.o hcd_ddma.o | ||
10 | endif | ||
11 | |||
12 | ifneq ($(filter y,$(CONFIG_USB_DWC2_PERIPHERAL) $(CONFIG_USB_DWC2_DUAL_ROLE)),) | ||
13 | dwc2-y += gadget.o | ||
14 | endif | ||
8 | 15 | ||
9 | # NOTE: The previous s3c-hsotg peripheral mode only driver has been moved to | 16 | # NOTE: The previous s3c-hsotg peripheral mode only driver has been moved to |
10 | # this location and renamed gadget.c. When building for dynamically linked | 17 | # this location and renamed gadget.c. When building for dynamically linked |
11 | # modules, dwc2_gadget.ko will get built for peripheral mode. For host mode, | 18 | # modules, dwc2.ko will get built for host mode, peripheral mode, and dual-role |
12 | # the core module will be dwc2.ko, the PCI bus interface module will called | 19 | # mode. The PCI bus interface module will called dwc2_pci.ko and the platform |
13 | # dwc2_pci.ko and the platform interface module will be called dwc2_platform.ko. | 20 | # interface module will be called dwc2_platform.ko. |
14 | # At present the host and gadget driver will be separate drivers, but there | ||
15 | # are plans in the near future to create a dual-role driver. | ||
16 | 21 | ||
17 | ifneq ($(CONFIG_USB_DWC2_PCI),) | 22 | ifneq ($(CONFIG_USB_DWC2_PCI),) |
18 | obj-$(CONFIG_USB_DWC2_HOST) += dwc2_pci.o | 23 | obj-$(CONFIG_USB_DWC2) += dwc2_pci.o |
19 | dwc2_pci-y := pci.o | 24 | dwc2_pci-y := pci.o |
20 | endif | 25 | endif |
21 | 26 | ||
22 | ifneq ($(CONFIG_USB_DWC2_PLATFORM),) | 27 | obj-$(CONFIG_USB_DWC2_PLATFORM) += dwc2_platform.o |
23 | obj-$(CONFIG_USB_DWC2_HOST) += dwc2_platform.o | 28 | dwc2_platform-y := platform.o |
24 | dwc2_platform-y := platform.o | ||
25 | endif | ||
26 | |||
27 | obj-$(CONFIG_USB_DWC2_PERIPHERAL) += dwc2_gadget.o | ||
28 | dwc2_gadget-y := gadget.o | ||