@@ -298,6 +298,7 @@ source "drivers/clk/imgtec/Kconfig"
source "drivers/clk/imx/Kconfig"
source "drivers/clk/ingenic/Kconfig"
source "drivers/clk/keystone/Kconfig"
+source "drivers/clk/loongson1/Kconfig"
source "drivers/clk/mediatek/Kconfig"
source "drivers/clk/meson/Kconfig"
source "drivers/clk/mvebu/Kconfig"
@@ -76,7 +76,7 @@ obj-y += imx/
obj-y += ingenic/
obj-$(CONFIG_ARCH_K3) += keystone/
obj-$(CONFIG_ARCH_KEYSTONE) += keystone/
-obj-$(CONFIG_MACH_LOONGSON32) += loongson1/
+obj-y += loongson1/
obj-y += mediatek/
obj-$(CONFIG_COMMON_CLK_AMLOGIC) += meson/
obj-$(CONFIG_MACH_PIC32) += microchip/
new file mode 100644
@@ -0,0 +1,27 @@
+menu "Loongson-1 Clock drivers"
+ depends on MACH_LOONGSON32
+
+config LOONGSON1_CLOCK_COMMON
+ bool
+
+config LOONGSON1_CLOCK_LS1B
+ bool "Loongson 1B driver"
+ default y
+ select LOONGSON1_CLOCK_COMMON
+ help
+ Support the clocks provided by the clock hardware on Loongson-1B
+ and compatible SoCs.
+
+ If building for a Loongson-1B SoC, you want to say Y here.
+
+config LOONGSON1_CLOCK_LS1C
+ bool "Loongson 1C driver"
+ default y
+ select LOONGSON1_CLOCK_COMMON
+ help
+ Support the clocks provided by the clock hardware on Loongson-1C
+ and compatible SoCs.
+
+ If building for a Loongson-1C SoC, you want to say Y here.
+
+endmenu
@@ -1,3 +1,4 @@
-obj-y += clk.o
-obj-$(CONFIG_LOONGSON1_LS1B) += clk-loongson1b.o
-obj-$(CONFIG_LOONGSON1_LS1C) += clk-loongson1c.o
+# SPDX-License-Identifier: GPL-2.0
+obj-$(CONFIG_LOONGSON1_CLOCK_COMMON) += clk.o
+obj-$(CONFIG_LOONGSON1_CLOCK_LS1B) += clk-loongson1b.o
+obj-$(CONFIG_LOONGSON1_CLOCK_LS1C) += clk-loongson1c.o
The patch introduces options for loongson1 clocks so we can select the driver we need. Signed-off-by: Jiaxun Yang <jiaxun.yang@flygoat.com> --- drivers/clk/Kconfig | 1 + drivers/clk/Makefile | 2 +- drivers/clk/loongson1/Kconfig | 27 +++++++++++++++++++++++++++ drivers/clk/loongson1/Makefile | 7 ++++--- 4 files changed, 33 insertions(+), 4 deletions(-) create mode 100644 drivers/clk/loongson1/Kconfig