Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

clk: samsung: Allow compile testing of Exynos, S3C64xx and S5Pv210

So far all Exynos, S3C64xx and S5Pv210 clock units were selected by
respective SOC/ARCH Kconfig option. On a kernel built for selected
SoCs, this allowed to build only limited set of matching clock drivers.
However compile testing was not possible in such case as Makefile object
depends on SOC/ARCH option.

Add separate Kconfig options for each of them to be able to compile
test.

Link: https://lore.kernel.org/r/20201119164509.754851-1-krzk@kernel.org
Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
Acked-by: Chanwoo Choi <cw00.choi@samsung.com>
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>

authored by

Krzysztof Kozlowski and committed by
Sylwester Nawrocki
e44cdff0 3650b228

+78 -15
+65 -2
drivers/clk/samsung/Kconfig
··· 2 2 # Recent Exynos platforms should just select COMMON_CLK_SAMSUNG: 3 3 config COMMON_CLK_SAMSUNG 4 4 bool "Samsung Exynos clock controller support" if COMPILE_TEST 5 - # Clocks on ARM64 SoCs (e.g. Exynos5433, Exynos7) are chosen by 6 - # EXYNOS_ARM64_COMMON_CLK to avoid building them on ARMv7: 5 + select S3C64XX_COMMON_CLK if ARM && ARCH_S3C64XX 6 + select S5PV210_COMMON_CLK if ARM && ARCH_S5PV210 7 + select EXYNOS_3250_COMMON_CLK if ARM && SOC_EXYNOS3250 8 + select EXYNOS_4_COMMON_CLK if ARM && ARCH_EXYNOS4 9 + select EXYNOS_5250_COMMON_CLK if ARM && SOC_EXYNOS5250 10 + select EXYNOS_5260_COMMON_CLK if ARM && SOC_EXYNOS5260 11 + select EXYNOS_5410_COMMON_CLK if ARM && SOC_EXYNOS5410 12 + select EXYNOS_5420_COMMON_CLK if ARM && SOC_EXYNOS5420 7 13 select EXYNOS_ARM64_COMMON_CLK if ARM64 && ARCH_EXYNOS 14 + 15 + config S3C64XX_COMMON_CLK 16 + bool "Samsung S3C64xx clock controller support" if COMPILE_TEST 17 + depends on COMMON_CLK_SAMSUNG 18 + help 19 + Support for the clock controller present on the Samsung S3C64xx SoCs. 20 + Choose Y here only if you build for this SoC. 21 + 22 + config S5PV210_COMMON_CLK 23 + bool "Samsung S5Pv210 clock controller support" if COMPILE_TEST 24 + depends on COMMON_CLK_SAMSUNG 25 + help 26 + Support for the clock controller present on the Samsung S5Pv210 SoCs. 27 + Choose Y here only if you build for this SoC. 28 + 29 + config EXYNOS_3250_COMMON_CLK 30 + bool "Samsung Exynos3250 clock controller support" if COMPILE_TEST 31 + depends on COMMON_CLK_SAMSUNG 32 + help 33 + Support for the clock controller present on the Samsung 34 + Exynos3250 SoCs. Choose Y here only if you build for this SoC. 35 + 36 + config EXYNOS_4_COMMON_CLK 37 + bool "Samsung Exynos4 clock controller support" if COMPILE_TEST 38 + depends on COMMON_CLK_SAMSUNG 39 + help 40 + Support for the clock controller present on the Samsung 41 + Exynos4212 and Exynos4412 SoCs. Choose Y here only if you build for 42 + this SoC. 43 + 44 + config EXYNOS_5250_COMMON_CLK 45 + bool "Samsung Exynos5250 clock controller support" if COMPILE_TEST 46 + depends on COMMON_CLK_SAMSUNG 47 + help 48 + Support for the clock controller present on the Samsung 49 + Exynos5250 SoCs. Choose Y here only if you build for this SoC. 50 + 51 + config EXYNOS_5260_COMMON_CLK 52 + bool "Samsung Exynos5260 clock controller support" if COMPILE_TEST 53 + depends on COMMON_CLK_SAMSUNG 54 + help 55 + Support for the clock controller present on the Samsung 56 + Exynos5260 SoCs. Choose Y here only if you build for this SoC. 57 + 58 + config EXYNOS_5410_COMMON_CLK 59 + bool "Samsung Exynos5410 clock controller support" if COMPILE_TEST 60 + depends on COMMON_CLK_SAMSUNG 61 + help 62 + Support for the clock controller present on the Samsung 63 + Exynos5410 SoCs. Choose Y here only if you build for this SoC. 64 + 65 + config EXYNOS_5420_COMMON_CLK 66 + bool "Samsung Exynos5420 clock controller support" if COMPILE_TEST 67 + depends on COMMON_CLK_SAMSUNG 68 + help 69 + Support for the clock controller present on the Samsung 70 + Exynos5420 SoCs. Choose Y here only if you build for this SoC. 8 71 9 72 config EXYNOS_ARM64_COMMON_CLK 10 73 bool "Samsung Exynos ARMv8-family clock controller support" if COMPILE_TEST
+11 -11
drivers/clk/samsung/Makefile
··· 4 4 # 5 5 6 6 obj-$(CONFIG_COMMON_CLK) += clk.o clk-pll.o clk-cpu.o 7 - obj-$(CONFIG_SOC_EXYNOS3250) += clk-exynos3250.o 8 - obj-$(CONFIG_ARCH_EXYNOS4) += clk-exynos4.o 9 - obj-$(CONFIG_ARCH_EXYNOS4) += clk-exynos4412-isp.o 10 - obj-$(CONFIG_SOC_EXYNOS5250) += clk-exynos5250.o 11 - obj-$(CONFIG_SOC_EXYNOS5250) += clk-exynos5-subcmu.o 12 - obj-$(CONFIG_SOC_EXYNOS5260) += clk-exynos5260.o 13 - obj-$(CONFIG_SOC_EXYNOS5410) += clk-exynos5410.o 14 - obj-$(CONFIG_SOC_EXYNOS5420) += clk-exynos5420.o 15 - obj-$(CONFIG_SOC_EXYNOS5420) += clk-exynos5-subcmu.o 7 + obj-$(CONFIG_EXYNOS_3250_COMMON_CLK) += clk-exynos3250.o 8 + obj-$(CONFIG_EXYNOS_4_COMMON_CLK) += clk-exynos4.o 9 + obj-$(CONFIG_EXYNOS_4_COMMON_CLK) += clk-exynos4412-isp.o 10 + obj-$(CONFIG_EXYNOS_5250_COMMON_CLK) += clk-exynos5250.o 11 + obj-$(CONFIG_EXYNOS_5250_COMMON_CLK) += clk-exynos5-subcmu.o 12 + obj-$(CONFIG_EXYNOS_5260_COMMON_CLK) += clk-exynos5260.o 13 + obj-$(CONFIG_EXYNOS_5410_COMMON_CLK) += clk-exynos5410.o 14 + obj-$(CONFIG_EXYNOS_5420_COMMON_CLK) += clk-exynos5420.o 15 + obj-$(CONFIG_EXYNOS_5420_COMMON_CLK) += clk-exynos5-subcmu.o 16 16 obj-$(CONFIG_EXYNOS_ARM64_COMMON_CLK) += clk-exynos5433.o 17 17 obj-$(CONFIG_EXYNOS_AUDSS_CLK_CON) += clk-exynos-audss.o 18 18 obj-$(CONFIG_ARCH_EXYNOS) += clk-exynos-clkout.o ··· 21 21 obj-$(CONFIG_S3C2410_COMMON_DCLK)+= clk-s3c2410-dclk.o 22 22 obj-$(CONFIG_S3C2412_COMMON_CLK)+= clk-s3c2412.o 23 23 obj-$(CONFIG_S3C2443_COMMON_CLK)+= clk-s3c2443.o 24 - obj-$(CONFIG_ARCH_S3C64XX) += clk-s3c64xx.o 25 - obj-$(CONFIG_ARCH_S5PV210) += clk-s5pv210.o clk-s5pv210-audss.o 24 + obj-$(CONFIG_S3C64XX_COMMON_CLK) += clk-s3c64xx.o 25 + obj-$(CONFIG_S5PV210_COMMON_CLK) += clk-s5pv210.o clk-s5pv210-audss.o
+2 -2
include/linux/clk/samsung.h
··· 10 10 11 11 struct device_node; 12 12 13 - #ifdef CONFIG_ARCH_S3C64XX 13 + #ifdef CONFIG_S3C64XX_COMMON_CLK 14 14 void s3c64xx_clk_init(struct device_node *np, unsigned long xtal_f, 15 15 unsigned long xusbxti_f, bool s3c6400, 16 16 void __iomem *base); ··· 19 19 unsigned long xtal_f, 20 20 unsigned long xusbxti_f, 21 21 bool s3c6400, void __iomem *base) { } 22 - #endif /* CONFIG_ARCH_S3C64XX */ 22 + #endif /* CONFIG_S3C64XX_COMMON_CLK */ 23 23 24 24 #ifdef CONFIG_S3C2410_COMMON_CLK 25 25 void s3c2410_common_clk_init(struct device_node *np, unsigned long xti_f,