[openwrt/openwrt] targets: add USES_PM auto-feature

LEDE Commits lede-commits at lists.infradead.org
Sun Jul 20 04:16:50 PDT 2025


dangole pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/85f27367eac568b389041ec8b7ee97cd8ceec622

commit 85f27367eac568b389041ec8b7ee97cd8ceec622
Author: Daniel Golle <daniel at makrotopia.org>
AuthorDate: Thu Jul 17 21:00:00 2025 +0100

    targets: add USES_PM auto-feature
    
    Not all targets support power management, some older or more simple
    targets don't have CONFIG_PM set. Allow kernel module packages to
    depend on USES_PM to only be available on targets which got
    CONFIG_PM=y in their kernel config.
    
    Signed-off-by: Daniel Golle <daniel at makrotopia.org>
---
 include/target.mk          | 3 +++
 scripts/target-metadata.pl | 1 +
 target/Config.in           | 3 +++
 3 files changed, 7 insertions(+)

diff --git a/include/target.mk b/include/target.mk
index 786c3ec5ce..b6c5e29d45 100644
--- a/include/target.mk
+++ b/include/target.mk
@@ -318,6 +318,9 @@ ifeq ($(DUMP),1)
     ifneq ($(CONFIG_PINCTRL),)
       FEATURES += pinctrl
     endif
+    ifneq ($(CONFIG_PM),)
+      FEATURES += pm
+    endif
     ifneq ($(CONFIG_PWM),)
       FEATURES += pwm
     endif
diff --git a/scripts/target-metadata.pl b/scripts/target-metadata.pl
index 751f66c7de..5c32b2c2d6 100755
--- a/scripts/target-metadata.pl
+++ b/scripts/target-metadata.pl
@@ -34,6 +34,7 @@ sub target_config_features(@) {
 		/^pcie$/ and $ret .= "\tselect PCIE_SUPPORT\n";
 		/^pcmcia$/ and $ret .= "\tselect PCMCIA_SUPPORT\n";
 		/^pinctrl$/ and $ret .= "\tselect PINCTRL_SUPPORT\n";
+		/^pm$/ and $ret .= "\tselect USES_PM\n";
 		/^powerpc64$/ and $ret .= "\tselect powerpc64\n";
 		/^pwm$/ and $ret .= "\select PWM_SUPPORT\n";
 		/^ramdisk$/ and $ret .= "\tselect USES_INITRAMFS\n";
diff --git a/target/Config.in b/target/Config.in
index 38ff716d69..82c88d0890 100644
--- a/target/Config.in
+++ b/target/Config.in
@@ -51,6 +51,9 @@ config RTC_SUPPORT
 config BIG_ENDIAN
 	bool
 
+config USES_PM
+	bool
+
 config USES_DEVICETREE
 	bool
 




More information about the lede-commits mailing list