diff mbox series

[RFC,v1,3/8] build: define PWM_SUPPORT arch feature flag

Message ID bec4598b68bc9d98af41e995f9d3cc8f95149228.1598756597.git.chunkeey@gmail.com
State RFC, archived
Delegated to: Christian Lamparter
Headers show
Series [RFC,v1,1/8] base-files: support label-property-less in get_dt_leds | expand

Commit Message

Christian Lamparter Aug. 30, 2020, 3:04 a.m. UTC
As the PWM has its own sub-system in the Linux kernel,
I think it should be handled in the same way as GPIO, RTC, PCI...

This patch introduces a specific feature flag "pwm" and the
"leds-pwm" kernel module as the first customer.

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
---
 package/kernel/linux/modules/leds.mk | 16 ++++++++++++++++
 scripts/target-metadata.pl           |  1 +
 target/Config.in                     |  3 +++
 3 files changed, 20 insertions(+)
diff mbox series

Patch

diff --git a/package/kernel/linux/modules/leds.mk b/package/kernel/linux/modules/leds.mk
index 59ea6edbcd..4ef64fd907 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-pwm
+  SUBMENU:=$(LEDS_MENU)
+  TITLE:=PWM driven LED Support
+  KCONFIG:=CONFIG_LEDS_PWM
+  DEPENDS:= @PWM_SUPPORT
+  FILES:=$(LINUX_DIR)/drivers/leds/leds-pwm.ko
+  AUTOLOAD:=$(call AutoLoad,60,leds-pwm,1)
+endef
+
+define KernelPackage/leds-pwm/description
+ This option enables support for pwm driven LEDs
+endef
+
+$(eval $(call KernelPackage,leds-pwm))
diff --git a/scripts/target-metadata.pl b/scripts/target-metadata.pl
index c58f096573..bf6413d315 100755
--- a/scripts/target-metadata.pl
+++ b/scripts/target-metadata.pl
@@ -20,6 +20,7 @@  sub target_config_features(@) {
 		/^usb$/ and $ret .= "\tselect USB_SUPPORT\n";
 		/^usbgadget$/ and $ret .= "\tselect USB_GADGET_SUPPORT\n";
 		/^pcmcia$/ and $ret .= "\tselect PCMCIA_SUPPORT\n";
+		/^pwm$/ and $ret .= "\select PWM_SUPPORT\n";
 		/^rtc$/ and $ret .= "\tselect RTC_SUPPORT\n";
 		/^squashfs$/ and $ret .= "\tselect USES_SQUASHFS\n";
 		/^jffs2$/ and $ret .= "\tselect USES_JFFS2\n";
diff --git a/target/Config.in b/target/Config.in
index 9fead5994f..43de4710df 100644
--- a/target/Config.in
+++ b/target/Config.in
@@ -29,6 +29,9 @@  config PCIE_SUPPORT
 config PCMCIA_SUPPORT
 	bool
 
+config PWM_SUPPORT
+	bool
+
 config USB_SUPPORT
 	select AUDIO_SUPPORT
 	bool