All of lore.kernel.org
 help / color / mirror / Atom feed
* clk: mediatek: support COMMON_CLK_MT8192 module build
@ 2022-01-10 17:09 ` Miles Chen
  0 siblings, 0 replies; 26+ messages in thread
From: Miles Chen @ 2022-01-10 17:09 UTC (permalink / raw)
  To: Matthias Brugger; +Cc: linux-arm-kernel, linux-mediatek

This patch set supports COMMON_CLK_MT8192 module build.
Boot-up tested with builtin and module build:

load test:
clk_mt8192_venc 16384 0 - Live 0xffff800008ff7000
clk_mt8192_vdec 16384 0 - Live 0xffff800008fef000
clk_mt8192_scp_adsp 16384 0 - Live 0xffff800008fe7000
clk_mt8192_msdc 16384 0 - Live 0xffff800008fdf000
clk_mt8192_mm 16384 0 - Live 0xffff800008fda000
clk_mt8192_mfg 16384 0 - Live 0xffff800008fd5000
clk_mt8192_mdp 16384 0 - Live 0xffff800008fd0000
clk_mt8192_ipe 16384 0 - Live 0xffff800008fcb000
clk_mt8192_imp_iic_wrap 16384 0 - Live 0xffff800008fc6000
clk_mt8192_img 16384 0 - Live 0xffff800008fc1000
clk_mt8192_cam 16384 0 - Live 0xffff800008fbc000
clk_mt8192_aud 16384 0 - Live 0xffff800008fb7000
clk_mt8192 40960 0 [permanent], Live 0xffff800008fa8000     




_______________________________________________
Linux-mediatek mailing list
Linux-mediatek@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-mediatek

^ permalink raw reply	[flat|nested] 26+ messages in thread

* clk: mediatek: support COMMON_CLK_MT8192 module build
@ 2022-01-10 17:09 ` Miles Chen
  0 siblings, 0 replies; 26+ messages in thread
From: Miles Chen @ 2022-01-10 17:09 UTC (permalink / raw)
  To: Matthias Brugger; +Cc: linux-arm-kernel, linux-mediatek

This patch set supports COMMON_CLK_MT8192 module build.
Boot-up tested with builtin and module build:

load test:
clk_mt8192_venc 16384 0 - Live 0xffff800008ff7000
clk_mt8192_vdec 16384 0 - Live 0xffff800008fef000
clk_mt8192_scp_adsp 16384 0 - Live 0xffff800008fe7000
clk_mt8192_msdc 16384 0 - Live 0xffff800008fdf000
clk_mt8192_mm 16384 0 - Live 0xffff800008fda000
clk_mt8192_mfg 16384 0 - Live 0xffff800008fd5000
clk_mt8192_mdp 16384 0 - Live 0xffff800008fd0000
clk_mt8192_ipe 16384 0 - Live 0xffff800008fcb000
clk_mt8192_imp_iic_wrap 16384 0 - Live 0xffff800008fc6000
clk_mt8192_img 16384 0 - Live 0xffff800008fc1000
clk_mt8192_cam 16384 0 - Live 0xffff800008fbc000
clk_mt8192_aud 16384 0 - Live 0xffff800008fb7000
clk_mt8192 40960 0 [permanent], Live 0xffff800008fa8000     




_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 26+ messages in thread

* [PATCH 1/3] clk: mediatek: export mtk_clk_simple_probe
  2022-01-10 17:09 ` Miles Chen
  (?)
@ 2022-01-10 17:09   ` Miles Chen
  -1 siblings, 0 replies; 26+ messages in thread
From: Miles Chen @ 2022-01-10 17:09 UTC (permalink / raw)
  To: Michael Turquette, Stephen Boyd, Matthias Brugger
  Cc: Miles Chen, Chun-Jie Chen, Chen-Yu Tsai, linux-clk,
	linux-arm-kernel, linux-mediatek, linux-kernel

Export mtk_clk_simple_probe() to support mt8192 module build.

Cc: Chun-Jie Chen <chun-jie.chen@mediatek.com>
Cc: Chen-Yu Tsai <wenst@chromium.org>
Signed-off-by: Miles Chen <miles.chen@mediatek.com>
---
 drivers/clk/mediatek/clk-mtk.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/clk/mediatek/clk-mtk.c b/drivers/clk/mediatek/clk-mtk.c
index 8d5791b3f460..807dea08d7de 100644
--- a/drivers/clk/mediatek/clk-mtk.c
+++ b/drivers/clk/mediatek/clk-mtk.c
@@ -332,5 +332,6 @@ int mtk_clk_simple_probe(struct platform_device *pdev)
 	mtk_free_clk_data(clk_data);
 	return r;
 }
+EXPORT_SYMBOL_GPL(mtk_clk_simple_probe);
 
 MODULE_LICENSE("GPL");
-- 
2.18.0


^ permalink raw reply related	[flat|nested] 26+ messages in thread

* [PATCH 1/3] clk: mediatek: export mtk_clk_simple_probe
@ 2022-01-10 17:09   ` Miles Chen
  0 siblings, 0 replies; 26+ messages in thread
From: Miles Chen @ 2022-01-10 17:09 UTC (permalink / raw)
  To: Michael Turquette, Stephen Boyd, Matthias Brugger
  Cc: Miles Chen, Chun-Jie Chen, Chen-Yu Tsai, linux-clk,
	linux-arm-kernel, linux-mediatek, linux-kernel

Export mtk_clk_simple_probe() to support mt8192 module build.

Cc: Chun-Jie Chen <chun-jie.chen@mediatek.com>
Cc: Chen-Yu Tsai <wenst@chromium.org>
Signed-off-by: Miles Chen <miles.chen@mediatek.com>
---
 drivers/clk/mediatek/clk-mtk.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/clk/mediatek/clk-mtk.c b/drivers/clk/mediatek/clk-mtk.c
index 8d5791b3f460..807dea08d7de 100644
--- a/drivers/clk/mediatek/clk-mtk.c
+++ b/drivers/clk/mediatek/clk-mtk.c
@@ -332,5 +332,6 @@ int mtk_clk_simple_probe(struct platform_device *pdev)
 	mtk_free_clk_data(clk_data);
 	return r;
 }
+EXPORT_SYMBOL_GPL(mtk_clk_simple_probe);
 
 MODULE_LICENSE("GPL");
-- 
2.18.0


_______________________________________________
Linux-mediatek mailing list
Linux-mediatek@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-mediatek

^ permalink raw reply related	[flat|nested] 26+ messages in thread

* [PATCH 1/3] clk: mediatek: export mtk_clk_simple_probe
@ 2022-01-10 17:09   ` Miles Chen
  0 siblings, 0 replies; 26+ messages in thread
From: Miles Chen @ 2022-01-10 17:09 UTC (permalink / raw)
  To: Michael Turquette, Stephen Boyd, Matthias Brugger
  Cc: Miles Chen, Chun-Jie Chen, Chen-Yu Tsai, linux-clk,
	linux-arm-kernel, linux-mediatek, linux-kernel

Export mtk_clk_simple_probe() to support mt8192 module build.

Cc: Chun-Jie Chen <chun-jie.chen@mediatek.com>
Cc: Chen-Yu Tsai <wenst@chromium.org>
Signed-off-by: Miles Chen <miles.chen@mediatek.com>
---
 drivers/clk/mediatek/clk-mtk.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/clk/mediatek/clk-mtk.c b/drivers/clk/mediatek/clk-mtk.c
index 8d5791b3f460..807dea08d7de 100644
--- a/drivers/clk/mediatek/clk-mtk.c
+++ b/drivers/clk/mediatek/clk-mtk.c
@@ -332,5 +332,6 @@ int mtk_clk_simple_probe(struct platform_device *pdev)
 	mtk_free_clk_data(clk_data);
 	return r;
 }
+EXPORT_SYMBOL_GPL(mtk_clk_simple_probe);
 
 MODULE_LICENSE("GPL");
-- 
2.18.0


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 26+ messages in thread

* [PATCH 2/3] clk: mediatek: clk-mt8192: drop CLK_OF_DECLARE_DRIVER
  2022-01-10 17:09 ` Miles Chen
  (?)
@ 2022-01-10 17:09   ` Miles Chen
  -1 siblings, 0 replies; 26+ messages in thread
From: Miles Chen @ 2022-01-10 17:09 UTC (permalink / raw)
  To: Michael Turquette, Stephen Boyd, Matthias Brugger
  Cc: Miles Chen, Chun-Jie Chen, Chen-Yu Tsai, linux-clk,
	linux-arm-kernel, linux-mediatek, linux-kernel

clk-mt8192.c uses CLK_OF_DECLARE_DRIVER and it does not work for
kernel modules.

To support clk-mt8192 moudle build, move the
clk_mt8192_top_init_early() logic to clk_mt8192_top_probe()
and drop clk_mt8192_top_init_early() and CLK_OF_DECLARE_DRIVER.

Cc: Chun-Jie Chen <chun-jie.chen@mediatek.com>
Cc: Chen-Yu Tsai <wenst@chromium.org>
Signed-off-by: Miles Chen <miles.chen@mediatek.com>
---
 drivers/clk/mediatek/clk-mt8192.c | 21 +++++----------------
 1 file changed, 5 insertions(+), 16 deletions(-)

