Re: [PATCH V6 2/6] clk: imx: Support building i.MX common clock driver as module

2020-07-15 Thread Stephen Boyd
Quoting Anson Huang (2020-07-06 22:09:35)
> There are more and more requirements of building SoC specific drivers
> as modules, add support for building i.MX common clock driver as module
> to meet the requirement.
> 
> Signed-off-by: Anson Huang 
> ---

Reviewed-by: Stephen Boyd 


[PATCH V6 2/6] clk: imx: Support building i.MX common clock driver as module

2020-07-06 Thread Anson Huang
There are more and more requirements of building SoC specific drivers
as modules, add support for building i.MX common clock driver as module
to meet the requirement.

Signed-off-by: Anson Huang 
---
No change.
---
 drivers/clk/imx/Kconfig|  8 ++--
 drivers/clk/imx/Makefile   | 40 +++---
 drivers/clk/imx/clk-composite-8m.c |  2 ++
 drivers/clk/imx/clk-cpu.c  |  2 ++
 drivers/clk/imx/clk-frac-pll.c |  2 ++
 drivers/clk/imx/clk-gate2.c|  2 ++
 drivers/clk/imx/clk-pll14xx.c  |  5 +
 drivers/clk/imx/clk-sscg-pll.c |  2 ++
 drivers/clk/imx/clk.c  | 17 
 drivers/clk/imx/clk.h  |  6 ++
 10 files changed, 60 insertions(+), 26 deletions(-)

diff --git a/drivers/clk/imx/Kconfig b/drivers/clk/imx/Kconfig
index db0253f..ee854ac 100644
--- a/drivers/clk/imx/Kconfig
+++ b/drivers/clk/imx/Kconfig
@@ -1,8 +1,8 @@
 # SPDX-License-Identifier: GPL-2.0
 # common clock support for NXP i.MX SoC family.
 config MXC_CLK
-   bool
-   def_bool ARCH_MXC
+   tristate "IMX clock"
+   depends on ARCH_MXC
 
 config MXC_CLK_SCU
bool
@@ -11,24 +11,28 @@ config MXC_CLK_SCU
 config CLK_IMX8MM
bool "IMX8MM CCM Clock Driver"
depends on ARCH_MXC
+   select MXC_CLK
help
Build the driver for i.MX8MM CCM Clock Driver
 
 config CLK_IMX8MN
bool "IMX8MN CCM Clock Driver"
depends on ARCH_MXC
+   select MXC_CLK
help
Build the driver for i.MX8MN CCM Clock Driver
 
 config CLK_IMX8MP
bool "IMX8MP CCM Clock Driver"
depends on ARCH_MXC
+   select MXC_CLK
help
Build the driver for i.MX8MP CCM Clock Driver
 
 config CLK_IMX8MQ
bool "IMX8MQ CCM Clock Driver"
depends on ARCH_MXC
+   select MXC_CLK
help
Build the driver for i.MX8MQ CCM Clock Driver
 
diff --git a/drivers/clk/imx/Makefile b/drivers/clk/imx/Makefile
index 928f874..687207d 100644
--- a/drivers/clk/imx/Makefile
+++ b/drivers/clk/imx/Makefile
@@ -1,25 +1,25 @@
 # SPDX-License-Identifier: GPL-2.0
 
-obj-$(CONFIG_MXC_CLK) += \
-   clk.o \
-   clk-busy.o \
-   clk-composite-8m.o \
-   clk-cpu.o \
-   clk-composite-7ulp.o \
-   clk-divider-gate.o \
-   clk-fixup-div.o \
-   clk-fixup-mux.o \
-   clk-frac-pll.o \
-   clk-gate-exclusive.o \
-   clk-gate2.o \
-   clk-pfd.o \
-   clk-pfdv2.o \
-   clk-pllv1.o \
-   clk-pllv2.o \
-   clk-pllv3.o \
-   clk-pllv4.o \
-   clk-sscg-pll.o \
-   clk-pll14xx.o
+mxc-clk-objs += clk.o
+mxc-clk-objs += clk-busy.o
+mxc-clk-objs += clk-composite-7ulp.o
+mxc-clk-objs += clk-composite-8m.o
+mxc-clk-objs += clk-cpu.o
+mxc-clk-objs += clk-divider-gate.o
+mxc-clk-objs += clk-fixup-div.o
+mxc-clk-objs += clk-fixup-mux.o
+mxc-clk-objs += clk-frac-pll.o
+mxc-clk-objs += clk-gate2.o
+mxc-clk-objs += clk-gate-exclusive.o
+mxc-clk-objs += clk-pfd.o
+mxc-clk-objs += clk-pfdv2.o
+mxc-clk-objs += clk-pllv1.o
+mxc-clk-objs += clk-pllv2.o
+mxc-clk-objs += clk-pllv3.o
+mxc-clk-objs += clk-pllv4.o
+mxc-clk-objs += clk-pll14xx.o
+mxc-clk-objs += clk-sscg-pll.o
+obj-$(CONFIG_MXC_CLK) += mxc-clk.o
 
 obj-$(CONFIG_MXC_CLK_SCU) += \
clk-scu.o \
diff --git a/drivers/clk/imx/clk-composite-8m.c 
b/drivers/clk/imx/clk-composite-8m.c
index d2b5af8..78fb7e5 100644
--- a/drivers/clk/imx/clk-composite-8m.c
+++ b/drivers/clk/imx/clk-composite-8m.c
@@ -5,6 +5,7 @@
 
 #include 
 #include 
+#include 
 #include 
 #include 
 
@@ -243,3 +244,4 @@ struct clk_hw *imx8m_clk_hw_composite_flags(const char 
*name,
kfree(mux);
return ERR_CAST(hw);
 }
+EXPORT_SYMBOL_GPL(imx8m_clk_hw_composite_flags);
diff --git a/drivers/clk/imx/clk-cpu.c b/drivers/clk/imx/clk-cpu.c
index cb182be..cb6ca4c 100644
--- a/drivers/clk/imx/clk-cpu.c
+++ b/drivers/clk/imx/clk-cpu.c
@@ -5,6 +5,7 @@
 
 #include 
 #include 
+#include 
 #include 
 #include "clk.h"
 
@@ -104,3 +105,4 @@ struct clk_hw *imx_clk_hw_cpu(const char *name, const char 
*parent_name,
 
return hw;
 }
+EXPORT_SYMBOL_GPL(imx_clk_hw_cpu);
diff --git a/drivers/clk/imx/clk-frac-pll.c b/drivers/clk/imx/clk-frac-pll.c
index 101e0a3..c703056 100644
--- a/drivers/clk/imx/clk-frac-pll.c
+++ b/drivers/clk/imx/clk-frac-pll.c
@@ -10,6 +10,7 @@
 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -233,3 +234,4 @@ struct clk_hw *imx_clk_hw_frac_pll(const char *name,
 
return hw;
 }
+EXPORT_SYMBOL_GPL(imx_clk_hw_frac_pll);
diff --git a/drivers/clk/imx/clk-gate2.c b/drivers/clk/imx/clk-gate2.c
index b87ab3c..512f675 100644
--- a/drivers/clk/imx/clk-gate2.c
+++ b/drivers/clk/imx/clk-gate2.c
@@ -7,6 +7,7 @@
  */
 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -177,3 +178,4 @@ struct clk_hw *clk_hw_register_gate2(struct device *dev, 
const char *name,
 
return hw;
 }
+EXPORT_SYMBOL_GPL(clk_hw_register_gate2);
diff --git