build: define PWM_SUPPORT arch feature flag
authorChristian Lamparter <chunkeey@gmail.com>
Sat, 29 Aug 2020 21:07:28 +0000 (23:07 +0200)
committerChristian Lamparter <chunkeey@gmail.com>
Fri, 25 Sep 2020 17:32:33 +0000 (19:32 +0200)
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
scripts/target-metadata.pl
target/Config.in

index c030b54b39e4f2a0a482cd75bc74a06d8f6908d6..fe90c6b5591d7073ee2b42dc1140f91ba48b0a5d 100644 (file)
@@ -159,3 +159,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))
index c58f09657323005adda3f897417b44be7d55c603..bf6413d315f927ed07a6cd3cf19f3f554202d07c 100755 (executable)
@@ -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";
index 9fead5994f709663dc6f86d487a20469289c5686..43de4710dfd3e6d19a7cc031db73f57891837e2f 100644 (file)
@@ -29,6 +29,9 @@ config PCIE_SUPPORT
 config PCMCIA_SUPPORT
        bool
 
+config PWM_SUPPORT
+       bool
+
 config USB_SUPPORT
        select AUDIO_SUPPORT
        bool