diff --git a/drivers/clk/mediatek/clk-mt8192.c b/drivers/clk/mediatek/clk-mt8192.c
index cbc7c6dbe0f4..552fae4f0fd5 100644
--- a/drivers/clk/mediatek/clk-mt8192.c
+++ b/drivers/clk/mediatek/clk-mt8192.c
@@ -1179,31 +1179,20 @@ static const struct mtk_pll_data plls[] = {
 
 static struct clk_onecell_data *top_clk_data;
 
-static void clk_mt8192_top_init_early(struct device_node *node)
+static int clk_mt8192_top_probe(struct platform_device *pdev)
 {
+	struct device_node *node = pdev->dev.of_node;
+	int r;
+	void __iomem *base;
 	int i;
 
 	top_clk_data = mtk_alloc_clk_data(CLK_TOP_NR_CLK);
 	if (!top_clk_data)
-		return;
+		return -ENOMEM;
 
 	for (i = 0; i < CLK_TOP_NR_CLK; i++)
 		top_clk_data->clks[i] = ERR_PTR(-EPROBE_DEFER);
 
-	mtk_clk_register_factors(top_early_divs, ARRAY_SIZE(top_early_divs), top_clk_data);
-
-	of_clk_add_provider(node, of_clk_src_onecell_get, top_clk_data);
-}
-
-CLK_OF_DECLARE_DRIVER(mt8192_topckgen, "mediatek,mt8192-topckgen",
-		      clk_mt8192_top_init_early);
-
-static int clk_mt8192_top_probe(struct platform_device *pdev)
-{
-	struct device_node *node = pdev->dev.of_node;
-	int r;
-	void __iomem *base;
-
 	base = devm_platform_ioremap_resource(pdev, 0);
 	if (IS_ERR(base))
 		return PTR_ERR(base);
-- 
2.18.0


^ permalink raw reply related	[flat|nested] 26+ messages in thread

* [PATCH 2/3] clk: mediatek: clk-mt8192: drop CLK_OF_DECLARE_DRIVER
@ 2022-01-10 17:09   ` Miles Chen
  0 siblings, 0 replies; 26+ messages in thread
From: Miles Chen @ 2022-01-10 17:09 UTC (permalink / raw)
  To: Michael Turquette, Stephen Boyd, Matthias Brugger
  Cc: Miles Chen, Chun-Jie Chen, Chen-Yu Tsai, linux-clk,
	linux-arm-kernel, linux-mediatek, linux-kernel

clk-mt8192.c uses CLK_OF_DECLARE_DRIVER and it does not work for
kernel modules.

To support clk-mt8192 moudle build, move the
clk_mt8192_top_init_early() logic to clk_mt8192_top_probe()
and drop clk_mt8192_top_init_early() and CLK_OF_DECLARE_DRIVER.

Cc: Chun-Jie Chen <chun-jie.chen@mediatek.com>
Cc: Chen-Yu Tsai <wenst@chromium.org>
Signed-off-by: Miles Chen <miles.chen@mediatek.com>
---
 drivers/clk/mediatek/clk-mt8192.c | 21 +++++----------------
 1 file changed, 5 insertions(+), 16 deletions(-)

diff --git a/drivers/clk/mediatek/clk-mt8192.c b/drivers/clk/mediatek/clk-mt8192.c
index cbc7c6dbe0f4..552fae4f0fd5 100644
--- a/drivers/clk/mediatek/clk-mt8192.c
+++ b/drivers/clk/mediatek/clk-mt8192.c
@@ -1179,31 +1179,20 @@ static const struct mtk_pll_data plls[] = {
 
 static struct clk_onecell_data *top_clk_data;
 
-static void clk_mt8192_top_init_early(struct device_node *node)
+static int clk_mt8192_top_probe(struct platform_device *pdev)
 {
+	struct device_node *node = pdev->dev.of_node;
+	int r;
+	void __iomem *base;
 	int i;
 
 	top_clk_data = mtk_alloc_clk_data(CLK_TOP_NR_CLK);
 	if (!top_clk_data)
-		return;
+		return -ENOMEM;
 
 	for (i = 0; i < CLK_TOP_NR_CLK; i++)
 		top_clk_data->clks[i] = ERR_PTR(-EPROBE_DEFER);
 
-	mtk_clk_register_factors(top_early_divs, ARRAY_SIZE(top_early_divs), top_clk_data);
-
-	of_clk_add_provider(node, of_clk_src_onecell_get, top_clk_data);
-}
-
-CLK_OF_DECLARE_DRIVER(mt8192_topckgen, "mediatek,mt8192-topckgen",
-		      clk_mt8192_top_init_early);
-
-static int clk_mt8192_top_probe(struct platform_device *pdev)
-{
-	struct device_node *node = pdev->dev.of_node;
-	int r;
-	void __iomem *base;
-
 	base = devm_platform_ioremap_resource(pdev, 0);
 	if (IS_ERR(base))
 		return PTR_ERR(base);
-- 
2.18.0


_______________________________________________
Linux-mediatek mailing list
Linux-mediatek@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-mediatek

^ permalink raw reply related	[flat|nested] 26+ messages in thread

* [PATCH 2/3] clk: mediatek: clk-mt8192: drop CLK_OF_DECLARE_DRIVER
@ 2022-01-10 17:09   ` Miles Chen
  0 siblings, 0 replies; 26+ messages in thread
From: Miles Chen @ 2022-01-10 17:09 UTC (permalink / raw)
  To: Michael Turquette, Stephen Boyd, Matthias Brugger
  Cc: Miles Chen, Chun-Jie Chen, Chen-Yu Tsai, linux-clk,
	linux-arm-kernel, linux-mediatek, linux-kernel

clk-mt8192.c uses CLK_OF_DECLARE_DRIVER and it does not work for
kernel modules.

To support clk-mt8192 moudle build, move the
clk_mt8192_top_init_early() logic to clk_mt8192_top_probe()
and drop clk_mt8192_top_init_early() and CLK_OF_DECLARE_DRIVER.

Cc: Chun-Jie Chen <chun-jie.chen@mediatek.com>
Cc: Chen-Yu Tsai <wenst@chromium.org>
Signed-off-by: Miles Chen <miles.chen@mediatek.com>
---
 drivers/clk/mediatek/clk-mt8192.c | 21 +++++----------------
 1 file changed, 5 insertions(+), 16 deletions(-)

diff --git a/drivers/clk/mediatek/clk-mt8192.c b/drivers/clk/mediatek/clk-mt8192.c
index cbc7c6dbe0f4..552fae4f0fd5 100644
--- a/drivers/clk/mediatek/clk-mt8192.c
+++ b/drivers/clk/mediatek/clk-mt8192.c
@@ -1179,31 +1179,20 @@ static const struct mtk_pll_data plls[] = {
 
 static struct clk_onecell_data *top_clk_data;
 
-static void clk_mt8192_top_init_early(struct device_node *node)
+static int clk_mt8192_top_probe(struct platform_device *pdev)
 {
+	struct device_node *node = pdev->dev.of_node;
+	int r;
+	void __iomem *base;
 	int i;
 
 	top_clk_data = mtk_alloc_clk_data(CLK_TOP_NR_CLK);
 	if (!top_clk_data)
-		return;
+		return -ENOMEM;
 
 	for (i = 0; i < CLK_TOP_NR_CLK; i++)
 		top_clk_data->clks[i] = ERR_PTR(-EPROBE_DEFER);
 
-	mtk_clk_register_factors(top_early_divs, ARRAY_SIZE(top_early_divs), top_clk_data);
-
-	of_clk_add_provider(node, of_clk_src_onecell_get, top_clk_data);
-}
-
-CLK_OF_DECLARE_DRIVER(mt8192_topckgen, "mediatek,mt8192-topckgen",
-		      clk_mt8192_top_init_early);
-
-static int clk_mt8192_top_probe(struct platform_device *pdev)
-{
-	struct device_node *node = pdev->dev.of_node;
-	int r;
-	void __iomem *base;
-
 	base = devm_platform_ioremap_resource(pdev, 0);
 	if (IS_ERR(base))
 		return PTR_ERR(base);
-- 
2.18.0


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 26+ messages in thread

* [PATCH 3/3] clk: mediatek: support COMMON_CLK_MT8192 module build
  2022-01-10 17:09 ` Miles Chen
  (?)
@ 2022-01-10 17:09   ` Miles Chen
  -1 siblings, 0 replies; 26+ messages in thread
From: Miles Chen @ 2022-01-10 17:09 UTC (permalink / raw)
  To: Michael Turquette, Stephen Boyd, Matthias Brugger
  Cc: Miles Chen, Chun-Jie Chen, Chen-Yu Tsai, linux-clk, linux-kernel,
	linux-arm-kernel, linux-mediatek

To support COMMON_CLK_MT8192* module build,
add MODULE_LICENSE and include module.h.

Cc: Chun-Jie Chen <chun-jie.chen@mediatek.com>
Cc: Chen-Yu Tsai <wenst@chromium.org>
Signed-off-by: Miles Chen <miles.chen@mediatek.com>
---
 drivers/clk/mediatek/Kconfig                  | 26 +++++++++----------
 drivers/clk/mediatek/clk-mt8192-aud.c         |  4 ++-
 drivers/clk/mediatek/clk-mt8192-cam.c         |  4 ++-
 drivers/clk/mediatek/clk-mt8192-img.c         |  4 ++-
 .../clk/mediatek/clk-mt8192-imp_iic_wrap.c    |  4 ++-
 drivers/clk/mediatek/clk-mt8192-ipe.c         |  4 ++-
 drivers/clk/mediatek/clk-mt8192-mdp.c         |  4 ++-
 drivers/clk/mediatek/clk-mt8192-mfg.c         |  4 ++-
 drivers/clk/mediatek/clk-mt8192-mm.c          |  4 ++-
 drivers/clk/mediatek/clk-mt8192-msdc.c        |  4 ++-
 drivers/clk/mediatek/clk-mt8192-scp_adsp.c    |  4 ++-
 drivers/clk/mediatek/clk-mt8192-vdec.c        |  4 ++-
 drivers/clk/mediatek/clk-mt8192-venc.c        |  4 ++-
 drivers/clk/mediatek/clk-mt8192.c             |  2 ++
 14 files changed, 51 insertions(+), 25 deletions(-)

diff --git a/drivers/clk/mediatek/Kconfig b/drivers/clk/mediatek/Kconfig
index 3ce6fb04d8ff..b2205caf673f 100644
--- a/drivers/clk/mediatek/Kconfig
+++ b/drivers/clk/mediatek/Kconfig
@@ -496,7 +496,7 @@ config COMMON_CLK_MT8183_VENCSYS
 	  This driver supports MediaTek MT8183 vencsys clocks.
 
 config COMMON_CLK_MT8192
-	bool "Clock driver for MediaTek MT8192"
+	tristate "Clock driver for MediaTek MT8192"
 	depends on ARM64 || COMPILE_TEST
 	select COMMON_CLK_MEDIATEK
 	default ARM64
@@ -504,73 +504,73 @@ config COMMON_CLK_MT8192
 	  This driver supports MediaTek MT8192 basic clocks.
 
 config COMMON_CLK_MT8192_AUDSYS
-	bool "Clock driver for MediaTek MT8192 audsys"
+	tristate "Clock driver for MediaTek MT8192 audsys"
 	depends on COMMON_CLK_MT8192
 	help
 	  This driver supports MediaTek MT8192 audsys clocks.
 
 config COMMON_CLK_MT8192_CAMSYS
-	bool "Clock driver for MediaTek MT8192 camsys"
+	tristate "Clock driver for MediaTek MT8192 camsys"
 	depends on COMMON_CLK_MT8192
 	help
 	  This driver supports MediaTek MT8192 camsys and camsys_raw clocks.
 
 config COMMON_CLK_MT8192_IMGSYS
-	bool "Clock driver for MediaTek MT8192 imgsys"
+	tristate "Clock driver for MediaTek MT8192 imgsys"
 	depends on COMMON_CLK_MT8192
 	help
 	  This driver supports MediaTek MT8192 imgsys and imgsys2 clocks.
 
 config COMMON_CLK_MT8192_IMP_IIC_WRAP
-	bool "Clock driver for MediaTek MT8192 imp_iic_wrap"
+	tristate "Clock driver for MediaTek MT8192 imp_iic_wrap"
 	depends on COMMON_CLK_MT8192
 	help
 	  This driver supports MediaTek MT8192 imp_iic_wrap clocks.
 
 config COMMON_CLK_MT8192_IPESYS
-	bool "Clock driver for MediaTek MT8192 ipesys"
+	tristate "Clock driver for MediaTek MT8192 ipesys"
 	depends on COMMON_CLK_MT8192
 	help
 	  This driver supports MediaTek MT8192 ipesys clocks.
 
 config COMMON_CLK_MT8192_MDPSYS
-	bool "Clock driver for MediaTek MT8192 mdpsys"
+	tristate "Clock driver for MediaTek MT8192 mdpsys"
 	depends on COMMON_CLK_MT8192
 	help
 	  This driver supports MediaTek MT8192 mdpsys clocks.
 
 config COMMON_CLK_MT8192_MFGCFG
-	bool "Clock driver for MediaTek MT8192 mfgcfg"
+	tristate "Clock driver for MediaTek MT8192 mfgcfg"
 	depends on COMMON_CLK_MT8192
 	help
 	  This driver supports MediaTek MT8192 mfgcfg clocks.
 
 config COMMON_CLK_MT8192_MMSYS
-	bool "Clock driver for MediaTek MT8192 mmsys"
+	tristate "Clock driver for MediaTek MT8192 mmsys"
 	depends on COMMON_CLK_MT8192
 	help
 	  This driver supports MediaTek MT8192 mmsys clocks.
 
 config COMMON_CLK_MT8192_MSDC
-	bool "Clock driver for MediaTek MT8192 msdc"
+	tristate "Clock driver for MediaTek MT8192 msdc"
 	depends on COMMON_CLK_MT8192
 	help
 	  This driver supports MediaTek MT8192 msdc and msdc_top clocks.
 
 config COMMON_CLK_MT8192_SCP_ADSP
-	bool "Clock driver for MediaTek MT8192 scp_adsp"
+	tristate "Clock driver for MediaTek MT8192 scp_adsp"
 	depends on COMMON_CLK_MT8192
 	help
 	  This driver supports MediaTek MT8192 scp_adsp clocks.
 
 config COMMON_CLK_MT8192_VDECSYS
-	bool "Clock driver for MediaTek MT8192 vdecsys"
+	tristate "Clock driver for MediaTek MT8192 vdecsys"
 	depends on COMMON_CLK_MT8192
 	help
 	  This driver supports MediaTek MT8192 vdecsys and vdecsys_soc clocks.
 
 config COMMON_CLK_MT8192_VENCSYS
-	bool "Clock driver for MediaTek MT8192 vencsys"
+	tristate "Clock driver for MediaTek MT8192 vencsys"
 	depends on COMMON_CLK_MT8192
 	help
 	  This driver supports MediaTek MT8192 vencsys clocks.
diff --git a/drivers/clk/mediatek/clk-mt8192-aud.c b/drivers/clk/mediatek/clk-mt8192-aud.c
index f28d56628045..ea512fa3d4b9 100644
--- a/drivers/clk/mediatek/clk-mt8192-aud.c
+++ b/drivers/clk/mediatek/clk-mt8192-aud.c
@@ -4,6 +4,7 @@
 // Author: Chun-Jie Chen <chun-jie.chen@mediatek.com>
 
 #include <linux/clk-provider.h>
+#include <linux/module.h>
 #include <linux/of_platform.h>
 #include <linux/platform_device.h>
 
@@ -115,4 +116,5 @@ static struct platform_driver clk_mt8192_aud_drv = {
 	},
 };
 
-builtin_platform_driver(clk_mt8192_aud_drv);
+module_platform_driver(clk_mt8192_aud_drv);
+MODULE_LICENSE("GPL");
diff --git a/drivers/clk/mediatek/clk-mt8192-cam.c b/drivers/clk/mediatek/clk-mt8192-cam.c
index fc74cd80b4b0..04a0de364408 100644
--- a/drivers/clk/mediatek/clk-mt8192-cam.c
+++ b/drivers/clk/mediatek/clk-mt8192-cam.c
@@ -4,6 +4,7 @@
 // Author: Chun-Jie Chen <chun-jie.chen@mediatek.com>
 
 #include <linux/clk-provider.h>
+#include <linux/module.h>
 #include <linux/of_device.h>
 #include <linux/platform_device.h>
 
@@ -104,4 +105,5 @@ static struct platform_driver clk_mt8192_cam_drv = {
 	},
 };
 
-builtin_platform_driver(clk_mt8192_cam_drv);
+module_platform_driver(clk_mt8192_cam_drv);
+MODULE_LICENSE("GPL");
diff --git a/drivers/clk/mediatek/clk-mt8192-img.c b/drivers/clk/mediatek/clk-mt8192-img.c
index 7ce3abe42577..54713a5f3dfc 100644
--- a/drivers/clk/mediatek/clk-mt8192-img.c
+++ b/drivers/clk/mediatek/clk-mt8192-img.c
@@ -4,6 +4,7 @@
 // Author: Chun-Jie Chen <chun-jie.chen@mediatek.com>
 
 #include <linux/clk-provider.h>
+#include <linux/module.h>
 #include <linux/of_device.h>
 #include <linux/platform_device.h>
 
@@ -67,4 +68,5 @@ static struct platform_driver clk_mt8192_img_drv = {
 	},
 };
 
-builtin_platform_driver(clk_mt8192_img_drv);
+module_platform_driver(clk_mt8192_img_drv);
+MODULE_LICENSE("GPL");
diff --git a/drivers/clk/mediatek/clk-mt8192-imp_iic_wrap.c b/drivers/clk/mediatek/clk-mt8192-imp_iic_wrap.c
index 700356ac6a58..94fdb3c1a963 100644
--- a/drivers/clk/mediatek/clk-mt8192-imp_iic_wrap.c
+++ b/drivers/clk/mediatek/clk-mt8192-imp_iic_wrap.c
@@ -4,6 +4,7 @@
 // Author: Chun-Jie Chen <chun-jie.chen@mediatek.com>
 
 #include <linux/clk-provider.h>
+#include <linux/module.h>
 #include <linux/of_device.h>
 #include <linux/platform_device.h>
 
@@ -116,4 +117,5 @@ static struct platform_driver clk_mt8192_imp_iic_wrap_drv = {
 	},
 };
 
