[OpenWrt-Devel] [PATCH 2/4] mvebu: enable Turris Omnia LED support as module

Klaus Kudielka klaus.kudielka at gmail.com
Thu Dec 13 00:29:50 EST 2018


leds.mk:
- Define kmod-leds-omnia including dependencies.
- Load early, in order to support LED diagnostics during preinit.

cortex-a9.mk:
- Select kmod-leds-omnia for the turris-omnia image.

i2c.mk:
- LED controller is behind i2c mux. Therefore, load i2c-mux-pca954x
  early as well.

Signed-off-by: Klaus Kudielka <klaus.kudielka at gmail.com>
---
 package/kernel/linux/modules/i2c.mk   |  2 +-
 package/kernel/linux/modules/leds.mk  | 16 ++++++++++++++++
 target/linux/mvebu/image/cortex-a9.mk |  1 +
 3 files changed, 18 insertions(+), 1 deletion(-)

diff --git a/package/kernel/linux/modules/i2c.mk b/package/kernel/linux/modules/i2c.mk
index 4cf37dae07..d7a07a733f 100644
--- a/package/kernel/linux/modules/i2c.mk
+++ b/package/kernel/linux/modules/i2c.mk
@@ -176,7 +176,7 @@ I2C_MUX_PCA954x_MODULES:= \
   CONFIG_I2C_MUX_PCA954x:drivers/i2c/muxes/i2c-mux-pca954x
 
 define KernelPackage/i2c-mux-pca954x
-  $(call i2c_defaults,$(I2C_MUX_PCA954x_MODULES),51)
+  $(call i2c_defaults,$(I2C_MUX_PCA954x_MODULES),51,1)
   TITLE:=Philips PCA954x I2C mux/switches
   DEPENDS:=kmod-i2c-mux
 endef
diff --git a/package/kernel/linux/modules/leds.mk b/package/kernel/linux/modules/leds.mk
index 7019f04779..a8673c4af9 100644
--- a/package/kernel/linux/modules/leds.mk
+++ b/package/kernel/linux/modules/leds.mk
@@ -145,3 +145,19 @@ define KernelPackage/leds-pca963x/description
 endef
 
 $(eval $(call KernelPackage,leds-pca963x))
+
+
+define KernelPackage/leds-omnia
+  SUBMENU:=$(LEDS_MENU)
+  TITLE:=Turris Omnia LED support
+  DEPENDS:=@TARGET_mvebu_cortexa9 +kmod-i2c-core +kmod-i2c-mux +kmod-i2c-mux-pca954x
+  KCONFIG:=CONFIG_LEDS_OMNIA
+  FILES:=$(LINUX_DIR)/drivers/leds/leds-omnia.ko
+  AUTOLOAD:=$(call AutoLoad,60,leds-omnia,1)
+endef
+
+define KernelPackage/leds-omnia/description
+ Driver for the Turris Omnia LED controller.
+endef
+
+$(eval $(call KernelPackage,leds-omnia))
diff --git a/target/linux/mvebu/image/cortex-a9.mk b/target/linux/mvebu/image/cortex-a9.mk
index 79c3bc7bdb..272e381db0 100644
--- a/target/linux/mvebu/image/cortex-a9.mk
+++ b/target/linux/mvebu/image/cortex-a9.mk
@@ -162,6 +162,7 @@ define Device/turris-omnia
   DEVICE_TITLE := Turris Omnia
   DEVICE_PACKAGES :=  \
     mkf2fs e2fsprogs kmod-fs-vfat kmod-nls-cp437 kmod-nls-iso8859-1 \
+    kmod-leds-omnia \
     wpad-basic kmod-ath9k kmod-ath10k-ct ath10k-firmware-qca988x-ct
   IMAGES := $$(IMAGE_PREFIX)-sysupgrade.img.gz omnia-medkit-$$(IMAGE_PREFIX)-initramfs.tar.gz
   IMAGE/$$(IMAGE_PREFIX)-sysupgrade.img.gz := boot-img | sdcard-img | gzip | append-metadata
-- 
2.17.1


_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel



More information about the openwrt-devel mailing list