kernel: fix dwc2 gadget dependency
[openwrt/openwrt.git] / package / kernel / linux / modules / usb.mk
index 294d354f015c883bbed84a8f577f60936e7a91cb..1d71c02e300a131057c7b92cf817af022085b49d 100644 (file)
@@ -36,6 +36,25 @@ define AddDepends/usb
 endef
 
 
+define KernelPackage/usb-ledtrig-usbport
+  TITLE:=LED trigger for USB ports
+  KCONFIG:=CONFIG_USB_LEDS_TRIGGER_USBPORT
+  DEPENDS:=@!LINUX_3_18
+  FILES:=$(LINUX_DIR)/drivers/usb/core/ledtrig-usbport.ko
+  AUTOLOAD:=$(call AutoLoad,50,ledtrig-usbport)
+  $(call AddDepends/usb)
+endef
+
+define KernelPackage/usb-ledtrig-usbport/description
+  This driver allows LEDs to be controlled by USB events. Enabling this
+  trigger allows specifying list of USB ports that should turn on LED
+  when some USB device gets connected.
+  If possible it should be prefered over similar ledtrig-usbdev.
+endef
+
+$(eval $(call KernelPackage,usb-ledtrig-usbport))
+
+
 define KernelPackage/usb-musb-hdrc
   TITLE:=Support for Mentor Graphics silicon dual role USB
   KCONFIG:= \
@@ -206,6 +225,7 @@ $(eval $(call KernelPackage,usb-phy-twl6030))
 define KernelPackage/usb-gadget
   TITLE:=USB Gadget support
   KCONFIG:=CONFIG_USB_GADGET
+  HIDDEN:=1
   FILES:=\
        $(LINUX_DIR)/drivers/usb/gadget/udc/udc-core.ko
   AUTOLOAD:=$(call AutoLoad,45,udc-core)
@@ -223,6 +243,7 @@ define KernelPackage/usb-lib-composite
   TITLE:=USB lib composite
   KCONFIG:=CONFIG_USB_LIBCOMPOSITE
   DEPENDS:=+kmod-usb-gadget +kmod-fs-configfs
+  HIDDEN:=1
   FILES:=$(LINUX_DIR)/drivers/usb/gadget/libcomposite.ko
   AUTOLOAD:=$(call AutoLoad,50,libcomposite)
   $(call AddDepends/usb)
@@ -234,8 +255,25 @@ endef
 
 $(eval $(call KernelPackage,usb-lib-composite))
 
+define KernelPackage/usb-gadget-ehci-debug
+  TITLE:=USB EHCI debug port Gadget support
+  KCONFIG:=\
+       CONFIG_USB_G_DBGP \
+       CONFIG_USB_G_DBGP_SERIAL=y \
+       CONFIG_USB_G_DBGP_PRINTK=n
+  DEPENDS:=+kmod-usb-gadget +kmod-usb-lib-composite +kmod-usb-gadget-serial
+  FILES:=$(LINUX_DIR)/drivers/usb/gadget/legacy/g_dbgp.ko
+  AUTOLOAD:=$(call AutoLoad,52,g_dbgp)
+  $(call AddDepends/usb)
+endef
+
+define KernelPackage/usb-gadget-ehci-debug/description
+  Kernel support for USB EHCI debug port Gadget.
+endef
 
-define KernelPackage/usb-eth-gadget
+$(eval $(call KernelPackage,usb-gadget-ehci-debug))
+
+define KernelPackage/usb-gadget-eth
   TITLE:=USB Ethernet Gadget support
   KCONFIG:= \
        CONFIG_USB_ETH \
@@ -252,14 +290,14 @@ define KernelPackage/usb-eth-gadget
   $(call AddDepends/usb)
 endef
 
-define KernelPackage/usb-eth-gadget/description
+define KernelPackage/usb-gadget-eth/description
  Kernel support for USB Ethernet Gadget
 endef
 
-$(eval $(call KernelPackage,usb-eth-gadget))
+$(eval $(call KernelPackage,usb-gadget-eth))
 
 
-define KernelPackage/usb-serial-gadget
+define KernelPackage/usb-gadget-serial
   TITLE:=USB Serial Gadget support
   KCONFIG:=CONFIG_USB_G_SERIAL
   DEPENDS:=+kmod-usb-gadget +kmod-usb-lib-composite
@@ -273,11 +311,28 @@ define KernelPackage/usb-serial-gadget
   $(call AddDepends/usb)
 endef
 
-define KernelPackage/usb-serial-gadget/description
+define KernelPackage/usb-gadget-serial/description
   Kernel support for USB Serial Gadget.
 endef
 
