From fd5c16870169bb76dd3d3bcfbcc6a112f74aeefe Mon Sep 17 00:00:00 2001 From: Hauke Mehrtens Date: Fri, 11 Jan 2019 18:05:11 +0100 Subject: 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 --- target/linux/at91/modules.mk | 2 +- target/linux/brcm2708/modules.mk | 4 ++-- target/linux/generic/hack-4.14/259-regmap_dynamic.patch | 14 +++++--------- target/linux/generic/hack-4.19/259-regmap_dynamic.patch | 17 ++++++----------- target/linux/generic/hack-4.9/259-regmap_dynamic.patch | 14 +++++--------- .../linux/generic/pending-3.18/259-regmap_dynamic.patch | 14 +++++--------- target/linux/ramips/modules.mk | 2 +- 7 files changed, 25 insertions(+), 42 deletions(-) (limited to 'target/linux') diff --git a/target/linux/at91/modules.mk b/target/linux/at91/modules.mk index 30858ce654..998c042ee1 100644 --- a/target/linux/at91/modules.mk +++ b/target/linux/at91/modules.mk @@ -53,7 +53,7 @@ $(eval $(call KernelPackage,at91-adc)) define KernelPackage/at91-udc SUBMENU:=$(USB_MENU) TITLE:=USB Device Controller on atmel SoC - DEPENDS:=@TARGET_at91 +kmod-usb-gadget +kmod-regmap + DEPENDS:=@TARGET_at91 +kmod-usb-gadget +kmod-regmap-core KCONFIG:=CONFIG_USB_AT91 ifneq ($(wildcard $(LINUX_DIR)/drivers/usb/gadget/udc/at91_udc.ko),) FILES:=$(LINUX_DIR)/drivers/usb/gadget/udc/at91_udc.ko diff --git a/target/linux/brcm2708/modules.mk b/target/linux/brcm2708/modules.mk index 9a5e7c2973..0788a6eda3 100644 --- a/target/linux/brcm2708/modules.mk +++ b/target/linux/brcm2708/modules.mk @@ -75,7 +75,7 @@ define KernelPackage/sound-soc-bcm2835-i2s FILES:= \ $(LINUX_DIR)/sound/soc/bcm/snd-soc-bcm2835-i2s.ko AUTOLOAD:=$(call AutoLoad,68,snd-soc-bcm2835-i2s) - DEPENDS:=@TARGET_brcm2708 +kmod-regmap +kmod-sound-soc-core + DEPENDS:=@TARGET_brcm2708 +kmod-regmap-mmio +kmod-sound-soc-core $(call AddDepends/sound) endef @@ -248,7 +248,7 @@ define KernelPackage/sound-soc-allo-katana-codec DEPENDS:= \ @LINUX_4_14 \ +kmod-i2c-bcm2708 \ - +kmod-regmap \ + +kmod-regmap-core \ kmod-sound-soc-bcm2835-i2s $(call AddDepends/sound) endef 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 458b7c35a1..59dfbf3ad2 100644 --- a/target/linux/generic/hack-4.14/259-regmap_dynamic.patch +++ b/target/linux/generic/hack-4.14/259-regmap_dynamic.patch @@ -21,22 +21,19 @@ Signed-off-by: Felix Fietkau - 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 depends on W1 config REGMAP_MMIO -- tristate -+ tristate "Regmap MMIO" + tristate + select REGMAP config REGMAP_IRQ diff --git a/target/linux/generic/hack-4.19/259-regmap_dynamic.patch b/target/linux/generic/hack-4.19/259-regmap_dynamic.patch index 1c5e1164e2..335ec4afc5 100644 --- a/target/linux/generic/hack-4.19/259-regmap_dynamic.patch +++ b/target/linux/generic/hack-4.19/259-regmap_dynamic.patch @@ -21,26 +21,22 @@ Signed-off-by: Felix Fietkau - 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 depends on W1 config REGMAP_MMIO -- tristate -+ tristate "Regmap MMIO" + tristate + select REGMAP config REGMAP_IRQ diff --git a/target/linux/generic/hack-4.9/259-regmap_dynamic.patch b/target/linux/generic/hack-4.9/259-regmap_dynamic.patch index 85c9d79159..237c2099e9 100644 --- a/target/linux/generic/hack-4.9/259-regmap_dynamic.patch +++ b/target/linux/generic/hack-4.9/259-regmap_dynamic.patch @@ -21,22 +21,19 @@ Signed-off-by: Felix Fietkau - 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 depends on SPMI config REGMAP_MMIO -- tristate -+ tristate "Regmap MMIO" + tristate + select REGMAP config REGMAP_IRQ diff --git a/target/linux/generic/pending-3.18/259-regmap_dynamic.patch b/target/linux/generic/pending-3.18/259-regmap_dynamic.patch index 5e422ebd48..0748919e66 100644 --- a/target/linux/generic/pending-3.18/259-regmap_dynamic.patch +++ b/target/linux/generic/pending-3.18/259-regmap_dynamic.patch @@ -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 diff --git a/target/linux/ramips/modules.mk b/target/linux/ramips/modules.mk index 88e83a487f..36f46e2b35 100644 --- a/target/linux/ramips/modules.mk +++ b/target/linux/ramips/modules.mk @@ -116,7 +116,7 @@ $(eval $(call KernelPackage,hsdma-mtk)) define KernelPackage/sound-mt7620 TITLE:=MT7620 PCM/I2S Alsa Driver - DEPENDS:=@TARGET_ramips +kmod-sound-soc-core +kmod-regmap +kmod-dma-ralink @!TARGET_ramips_rt288x + DEPENDS:=@TARGET_ramips +kmod-sound-soc-core +kmod-regmap-mmio +kmod-dma-ralink @!TARGET_ramips_rt288x KCONFIG:= \ CONFIG_SND_RALINK_SOC_I2S \ CONFIG_SND_SIMPLE_CARD \ -- cgit v1.2.3