This reduces the needed modifications to the mainline Linux kernel and
also makes the regmap package work with an out of tree kernel which
does not have these modifications.
The regmap-core is only added when it is really build as a module.
The regmap-core is normally bool so it cannot be built as a module in an
unmodified kernel. When it is selected by on other kernel module it will
always be selected as build in and it also does not show up in
$(LINUX_DIR)/modules.builtin as it is not supposed to be a kernel module.
When it is not in $(LINUX_DIR)/modules.builtin the build system expects
it to be built as a .ko file.
Just check if the module is really there and only add it in that case.
This splits the regmap package into multiple packages, one for each bus type.
This way only the bus maps which are really needed have to be added.
This also splits the I2C, SPI and MMIO regmap into separate packages to not
require all these subsystems to build them, on an unmodified upstream kernel
this also causes problems in some situations.
Signed-off-by: Hauke Mehrtens
---
package/kernel/linux/modules/can.mk| 2 +-
package/kernel/linux/modules/hwmon.mk | 10 +--
package/kernel/linux/modules/iio.mk| 6 +-
package/kernel/linux/modules/other.mk | 87 --
package/kernel/linux/modules/sound.mk | 4 +-
package/kernel/linux/modules/wpan.mk | 4 +-
target/linux/at91/modules.mk | 2 +-
target/linux/brcm2708/modules.mk | 4 +-
.../generic/hack-4.14/259-regmap_dynamic.patch | 14 ++--
.../generic/hack-4.19/259-regmap_dynamic.patch | 17 ++---
.../generic/hack-4.9/259-regmap_dynamic.patch | 14 ++--
.../generic/pending-3.18/259-regmap_dynamic.patch | 14 ++--
target/linux/ramips/modules.mk | 2 +-
13 files changed, 101 insertions(+), 79 deletions(-)
diff --git a/package/kernel/linux/modules/can.mk
b/package/kernel/linux/modules/can.mk
index 4154ceb..b0d2545 100644
--- a/package/kernel/linux/modules/can.mk
+++ b/package/kernel/linux/modules/can.mk
@@ -99,7 +99,7 @@ $(eval $(call KernelPackage,can-c-can-pci))
define KernelPackage/can-c-can-platform
TITLE:=Platform Bus based BOSCH C_CAN/D_CAN driver
KCONFIG:=CONFIG_CAN_C_CAN_PLATFORM
- DEPENDS:=kmod-can-c-can +!LINUX_3_18:kmod-regmap
+ DEPENDS:=kmod-can-c-can +!LINUX_3_18:kmod-regmap-core
FILES:=$(LINUX_DIR)/drivers/net/can/c_can/c_can_platform.ko
AUTOLOAD:=$(call AutoProbe,c_can_platform)
$(call AddDepends/can)
diff --git a/package/kernel/linux/modules/hwmon.mk
b/package/kernel/linux/modules/hwmon.mk
index 00bb185..5f54b4a 100644
--- a/package/kernel/linux/modules/hwmon.mk
+++ b/package/kernel/linux/modules/hwmon.mk
@@ -112,7 +112,7 @@ define KernelPackage/hwmon-ina2xx
KCONFIG:=CONFIG_SENSORS_INA2XX
FILES:=$(LINUX_DIR)/drivers/hwmon/ina2xx.ko
AUTOLOAD:=$(call AutoProbe,ina2xx)
- $(call AddDepends/hwmon,+kmod-i2c-core +!LINUX_3_18:kmod-regmap)
+ $(call AddDepends/hwmon,+kmod-i2c-core +!LINUX_3_18:kmod-regmap-i2c)
endef
define KernelPackage/hwmon-ina2xx/description
@@ -142,7 +142,7 @@ define KernelPackage/hwmon-lm63
KCONFIG:=CONFIG_SENSORS_LM63
FILES:=$(LINUX_DIR)/drivers/hwmon/lm63.ko
AUTOLOAD:=$(call AutoProbe,lm63)
- $(call AddDepends/hwmon,+kmod-i2c-core +kmod-regmap)
+ $(call AddDepends/hwmon,+kmod-i2c-core +kmod-regmap-i2c)
endef
define KernelPackage/hwmon-lm63/description
@@ -157,7 +157,7 @@ define KernelPackage/hwmon-lm75
KCONFIG:=CONFIG_SENSORS_LM75
FILES:=$(LINUX_DIR)/drivers/hwmon/lm75.ko
AUTOLOAD:=$(call AutoProbe,lm75)
- $(call AddDepends/hwmon,+kmod-i2c-core +PACKAGE_kmod-thermal:kmod-thermal
+kmod-regmap)
+ $(call AddDepends/hwmon,+kmod-i2c-core +PACKAGE_kmod-thermal:kmod-thermal
+kmod-regmap-i2c)
endef
define KernelPackage/hwmon-lm75/description
@@ -339,7 +339,7 @@ define KernelPackage/hwmon-tmp102
KCONFIG:=CONFIG_SENSORS_TMP102
FILES:=$(LINUX_DIR)/drivers/hwmon/tmp102.ko
AUTOLOAD:=$(call AutoProbe,tmp102)
- $(call AddDepends/hwmon,+kmod-i2c-core +PACKAGE_kmod-thermal:kmod-thermal
+kmod-regmap)
+ $(call AddDepends/hwmon,+kmod-i2c-core +PACKAGE_kmod-thermal:kmod-thermal
+kmod-regmap-i2c)
endef
define KernelPackage/hwmon-tmp102/description
@@ -354,7 +354,7 @@ define KernelPackage/hwmon-tmp103
KCONFIG:=CONFIG_SENSORS_TMP103
FILES:=$(LINUX_DIR)/drivers/hwmon/tmp103.ko
AUTOLOAD:=$(call AutoProbe,tmp103)
- $(call AddDepends/hwmon,+kmod-i2c-core +kmod-regmap)
+ $(call AddDepends/hwmon,+kmod-i2c-core +kmod-regmap-i2c)
endef
define KernelPackage/hwmon-tmp103/description
diff --git a/package/kernel/linux/modules/iio.mk
b/package/kernel/linux/modules/iio.mk
index ee82eee..fe682b3 100644
--- a/package/kernel/linux/modules/iio.mk
+++ b/package/kernel/linux/modules/iio.mk
@@ -54,7 +54,7 @@ $(eval $(call KernelPackage,iio-ad799x))
define KernelPackage/iio-hmc5843
SUBMENU:=$(IIO_MENU)
-