-$(eval $(call KernelPackage,usb-serial-gadget))
+$(eval $(call KernelPackage,usb-gadget-serial))
+
+define KernelPackage/usb-gadget-mass-storage
+  TITLE:=USB Mass Storage support
+  KCONFIG:=CONFIG_USB_MASS_STORAGE
+  DEPENDS:=+kmod-usb-gadget +kmod-usb-lib-composite
+  FILES:= \
+       $(LINUX_DIR)/drivers/usb/gadget/function/usb_f_mass_storage.ko \
+       $(LINUX_DIR)/drivers/usb/gadget/legacy/g_mass_storage.ko
+  AUTOLOAD:=$(call AutoLoad,52,usb_f_mass_storage g_mass_storage)
+  $(call AddDepends/usb)
+endef
+
+define KernelPackage/usb-gadget-mass-storage/description
+  Kernel support for USB Gadget Mass Storage
+endef
+
+$(eval $(call KernelPackage,usb-gadget-mass-storage))
 
 
 define KernelPackage/usb-uhci
@@ -315,7 +370,10 @@ define KernelPackage/usb-ohci
   FILES:= \
        $(LINUX_DIR)/drivers/usb/host/ohci-hcd.ko \
        $(LINUX_DIR)/drivers/usb/host/ohci-platform.ko
-  AUTOLOAD:=$(call AutoLoad,50,ohci-hcd ohci-platform,1)
+  ifneq ($(wildcard $(LINUX_DIR)/drivers/usb/host/ohci-at91.ko),)
+    FILES+=$(LINUX_DIR)/drivers/usb/host/ohci-at91.ko
+  endif
+  AUTOLOAD:=$(call AutoLoad,50,ohci-hcd ohci-platform ohci-at91,1)
   $(call AddDepends/usb)
 endef
 
@@ -345,9 +403,8 @@ $(eval $(call KernelPackage,usb-ohci-pci))
 define KernelPackage/usb2-fsl
   TITLE:=Support for Freescale USB2 controllers
   DEPENDS:=@TARGET_mpc85xx
-  KCONFIG:=\
-       CONFIG_USB_FSL_MPH_DR_OF \
-       CONFIG_USB_EHCI_FSL=y
+  HIDDEN:=1
+  KCONFIG:=CONFIG_USB_FSL_MPH_DR_OF
   FILES:=$(LINUX_DIR)/drivers/usb/host/fsl-mph-dr-of.ko
   AUTOLOAD:=$(call AutoLoad,39,fsl-mph-dr-of,1)
   $(call AddDepends/usb)
@@ -407,6 +464,7 @@ define KernelPackage/usb2
        +TARGET_brcm47xx:kmod-usb-bcma \
        +TARGET_brcm47xx:kmod-usb-ssb \
        +TARGET_bcm53xx:kmod-usb-bcma \
+       +TARGET_bcm53xx:kmod-phy-bcm-ns-usb2 \
        +TARGET_mpc85xx:kmod-usb2-fsl
   KCONFIG:=\
        CONFIG_USB_EHCI_HCD \
@@ -416,14 +474,22 @@ define KernelPackage/usb2
        CONFIG_USB_EHCI_MXC=y \
        CONFIG_USB_OCTEON_EHCI=y \
        CONFIG_USB_EHCI_HCD_ORION=y \
-       CONFIG_USB_EHCI_HCD_PLATFORM=y
+       CONFIG_USB_EHCI_HCD_PLATFORM=y \
+       CONFIG_USB_EHCI_HCD_AT91=y \
+       CONFIG_USB_EHCI_FSL
   FILES:= \
        $(LINUX_DIR)/drivers/usb/host/ehci-hcd.ko \
        $(LINUX_DIR)/drivers/usb/host/ehci-platform.ko
   ifneq ($(wildcard $(LINUX_DIR)/drivers/usb/host/ehci-orion.ko),)
     FILES+=$(LINUX_DIR)/drivers/usb/host/ehci-orion.ko
   endif
-  AUTOLOAD:=$(call AutoLoad,40,ehci-hcd ehci-platform ehci-orion,1)
+  ifneq ($(wildcard $(LINUX_DIR)/drivers/usb/host/ehci-atmel.ko),)
+    FILES+=$(LINUX_DIR)/drivers/usb/host/ehci-atmel.ko
+  endif
+  ifneq ($(wildcard $(LINUX_DIR)/drivers/usb/host/ehci-fsl.ko),)
+    FILES+=$(LINUX_DIR)/drivers/usb/host/ehci-fsl.ko
+  endif
+  AUTOLOAD:=$(call AutoLoad,40,ehci-hcd ehci-platform ehci-orion ehci-atmel ehci-fsl,1)
   $(call AddDepends/usb)
 endef
 