-builtin_platform_driver(clk_mt8192_imp_iic_wrap_drv);
+module_platform_driver(clk_mt8192_imp_iic_wrap_drv);
+MODULE_LICENSE("GPL");
diff --git a/drivers/clk/mediatek/clk-mt8192-ipe.c b/drivers/clk/mediatek/clk-mt8192-ipe.c
index 730d91b64b3f..7f8a7a60e2bd 100644
--- a/drivers/clk/mediatek/clk-mt8192-ipe.c
+++ b/drivers/clk/mediatek/clk-mt8192-ipe.c
@@ -4,6 +4,7 @@
 // Author: Chun-Jie Chen <chun-jie.chen@mediatek.com>
 
 #include <linux/clk-provider.h>
+#include <linux/module.h>
 #include <linux/of_device.h>
 #include <linux/platform_device.h>
 
@@ -54,4 +55,5 @@ static struct platform_driver clk_mt8192_ipe_drv = {
 	},
 };
 
-builtin_platform_driver(clk_mt8192_ipe_drv);
+module_platform_driver(clk_mt8192_ipe_drv);
+MODULE_LICENSE("GPL");
diff --git a/drivers/clk/mediatek/clk-mt8192-mdp.c b/drivers/clk/mediatek/clk-mt8192-mdp.c
index 93c87ae2f332..9eab7337fabe 100644
--- a/drivers/clk/mediatek/clk-mt8192-mdp.c
+++ b/drivers/clk/mediatek/clk-mt8192-mdp.c
@@ -4,6 +4,7 @@
 // Author: Chun-Jie Chen <chun-jie.chen@mediatek.com>
 
 #include <linux/clk-provider.h>
+#include <linux/module.h>
 #include <linux/of_device.h>
 #include <linux/platform_device.h>
 
@@ -79,4 +80,5 @@ static struct platform_driver clk_mt8192_mdp_drv = {
 	},
 };
 
-builtin_platform_driver(clk_mt8192_mdp_drv);
+module_platform_driver(clk_mt8192_mdp_drv);
+MODULE_LICENSE("GPL");
diff --git a/drivers/clk/mediatek/clk-mt8192-mfg.c b/drivers/clk/mediatek/clk-mt8192-mfg.c
index 3bbc7469f0e4..8b44f0779a8c 100644
--- a/drivers/clk/mediatek/clk-mt8192-mfg.c
+++ b/drivers/clk/mediatek/clk-mt8192-mfg.c
@@ -4,6 +4,7 @@
 // Author: Chun-Jie Chen <chun-jie.chen@mediatek.com>
 
 #include <linux/clk-provider.h>
+#include <linux/module.h>
 #include <linux/of_device.h>
 #include <linux/platform_device.h>
 
@@ -47,4 +48,5 @@ static struct platform_driver clk_mt8192_mfg_drv = {
 	},
 };
 
-builtin_platform_driver(clk_mt8192_mfg_drv);
+module_platform_driver(clk_mt8192_mfg_drv);
+MODULE_LICENSE("GPL");
diff --git a/drivers/clk/mediatek/clk-mt8192-mm.c b/drivers/clk/mediatek/clk-mt8192-mm.c
index 4a0b4c4bc06a..506beb5a410d 100644
--- a/drivers/clk/mediatek/clk-mt8192-mm.c
+++ b/drivers/clk/mediatek/clk-mt8192-mm.c
@@ -4,6 +4,7 @@
 // Author: Chun-Jie Chen <chun-jie.chen@mediatek.com>
 
 #include <linux/clk-provider.h>
+#include <linux/module.h>
 #include <linux/platform_device.h>
 
 #include "clk-mtk.h"
@@ -105,4 +106,5 @@ static struct platform_driver clk_mt8192_mm_drv = {
 	},
 };
 
-builtin_platform_driver(clk_mt8192_mm_drv);
+module_platform_driver(clk_mt8192_mm_drv);
+MODULE_LICENSE("GPL");
diff --git a/drivers/clk/mediatek/clk-mt8192-msdc.c b/drivers/clk/mediatek/clk-mt8192-msdc.c
index 87c3b79b79cf..a467885abbf8 100644
--- a/drivers/clk/mediatek/clk-mt8192-msdc.c
+++ b/drivers/clk/mediatek/clk-mt8192-msdc.c
@@ -4,6 +4,7 @@
 // Author: Chun-Jie Chen <chun-jie.chen@mediatek.com>
 
 #include <linux/clk-provider.h>
+#include <linux/module.h>
 #include <linux/of_device.h>
 #include <linux/platform_device.h>
 
@@ -82,4 +83,5 @@ static struct platform_driver clk_mt8192_msdc_drv = {
 	},
 };
 
-builtin_platform_driver(clk_mt8192_msdc_drv);
+module_platform_driver(clk_mt8192_msdc_drv);
+MODULE_LICENSE("GPL");
diff --git a/drivers/clk/mediatek/clk-mt8192-scp_adsp.c b/drivers/clk/mediatek/clk-mt8192-scp_adsp.c
index 58725d79dd13..87fbd0131aed 100644
--- a/drivers/clk/mediatek/clk-mt8192-scp_adsp.c
+++ b/drivers/clk/mediatek/clk-mt8192-scp_adsp.c
@@ -4,6 +4,7 @@
 // Author: Chun-Jie Chen <chun-jie.chen@mediatek.com>
 
 #include <linux/clk-provider.h>
+#include <linux/module.h>
 #include <linux/of_device.h>
 #include <linux/platform_device.h>
 
@@ -47,4 +48,5 @@ static struct platform_driver clk_mt8192_scp_adsp_drv = {
 	},
 };
 
-builtin_platform_driver(clk_mt8192_scp_adsp_drv);
+module_platform_driver(clk_mt8192_scp_adsp_drv);
+MODULE_LICENSE("GPL");
diff --git a/drivers/clk/mediatek/clk-mt8192-vdec.c b/drivers/clk/mediatek/clk-mt8192-vdec.c
index b1d95cfbf22a..4d223ecca2c8 100644
--- a/drivers/clk/mediatek/clk-mt8192-vdec.c
+++ b/drivers/clk/mediatek/clk-mt8192-vdec.c
@@ -4,6 +4,7 @@
 // Author: Chun-Jie Chen <chun-jie.chen@mediatek.com>
 
 #include <linux/clk-provider.h>
+#include <linux/module.h>
 #include <linux/of_device.h>
 #include <linux/platform_device.h>
 
@@ -91,4 +92,5 @@ static struct platform_driver clk_mt8192_vdec_drv = {
 	},
 };
 
