[openwrt/openwrt] kernel: modules: bluetooth: separating UART and USB drivers

LEDE Commits lede-commits at lists.infradead.org
Sun Feb 23 15:22:56 PST 2025


hauke pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/1c42a0be3619e0cab7265996a424a5adfd537fb5

commit 1c42a0be3619e0cab7265996a424a5adfd537fb5
Author: Paweł Owoc <frut3k7 at gmail.com>
AuthorDate: Sat Jan 4 22:48:01 2025 +0100

    kernel: modules: bluetooth: separating UART and USB drivers
    
    Not all devices need Bluetooth UART and USB drivers to be installed together. Three separate drivers have been created:
    - kmod-bluetooth
    - kmod-hci-uart
    - kmod-btusb
    
    Signed-off-by: Paweł Owoc <frut3k7 at gmail.com>
    Link: https://github.com/openwrt/openwrt/pull/15118
    Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
---
 package/kernel/linux/modules/bluetooth.mk | 67 +++++++++++++++++++++++--------
 1 file changed, 50 insertions(+), 17 deletions(-)

diff --git a/package/kernel/linux/modules/bluetooth.mk b/package/kernel/linux/modules/bluetooth.mk
index 52827e76a4..a498c31e0b 100644
--- a/package/kernel/linux/modules/bluetooth.mk
+++ b/package/kernel/linux/modules/bluetooth.mk
@@ -10,7 +10,7 @@ BLUETOOTH_MENU:=Bluetooth Support
 define KernelPackage/bluetooth
   SUBMENU:=$(BLUETOOTH_MENU)
   TITLE:=Bluetooth support
-  DEPENDS:=@USB_SUPPORT +kmod-usb-core +kmod-crypto-hash +kmod-crypto-ecb +kmod-lib-crc16 +kmod-hid +kmod-crypto-cmac +kmod-regmap-core +kmod-crypto-ecdh
+  DEPENDS:=+kmod-crypto-hash +kmod-crypto-ecb +kmod-lib-crc16 +kmod-hid +kmod-crypto-cmac +kmod-regmap-core +kmod-crypto-ecdh
   KCONFIG:= \
 	CONFIG_BT \
 	CONFIG_BT_BREDR=y \
@@ -18,40 +18,73 @@ define KernelPackage/bluetooth
 	CONFIG_BT_LE=y \
 	CONFIG_BT_RFCOMM \
 	CONFIG_BT_BNEP \
-	CONFIG_BT_HCIBTUSB \
-	CONFIG_BT_HCIBTUSB_BCM=n \
-	CONFIG_BT_HCIBTUSB_MTK=y \
-	CONFIG_BT_HCIBTUSB_RTL=y \
-	CONFIG_BT_HCIUART \
-	CONFIG_BT_HCIUART_BCM=n \
-	CONFIG_BT_HCIUART_INTEL=n \
-	CONFIG_BT_HCIUART_H4 \
-	CONFIG_BT_HCIUART_NOKIA=n \
 	CONFIG_BT_HIDP
   $(call AddDepends/rfkill)
   FILES:= \
 	$(LINUX_DIR)/net/bluetooth/bluetooth.ko \
 	$(LINUX_DIR)/net/bluetooth/rfcomm/rfcomm.ko \
 	$(LINUX_DIR)/net/bluetooth/bnep/bnep.ko \
-	$(LINUX_DIR)/net/bluetooth/hidp/hidp.ko \
-	$(LINUX_DIR)/drivers/bluetooth/hci_uart.ko \
+	$(LINUX_DIR)/net/bluetooth/hidp/hidp.ko
+  AUTOLOAD:=$(call AutoProbe,bluetooth rfcomm bnep hidp)
+endef
+
+define KernelPackage/bluetooth/description
+ Kernel support for Bluetooth devices
+endef
+
+$(eval $(call KernelPackage,bluetooth))
+
+
+define KernelPackage/hci-uart
+  SUBMENU:=$(BLUETOOTH_MENU)
+  TITLE:=Bluetooth HCI UART support
+  DEPENDS:=+kmod-bluetooth
+  KCONFIG:= \
+	CONFIG_BT_HCIUART \
+	CONFIG_BT_HCIUART_BCM=n \
+	CONFIG_BT_HCIUART_INTEL=n \
+	CONFIG_BT_HCIUART_H4 \
+	CONFIG_BT_HCIUART_NOKIA=n
+  FILES:= \
+	$(LINUX_DIR)/drivers/bluetooth/hci_uart.ko
+  AUTOLOAD:=$(call AutoProbe,hci_uart)
+endef
+
+define KernelPackage/hci-uart/description
+ Kernel support for Bluetooth HCI UART devices
+endef
+
+$(eval $(call KernelPackage,hci-uart))
+
+
+define KernelPackage/btusb
+  SUBMENU:=$(BLUETOOTH_MENU)
+  TITLE:=Bluetooth HCI USB support
+  DEPENDS:=@USB_SUPPORT +kmod-usb-core +kmod-bluetooth
+  KCONFIG:= \
+	CONFIG_BT_HCIBTUSB \
+	CONFIG_BT_HCIBTUSB_BCM=n \
+	CONFIG_BT_HCIBTUSB_MTK=y \
+	CONFIG_BT_HCIBTUSB_RTL=y
+  FILES:= \
 	$(LINUX_DIR)/drivers/bluetooth/btusb.ko \
 	$(LINUX_DIR)/drivers/bluetooth/btintel.ko \
 	$(LINUX_DIR)/drivers/bluetooth/btrtl.ko \
 	$(LINUX_DIR)/drivers/bluetooth/btmtk.ko
-  AUTOLOAD:=$(call AutoProbe,bluetooth rfcomm bnep hidp hci_uart btusb)
+  AUTOLOAD:=$(call AutoProbe,btusb)
 endef
 
-define KernelPackage/bluetooth/description
- Kernel support for Bluetooth devices
+define KernelPackage/btusb/description
+ Kernel support for USB Bluetooth HCI USB devices
 endef
 
-$(eval $(call KernelPackage,bluetooth))
+$(eval $(call KernelPackage,btusb))
+
 
 define KernelPackage/ath3k
   SUBMENU:=$(BLUETOOTH_MENU)
   TITLE:=ATH3K Kernel Module support
-  DEPENDS:=+kmod-bluetooth +ar3k-firmware
+  DEPENDS:=+kmod-hci-uart +kmod-btusb +ar3k-firmware
   KCONFIG:= \
 	CONFIG_BT_ATH3K \
 	CONFIG_BT_HCIUART_ATH3K=y




More information about the lede-commits mailing list