diff options
author | Dinh Nguyen <dinguyen@opensource.altera.com> | 2014-08-26 12:19:52 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2014-09-08 18:45:00 -0400 |
commit | e006fee6ecfed5b957bdd41c236aad751ab29042 (patch) | |
tree | aee9105112e8a398b7f5d2226a96e47041391848 /drivers/usb/dwc2 | |
parent | c0155b9d5ef29092d39502ec57b0454b2b3c7cc9 (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, only dwc2.ko is needed.
Signed-off-by: Dinh Nguyen <dinguyen@opensource.altera.com>
Acked-by: Paul Zimmerman <paulz@synopsys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/dwc2')
-rw-r--r-- | drivers/usb/dwc2/Kconfig | 63 | ||||
-rw-r--r-- | drivers/usb/dwc2/Makefile | 21 |
2 files changed, 47 insertions, 37 deletions
diff --git a/drivers/usb/dwc2/Kconfig b/drivers/usb/dwc2/Kconfig index f93807b3631a..4396a1f48156 100644 --- a/drivers/usb/dwc2/Kconfig +++ b/drivers/usb/dwc2/Kconfig | |||
@@ -1,40 +1,29 @@ | |||
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 | 3 | depends on USB |
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 |
6 | controller based on the DesignWare HSOTG IP Core. | 6 | controller based on the DesignWare HSOTG IP Core. |
7 | 7 | ||
8 | For host mode, if you choose to build the driver as dynamically | 8 | If you choose to build the driver as dynamically |
9 | linked modules, the core module will be called dwc2.ko, the PCI | 9 | linked modules, a single dwc2.ko(regardless of mode of operation) |
10 | bus interface module (if you have a PCI bus system) will be | 10 | will get built for both platform IPs and PCI. |
11 | called dwc2_pci.ko, and the platform interface module (for | ||
12 | controllers directly connected to the CPU) will be called | ||
13 | dwc2_platform.ko. For gadget mode, there will be a single | ||
14 | module called dwc2_gadget.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 | 11 | ||
21 | if USB_DWC2 | 12 | if USB_DWC2 |
22 | 13 | ||
14 | choice | ||
15 | bool "DWC2 Mode Selection" | ||
16 | default USB_DWC2_DUAL_ROLE if (USB && USB_GADGET) | ||
17 | default USB_DWC2_HOST if (USB && !USB_GADGET) | ||
18 | default USB_DWC2_PERIPHERAL if (!USB && USB_GADGET) | ||
19 | |||
23 | config USB_DWC2_HOST | 20 | config USB_DWC2_HOST |
24 | tristate "Host only mode" | 21 | bool "Host only mode" |
25 | depends on USB | 22 | depends on USB |
26 | help | 23 | help |
27 | The Designware USB2.0 high-speed host controller | 24 | The Designware USB2.0 high-speed host controller |
28 | integrated into many SoCs. | 25 | integrated into many SoCs. Select this option if you want the |
29 | 26 | driver to operate in Host-only mode. | |
30 | config USB_DWC2_PLATFORM | ||
31 | bool "DWC2 Platform" | ||
32 | depends on USB_DWC2_HOST | ||
33 | default USB_DWC2_HOST | ||
34 | help | ||
35 | The Designware USB2.0 platform interface module for | ||
36 | controllers directly connected to the CPU. This is only | ||
37 | used for host mode. | ||
38 | 27 | ||
39 | config USB_DWC2_PCI | 28 | config USB_DWC2_PCI |
40 | bool "DWC2 PCI" | 29 | bool "DWC2 PCI" |
@@ -47,11 +36,31 @@ config USB_DWC2_PCI | |||
47 | comment "Gadget mode requires USB Gadget support to be enabled" | 36 | comment "Gadget mode requires USB Gadget support to be enabled" |
48 | 37 | ||
49 | config USB_DWC2_PERIPHERAL | 38 | config USB_DWC2_PERIPHERAL |
50 | tristate "Gadget only mode" | 39 | bool "Gadget only mode" |
51 | depends on USB_GADGET | 40 | depends on USB_GADGET=y || USB_GADGET=USB_DWC2 |
52 | help | 41 | help |
53 | The Designware USB2.0 high-speed gadget controller | 42 | The Designware USB2.0 high-speed gadget controller |
54 | integrated into many SoCs. | 43 | integrated into many SoCs. Select this option if you want the |
44 | driver to operate in Peripheral-only mode. This option requires | ||
45 | USB_GADGET=y. | ||
46 | |||
47 | config USB_DWC2_DUAL_ROLE | ||
48 | bool "Dual Role mode" | ||
49 | depends on ((USB=y || USB=USB_DWC2) && (USB_GADGET=y || USB_GADGET=USB_DWC2)) | ||
50 | help | ||
51 | Select this option if you want the driver to work in a dual-role | ||
52 | mode. In this mode both host and gadget features are enabled, and | ||
53 | the role will be determined by the cable that gets plugged-in. This | ||
54 | option requires USB_GADGET=y. | ||
55 | endchoice | ||
56 | |||
57 | config USB_DWC2_PLATFORM | ||
58 | bool | ||
59 | depends on !PCI | ||
60 | default y | ||
61 | help | ||
62 | The Designware USB2.0 platform interface module for | ||
63 | controllers directly connected to the CPU. | ||
55 | 64 | ||
56 | config USB_DWC2_DEBUG | 65 | config USB_DWC2_DEBUG |
57 | bool "Enable Debugging Messages" | 66 | bool "Enable Debugging Messages" |
diff --git a/drivers/usb/dwc2/Makefile b/drivers/usb/dwc2/Makefile index b73d2a527970..302613570fab 100644 --- a/drivers/usb/dwc2/Makefile +++ b/drivers/usb/dwc2/Makefile | |||
@@ -1,10 +1,17 @@ | |||
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 |
@@ -19,10 +26,4 @@ ifneq ($(CONFIG_USB_DWC2_PCI),) | |||
19 | dwc2_pci-y := pci.o | 26 | dwc2_pci-y := pci.o |
20 | endif | 27 | endif |
21 | 28 | ||
22 | ifneq ($(CONFIG_USB_DWC2_PLATFORM),) | 29 | dwc2-$(CONFIG_USB_DWC2_PLATFORM) += platform.o |
23 | obj-$(CONFIG_USB_DWC2_HOST) += dwc2_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 | ||