-builtin_platform_driver(clk_mt8192_vdec_drv);
+module_platform_driver(clk_mt8192_vdec_drv);
+MODULE_LICENSE("GPL");
diff --git a/drivers/clk/mediatek/clk-mt8192-venc.c b/drivers/clk/mediatek/clk-mt8192-venc.c
index c0d867bff09e..0e8092802771 100644
--- a/drivers/clk/mediatek/clk-mt8192-venc.c
+++ b/drivers/clk/mediatek/clk-mt8192-venc.c
@@ -4,6 +4,7 @@
 // Author: Chun-Jie Chen <chun-jie.chen@mediatek.com>
 
 #include <linux/clk-provider.h>
+#include <linux/module.h>
 #include <linux/of_device.h>
 #include <linux/platform_device.h>
 
@@ -50,4 +51,5 @@ static struct platform_driver clk_mt8192_venc_drv = {
 	},
 };
 
-builtin_platform_driver(clk_mt8192_venc_drv);
+module_platform_driver(clk_mt8192_venc_drv);
+MODULE_LICENSE("GPL");
diff --git a/drivers/clk/mediatek/clk-mt8192.c b/drivers/clk/mediatek/clk-mt8192.c
index 552fae4f0fd5..a221834db347 100644
--- a/drivers/clk/mediatek/clk-mt8192.c
+++ b/drivers/clk/mediatek/clk-mt8192.c
@@ -6,6 +6,7 @@
 #include <linux/clk.h>
 #include <linux/delay.h>
 #include <linux/mfd/syscon.h>
+#include <linux/module.h>
 #include <linux/of.h>
 #include <linux/of_address.h>
 #include <linux/of_device.h>
@@ -1313,3 +1314,4 @@ static int __init clk_mt8192_init(void)
 }
 
 arch_initcall(clk_mt8192_init);
+MODULE_LICENSE("GPL");
-- 
2.18.0


^ permalink raw reply related	[flat|nested] 26+ messages in thread

* [PATCH 3/3] clk: mediatek: support COMMON_CLK_MT8192 module build
@ 2022-01-10 17:09   ` Miles Chen
  0 siblings, 0 replies; 26+ messages in thread
From: Miles Chen @ 2022-01-10 17:09 UTC (permalink / raw)
  To: Michael Turquette, Stephen Boyd, Matthias Brugger
  Cc: Miles Chen, Chun-Jie Chen, Chen-Yu Tsai, linux-clk, linux-kernel,
	linux-arm-kernel, linux-mediatek

To support COMMON_CLK_MT8192* module build,
add MODULE_LICENSE and include module.h.

Cc: Chun-Jie Chen <chun-jie.chen@mediatek.com>
Cc: Chen-Yu Tsai <wenst@chromium.org>
Signed-off-by: Miles Chen <miles.chen@mediatek.com>
---
 drivers/clk/mediatek/Kconfig                  | 26 +++++++++----------
 drivers/clk/mediatek/clk-mt8192-aud.c         |  4 ++-
 drivers/clk/mediatek/clk-mt8192-cam.c         |  4 ++-
 drivers/clk/mediatek/clk-mt8192-img.c         |  4 ++-
 .../clk/mediatek/clk-mt8192-imp_iic_wrap.c    |  4 ++-
 drivers/clk/mediatek/clk-mt8192-ipe.c         |  4 ++-
 drivers/clk/mediatek/clk-mt8192-mdp.c         |  4 ++-
 drivers/clk/mediatek/clk-mt8192-mfg.c         |  4 ++-
 drivers/clk/mediatek/clk-mt8192-mm.c          |  4 ++-
 drivers/clk/mediatek/clk-mt8192-msdc.c        |  4 ++-
 drivers/clk/mediatek/clk-mt8192-scp_adsp.c    |  4 ++-
 drivers/clk/mediatek/clk-mt8192-vdec.c        |  4 ++-
 drivers/clk/mediatek/clk-mt8192-venc.c        |  4 ++-
 drivers/clk/mediatek/clk-mt8192.c             |  2 ++
 14 files changed, 51 insertions(+), 25 deletions(-)

diff --git a/drivers/clk/mediatek/Kconfig b/drivers/clk/mediatek/Kconfig
index 3ce6fb04d8ff..b2205caf673f 100644
--- a/drivers/clk/mediatek/Kconfig
+++ b/drivers/clk/mediatek/Kconfig
@@ -496,7 +496,7 @@ config COMMON_CLK_MT8183_VENCSYS
 	  This driver supports MediaTek MT8183 vencsys clocks.
 
 config COMMON_CLK_MT8192
-	bool "Clock driver for MediaTek MT8192"
+	tristate "Clock driver for MediaTek MT8192"
 	depends on ARM64 || COMPILE_TEST
 	select COMMON_CLK_MEDIATEK
 	default ARM64
@@ -504,73 +504,73 @@ config COMMON_CLK_MT8192
 	  This driver supports MediaTek MT8192 basic clocks.
 
 config COMMON_CLK_MT8192_AUDSYS
-	bool "Clock driver for MediaTek MT8192 audsys"
+	tristate "Clock driver for MediaTek MT8192 audsys"
 	depends on COMMON_CLK_MT8192
 	help
 	  This driver supports MediaTek MT8192 audsys clocks.
 
 config COMMON_CLK_MT8192_CAMSYS
-	bool "Clock driver for MediaTek MT8192 camsys"
+	tristate "Clock driver for MediaTek MT8192 camsys"
 	depends on COMMON_CLK_MT8192
 	help
 	  This driver supports MediaTek MT8192 camsys and camsys_raw clocks.
 
 config COMMON_CLK_MT8192_IMGSYS
-	bool "Clock driver for MediaTek MT8192 imgsys"
+	tristate "Clock driver for MediaTek MT8192 imgsys"
 	depends on COMMON_CLK_MT8192
 	help
 	  This driver supports MediaTek MT8192 imgsys and imgsys2 clocks.
 
 config COMMON_CLK_MT8192_IMP_IIC_WRAP
-	bool "Clock driver for MediaTek MT8192 imp_iic_wrap"
+	tristate "Clock driver for MediaTek MT8192 imp_iic_wrap"
 	depends on COMMON_CLK_MT8192
 	help
 	  This driver supports MediaTek MT8192 imp_iic_wrap clocks.
 
 config COMMON_CLK_MT8192_IPESYS
-	bool "Clock driver for MediaTek MT8192 ipesys"
+	tristate "Clock driver for MediaTek MT8192 ipesys"
 	depends on COMMON_CLK_MT8192
 	help
 	  This driver supports MediaTek MT8192 ipesys clocks.
 
 config COMMON_CLK_MT8192_MDPSYS
-	bool "Clock driver for MediaTek MT8192 mdpsys"
+	tristate "Clock driver for MediaTek MT8192 mdpsys"
 	depends on COMMON_CLK_MT8192
 	help
 	  This driver supports MediaTek MT8192 mdpsys clocks.
 
 config COMMON_CLK_MT8192_MFGCFG
-	bool "Clock driver for MediaTek MT8192 mfgcfg"
+	tristate "Clock driver for MediaTek MT8192 mfgcfg"
 	depends on COMMON_CLK_MT8192
 	help
 	  This driver supports MediaTek MT8192 mfgcfg clocks.
 
 config COMMON_CLK_MT8192_MMSYS
-	bool "Clock driver for MediaTek MT8192 mmsys"
+	tristate "Clock driver for MediaTek MT8192 mmsys"
 	depends on COMMON_CLK_MT8192
 	help
 	  This driver supports MediaTek MT8192 mmsys clocks.
 
 config COMMON_CLK_MT8192_MSDC
-	bool "Clock driver for MediaTek MT8192 msdc"
+	tristate "Clock driver for MediaTek MT8192 msdc"
 	depends on COMMON_CLK_MT8192
 	help
 	  This driver supports MediaTek MT8192 msdc and msdc_top clocks.
 
 config COMMON_CLK_MT8192_SCP_ADSP
-	bool "Clock driver for MediaTek MT8192 scp_adsp"
+	tristate "Clock driver for MediaTek MT8192 scp_adsp"
 	depends on COMMON_CLK_MT8192
 	help
 	  This driver supports MediaTek MT8192 scp_adsp clocks.
 
 config COMMON_CLK_MT8192_VDECSYS
-	bool "Clock driver for MediaTek MT8192 vdecsys"
+	tristate "Clock driver for MediaTek MT8192 vdecsys"
 	depends on COMMON_CLK_MT8192
 	help
 	  This driver supports MediaTek MT8192 vdecsys and vdecsys_soc clocks.
 
 config COMMON_CLK_MT8192_VENCSYS
-	bool "Clock driver for MediaTek MT8192 vencsys"
+	tristate "Clock driver for MediaTek MT8192 vencsys"
 	depends on COMMON_CLK_MT8192
 	help
 	  This driver supports MediaTek MT8192 vencsys clocks.
diff --git a/drivers/clk/mediatek/clk-mt8192-aud.c b/drivers/clk/mediatek/clk-mt8192-aud.c
index f28d56628045..ea512fa3d4b9 100644
--- a/drivers/clk/mediatek/clk-mt8192-aud.c
+++ b/drivers/clk/mediatek/clk-mt8192-aud.c
@@ -4,6 +4,7 @@
 // Author: Chun-Jie Chen <chun-jie.chen@mediatek.com>
 
 #include <linux/clk-provider.h>
+#include <linux/module.h>
 #include <linux/of_platform.h>
 #include <linux/platform_device.h>
 
@@ -115,4 +116,5 @@ static struct platform_driver clk_mt8192_aud_drv = {
 	},
 };
 
-builtin_platform_driver(clk_mt8192_aud_drv);
+module_platform_driver(clk_mt8192_aud_drv);
+MODULE_LICENSE("GPL");
diff --git a/drivers/clk/mediatek/clk-mt8192-cam.c b/drivers/clk/mediatek/clk-mt8192-cam.c
index fc74cd80b4b0..04a0de364408 100644
--- a/drivers/clk/mediatek/clk-mt8192-cam.c
+++ b/drivers/clk/mediatek/clk-mt8192-cam.c
@@ -4,6 +4,7 @@
 // Author: Chun-Jie Chen <chun-jie.chen@mediatek.com>
 
 #include <linux/clk-provider.h>
+#include <linux/module.h>
 #include <linux/of_device.h>
 #include <linux/platform_device.h>
 
@@ -104,4 +105,5 @@ static struct platform_driver clk_mt8192_cam_drv = {
 	},
 };
 
-builtin_platform_driver(clk_mt8192_cam_drv);
+module_platform_driver(clk_mt8192_cam_drv);
+MODULE_LICENSE("GPL");
diff --git a/drivers/clk/mediatek/clk-mt8192-img.c b/drivers/clk/mediatek/clk-mt8192-img.c
index 7ce3abe42577..54713a5f3dfc 100644
--- a/drivers/clk/mediatek/clk-mt8192-img.c
+++ b/drivers/clk/mediatek/clk-mt8192-img.c
@@ -4,6 +4,7 @@
 // Author: Chun-Jie Chen <chun-jie.chen@mediatek.com>
 
 #include <linux/clk-provider.h>
+#include <linux/module.h>
 #include <linux/of_device.h>
 #include <linux/platform_device.h>
 
@@ -67,4 +68,5 @@ static struct platform_driver clk_mt8192_img_drv = {
 	},
 };
 
-builtin_platform_driver(clk_mt8192_img_drv);
+module_platform_driver(clk_mt8192_img_drv);
+MODULE_LICENSE("GPL");
diff --git a/drivers/clk/mediatek/clk-mt8192-imp_iic_wrap.c b/drivers/clk/mediatek/clk-mt8192-imp_iic_wrap.c
index 700356ac6a58..94fdb3c1a963 100644
--- a/drivers/clk/mediatek/clk-mt8192-imp_iic_wrap.c
+++ b/drivers/clk/mediatek/clk-mt8192-imp_iic_wrap.c
@@ -4,6 +4,7 @@
 // Author: Chun-Jie Chen <chun-jie.chen@mediatek.com>
 
 #include <linux/clk-provider.h>
+#include <linux/module.h>
 #include <linux/of_device.h>
 #include <linux/platform_device.h>
 
@@ -116,4 +117,5 @@ static struct platform_driver clk_mt8192_imp_iic_wrap_drv = {
 	},
 };
 
-builtin_platform_driver(clk_mt8192_imp_iic_wrap_drv);
+module_platform_driver(clk_mt8192_imp_iic_wrap_drv);
+MODULE_LICENSE("GPL");
diff --git a/drivers/clk/mediatek/clk-mt8192-ipe.c b/drivers/clk/mediatek/clk-mt8192-ipe.c
index 730d91b64b3f..7f8a7a60e2bd 100644
--- a/drivers/clk/mediatek/clk-mt8192-ipe.c
+++ b/drivers/clk/mediatek/clk-mt8192-ipe.c
@@ -4,6 +4,7 @@
 // Author: Chun-Jie Chen <chun-jie.chen@mediatek.com>
 
 #include <linux/clk-provider.h>
+#include <linux/module.h>
 #include <linux/of_device.h>
 #include <linux/platform_device.h>
 
@@ -54,4 +55,5 @@ static struct platform_driver clk_mt8192_ipe_drv = {
 	},
 };
 
-builtin_platform_driver(clk_mt8192_ipe_drv);
+module_platform_driver(clk_mt8192_ipe_drv);
+MODULE_LICENSE("GPL");
diff --git a/drivers/clk/mediatek/clk-mt8192-mdp.c b/drivers/clk/mediatek/clk-mt8192-mdp.c
index 93c87ae2f332..9eab7337fabe 100644
--- a/drivers/clk/mediatek/clk-mt8192-mdp.c
+++ b/drivers/clk/mediatek/clk-mt8192-mdp.c
@@ -4,6 +4,7 @@
 // Author: Chun-Jie Chen <chun-jie.chen@mediatek.com>
 
 #include <linux/clk-provider.h>
+#include <linux/module.h>
 #include <linux/of_device.h>
 #include <linux/platform_device.h>
 
@@ -79,4 +80,5 @@ static struct platform_driver clk_mt8192_mdp_drv = {
 	},
 };
 
-builtin_platform_driver(clk_mt8192_mdp_drv);
+module_platform_driver(clk_mt8192_mdp_drv);
+MODULE_LICENSE("GPL");
diff --git a/drivers/clk/mediatek/clk-mt8192-mfg.c b/drivers/clk/mediatek/clk-mt8192-mfg.c
index 3bbc7469f0e4..8b44f0779a8c 100644
--- a/drivers/clk/mediatek/clk-mt8192-mfg.c
+++ b/drivers/clk/mediatek/clk-mt8192-mfg.c
@@ -4,6 +4,7 @@
 // Author: Chun-Jie Chen <chun-jie.chen@mediatek.com>
 
 #include <linux/clk-provider.h>
+#include <linux/module.h>
 #include <linux/of_device.h>
 #include <linux/platform_device.h>
 
@@ -47,4 +48,5 @@ static struct platform_driver clk_mt8192_mfg_drv = {
 	},
 };
 
-builtin_platform_driver(clk_mt8192_mfg_drv);
+module_platform_driver(clk_mt8192_mfg_drv);
+MODULE_LICENSE("GPL");
diff --git a/drivers/clk/mediatek/clk-mt8192-mm.c b/drivers/clk/mediatek/clk-mt8192-mm.c
index 4a0b4c4bc06a..506beb5a410d 100644
--- a/drivers/clk/mediatek/clk-mt8192-mm.c
+++ b/drivers/clk/mediatek/clk-mt8192-mm.c
@@ -4,6 +4,7 @@
 // Author: Chun-Jie Chen <chun-jie.chen@mediatek.com>
 
 #include <linux/clk-provider.h>
+#include <linux/module.h>
 #include <linux/platform_device.h>
 
 #include "clk-mtk.h"
@@ -105,4 +106,5 @@ static struct platform_driver clk_mt8192_mm_drv = {
 	},
 };
 
-builtin_platform_driver(clk_mt8192_mm_drv);
+module_platform_driver(clk_mt8192_mm_drv);
+MODULE_LICENSE("GPL");
diff --git a/drivers/clk/mediatek/clk-mt8192-msdc.c b/drivers/clk/mediatek/clk-mt8192-msdc.c
index 87c3b79b79cf..a467885abbf8 100644
--- a/drivers/clk/mediatek/clk-mt8192-msdc.c
+++ b/drivers/clk/mediatek/clk-mt8192-msdc.c
@@ -4,6 +4,7 @@
 // Author: Chun-Jie Chen <chun-jie.chen@mediatek.com>
 
 #include <linux/clk-provider.h>
+#include <linux/module.h>
 #include <linux/of_device.h>
 #include <linux/platform_device.h>
 
@@ -82,4 +83,5 @@ static struct platform_driver clk_mt8192_msdc_drv = {
 	},
 };
 
-builtin_platform_driver(clk_mt8192_msdc_drv);
+module_platform_driver(clk_mt8192_msdc_drv);
+MODULE_LICENSE("GPL");
diff --git a/drivers/clk/mediatek/clk-mt8192-scp_adsp.c b/drivers/clk/mediatek/clk-mt8192-scp_adsp.c
index 58725d79dd13..87fbd0131aed 100644
--- a/drivers/clk/mediatek/clk-mt8192-scp_adsp.c
+++ b/drivers/clk/mediatek/clk-mt8192-scp_adsp.c
@@ -4,6 +4,7 @@
 // Author: Chun-Jie Chen <chun-jie.chen@mediatek.com>
 
 #include <linux/clk-provider.h>
+#include <linux/module.h>
 #include <linux/of_device.h>
 #include <linux/platform_device.h>
 
@@ -47,4 +48,5 @@ static struct platform_driver clk_mt8192_scp_adsp_drv = {
 	},
 };
 
-builtin_platform_driver(clk_mt8192_scp_adsp_drv);
+module_platform_driver(clk_mt8192_scp_adsp_drv);
+MODULE_LICENSE("GPL");
diff --git a/drivers/clk/mediatek/clk-mt8192-vdec.c b/drivers/clk/mediatek/clk-mt8192-vdec.c
index b1d95cfbf22a..4d223ecca2c8 100644
--- a/drivers/clk/mediatek/clk-mt8192-vdec.c
+++ b/drivers/clk/mediatek/clk-mt8192-vdec.c
@@ -4,6 +4,7 @@
 // Author: Chun-Jie Chen <chun-jie.chen@mediatek.com>
 
 #include <linux/clk-provider.h>
+#include <linux/module.h>
 #include <linux/of_device.h>
 #include <linux/platform_device.h>
 
@@ -91,4 +92,5 @@ static struct platform_driver clk_mt8192_vdec_drv = {
 	},
 };
 
-builtin_platform_driver(clk_mt8192_vdec_drv);
+module_platform_driver(clk_mt8192_vdec_drv);
+MODULE_LICENSE("GPL");
diff --git a/drivers/clk/mediatek/clk-mt8192-venc.c b/drivers/clk/mediatek/clk-mt8192-venc.c
index c0d867bff09e..0e8092802771 100644
--- a/drivers/clk/mediatek/clk-mt8192-venc.c
+++ b/drivers/clk/mediatek/clk-mt8192-venc.c
@@ -4,6 +4,7 @@
 // Author: Chun-Jie Chen <chun-jie.chen@mediatek.com>
 
 #include <linux/clk-provider.h>
+#include <linux/module.h>
 #include <linux/of_device.h>
 #include <linux/platform_device.h>
 
@@ -50,4 +51,5 @@ static struct platform_driver clk_mt8192_venc_drv = {
 	},
 };
 
-builtin_platform_driver(clk_mt8192_venc_drv);
+module_platform_driver(clk_mt8192_venc_drv);
+MODULE_LICENSE("GPL");
diff --git a/drivers/clk/mediatek/clk-mt8192.c b/drivers/clk/mediatek/clk-mt8192.c
index 552fae4f0fd5..a221834db347 100644
--- a/drivers/clk/mediatek/clk-mt8192.c
+++ b/drivers/clk/mediatek/clk-mt8192.c
@@ -6,6 +6,7 @@
 #include <linux/clk.h>
 #include <linux/delay.h>
 #include <linux/mfd/syscon.h>
+#include <linux/module.h>
 #include <linux/of.h>
 #include <linux/of_address.h>
 #include <linux/of_device.h>
@@ -1313,3 +1314,4 @@ static int __init clk_mt8192_init(void)
 }
 
 arch_initcall(clk_mt8192_init);
+MODULE_LICENSE("GPL");
-- 
2.18.0


_______________________________________________
Linux-mediatek mailing list
Linux-mediatek@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-mediatek

^ permalink raw reply related	[flat|nested] 26+ messages in thread

* [PATCH 3/3] clk: mediatek: support COMMON_CLK_MT8192 module build
@ 2022-01-10 17:09   ` Miles Chen
  0 siblings, 0 replies; 26+ messages in thread
