mediatek: build ubnt-ledbar as a module
authorChuanhong Guo <gch981213@gmail.com>
Sat, 30 Apr 2022 15:08:00 +0000 (23:08 +0800)
committerDaniel Golle <daniel@makrotopia.org>
Mon, 4 Jul 2022 18:57:49 +0000 (19:57 +0100)
The config for LEDS_UBNT_LEDBAR doesn't stay in mt7629 kconfig because
of its I2C dependency. Build it as a module and let buildroot handle
this config option instead.

Signed-off-by: Chuanhong Guo <gch981213@gmail.com>
(cherry picked from commit d9ea9c06e98b597174e0e94e0a13934637c0c03e)

target/linux/mediatek/image/mt7622.mk
target/linux/mediatek/modules.mk
target/linux/mediatek/mt7622/config-5.10
target/linux/mediatek/mt7623/config-5.10

index 8e0126f5764758468c5178f9f7829e4bb840357c..39bc7bc2ea0a170c2da71d578fcfeb90a7b0b7fa 100644 (file)
@@ -228,7 +228,7 @@ define Device/ubnt_unifi-6-lr
   DEVICE_DTS_CONFIG := config@1
   DEVICE_DTS := mt7622-ubnt-unifi-6-lr
   DEVICE_DTS_DIR := ../dts
-  DEVICE_PACKAGES := kmod-mt7915e
+  DEVICE_PACKAGES := kmod-mt7915e kmod-leds-ubnt-ledbar
 endef
 TARGET_DEVICES += ubnt_unifi-6-lr
 
@@ -238,7 +238,7 @@ define Device/ubnt_unifi-6-lr-ubootmod
   DEVICE_VARIANT := U-Boot mod
   DEVICE_DTS := mt7622-ubnt-unifi-6-lr-ubootmod
   DEVICE_DTS_DIR := ../dts
-  DEVICE_PACKAGES := kmod-mt7915e
+  DEVICE_PACKAGES := kmod-mt7915e kmod-leds-ubnt-ledbar
   KERNEL := kernel-bin | lzma
   KERNEL_INITRAMFS_SUFFIX := -recovery.itb
   KERNEL_INITRAMFS := kernel-bin | lzma | fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb with-initrd | pad-to 64k
index 467934256c64c4bc6a50b618530d80f328a59a87..0eb2866cf060441dc85c88fda3102e6b003e1fca 100644 (file)
@@ -38,3 +38,19 @@ define KernelPackage/sdhci-mtk
 endef
 
 $(eval $(call KernelPackage,sdhci-mtk))
+
+define KernelPackage/leds-ubnt-ledbar
+  SUBMENU:=LED modules
+  TITLE:=Ubiquiti UniFi 6 LR LED support
+  KCONFIG:=CONFIG_LEDS_UBNT_LEDBAR
+  FILES:= \
+       $(LINUX_DIR)/drivers/leds/leds-ubnt-ledbar.ko
+  AUTOLOAD:=$(call AutoProbe,leds-ubnt-ledbar,1)
+  DEPENDS:=@TARGET_mediatek_mt7622 +kmod-i2c-core
+endef
+
+define KernelPackage/leds-ubnt-ledbar/description
+  LED support for Ubiquiti UniFi 6 LR
+endef
+
+$(eval $(call KernelPackage,leds-ubnt-ledbar))
index 89ebc615766212ebfc15022cb722e3cb420e5c3a..0c71b39cf06d0045e834367c6ac5092ece3c8130 100644 (file)
@@ -226,7 +226,6 @@ CONFIG_IRQ_WORK=y
 CONFIG_JBD2=y
 CONFIG_JUMP_LABEL=y
 # CONFIG_KEYBOARD_MTK_PMIC is not set
-CONFIG_LEDS_UBNT_LEDBAR=y
 CONFIG_LIBFDT=y
 CONFIG_LOCK_DEBUGGING_SUPPORT=y
 CONFIG_LOCK_SPIN_ON_OWNER=y
index 3d017400a04725ff4059a7dbd5f28cadf8405f0b..a2be7b1ff85c1862a08d75dd1a2636a39eea66bf 100644 (file)
@@ -343,7 +343,6 @@ CONFIG_KEYBOARD_MTK_PMIC=y
 CONFIG_LCD_CLASS_DEVICE=y
 CONFIG_LCD_PLATFORM=y
 CONFIG_LEDS_MT6323=y
-# CONFIG_LEDS_UBNT_LEDBAR is not set
 CONFIG_LIBFDT=y
 CONFIG_LOCK_DEBUGGING_SUPPORT=y
 CONFIG_LOCK_SPIN_ON_OWNER=y