From 17139e35b1bd7fdd0194e9d46ac64254e6102361 Mon Sep 17 00:00:00 2001 From: Robert Marko Date: Fri, 27 Feb 2026 12:08:56 +0100 Subject: [PATCH] targets: add REGULATOR_SUPPORT auto-feature Not all targets need regulator support, so they dont enable it as its disabled in the generic config by default. So, in order to allow kernel modules to depend on regulator support lets add a new feature flag "regulator" and set it automatically if target kernel config enables CONFIG_REGULATOR. Link: https://github.com/openwrt/openwrt/pull/22172 Signed-off-by: Robert Marko --- 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 c51ca1c6b8..45d0a6686b 100644 --- a/include/target.mk +++ b/include/target.mk @@ -317,6 +317,9 @@ ifeq ($(DUMP),1) ifneq ($(CONFIG_PWM),) FEATURES += pwm endif + ifneq ($(CONFIG_REGULATOR),) + FEATURES += regulator + endif ifneq ($(CONFIG_USB)$(CONFIG_USB_SUPPORT),) ifneq ($(CONFIG_USB_ARCH_HAS_HCD)$(CONFIG_USB_EHCI_HCD),) FEATURES += usb diff --git a/scripts/target-metadata.pl b/scripts/target-metadata.pl index 5c32b2c2d6..dc03caec5c 100755 --- a/scripts/target-metadata.pl +++ b/scripts/target-metadata.pl @@ -38,6 +38,7 @@ sub target_config_features(@) { /^powerpc64$/ and $ret .= "\tselect powerpc64\n"; /^pwm$/ and $ret .= "\select PWM_SUPPORT\n"; /^ramdisk$/ and $ret .= "\tselect USES_INITRAMFS\n"; + /^regulator$/ and $ret .= "\tselect REGULATOR_SUPPORT\n"; /^rfkill$/ and $ret .= "\tselect RFKILL_SUPPORT\n"; /^rootfs-part$/ and $ret .= "\tselect USES_ROOTFS_PART\n"; /^rtc$/ and $ret .= "\tselect RTC_SUPPORT\n"; diff --git a/target/Config.in b/target/Config.in index 82c88d0890..d56de80f5a 100644 --- a/target/Config.in +++ b/target/Config.in @@ -128,6 +128,9 @@ config USES_ROOTFS_PART config USES_BOOT_PART bool +config REGULATOR_SUPPORT + bool + # Architecture selection config aarch64