From: Miles Chen @ 2022-01-10 17:09 UTC (permalink / raw)
  To: Michael Turquette, Stephen Boyd, Matthias Brugger
  Cc: Miles Chen, Chun-Jie Chen, Chen-Yu Tsai, linux-clk, linux-kernel,
	linux-arm-kernel, linux-mediatek

To support COMMON_CLK_MT8192* module build,
add MODULE_LICENSE and include module.h.

Cc: Chun-Jie Chen <chun-jie.chen@mediatek.com>
Cc: Chen-Yu Tsai <wenst@chromium.org>
Signed-off-by: Miles Chen <miles.chen@mediatek.com>
---
 drivers/clk/mediatek/Kconfig                  | 26 +++++++++----------
 drivers/clk/mediatek/clk-mt8192-aud.c         |  4 ++-
 drivers/clk/mediatek/clk-mt8192-cam.c         |  4 ++-
 drivers/clk/mediatek/clk-mt8192-img.c         |  4 ++-
 .../clk/mediatek/clk-mt8192-imp_iic_wrap.c    |  4 ++-
 drivers/clk/mediatek/clk-mt8192-ipe.c         |  4 ++-
 drivers/clk/mediatek/clk-mt8192-mdp.c         |  4 ++-
 drivers/clk/mediatek/clk-mt8192-mfg.c         |  4 ++-
 drivers/clk/mediatek/clk-mt8192-mm.c          |  4 ++-
 drivers/clk/mediatek/clk-mt8192-msdc.c        |  4 ++-
 drivers/clk/mediatek/clk-mt8192-scp_adsp.c    |  4 ++-
 drivers/clk/mediatek/clk-mt8192-vdec.c        |  4 ++-
 drivers/clk/mediatek/clk-mt8192-venc.c        |  4 ++-
 drivers/clk/mediatek/clk-mt8192.c             |  2 ++
 14 files changed, 51 insertions(+), 25 deletions(-)

