]> git.ipfire.org Git - thirdparty/openwrt.git/commitdiff
kernel: usb: add kmod-usb-common package
authorThomas Richard <thomas.richard@bootlin.com>
Tue, 5 Aug 2025 07:32:48 +0000 (09:32 +0200)
committerHauke Mehrtens <hauke@hauke-m.de>
Fri, 8 Aug 2025 16:06:51 +0000 (18:06 +0200)
Move usb-common driver from usb-core package to a new usb-common package.
The usb-common driver is needed by usb-gadget driver which can be used
without host support.

Signed-off-by: Thomas Richard <thomas.richard@bootlin.com>
Link: https://github.com/openwrt/openwrt/pull/19246
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
package/kernel/linux/modules/usb.mk

index 4155082901535ff643906b8dbe7458b6b2f08357..445a8ff0a15646a9cb23249da990cbeeebb1949f 100644 (file)
@@ -11,15 +11,24 @@ USBNET_DIR:=net/usb
 USBHID_DIR?=hid/usbhid
 USBINPUT_DIR?=input/misc
 
+define KernelPackage/usb-common
+  TITLE:=USB common
+  HIDDEN:=1
+  DEPENDS:=@(USB_SUPPORT||USB_GADGET_SUPPORT)
+  KCONFIG:=CONFIG_USB_COMMON
+  FILES:=$(LINUX_DIR)/drivers/usb/common/usb-common.ko
+  AUTOLOAD:=$(call AutoLoad,20,usb-common,1)
+endef
+
+$(eval $(call KernelPackage,usb-common))
+
 define KernelPackage/usb-core
   SUBMENU:=$(USB_MENU)
   TITLE:=Support for USB
-  DEPENDS:=@USB_SUPPORT
+  DEPENDS:=@USB_SUPPORT +USB_SUPPORT:kmod-usb-common
   KCONFIG:=CONFIG_USB CONFIG_XPS_USB_HCD_XILINX=n CONFIG_USB_FHCI_HCD=n
-  FILES:= \
-       $(LINUX_DIR)/drivers/usb/core/usbcore.ko \
-       $(LINUX_DIR)/drivers/usb/common/usb-common.ko
-  AUTOLOAD:=$(call AutoLoad,20,usb-common usbcore,1)
+  FILES:=$(LINUX_DIR)/drivers/usb/core/usbcore.ko
+  AUTOLOAD:=$(call AutoLoad,20,usbcore,1)
   $(call AddDepends/nls)
 endef