@@ -32,6 +32,23 @@ if USB_SUPPORT
config USB_COMMON
tristate
+config USB_OTG_CORE
+ tristate
+
+config USB_OTG
+ bool "OTG/Dual-role support"
+ depends on PM && USB && USB_GADGET
+ default n
+ ---help---
+ The most notable feature of USB OTG is support for a
+ "Dual-Role" device, which can act as either a device
+ or a host. The initial role is decided by the type of
+ plug inserted and can be changed later when two dual
+ role devices talk to each other.
+
+ Select this only if your board has Mini-AB/Micro-AB
+ connector.
+
config USB_ARCH_HAS_HCD
def_bool y
@@ -40,6 +57,7 @@ config USB
tristate "Support for Host-side USB"
depends on USB_ARCH_HAS_HCD
select USB_COMMON
+ select USB_OTG_CORE
select NLS # for UTF-8 strings
---help---
Universal Serial Bus (USB) is a specification for a serial bus
@@ -59,6 +59,6 @@ obj-$(CONFIG_USB_RENESAS_USBHS) += renesas_usbhs/
obj-$(CONFIG_USB_GADGET) += gadget/
obj-$(CONFIG_USB_COMMON) += common/
-obj-$(CONFIG_USB_OTG) += common/
+obj-$(CONFIG_USB_OTG_CORE) += common/
obj-$(CONFIG_USBIP_CORE) += usbip/
@@ -7,5 +7,7 @@ usb-common-y += common.o
usb-common-$(CONFIG_USB_LED_TRIG) += led.o
obj-$(CONFIG_USB_ULPI_BUS) += ulpi.o
+ifeq ($(CONFIG_USB_OTG),y)
usbotg-y := usb-otg.o usb-otg-fsm.o
-obj-$(CONFIG_USB_OTG) += usbotg.o
+obj-$(CONFIG_USB_OTG_CORE) += usbotg.o
+endif
@@ -16,6 +16,7 @@
#include <linux/kernel.h>
#include <linux/list.h>
+#include <linux/module.h>
#include <linux/of.h>
#include <linux/of_platform.h>
#include <linux/usb/of.h>
@@ -841,3 +842,5 @@ int usb_otg_gadget_ready(struct usb_gadget *gadget, bool ready)
return 0;
}
EXPORT_SYMBOL_GPL(usb_otg_gadget_ready);
+
+MODULE_LICENSE("GPL");
@@ -41,20 +41,6 @@ config USB_DYNAMIC_MINORS
If you are unsure about this, say N here.
-config USB_OTG
- bool "OTG/Dual-role support"
- depends on PM && USB_GADGET
- default n
- help
- The most notable feature of USB OTG is support for a
- "Dual-Role" device, which can act as either a device
- or a host. The initial role is decided by the type of
- plug inserted and can be changed later when two dual
- role devices talk to each other.
-
- Select this only if your board has Mini-AB/Micro-AB
- connector.
-
config USB_OTG_WHITELIST
bool "Rely on OTG and EH Targeted Peripherals List"
depends on USB
@@ -16,6 +16,7 @@
menuconfig USB_GADGET
tristate "USB Gadget Support"
select USB_COMMON
+ select USB_OTG_CORE
select NLS
help
USB is a master/slave protocol, organized with one master