diff --git a/drivers/clk/mediatek/Kconfig b/drivers/clk/mediatek/Kconfig
index 3ce6fb04d8ff..b2205caf673f 100644
--- a/drivers/clk/mediatek/Kconfig
+++ b/drivers/clk/mediatek/Kconfig
@@ -496,7 +496,7 @@ config COMMON_CLK_MT8183_VENCSYS
 	  This driver supports MediaTek MT8183 vencsys clocks.
 
 config COMMON_CLK_MT8192
-	bool "Clock driver for MediaTek MT8192"
+	tristate "Clock driver for MediaTek MT8192"
 	depends on ARM64 || COMPILE_TEST
 	select COMMON_CLK_MEDIATEK
 	default ARM64
@@ -504,73 +504,73 @@ config COMMON_CLK_MT8192
 	  This driver supports MediaTek MT8192 basic clocks.
 
 config COMMON_CLK_MT8192_AUDSYS
-	bool "Clock driver for MediaTek MT8192 audsys"
+	tristate "Clock driver for MediaTek MT8192 audsys"
 	depends on COMMON_CLK_MT8192
 	help
 	  This driver supports MediaTek MT8192 audsys clocks.
 
 config COMMON_CLK_MT8192_CAMSYS
-	bool "Clock driver for MediaTek MT8192 camsys"
+	tristate "Clock driver for MediaTek MT8192 camsys"
 	depends on COMMON_CLK_MT8192
 	help
 	  This driver supports MediaTek MT8192 camsys and camsys_raw clocks.
 
 config COMMON_CLK_MT8192_IMGSYS
-	bool "Clock driver for MediaTek MT8192 imgsys"
+	tristate "Clock driver for MediaTek MT8192 imgsys"
 	depends on COMMON_CLK_MT8192
 	help
 	  This driver supports MediaTek MT8192 imgsys and imgsys2 clocks.
 
 config COMMON_CLK_MT8192_IMP_IIC_WRAP
-	bool "Clock driver for MediaTek MT8192 imp_iic_wrap"
+	tristate "Clock driver for MediaTek MT8192 imp_iic_wrap"
 	depends on COMMON_CLK_MT8192
 	help
 	  This driver supports MediaTek MT8192 imp_iic_wrap clocks.
 
 config COMMON_CLK_MT8192_IPESYS
-	bool "Clock driver for MediaTek MT8192 ipesys"
+	tristate "Clock driver for MediaTek MT8192 ipesys"
 	depends on COMMON_CLK_MT8192
 	help
 	  This driver supports MediaTek MT8192 ipesys clocks.
 
 config COMMON_CLK_MT8192_MDPSYS
-	bool "Clock driver for MediaTek MT8192 mdpsys"
+	tristate "Clock driver for MediaTek MT8192 mdpsys"
 	depends on COMMON_CLK_MT8192
 	help
 	  This driver supports MediaTek MT8192 mdpsys clocks.
 
 config COMMON_CLK_MT8192_MFGCFG
-	bool "Clock driver for MediaTek MT8192 mfgcfg"
+	tristate "Clock driver for MediaTek MT8192 mfgcfg"
 	depends on COMMON_CLK_MT8192
 	help
 	  This driver supports MediaTek MT8192 mfgcfg clocks.
 
 config COMMON_CLK_MT8192_MMSYS
-	bool "Clock driver for MediaTek MT8192 mmsys"
+	tristate "Clock driver for MediaTek MT8192 mmsys"
 	depends on COMMON_CLK_MT8192
 	help
 	  This driver supports MediaTek MT8192 mmsys clocks.
 
 config COMMON_CLK_MT8192_MSDC
-	bool "Clock driver for MediaTek MT8192 msdc"
+	tristate "Clock driver for MediaTek MT8192 msdc"
 	depends on COMMON_CLK_MT8192
 	help
 	  This driver supports MediaTek MT8192 msdc and msdc_top clocks.
 
 config COMMON_CLK_MT8192_SCP_ADSP
-	bool "Clock driver for MediaTek MT8192 scp_adsp"
+	tristate "Clock driver for MediaTek MT8192 scp_adsp"
 	depends on COMMON_CLK_MT8192
 	help
 	  This driver supports MediaTek MT8192 scp_adsp clocks.
 
 config COMMON_CLK_MT8192_VDECSYS
-	bool "Clock driver for MediaTek MT8192 vdecsys"
+	tristate "Clock driver for MediaTek MT8192 vdecsys"
 	depends on COMMON_CLK_MT8192
 	help
 	  This driver supports MediaTek MT8192 vdecsys and vdecsys_soc clocks.
 
 config COMMON_CLK_MT8192_VENCSYS
-	bool "Clock driver for MediaTek MT8192 vencsys"
+	tristate "Clock driver for MediaTek MT8192 vencsys"
 	depends on COMMON_CLK_MT8192
 	help
 	  This driver supports MediaTek MT8192 vencsys clocks.
diff --git a/drivers/clk/mediatek/clk-mt8192-aud.c b/drivers/clk/mediatek/clk-mt8192-aud.c
index f28d56628045..ea512fa3d4b9 100644
--- a/drivers/clk/mediatek/clk-mt8192-aud.c
+++ b/drivers/clk/mediatek/clk-mt8192-aud.c
@@ -4,6 +4,7 @@
 // Author: Chun-Jie Chen <chun-jie.chen@mediatek.com>
 
 #include <linux/clk-provider.h>
+#include <linux/module.h>
 #include <linux/of_platform.h>
 #include <linux/platform_device.h>
 
@@ -115,4 +116,5 @@ static struct platform_driver clk_mt8192_aud_drv = {
 	},
 };
 
-builtin_platform_driver(clk_mt8192_aud_drv);
+module_platform_driver(clk_mt8192_aud_drv);
+MODULE_LICENSE("GPL");
diff --git a/drivers/clk/mediatek/clk-mt8192-cam.c b/drivers/clk/mediatek/clk-mt8192-cam.c
index fc74cd80b4b0..04a0de364408 100644
--- a/drivers/clk/mediatek/clk-mt8192-cam.c
+++ b/drivers/clk/mediatek/clk-mt8192-cam.c
@@ -4,6 +4,7 @@
 // Author: Chun-Jie Chen <chun-jie.chen@mediatek.com>
 
 #include <linux/clk-provider.h>
+#include <linux/module.h>
 #include <linux/of_device.h>
 #include <linux/platform_device.h>
 
@@ -104,4 +105,5 @@ static struct platform_driver clk_mt8192_cam_drv = {
 	},
 };
 
-builtin_platform_driver(clk_mt8192_cam_drv);
+module_platform_driver(clk_mt8192_cam_drv);
+MODULE_LICENSE("GPL");
diff --git a/drivers/clk/mediatek/clk-mt8192-img.c b/drivers/clk/mediatek/clk-mt8192-img.c
index 7ce3abe42577..54713a5f3dfc 100644
--- a/drivers/clk/mediatek/clk-mt8192-img.c
+++ b/drivers/clk/mediatek/clk-mt8192-img.c
@@ -4,6 +4,7 @@
 // Author: Chun-Jie Chen <chun-jie.chen@mediatek.com>
 
 #include <linux/clk-provider.h>
+#include <linux/module.h>
 #include <linux/of_device.h>
 #include <linux/platform_device.h>
 
@@ -67,4 +68,5 @@ static struct platform_driver clk_mt8192_img_drv = {
 	},
 };
 
-builtin_platform_driver(clk_mt8192_img_drv);
+module_platform_driver(clk_mt8192_img_drv);
+MODULE_LICENSE("GPL");
diff --git a/drivers/clk/mediatek/clk-mt8192-imp_iic_wrap.c b/drivers/clk/mediatek/clk-mt8192-imp_iic_wrap.c
index 700356ac6a58..94fdb3c1a963 100644
--- a/drivers/clk/mediatek/clk-mt8192-imp_iic_wrap.c
+++ b/drivers/clk/mediatek/clk-mt8192-imp_iic_wrap.c
@@ -4,6 +4,7 @@
 // Author: Chun-Jie Chen <chun-jie.chen@mediatek.com>
 
 #include <linux/clk-provider.h>
+#include <linux/module.h>
 #include <linux/of_device.h>
 #include <linux/platform_device.h>
 
@@ -116,4 +117,5 @@ static struct platform_driver clk_mt8192_imp_iic_wrap_drv = {
 	},
 };
 
-builtin_platform_driver(clk_mt8192_imp_iic_wrap_drv);
+module_platform_driver(clk_mt8192_imp_iic_wrap_drv);
+MODULE_LICENSE("GPL");
diff --git a/drivers/clk/mediatek/clk-mt8192-ipe.c b/drivers/clk/mediatek/clk-mt8192-ipe.c
index 730d91b64b3f..7f8a7a60e2bd 100644
--- a/drivers/clk/mediatek/clk-mt8192-ipe.c
+++ b/drivers/clk/mediatek/clk-mt8192-ipe.c
@@ -4,6 +4,7 @@
 // Author: Chun-Jie Chen <chun-jie.chen@mediatek.com>
 
 #include <linux/clk-provider.h>
+#include <linux/module.h>
 #include <linux/of_device.h>
 #include <linux/platform_device.h>
 
@@ -54,4 +55,5 @@ static struct platform_driver clk_mt8192_ipe_drv = {
 	},
 };
 
-builtin_platform_driver(clk_mt8192_ipe_drv);
+module_platform_driver(clk_mt8192_ipe_drv);
+MODULE_LICENSE("GPL");
diff --git a/drivers/clk/mediatek/clk-mt8192-mdp.c b/drivers/clk/mediatek/clk-mt8192-mdp.c
index 93c87ae2f332..9eab7337fabe 100644
--- a/drivers/clk/mediatek/clk-mt8192-mdp.c
+++ b/drivers/clk/mediatek/clk-mt8192-mdp.c
@@ -4,6 +4,7 @@
 // Author: Chun-Jie Chen <chun-jie.chen@mediatek.com>
 
 #include <linux/clk-provider.h>
+#include <linux/module.h>
 #include <linux/of_device.h>
 #include <linux/platform_device.h>
 
@@ -79,4 +80,5 @@ static struct platform_driver clk_mt8192_mdp_drv = {
 	},
 };
 
-builtin_platform_driver(clk_mt8192_mdp_drv);
+module_platform_driver(clk_mt8192_mdp_drv);
+MODULE_LICENSE("GPL");
diff --git a/drivers/clk/mediatek/clk-mt8192-mfg.c b/drivers/clk/mediatek/clk-mt8192-mfg.c
index 3bbc7469f0e4..8b44f0779a8c 100644
--- a/drivers/clk/mediatek/clk-mt8192-mfg.c
+++ b/drivers/clk/mediatek/clk-mt8192-mfg.c
@@ -4,6 +4,7 @@
 // Author: Chun-Jie Chen <chun-jie.chen@mediatek.com>
 
 #include <linux/clk-provider.h>
+#include <linux/module.h>
 #include <linux/of_device.h>
 #include <linux/platform_device.h>
 
@@ -47,4 +48,5 @@ static struct platform_driver clk_mt8192_mfg_drv = {
 	},
 };
 