@@ -452,18 +518,19 @@ $(eval $(call KernelPackage,usb2-pci))
 
 define KernelPackage/usb-dwc2
   TITLE:=DWC2 USB controller driver
-  DEPENDS:=+(TARGET_brcm2708||TARGET_at91||TARGET_brcm63xx||TARGET_mxs||TARGET_imx6):kmod-usb-gadget
+  DEPENDS:=+USB_GADGET_SUPPORT:kmod-usb-gadget
   KCONFIG:= \
        CONFIG_USB_DWC2 \
        CONFIG_USB_DWC2_PCI \
        CONFIG_USB_DWC2_PLATFORM \
        CONFIG_USB_DWC2_DEBUG=n \
        CONFIG_USB_DWC2_VERBOSE=n \
-       CONFIG_USB_DWC2_TRACK_MISSED_SOFS=n
+       CONFIG_USB_DWC2_TRACK_MISSED_SOFS=n \
+       CONFIG_USB_DWC2_DEBUG_PERIODIC=n
   FILES:= \
        $(LINUX_DIR)/drivers/usb/dwc2/dwc2.ko \
-       $(LINUX_DIR)/drivers/usb/dwc2/dwc2_platform.ko
-  AUTOLOAD:=$(call AutoLoad,54,dwc2 dwc2_platform,1)
+       $(LINUX_DIR)/drivers/usb/dwc2/dwc2_platform.ko@lt4.3
+  AUTOLOAD:=$(call AutoLoad,54,dwc2 dwc2_platform@lt4.3,1)
   $(call AddDepends/usb)
 endef
 
@@ -475,23 +542,6 @@ endef
 $(eval $(call KernelPackage,usb-dwc2))
 
 
-define KernelPackage/usb2-oxnas
-  TITLE:=OXNAS USB controller driver
-  DEPENDS:=@TARGET_oxnas +kmod-usb2
-  KCONFIG:=CONFIG_USB_EHCI_OXNAS
-  FILES:=$(LINUX_DIR)/drivers/usb/host/ehci-oxnas.ko
-  AUTOLOAD:=$(call AutoLoad,55,ehci-oxnas,1)
-  $(call AddDepends/usb)
-endef
-
-define KernelPackage/usb2-oxnas/description
- This driver provides USB Device Controller support for the
- EHCI USB host built-in to the PLXTECH NAS782x SoC
-endef
-
-$(eval $(call KernelPackage,usb2-oxnas))
-
-
 define KernelPackage/usb-dwc3
   TITLE:=DWC3 USB controller driver
   KCONFIG:= \
@@ -549,6 +599,7 @@ define KernelPackage/usb-audio
   TITLE:=Support for USB audio devices
   KCONFIG:= \
        CONFIG_USB_AUDIO \
+       CONFIG_SND_USB=y \
        CONFIG_SND_USB_AUDIO
   $(call AddDepends/usb)
   $(call AddDepends/sound)
@@ -1290,6 +1341,21 @@ endef
 $(eval $(call KernelPackage,usb-net-rtl8152))
 
 
+define KernelPackage/usb-net-sr9700
+  TITLE:=Support for CoreChip SR9700 ethernet devices
+  KCONFIG:=CONFIG_USB_NET_SR9700
+  FILES:=$(LINUX_DIR)/drivers/$(USBNET_DIR)/sr9700.ko
+  AUTOLOAD:=$(call AutoProbe,sr9700)
+  $(call AddDepends/usb-net)
+endef
+
+define KernelPackage/usb-net-sr9700/description
+ Kernel module for CoreChip-sz SR9700 based USB 1.1 10/100 ethernet devices
+endef
+
+$(eval $(call KernelPackage,usb-net-sr9700))
+
+
 define KernelPackage/usb-net-rndis
   TITLE:=Support for RNDIS connections
   KCONFIG:=CONFIG_USB_NET_RNDIS_HOST
@@ -1498,46 +1564,6 @@ endef
 $(eval $(call KernelPackage,usbip-server))
 
 
