kernel: Build: Split kmod-regmap

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 <hauke.mehrtens@intel.com>
This commit is contained in:
Hauke Mehrtens
2019-01-11 18:05:11 +01:00
committed by Hauke Mehrtens
parent 538127cf98
commit fd5c168701
13 changed files with 101 additions and 79 deletions

View File

@@ -21,22 +21,19 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
- default y if (REGMAP_I2C || REGMAP_SPI || REGMAP_SPMI || REGMAP_W1 || REGMAP_AC97 || REGMAP_MMIO || REGMAP_IRQ)
select IRQ_DOMAIN if REGMAP_IRQ
- bool
+ tristate "Regmap"
+ tristate
config REGCACHE_COMPRESSED
select LZO_COMPRESS
@@ -17,23 +16,30 @@ config REGMAP_AC97
tristate
@@ -18,22 +17,29 @@ config REGMAP_AC97
config REGMAP_I2C
- tristate
+ tristate "Regmap I2C"
tristate
+ select REGMAP
depends on I2C
config REGMAP_SPI
- tristate
+ tristate "Regmap SPI"
tristate
+ select REGMAP
+ depends on SPI_MASTER
depends on SPI
@@ -52,8 +49,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
depends on W1
config REGMAP_MMIO
- tristate
+ tristate "Regmap MMIO"
tristate
+ select REGMAP
config REGMAP_IRQ

View File

@@ -21,26 +21,22 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
- default y if (REGMAP_I2C || REGMAP_SPI || REGMAP_SPMI || REGMAP_W1 || REGMAP_AC97 || REGMAP_MMIO || REGMAP_IRQ)
select IRQ_DOMAIN if REGMAP_IRQ
- bool
+ tristate "Regmap"
+ tristate
config REGCACHE_COMPRESSED
select LZO_COMPRESS
@@ -17,7 +16,8 @@ config REGMAP_AC97
tristate
@@ -18,6 +17,7 @@ config REGMAP_AC97
config REGMAP_I2C
- tristate
+ tristate "Regmap I2C"
tristate
+ select REGMAP
depends on I2C
config REGMAP_SLIMBUS
@@ -25,21 +25,27 @@ config REGMAP_SLIMBUS
depends on SLIMBUS
@@ -26,20 +26,26 @@ config REGMAP_SLIMBUS
config REGMAP_SPI
- tristate
+ tristate "Regmap SPI"
tristate
+ select REGMAP
+ depends on SPI_MASTER
depends on SPI
@@ -56,8 +52,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
depends on W1
config REGMAP_MMIO
- tristate
+ tristate "Regmap MMIO"
tristate
+ select REGMAP
config REGMAP_IRQ

View File

@@ -21,22 +21,19 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
- default y if (REGMAP_I2C || REGMAP_SPI || REGMAP_SPMI || REGMAP_AC97 || REGMAP_MMIO || REGMAP_IRQ)
select IRQ_DOMAIN if REGMAP_IRQ
- bool
+ tristate "Regmap"
+ tristate
config REGCACHE_COMPRESSED
select LZO_COMPRESS
@@ -16,19 +15,25 @@ config REGMAP_AC97
tristate
@@ -17,18 +16,24 @@ config REGMAP_AC97
config REGMAP_I2C
- tristate
+ tristate "Regmap I2C"
tristate
+ select REGMAP
depends on I2C
config REGMAP_SPI
- tristate
+ tristate "Regmap SPI"
tristate
+ select REGMAP
+ depends on SPI_MASTER
depends on SPI
@@ -47,8 +44,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
depends on SPMI
config REGMAP_MMIO
- tristate
+ tristate "Regmap MMIO"
tristate
+ select REGMAP
config REGMAP_IRQ

View File

@@ -7,22 +7,19 @@
- default y if (REGMAP_I2C || REGMAP_SPI || REGMAP_SPMI || REGMAP_MMIO || REGMAP_IRQ)
select IRQ_DOMAIN if REGMAP_IRQ
- bool
+ tristate "Regmap"
+ tristate
config REGCACHE_COMPRESSED
select LZO_COMPRESS
@@ -13,19 +12,25 @@ config REGCACHE_COMPRESSED
bool
@@ -14,18 +13,24 @@ config REGCACHE_COMPRESSED
config REGMAP_I2C
- tristate
+ tristate "Regmap I2C"
tristate
+ select REGMAP
depends on I2C
config REGMAP_SPI
- tristate
+ tristate "Regmap SPI"
tristate
+ select REGMAP
+ depends on SPI_MASTER
depends on SPI
@@ -33,8 +30,7 @@
depends on SPMI
config REGMAP_MMIO
- tristate
+ tristate "Regmap MMIO"
tristate
+ select REGMAP
config REGMAP_IRQ