-builtin_platform_driver(clk_mt8192_mfg_drv);
+module_platform_driver(clk_mt8192_mfg_drv);
+MODULE_LICENSE("GPL");
diff --git a/drivers/clk/mediatek/clk-mt8192-mm.c b/drivers/clk/mediatek/clk-mt8192-mm.c
index 4a0b4c4bc06a..506beb5a410d 100644
--- a/drivers/clk/mediatek/clk-mt8192-mm.c
+++ b/drivers/clk/mediatek/clk-mt8192-mm.c
@@ -4,6 +4,7 @@
 // Author: Chun-Jie Chen <chun-jie.chen@mediatek.com>
 
 #include <linux/clk-provider.h>
+#include <linux/module.h>
 #include <linux/platform_device.h>
 
 #include "clk-mtk.h"
@@ -105,4 +106,5 @@ static struct platform_driver clk_mt8192_mm_drv = {
 	},
 };
 
-builtin_platform_driver(clk_mt8192_mm_drv);
+module_platform_driver(clk_mt8192_mm_drv);
+MODULE_LICENSE("GPL");
diff --git a/drivers/clk/mediatek/clk-mt8192-msdc.c b/drivers/clk/mediatek/clk-mt8192-msdc.c
index 87c3b79b79cf..a467885abbf8 100644
--- a/drivers/clk/mediatek/clk-mt8192-msdc.c
+++ b/drivers/clk/mediatek/clk-mt8192-msdc.c
@@ -4,6 +4,7 @@
 // Author: Chun-Jie Chen <chun-jie.chen@mediatek.com>
 
 #include <linux/clk-provider.h>
+#include <linux/module.h>
 #include <linux/of_device.h>
 #include <linux/platform_device.h>
 
@@ -82,4 +83,5 @@ static struct platform_driver clk_mt8192_msdc_drv = {
 	},
 };
 
-builtin_platform_driver(clk_mt8192_msdc_drv);
+module_platform_driver(clk_mt8192_msdc_drv);
+MODULE_LICENSE("GPL");
diff --git a/drivers/clk/mediatek/clk-mt8192-scp_adsp.c b/drivers/clk/mediatek/clk-mt8192-scp_adsp.c
index 58725d79dd13..87fbd0131aed 100644
--- a/drivers/clk/mediatek/clk-mt8192-scp_adsp.c
+++ b/drivers/clk/mediatek/clk-mt8192-scp_adsp.c
@@ -4,6 +4,7 @@
 // Author: Chun-Jie Chen <chun-jie.chen@mediatek.com>
 
 #include <linux/clk-provider.h>
+#include <linux/module.h>
 #include <linux/of_device.h>
 #include <linux/platform_device.h>
 
@@ -47,4 +48,5 @@ static struct platform_driver clk_mt8192_scp_adsp_drv = {
 	},
 };
 
-builtin_platform_driver(clk_mt8192_scp_adsp_drv);
+module_platform_driver(clk_mt8192_scp_adsp_drv);
+MODULE_LICENSE("GPL");
diff --git a/drivers/clk/mediatek/clk-mt8192-vdec.c b/drivers/clk/mediatek/clk-mt8192-vdec.c
index b1d95cfbf22a..4d223ecca2c8 100644
--- a/drivers/clk/mediatek/clk-mt8192-vdec.c
+++ b/drivers/clk/mediatek/clk-mt8192-vdec.c
@@ -4,6 +4,7 @@
 // Author: Chun-Jie Chen <chun-jie.chen@mediatek.com>
 
 #include <linux/clk-provider.h>
+#include <linux/module.h>
 #include <linux/of_device.h>
 #include <linux/platform_device.h>
 
@@ -91,4 +92,5 @@ static struct platform_driver clk_mt8192_vdec_drv = {
 	},
 };
 
-builtin_platform_driver(clk_mt8192_vdec_drv);
+module_platform_driver(clk_mt8192_vdec_drv);
+MODULE_LICENSE("GPL");
diff --git a/drivers/clk/mediatek/clk-mt8192-venc.c b/drivers/clk/mediatek/clk-mt8192-venc.c
index c0d867bff09e..0e8092802771 100644
--- a/drivers/clk/mediatek/clk-mt8192-venc.c
+++ b/drivers/clk/mediatek/clk-mt8192-venc.c
@@ -4,6 +4,7 @@
 // Author: Chun-Jie Chen <chun-jie.chen@mediatek.com>
 
 #include <linux/clk-provider.h>
+#include <linux/module.h>
 #include <linux/of_device.h>
 #include <linux/platform_device.h>
 
@@ -50,4 +51,5 @@ static struct platform_driver clk_mt8192_venc_drv = {
 	},
 };
 
-builtin_platform_driver(clk_mt8192_venc_drv);
+module_platform_driver(clk_mt8192_venc_drv);
+MODULE_LICENSE("GPL");
diff --git a/drivers/clk/mediatek/clk-mt8192.c b/drivers/clk/mediatek/clk-mt8192.c
index 552fae4f0fd5..a221834db347 100644
--- a/drivers/clk/mediatek/clk-mt8192.c
+++ b/drivers/clk/mediatek/clk-mt8192.c
@@ -6,6 +6,7 @@
 #include <linux/clk.h>
 #include <linux/delay.h>
 #include <linux/mfd/syscon.h>
+#include <linux/module.h>
 #include <linux/of.h>
 #include <linux/of_address.h>
 #include <linux/of_device.h>
@@ -1313,3 +1314,4 @@ static int __init clk_mt8192_init(void)
 }
 
 arch_initcall(clk_mt8192_init);
+MODULE_LICENSE("GPL");
-- 
2.18.0


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 26+ messages in thread

* Re: [PATCH 3/3] clk: mediatek: support COMMON_CLK_MT8192 module build
  2022-01-10 17:09   ` Miles Chen
  (?)
@ 2022-01-14  2:11     ` Stephen Boyd
  -1 siblings, 0 replies; 26+ messages in thread
From: Stephen Boyd @ 2022-01-14  2:11 UTC (permalink / raw)
  To: Matthias Brugger, Michael Turquette, Miles Chen
  Cc: Miles Chen, Chun-Jie Chen, Chen-Yu Tsai, linux-clk, linux-kernel,
	linux-arm-kernel, linux-mediatek

Quoting Miles Chen (2022-01-10 09:09:59)
> To support COMMON_CLK_MT8192* module build,
> add MODULE_LICENSE and include module.h.
> 
> Cc: Chun-Jie Chen <chun-jie.chen@mediatek.com>
> Cc: Chen-Yu Tsai <wenst@chromium.org>
> Signed-off-by: Miles Chen <miles.chen@mediatek.com>

Have you tried removing the modules? And then reloading them? I also see
that mtk_clk_simple_probe() doesn't actually unregister anything, it
just frees some allocations. Please fix this before making these
modules.

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [PATCH 3/3] clk: mediatek: support COMMON_CLK_MT8192 module build
@ 2022-01-14  2:11     ` Stephen Boyd
  0 siblings, 0 replies; 26+ messages in thread
From: Stephen Boyd @ 2022-01-14  2:11 UTC (permalink / raw)
  To: Matthias Brugger, Michael Turquette, Miles Chen
  Cc: Miles Chen, Chun-Jie Chen, Chen-Yu Tsai, linux-clk, linux-kernel,
	linux-arm-kernel, linux-mediatek

Quoting Miles Chen (2022-01-10 09:09:59)
> To support COMMON_CLK_MT8192* module build,
> add MODULE_LICENSE and include module.h.
> 
> Cc: Chun-Jie Chen <chun-jie.chen@mediatek.com>
> Cc: Chen-Yu Tsai <wenst@chromium.org>
> Signed-off-by: Miles Chen <miles.chen@mediatek.com>

Have you tried removing the modules? And then reloading them? I also see
that mtk_clk_simple_probe() doesn't actually unregister anything, it
just frees some allocations. Please fix this before making these
modules.

_______________________________________________
Linux-mediatek mailing list
Linux-mediatek@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-mediatek

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [PATCH 3/3] clk: mediatek: support COMMON_CLK_MT8192 module build
@ 2022-01-14  2:11     ` Stephen Boyd
  0 siblings, 0 replies; 26+ messages in thread
From: Stephen Boyd @ 2022-01-14  2:11 UTC (permalink / raw)
  To: Matthias Brugger, Michael Turquette, Miles Chen
  Cc: Miles Chen, Chun-Jie Chen, Chen-Yu Tsai, linux-clk, linux-kernel,
	linux-arm-kernel, linux-mediatek

Quoting Miles Chen (2022-01-10 09:09:59)
> To support COMMON_CLK_MT8192* module build,
> add MODULE_LICENSE and include module.h.
> 
> Cc: Chun-Jie Chen <chun-jie.chen@mediatek.com>
> Cc: Chen-Yu Tsai <wenst@chromium.org>
> Signed-off-by: Miles Chen <miles.chen@mediatek.com>

Have you tried removing the modules? And then reloading them? I also see
that mtk_clk_simple_probe() doesn't actually unregister anything, it
just frees some allocations. Please fix this before making these
modules.

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [PATCH 1/3] clk: mediatek: export mtk_clk_simple_probe
  2022-01-10 17:09   ` Miles Chen
  (?)
@ 2022-01-14  2:12     ` Stephen Boyd
  -1 siblings, 0 replies; 26+ messages in thread
From: Stephen Boyd @ 2022-01-14  2:12 UTC (permalink / raw)
  To: Matthias Brugger, Michael Turquette, Miles Chen
  Cc: Miles Chen, Chun-Jie Chen, Chen-Yu Tsai, linux-clk,
	linux-arm-kernel, linux-mediatek, linux-kernel

Quoting Miles Chen (2022-01-10 09:09:57)
> Export mtk_clk_simple_probe() to support mt8192 module build.
> 
> Cc: Chun-Jie Chen <chun-jie.chen@mediatek.com>
> Cc: Chen-Yu Tsai <wenst@chromium.org>
> Signed-off-by: Miles Chen <miles.chen@mediatek.com>
> ---

Please send a cover letter for multi-patch series.

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [PATCH 1/3] clk: mediatek: export mtk_clk_simple_probe
@ 2022-01-14  2:12     ` Stephen Boyd
  0 siblings, 0 replies; 26+ messages in thread
From: Stephen Boyd @ 2022-01-14  2:12 UTC (permalink / raw)
  To: Matthias Brugger, Michael Turquette, Miles Chen
  Cc: Miles Chen, Chun-Jie Chen, Chen-Yu Tsai, linux-clk,
	linux-arm-kernel, linux-mediatek, linux-kernel

Quoting Miles Chen (2022-01-10 09:09:57)
> Export mtk_clk_simple_probe() to support mt8192 module build.
> 
> Cc: Chun-Jie Chen <chun-jie.chen@mediatek.com>
> Cc: Chen-Yu Tsai <wenst@chromium.org>
> Signed-off-by: Miles Chen <miles.chen@mediatek.com>
> ---

Please send a cover letter for multi-patch series.

_______________________________________________
Linux-mediatek mailing list
Linux-mediatek@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-mediatek

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [PATCH 1/3] clk: mediatek: export mtk_clk_simple_probe
@ 2022-01-14  2:12     ` Stephen Boyd
  0 siblings, 0 replies; 26+ messages in thread
From: Stephen Boyd @ 2022-01-14  2:12 UTC (permalink / raw)
  To: Matthias Brugger, Michael Turquette, Miles Chen
  Cc: Miles Chen, Chun-Jie Chen, Chen-Yu Tsai, linux-clk,
	linux-arm-kernel, linux-mediatek, linux-kernel

Quoting Miles Chen (2022-01-10 09:09:57)
> Export mtk_clk_simple_probe() to support mt8192 module build.
> 
> Cc: Chun-Jie Chen <chun-jie.chen@mediatek.com>
> Cc: Chen-Yu Tsai <wenst@chromium.org>
> Signed-off-by: Miles Chen <miles.chen@mediatek.com>
> ---