-define KernelPackage/usb-chipidea-imx
-  TITLE:=Support for ChipIdea controllers
-  DEPENDS:=@TARGET_imx6||TARGET_mxs +kmod-usb2 +USB_GADGET_SUPPORT:kmod-usb-gadget
-  KCONFIG:=\
-       CONFIG_USB_CHIPIDEA \
-       CONFIG_USB_CHIPIDEA_HOST=y \
-       CONFIG_USB_CHIPIDEA_UDC=y \
-       CONFIG_USB_CHIPIDEA_DEBUG=y
-  FILES:=\
-       $(LINUX_DIR)/drivers/usb/chipidea/ci_hdrc.ko \
-       $(if $(CONFIG_OF),$(LINUX_DIR)/drivers/usb/chipidea/ci_hdrc_imx.ko) \
-       $(if $(CONFIG_OF),$(LINUX_DIR)/drivers/usb/chipidea/usbmisc_imx.ko)
-  AUTOLOAD:=$(call AutoLoad,51,ci_hdrc $(if $(CONFIG_OF),ci_hdrc_imx usbmisc_imx),1)
-  $(call AddDepends/usb)
-endef
-
-define KernelPackage/usb-chipidea-imx/description
- Kernel support for USB ChipIdea controllers
-endef
-
-$(eval $(call KernelPackage,usb-chipidea-imx,1))
-
-
-define KernelPackage/usb-mxs-phy
-  TITLE:=Support for Freescale MXS USB PHY
-  DEPENDS:=@TARGET_imx6||TARGET_mxs +TARGET_mxs:kmod-usb-chipidea-imx
-  KCONFIG:=CONFIG_USB_MXS_PHY
-  FILES:=\
-       $(LINUX_DIR)/drivers/usb/phy/phy-mxs-usb.ko
-  AUTOLOAD:=$(call AutoLoad,52,phy-mxs-usb,1)
-  $(call AddDepends/usb)
-endef
-
-define KernelPackage/usb-mxs-phy/description
- Kernel support for Freescale MXS USB PHY
-endef
-
-$(eval $(call KernelPackage,usb-mxs-phy,1))
-
-
 define KernelPackage/usbmon
   TITLE:=USB traffic monitor
   KCONFIG:=CONFIG_USB_MON
@@ -1552,17 +1578,25 @@ endef
 
 $(eval $(call KernelPackage,usbmon))
 
-XHCI_FILES := $(wildcard $(patsubst %,$(LINUX_DIR)/drivers/usb/host/%.ko,xhci-hcd xhci-pci xhci-plat-hcd))
+XHCI_MODULES := xhci-hcd xhci-pci xhci-plat-hcd
+ifdef CONFIG_TARGET_ramips_mt7621
+  XHCI_MODULES += xhci-mtk
+endif
+XHCI_FILES := $(wildcard $(patsubst %,$(LINUX_DIR)/drivers/usb/host/%.ko,$(XHCI_MODULES)))
 XHCI_AUTOLOAD := $(patsubst $(LINUX_DIR)/drivers/usb/host/%.ko,%,$(XHCI_FILES))
 
 define KernelPackage/usb3
   TITLE:=Support for USB3 controllers
-  DEPENDS:=+TARGET_omap:kmod-usb-phy-omap-usb3
+  DEPENDS:= \
+       +TARGET_bcm53xx:kmod-usb-bcma \
+       +TARGET_bcm53xx:kmod-phy-bcm-ns-usb3 \
+       +TARGET_omap:kmod-usb-phy-omap-usb3
   KCONFIG:= \
        CONFIG_USB_XHCI_HCD \
        CONFIG_USB_XHCI_PCI \
        CONFIG_USB_XHCI_PLATFORM \
        CONFIG_USB_XHCI_MVEBU=y \
+       CONFIG_USB_XHCI_MTK \
        CONFIG_USB_XHCI_HCD_DEBUGGING=n
   FILES:= \
        $(XHCI_FILES)
@@ -1575,3 +1609,20 @@ define KernelPackage/usb3/description
 endef
 
 $(eval $(call KernelPackage,usb3))
+
+
+define KernelPackage/usb-net2280
+  TITLE:=Support for NetChip 228x PCI USB peripheral controller
+  KCONFIG:= CONFIG_USB_NET2280
+  DEPENDS:=@PCI_SUPPORT +kmod-usb-gadget
+  FILES:=$(LINUX_DIR)/drivers/usb/gadget/udc/net2280.ko
+  AUTOLOAD:=$(call AutoLoad,46,net2280)
+  $(call AddDepends/usb)
+endef
+
+define KernelPackage/usb-net2280/description
+  Kernel support for NetChip 228x / PLX USB338x PCI USB peripheral controller.
+endef
+
+$(eval $(call KernelPackage,usb-net2280))
+