No subject

Thu Jun 25 05:52:11 EDT 2020

the case. The drivers for the i2c jellybean regulator parts select REGMAP_I2C.
The remaining regulators drivers are usually part of a SoC and have a indirect
dependency/select to another symbol that selects REGMAP (these are mostly 
syscon/mfd symbols and CONFIG_SYSCON pulls in REGMAP_MMIO). So I guess this
will only become a problem is regulator kmods are added.

> b) (OpenWrt only) Change the usage in regulator/core.c and
> regulator/helper.c to work like REGMAP is disabled if it is
> build as a module.

diff --git a/package/kernel/linux/modules/ b/package/kernel/linux/modules/
index dd037cf86c..7e18a21db3 100644
--- a/package/kernel/linux/modules/
+++ b/package/kernel/linux/modules/
@@ -718,7 +718,7 @@ define KernelPackage/regmap
   TITLE:=Generic register map support
   DEPENDS:=+kmod-lib-lzo +kmod-i2c-core
diff --git a/target/linux/generic/hack-4.14/259-regmap_dynamic.patch b/target/linux/generic/hack-4.14/259-regmap_dynamic.patch
index 1c6e78df30..458b7c35a1 100644
--- a/target/linux/generic/hack-4.14/259-regmap_dynamic.patch
+++ b/target/linux/generic/hack-4.14/259-regmap_dynamic.patch
@@ -103,7 +103,7 @@ Signed-off-by: Felix Fietkau <nbd at>
  enum regmap_endian {
  	/* Unspecified -> 0 -> Backwards compatible default */

I think this should do just that. To quote IS_REACHABLE help text:"
IS_REACHABLE(CONFIG_FOO) evaluates to 1 if the currently compiled
code can call a function defined in code compiled based on CONFIG_FOO.
This is similar to IS_ENABLED(), but returns false when invoked from
built-in code when CONFIG_FOO is set to 'm'."

and it should combine the best of both worlds. (And maybe make it
possible to disable the REGMAP=y from ath79-tiny. Any testers?)

> b) is to allow building REGMAP as =m even when REGULATOR is enabled,
> if no REGMAP requiring REGULATOR driver is enabled.
I was more thinking about detangling just the REGULATOR_FIXED_VOLTAGE
driver from the REGULATOR framework. So it can be built without the 
regulator core and regmap. I did play around with #ifdefing but nah,
this turns out to become a much bigger fragile hack, that nobody is
going to maintain. 


openwrt-devel mailing list
openwrt-devel at

More information about the openwrt-devel mailing list