Please send a cover letter for multi-patch series.

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [PATCH 3/3] clk: mediatek: support COMMON_CLK_MT8192 module build
  2022-01-14  2:11     ` Stephen Boyd
@ 2022-01-14  8:35       ` Miles Chen
  -1 siblings, 0 replies; 26+ messages in thread
From: Miles Chen @ 2022-01-14  8:35 UTC (permalink / raw)
  To: sboyd, Matthias Brugger
  Cc: chun-jie.chen, linux-arm-kernel, linux-clk, linux-kernel,
	linux-mediatek, miles.chen, mturquette, wenst

Hi,

>Have you tried removing the modules? And then reloading them? I also see

Thanks for the comment.
I did not try it because we do not unload our clk modules.
After testing I understand that the clock driver does not unregister clks so 
we cannot remove then unload it.

I think I have to add some unregister logic to these drivers.

>that mtk_clk_simple_probe() doesn't actually unregister anything, it
>just frees some allocations. Please fix this before making these
>modules.

You meant that mtk_clk_simple_probe() has no unregister logic in error path?

Miles

_______________________________________________
Linux-mediatek mailing list
Linux-mediatek@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-mediatek

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [PATCH 3/3] clk: mediatek: support COMMON_CLK_MT8192 module build
@ 2022-01-14  8:35       ` Miles Chen
  0 siblings, 0 replies; 26+ messages in thread
From: Miles Chen @ 2022-01-14  8:35 UTC (permalink / raw)
  To: sboyd, Matthias Brugger
  Cc: chun-jie.chen, linux-arm-kernel, linux-clk, linux-kernel,
	linux-mediatek, miles.chen, mturquette, wenst

Hi,

>Have you tried removing the modules? And then reloading them? I also see

Thanks for the comment.
I did not try it because we do not unload our clk modules.
After testing I understand that the clock driver does not unregister clks so 
we cannot remove then unload it.

I think I have to add some unregister logic to these drivers.

>that mtk_clk_simple_probe() doesn't actually unregister anything, it
>just frees some allocations. Please fix this before making these
>modules.

You meant that mtk_clk_simple_probe() has no unregister logic in error path?

Miles

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [PATCH 1/3] clk: mediatek: export mtk_clk_simple_probe
  2022-01-14  2:12     ` Stephen Boyd
@ 2022-01-14  8:36       ` Miles Chen
  -1 siblings, 0 replies; 26+ messages in thread
From: Miles Chen @ 2022-01-14  8:36 UTC (permalink / raw)
  To: sboyd, Matthias Brugger
  Cc: chun-jie.chen, linux-arm-kernel, linux-clk, linux-kernel,
	linux-mediatek, miles.chen, mturquette, wenst

> Please send a cover letter for multi-patch series.

Sorry for that, I will submit a cover letter in next version.

Miles

_______________________________________________
Linux-mediatek mailing list
Linux-mediatek@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-mediatek

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [PATCH 1/3] clk: mediatek: export mtk_clk_simple_probe
@ 2022-01-14  8:36       ` Miles Chen
  0 siblings, 0 replies; 26+ messages in thread
From: Miles Chen @ 2022-01-14  8:36 UTC (permalink / raw)
  To: sboyd, Matthias Brugger
  Cc: chun-jie.chen, linux-arm-kernel, linux-clk, linux-kernel,
	linux-mediatek, miles.chen, mturquette, wenst

> Please send a cover letter for multi-patch series.

Sorry for that, I will submit a cover letter in next version.

Miles

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [PATCH 3/3] clk: mediatek: support COMMON_CLK_MT8192 module build
  2022-01-14  8:35       ` Miles Chen
  (?)
@ 2022-01-14 22:19         ` Stephen Boyd
  -1 siblings, 0 replies; 26+ messages in thread
From: Stephen Boyd @ 2022-01-14 22:19 UTC (permalink / raw)
  To: Matthias Brugger, Miles Chen
  Cc: chun-jie.chen, linux-arm-kernel, linux-clk, linux-kernel,
	linux-mediatek, miles.chen, mturquette, wenst

Quoting Miles Chen (2022-01-14 00:35:10)
> Hi,
> 
> >Have you tried removing the modules? And then reloading them? I also see
> 
> Thanks for the comment.
> I did not try it because we do not unload our clk modules.
> After testing I understand that the clock driver does not unregister clks so 
> we cannot remove then unload it.
> 
> I think I have to add some unregister logic to these drivers.

Yes

> 
> >that mtk_clk_simple_probe() doesn't actually unregister anything, it
> >just frees some allocations. Please fix this before making these
> >modules.
> 
> You meant that mtk_clk_simple_probe() has no unregister logic in error path?
> 

Yes

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [PATCH 3/3] clk: mediatek: support COMMON_CLK_MT8192 module build
@ 2022-01-14 22:19         ` Stephen Boyd
  0 siblings, 0 replies; 26+ messages in thread
From: Stephen Boyd @ 2022-01-14 22:19 UTC (permalink / raw)
  To: Matthias Brugger, Miles Chen
  Cc: chun-jie.chen, linux-arm-kernel, linux-clk, linux-kernel,
	linux-mediatek, miles.chen, mturquette, wenst

Quoting Miles Chen (2022-01-14 00:35:10)
> Hi,
> 
> >Have you tried removing the modules? And then reloading them? I also see
> 
> Thanks for the comment.
> I did not try it because we do not unload our clk modules.
> After testing I understand that the clock driver does not unregister clks so 
> we cannot remove then unload it.
> 
> I think I have to add some unregister logic to these drivers.

Yes

> 
> >that mtk_clk_simple_probe() doesn't actually unregister anything, it
> >just frees some allocations. Please fix this before making these
> >modules.
> 
> You meant that mtk_clk_simple_probe() has no unregister logic in error path?
> 

Yes

_______________________________________________
Linux-mediatek mailing list
Linux-mediatek@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-mediatek

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [PATCH 3/3] clk: mediatek: support COMMON_CLK_MT8192 module build
@ 2022-01-14 22:19         ` Stephen Boyd
  0 siblings, 0 replies; 26+ messages in thread
From: Stephen Boyd @ 2022-01-14 22:19 UTC (permalink / raw)
  To: Matthias Brugger, Miles Chen
  Cc: chun-jie.chen, linux-arm-kernel, linux-clk, linux-kernel,
	linux-mediatek, miles.chen, mturquette, wenst

Quoting Miles Chen (2022-01-14 00:35:10)
> Hi,
> 
> >Have you tried removing the modules? And then reloading them? I also see
> 
> Thanks for the comment.
> I did not try it because we do not unload our clk modules.
> After testing I understand that the clock driver does not unregister clks so 
> we cannot remove then unload it.
> 
> I think I have to add some unregister logic to these drivers.

Yes

> 
> >that mtk_clk_simple_probe() doesn't actually unregister anything, it
> >just frees some allocations. Please fix this before making these
> >modules.
> 
> You meant that mtk_clk_simple_probe() has no unregister logic in error path?
> 

Yes

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [PATCH 3/3] clk: mediatek: support COMMON_CLK_MT8192 module build
  2022-01-14 22:19         ` Stephen Boyd
@ 2022-01-17  9:18           ` Miles Chen
  -1 siblings, 0 replies; 26+ messages in thread
From: Miles Chen @ 2022-01-17  9:18 UTC (permalink / raw)
  To: sboyd, Matthias Brugger
  Cc: chun-jie.chen, linux-arm-kernel, linux-clk, linux-kernel,
	linux-mediatek, miles.chen, mturquette, wenst

>> I did not try it because we do not unload our clk modules.
>> After testing I understand that the clock driver does not unregister clks
>> we cannot remove then unload it.
>> I think I have to add some unregister logic to these drivers.
>
>Yes

I will do this later.

>
>> >that mtk_clk_simple_probe() doesn't actually unregister anything, it
>> >just frees some allocations. Please fix this before making these
>> >modules.
>> You meant that mtk_clk_simple_probe() has no unregister logic in error pa=
>
>Yes

I post a patch to fix this first:
https://lore.kernel.org/lkml/20220117090030.13064-1-miles.chen@mediatek.com/T/#u

After this, I think that I can use mtk_clk_simple_probe() in other mediatek clk
drivers by submitting some clean up patches.

Miles

_______________________________________________
Linux-mediatek mailing list
Linux-mediatek@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-mediatek

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [PATCH 3/3] clk: mediatek: support COMMON_CLK_MT8192 module build
@ 2022-01-17  9:18           ` Miles Chen
  0 siblings, 0 replies; 26+ messages in thread
From: Miles Chen @ 2022-01-17  9:18 UTC (permalink / raw)
  To: sboyd, Matthias Brugger
  Cc: chun-jie.chen, linux-arm-kernel, linux-clk, linux-kernel,
	linux-mediatek, miles.chen, mturquette, wenst

>> I did not try it because we do not unload our clk modules.
>> After testing I understand that the clock driver does not unregister clks
>> we cannot remove then unload it.
>> I think I have to add some unregister logic to these drivers.
>
>Yes

I will do this later.

>
>> >that mtk_clk_simple_probe() doesn't actually unregister anything, it
>> >just frees some allocations. Please fix this before making these
>> >modules.
>> You meant that mtk_clk_simple_probe() has no unregister logic in error pa=
>
>Yes

I post a patch to fix this first:
https://lore.kernel.org/lkml/20220117090030.13064-1-miles.chen@mediatek.com/T/#u

After this, I think that I can use mtk_clk_simple_probe() in other mediatek clk
drivers by submitting some clean up patches.

Miles

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 26+ messages in thread

end of thread, other threads:[~2022-01-17  9:19 UTC | newest]

Thread overview: 26+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-10 17:09 clk: mediatek: support COMMON_CLK_MT8192 module build Miles Chen
2022-01-10 17:09 ` Miles Chen
2022-01-10 17:09 ` [PATCH 1/3] clk: mediatek: export mtk_clk_simple_probe Miles Chen
2022-01-10 17:09   ` Miles Chen
2022-01-10 17:09   ` Miles Chen
2022-01-14  2:12   ` Stephen Boyd
2022-01-14  2:12     ` Stephen Boyd
2022-01-14  2:12     ` Stephen Boyd
2022-01-14  8:36     ` Miles Chen
2022-01-14  8:36       ` Miles Chen
2022-01-10 17:09 ` [PATCH 2/3] clk: mediatek: clk-mt8192: drop CLK_OF_DECLARE_DRIVER Miles Chen
2022-01-10 17:09   ` Miles Chen
2022-01-10 17:09   ` Miles Chen
2022-01-10 17:09 ` [PATCH 3/3] clk: mediatek: support COMMON_CLK_MT8192 module build Miles Chen
2022-01-10 17:09   ` Miles Chen
2022-01-10 17:09   ` Miles Chen
2022-01-14  2:11   ` Stephen Boyd
2022-01-14  2:11     ` Stephen Boyd
2022-01-14  2:11     ` Stephen Boyd
2022-01-14  8:35     ` Miles Chen
2022-01-14  8:35       ` Miles Chen
2022-01-14 22:19       ` Stephen Boyd
2022-01-14 22:19         ` Stephen Boyd
2022-01-14 22:19         ` Stephen Boyd
2022-01-17  9:18         ` Miles Chen
2022-01-17  9:18           ` Miles Chen

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.