LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [RESEND PATCH 0/4] clk: mediatek: modularize COMMON_CLK_MT6779
@ 2021-08-13 3:24 Miles Chen
2021-08-13 3:24 ` [RESEND PATCH 1/4] clk: composite: export clk_register_composite Miles Chen
` (3 more replies)
0 siblings, 4 replies; 9+ messages in thread
From: Miles Chen @ 2021-08-13 3:24 UTC (permalink / raw)
To: Michael Turquette, Stephen Boyd, Matthias Brugger
Cc: Wendell Lin, Hanks Chen, linux-clk, linux-kernel,
linux-arm-kernel, linux-mediatek, wsd_upstream, Miles Chen
This patch set makes COMMON_CLK_MEDIATEK and COMMON_CLK_MT6779*
be able to built as kernel modules. Necessary symbols are exported
in this patch.
In previous discussion [1], Stephen commented that there must
be a user before exporting a symbol:
"
Is the mediatek driver compilable as a module? Last time I checked it
wasn't a module. I want an upstream modular driver that uses the symbol.
Otherwise we're exporting symbols when it doesn't need to be.
"
[1] https://lore.kernel.org/patchwork/patch/1278089/
Miles Chen (4):
clk: composite: export clk_register_composite
clk: mediatek: modularize COMMON_CLK_MEDIATEK
clk: mediatek: modularize COMMON_CLK_MT6779*
clk: mediatek: use tristate for COMMON_CLK_MEDAITEK and
COMMON_CLK_MT6779
drivers/clk/clk-composite.c | 1 +
drivers/clk/mediatek/Kconfig | 20 ++++++++++----------
drivers/clk/mediatek/clk-apmixed.c | 3 +++
drivers/clk/mediatek/clk-cpumux.c | 3 +++
drivers/clk/mediatek/clk-gate.c | 8 ++++++++
drivers/clk/mediatek/clk-mt6779-aud.c | 2 ++
drivers/clk/mediatek/clk-mt6779-cam.c | 2 ++
drivers/clk/mediatek/clk-mt6779-img.c | 2 ++
drivers/clk/mediatek/clk-mt6779-ipe.c | 2 ++
drivers/clk/mediatek/clk-mt6779-mfg.c | 2 ++
drivers/clk/mediatek/clk-mt6779-mm.c | 2 ++
drivers/clk/mediatek/clk-mt6779-vdec.c | 2 ++
drivers/clk/mediatek/clk-mt6779-venc.c | 2 ++
drivers/clk/mediatek/clk-mt6779.c | 2 ++
drivers/clk/mediatek/clk-mtk.c | 8 ++++++++
drivers/clk/mediatek/clk-mux.c | 4 ++++
drivers/clk/mediatek/clk-pll.c | 4 ++++
drivers/clk/mediatek/reset.c | 2 ++
18 files changed, 61 insertions(+), 10 deletions(-)
--
2.18.0
^ permalink raw reply [flat|nested] 9+ messages in thread
* [RESEND PATCH 1/4] clk: composite: export clk_register_composite
2021-08-13 3:24 [RESEND PATCH 0/4] clk: mediatek: modularize COMMON_CLK_MT6779 Miles Chen
@ 2021-08-13 3:24 ` Miles Chen
2021-08-13 3:24 ` [RESEND PATCH 2/4] clk: mediatek: support COMMON_CLK_MEDIATEK module build Miles Chen
` (2 subsequent siblings)
3 siblings, 0 replies; 9+ messages in thread
From: Miles Chen @ 2021-08-13 3:24 UTC (permalink / raw)
To: Michael Turquette, Stephen Boyd, Matthias Brugger
Cc: Wendell Lin, Hanks Chen, linux-clk, linux-kernel,
linux-arm-kernel, linux-mediatek, wsd_upstream, Miles Chen,
Lee Jones
To support module build of mediatek clk drivers,
it is necessary to export clk_register_composite.
Cc: Stephen Boyd <sboyd@kernel.org>
Cc: Hanks Chen <hanks.chen@mediatek.com>
Cc: Wendell Lin <wendell.lin@mediatek.com>
Cc: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Miles Chen <miles.chen@mediatek.com>
---
drivers/clk/clk-composite.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/clk/clk-composite.c b/drivers/clk/clk-composite.c
index 0506046a5f4b..c7b97fb0051b 100644
--- a/drivers/clk/clk-composite.c
+++ b/drivers/clk/clk-composite.c
@@ -362,6 +362,7 @@ struct clk *clk_register_composite(struct device *dev, const char *name,
return ERR_CAST(hw);
return hw->clk;
}
+EXPORT_SYMBOL_GPL(clk_register_composite);
struct clk *clk_register_composite_pdata(struct device *dev, const char *name,
const struct clk_parent_data *parent_data,
--
2.18.0
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [RESEND PATCH 2/4] clk: mediatek: support COMMON_CLK_MEDIATEK module build
2021-08-13 3:24 [RESEND PATCH 0/4] clk: mediatek: modularize COMMON_CLK_MT6779 Miles Chen
2021-08-13 3:24 ` [RESEND PATCH 1/4] clk: composite: export clk_register_composite Miles Chen
@ 2021-08-13 3:24 ` Miles Chen
2021-08-13 3:24 ` [RESEND PATCH 3/4] clk: mediatek: support COMMON_CLK_MT6779 " Miles Chen
2021-08-13 3:24 ` [RESEND PATCH 4/4] clk: mediatek: use tristate for COMMON_CLK_MEDAITEK and COMMON_CLK_MT6779 Miles Chen
3 siblings, 0 replies; 9+ messages in thread
From: Miles Chen @ 2021-08-13 3:24 UTC (permalink / raw)
To: Michael Turquette, Stephen Boyd, Matthias Brugger
Cc: Wendell Lin, Hanks Chen, linux-clk, linux-kernel,
linux-arm-kernel, linux-mediatek, wsd_upstream, Miles Chen,
Lee Jones
To support COMMON_CLK_MEDIATEK module build,
add MODULE_LICENSE and export necessary symbols.
Cc: Stephen Boyd <sboyd@kernel.org>
Cc: Hanks Chen <hanks.chen@mediatek.com>
Cc: Wendell Lin <wendell.lin@mediatek.com>
Cc: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Miles Chen <miles.chen@mediatek.com>
---
drivers/clk/mediatek/clk-apmixed.c | 3 +++
drivers/clk/mediatek/clk-cpumux.c | 3 +++
drivers/clk/mediatek/clk-gate.c | 8 ++++++++
drivers/clk/mediatek/clk-mtk.c | 8 ++++++++
drivers/clk/mediatek/clk-mux.c | 4 ++++
drivers/clk/mediatek/clk-pll.c | 4 ++++
drivers/clk/mediatek/reset.c | 2 ++
7 files changed, 32 insertions(+)
diff --git a/drivers/clk/mediatek/clk-apmixed.c b/drivers/clk/mediatek/clk-apmixed.c
index 258d128370f2..caa9119413f1 100644
--- a/drivers/clk/mediatek/clk-apmixed.c
+++ b/drivers/clk/mediatek/clk-apmixed.c
@@ -5,6 +5,7 @@
*/
#include <linux/delay.h>
+#include <linux/module.h>
#include <linux/of_address.h>
#include <linux/slab.h>
@@ -97,3 +98,5 @@ struct clk * __init mtk_clk_register_ref2usb_tx(const char *name,
return clk;
}
+
+MODULE_LICENSE("GPL");
diff --git a/drivers/clk/mediatek/clk-cpumux.c b/drivers/clk/mediatek/clk-cpumux.c
index 79fe09028742..f85c755c9fc1 100644
--- a/drivers/clk/mediatek/clk-cpumux.c
+++ b/drivers/clk/mediatek/clk-cpumux.c
@@ -6,6 +6,7 @@
#include <linux/clk-provider.h>
#include <linux/mfd/syscon.h>
+#include <linux/module.h>
#include <linux/slab.h>
#include "clk-mtk.h"
@@ -106,3 +107,5 @@ int mtk_clk_register_cpumuxes(struct device_node *node,
return 0;
}
+
+MODULE_LICENSE("GPL");
diff --git a/drivers/clk/mediatek/clk-gate.c b/drivers/clk/mediatek/clk-gate.c
index a35cf0b22150..b02d2f74dd0d 100644
--- a/drivers/clk/mediatek/clk-gate.c
+++ b/drivers/clk/mediatek/clk-gate.c
@@ -11,6 +11,7 @@
#include <linux/slab.h>
#include <linux/delay.h>
#include <linux/clkdev.h>
+#include <linux/module.h>
#include "clk-mtk.h"
#include "clk-gate.h"
@@ -122,24 +123,28 @@ const struct clk_ops mtk_clk_gate_ops_setclr = {
.enable = mtk_cg_enable,
.disable = mtk_cg_disable,
};
+EXPORT_SYMBOL_GPL(mtk_clk_gate_ops_setclr);
const struct clk_ops mtk_clk_gate_ops_setclr_inv = {
.is_enabled = mtk_cg_bit_is_set,
.enable = mtk_cg_enable_inv,
.disable = mtk_cg_disable_inv,
};
+EXPORT_SYMBOL_GPL(mtk_clk_gate_ops_setclr_inv);
const struct clk_ops mtk_clk_gate_ops_no_setclr = {
.is_enabled = mtk_cg_bit_is_cleared,
.enable = mtk_cg_enable_no_setclr,
.disable = mtk_cg_disable_no_setclr,
};
+EXPORT_SYMBOL_GPL(mtk_clk_gate_ops_no_setclr);
const struct clk_ops mtk_clk_gate_ops_no_setclr_inv = {
.is_enabled = mtk_cg_bit_is_set,
.enable = mtk_cg_enable_inv_no_setclr,
.disable = mtk_cg_disable_inv_no_setclr,
};
+EXPORT_SYMBOL_GPL(mtk_clk_gate_ops_no_setclr_inv);
struct clk *mtk_clk_register_gate(
const char *name,
@@ -181,3 +186,6 @@ struct clk *mtk_clk_register_gate(
return clk;
}
+EXPORT_SYMBOL_GPL(mtk_clk_register_gate);
+
+MODULE_LICENSE("GPL");
diff --git a/drivers/clk/mediatek/clk-mtk.c b/drivers/clk/mediatek/clk-mtk.c
index cec1c8a27211..cb2dabe60aaf 100644
--- a/drivers/clk/mediatek/clk-mtk.c
+++ b/drivers/clk/mediatek/clk-mtk.c
@@ -11,6 +11,7 @@
#include <linux/slab.h>
#include <linux/delay.h>
#include <linux/clkdev.h>
+#include <linux/module.h>
#include <linux/mfd/syscon.h>
#include <linux/device.h>
@@ -41,6 +42,7 @@ struct clk_onecell_data *mtk_alloc_clk_data(unsigned int clk_num)
return NULL;
}
+EXPORT_SYMBOL_GPL(mtk_alloc_clk_data);
void mtk_clk_register_fixed_clks(const struct mtk_fixed_clk *clks,
int num, struct clk_onecell_data *clk_data)
@@ -67,6 +69,7 @@ void mtk_clk_register_fixed_clks(const struct mtk_fixed_clk *clks,
clk_data->clks[rc->id] = clk;
}
}
+EXPORT_SYMBOL_GPL(mtk_clk_register_fixed_clks);
void mtk_clk_register_factors(const struct mtk_fixed_factor *clks,
int num, struct clk_onecell_data *clk_data)
@@ -93,6 +96,7 @@ void mtk_clk_register_factors(const struct mtk_fixed_factor *clks,
clk_data->clks[ff->id] = clk;
}
}
+EXPORT_SYMBOL_GPL(mtk_clk_register_factors);
int mtk_clk_register_gates_with_dev(struct device_node *node,
const struct mtk_gate *clks,
@@ -145,6 +149,7 @@ int mtk_clk_register_gates(struct device_node *node,
return mtk_clk_register_gates_with_dev(node,
clks, num, clk_data, NULL);
}
+EXPORT_SYMBOL_GPL(mtk_clk_register_gates);
struct clk *mtk_clk_register_composite(const struct mtk_composite *mc,
void __iomem *base, spinlock_t *lock)
@@ -258,6 +263,7 @@ void mtk_clk_register_composites(const struct mtk_composite *mcs,
clk_data->clks[mc->id] = clk;
}
}
+EXPORT_SYMBOL_GPL(mtk_clk_register_composites);
void mtk_clk_register_dividers(const struct mtk_clk_divider *mcds,
int num, void __iomem *base, spinlock_t *lock,
@@ -286,3 +292,5 @@ void mtk_clk_register_dividers(const struct mtk_clk_divider *mcds,
clk_data->clks[mcd->id] = clk;
}
}
+
+MODULE_LICENSE("GPL");
diff --git a/drivers/clk/mediatek/clk-mux.c b/drivers/clk/mediatek/clk-mux.c
index b0c61709bacc..a507eea26cc7 100644
--- a/drivers/clk/mediatek/clk-mux.c
+++ b/drivers/clk/mediatek/clk-mux.c
@@ -8,6 +8,7 @@
#include <linux/of_address.h>
#include <linux/slab.h>
#include <linux/mfd/syscon.h>
+#include <linux/module.h>
#include "clk-mtk.h"
#include "clk-mux.h"
@@ -190,3 +191,6 @@ int mtk_clk_register_muxes(const struct mtk_mux *muxes,
return 0;
}
+EXPORT_SYMBOL_GPL(mtk_clk_register_muxes);
+
+MODULE_LICENSE("GPL");
diff --git a/drivers/clk/mediatek/clk-pll.c b/drivers/clk/mediatek/clk-pll.c
index f440f2cd0b69..399e7b4297c8 100644
--- a/drivers/clk/mediatek/clk-pll.c
+++ b/drivers/clk/mediatek/clk-pll.c
@@ -7,6 +7,7 @@
#include <linux/of.h>
#include <linux/of_address.h>
#include <linux/io.h>
+#include <linux/module.h>
#include <linux/slab.h>
#include <linux/clkdev.h>
#include <linux/delay.h>
@@ -368,3 +369,6 @@ void mtk_clk_register_plls(struct device_node *node,
clk_data->clks[pll->id] = clk;
}
}
+EXPORT_SYMBOL_GPL(mtk_clk_register_plls);
+
+MODULE_LICENSE("GPL");
diff --git a/drivers/clk/mediatek/reset.c b/drivers/clk/mediatek/reset.c
index cb939c071b0c..9079bfc29ec0 100644
--- a/drivers/clk/mediatek/reset.c
+++ b/drivers/clk/mediatek/reset.c
@@ -137,3 +137,5 @@ void mtk_register_reset_controller_set_clr(struct device_node *np,
mtk_register_reset_controller_common(np, num_regs, regofs,
&mtk_reset_ops_set_clr);
}
+
+MODULE_LICENSE("GPL");
--
2.18.0
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [RESEND PATCH 3/4] clk: mediatek: support COMMON_CLK_MT6779 module build
2021-08-13 3:24 [RESEND PATCH 0/4] clk: mediatek: modularize COMMON_CLK_MT6779 Miles Chen
2021-08-13 3:24 ` [RESEND PATCH 1/4] clk: composite: export clk_register_composite Miles Chen
2021-08-13 3:24 ` [RESEND PATCH 2/4] clk: mediatek: support COMMON_CLK_MEDIATEK module build Miles Chen
@ 2021-08-13 3:24 ` Miles Chen
2021-08-29 4:14 ` Stephen Boyd
2021-08-13 3:24 ` [RESEND PATCH 4/4] clk: mediatek: use tristate for COMMON_CLK_MEDAITEK and COMMON_CLK_MT6779 Miles Chen
3 siblings, 1 reply; 9+ messages in thread
From: Miles Chen @ 2021-08-13 3:24 UTC (permalink / raw)
To: Michael Turquette, Stephen Boyd, Matthias Brugger
Cc: Wendell Lin, Hanks Chen, linux-clk, linux-kernel,
linux-arm-kernel, linux-mediatek, wsd_upstream, Miles Chen,
Lee Jones
To support COMMON_CLK_MT6779* module build,
add MODULE_LICENSE and export necessary symbols.
Cc: Stephen Boyd <sboyd@kernel.org>
Cc: Hanks Chen <hanks.chen@mediatek.com>
Cc: Wendell Lin <wendell.lin@mediatek.com>
Cc: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Miles Chen <miles.chen@mediatek.com>
---
drivers/clk/mediatek/clk-mt6779-aud.c | 2 ++
drivers/clk/mediatek/clk-mt6779-cam.c | 2 ++
drivers/clk/mediatek/clk-mt6779-img.c | 2 ++
drivers/clk/mediatek/clk-mt6779-ipe.c | 2 ++
drivers/clk/mediatek/clk-mt6779-mfg.c | 2 ++
drivers/clk/mediatek/clk-mt6779-mm.c | 2 ++
drivers/clk/mediatek/clk-mt6779-vdec.c | 2 ++
drivers/clk/mediatek/clk-mt6779-venc.c | 2 ++
drivers/clk/mediatek/clk-mt6779.c | 2 ++
9 files changed, 18 insertions(+)
diff --git a/drivers/clk/mediatek/clk-mt6779-aud.c b/drivers/clk/mediatek/clk-mt6779-aud.c
index 11b209f95e25..439c0bc94b73 100644
--- a/drivers/clk/mediatek/clk-mt6779-aud.c
+++ b/drivers/clk/mediatek/clk-mt6779-aud.c
@@ -4,6 +4,7 @@
* Author: Wendell Lin <wendell.lin@mediatek.com>
*/
+#include <linux/module.h>
#include <linux/clk-provider.h>
#include <linux/of.h>
#include <linux/of_address.h>
@@ -115,3 +116,4 @@ static struct platform_driver clk_mt6779_aud_drv = {
};
builtin_platform_driver(clk_mt6779_aud_drv);
+MODULE_LICENSE("GPL");
diff --git a/drivers/clk/mediatek/clk-mt6779-cam.c b/drivers/clk/mediatek/clk-mt6779-cam.c
index 244d4208b7fb..c99ddb210b70 100644
--- a/drivers/clk/mediatek/clk-mt6779-cam.c
+++ b/drivers/clk/mediatek/clk-mt6779-cam.c
@@ -4,6 +4,7 @@
* Author: Wendell Lin <wendell.lin@mediatek.com>
*/
+#include <linux/module.h>
#include <linux/clk-provider.h>
#include <linux/platform_device.h>
#include <dt-bindings/clock/mt6779-clk.h>
@@ -64,3 +65,4 @@ static struct platform_driver clk_mt6779_cam_drv = {
};
builtin_platform_driver(clk_mt6779_cam_drv);
+MODULE_LICENSE("GPL");
diff --git a/drivers/clk/mediatek/clk-mt6779-img.c b/drivers/clk/mediatek/clk-mt6779-img.c
index 26292a45c613..bf652052879c 100644
--- a/drivers/clk/mediatek/clk-mt6779-img.c
+++ b/drivers/clk/mediatek/clk-mt6779-img.c
@@ -4,6 +4,7 @@
* Author: Wendell Lin <wendell.lin@mediatek.com>
*/
+#include <linux/module.h>
#include <linux/clk-provider.h>
#include <linux/platform_device.h>
#include <dt-bindings/clock/mt6779-clk.h>
@@ -56,3 +57,4 @@ static struct platform_driver clk_mt6779_img_drv = {
};
builtin_platform_driver(clk_mt6779_img_drv);
+MODULE_LICENSE("GPL");
diff --git a/drivers/clk/mediatek/clk-mt6779-ipe.c b/drivers/clk/mediatek/clk-mt6779-ipe.c
index bb519075639c..a1a1c9cb329a 100644
--- a/drivers/clk/mediatek/clk-mt6779-ipe.c
+++ b/drivers/clk/mediatek/clk-mt6779-ipe.c
@@ -4,6 +4,7 @@
* Author: Wendell Lin <wendell.lin@mediatek.com>
*/
+#include <linux/module.h>
#include <linux/clk-provider.h>
#include <linux/platform_device.h>
#include <dt-bindings/clock/mt6779-clk.h>
@@ -58,3 +59,4 @@ static struct platform_driver clk_mt6779_ipe_drv = {
};
builtin_platform_driver(clk_mt6779_ipe_drv);
+MODULE_LICENSE("GPL");
diff --git a/drivers/clk/mediatek/clk-mt6779-mfg.c b/drivers/clk/mediatek/clk-mt6779-mfg.c
index c6ee2a89c070..9bf48c56d852 100644
--- a/drivers/clk/mediatek/clk-mt6779-mfg.c
+++ b/drivers/clk/mediatek/clk-mt6779-mfg.c
@@ -4,6 +4,7 @@
* Author: Wendell Lin <wendell.lin@mediatek.com>
*/
+#include <linux/module.h>
#include <linux/clk-provider.h>
#include <linux/platform_device.h>
@@ -53,3 +54,4 @@ static struct platform_driver clk_mt6779_mfg_drv = {
};
builtin_platform_driver(clk_mt6779_mfg_drv);
+MODULE_LICENSE("GPL");
diff --git a/drivers/clk/mediatek/clk-mt6779-mm.c b/drivers/clk/mediatek/clk-mt6779-mm.c
index 059c1a41ac7a..d5ead5531026 100644
--- a/drivers/clk/mediatek/clk-mt6779-mm.c
+++ b/drivers/clk/mediatek/clk-mt6779-mm.c
@@ -4,6 +4,7 @@
* Author: Wendell Lin <wendell.lin@mediatek.com>
*/
+#include <linux/module.h>
#include <linux/clk-provider.h>
#include <linux/platform_device.h>
#include <dt-bindings/clock/mt6779-clk.h>
@@ -106,3 +107,4 @@ static struct platform_driver clk_mt6779_mm_drv = {
};
builtin_platform_driver(clk_mt6779_mm_drv);
+MODULE_LICENSE("GPL");
diff --git a/drivers/clk/mediatek/clk-mt6779-vdec.c b/drivers/clk/mediatek/clk-mt6779-vdec.c
index 1900da2586a1..ff7390e4c5f5 100644
--- a/drivers/clk/mediatek/clk-mt6779-vdec.c
+++ b/drivers/clk/mediatek/clk-mt6779-vdec.c
@@ -4,6 +4,7 @@
* Author: Wendell Lin <wendell.lin@mediatek.com>
*/
+#include <linux/module.h>
#include <linux/clk-provider.h>
#include <linux/platform_device.h>
@@ -65,3 +66,4 @@ static struct platform_driver clk_mt6779_vdec_drv = {
};
builtin_platform_driver(clk_mt6779_vdec_drv);
+MODULE_LICENSE("GPL");
diff --git a/drivers/clk/mediatek/clk-mt6779-venc.c b/drivers/clk/mediatek/clk-mt6779-venc.c
index b41d1f859edc..489bf64346e3 100644
--- a/drivers/clk/mediatek/clk-mt6779-venc.c
+++ b/drivers/clk/mediatek/clk-mt6779-venc.c
@@ -4,6 +4,7 @@
* Author: Wendell Lin <wendell.lin@mediatek.com>
*/
+#include <linux/module.h>
#include <linux/clk-provider.h>
#include <linux/platform_device.h>
@@ -56,3 +57,4 @@ static struct platform_driver clk_mt6779_venc_drv = {
};
builtin_platform_driver(clk_mt6779_venc_drv);
+MODULE_LICENSE("GPL");
diff --git a/drivers/clk/mediatek/clk-mt6779.c b/drivers/clk/mediatek/clk-mt6779.c
index 6e0d3a166729..9825385c9f94 100644
--- a/drivers/clk/mediatek/clk-mt6779.c
+++ b/drivers/clk/mediatek/clk-mt6779.c
@@ -4,6 +4,7 @@
* Author: Wendell Lin <wendell.lin@mediatek.com>
*/
+#include <linux/module.h>
#include <linux/of.h>
#include <linux/of_address.h>
#include <linux/of_device.h>
@@ -1314,3 +1315,4 @@ static int __init clk_mt6779_init(void)
}
arch_initcall(clk_mt6779_init);
+MODULE_LICENSE("GPL");
--
2.18.0
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [RESEND PATCH 4/4] clk: mediatek: use tristate for COMMON_CLK_MEDAITEK and COMMON_CLK_MT6779
2021-08-13 3:24 [RESEND PATCH 0/4] clk: mediatek: modularize COMMON_CLK_MT6779 Miles Chen
` (2 preceding siblings ...)
2021-08-13 3:24 ` [RESEND PATCH 3/4] clk: mediatek: support COMMON_CLK_MT6779 " Miles Chen
@ 2021-08-13 3:24 ` Miles Chen
3 siblings, 0 replies; 9+ messages in thread
From: Miles Chen @ 2021-08-13 3:24 UTC (permalink / raw)
To: Michael Turquette, Stephen Boyd, Matthias Brugger
Cc: Wendell Lin, Hanks Chen, linux-clk, linux-kernel,
linux-arm-kernel, linux-mediatek, wsd_upstream, Miles Chen,
Lee Jones
Now we have all necessary exported symbols, change
COMMON_CLK_MEDAITEK and COMMON_CLK_MT6779* to tristate.
Cc: Stephen Boyd <sboyd@kernel.org>
Cc: Hanks Chen <hanks.chen@mediatek.com>
Cc: Wendell Lin <wendell.lin@mediatek.com>
Cc: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Miles Chen <miles.chen@mediatek.com>
---
drivers/clk/mediatek/Kconfig | 20 ++++++++++----------
1 file changed, 10 insertions(+), 10 deletions(-)
diff --git a/drivers/clk/mediatek/Kconfig b/drivers/clk/mediatek/Kconfig
index 886e2d9fced5..62ed2054a849 100644
--- a/drivers/clk/mediatek/Kconfig
+++ b/drivers/clk/mediatek/Kconfig
@@ -6,7 +6,7 @@ menu "Clock driver for MediaTek SoC"
depends on ARCH_MEDIATEK || COMPILE_TEST
config COMMON_CLK_MEDIATEK
- bool
+ tristate
select RESET_CONTROLLER
help
MediaTek SoCs' clock support.
@@ -204,7 +204,7 @@ config COMMON_CLK_MT6765_MIPI2BSYS
This driver supports MediaTek MT6765 mipi2bsys clocks.
config COMMON_CLK_MT6779
- bool "Clock driver for MediaTek MT6779"
+ tristate "Clock driver for MediaTek MT6779"
depends on (ARCH_MEDIATEK && ARM64) || COMPILE_TEST
select COMMON_CLK_MEDIATEK
default ARCH_MEDIATEK && ARM64
@@ -212,49 +212,49 @@ config COMMON_CLK_MT6779
This driver supports MediaTek MT6779 basic clocks.
config COMMON_CLK_MT6779_MMSYS
- bool "Clock driver for MediaTek MT6779 mmsys"
+ tristate "Clock driver for MediaTek MT6779 mmsys"
depends on COMMON_CLK_MT6779
help
This driver supports MediaTek MT6779 mmsys clocks.
config COMMON_CLK_MT6779_IMGSYS
- bool "Clock driver for MediaTek MT6779 imgsys"
+ tristate "Clock driver for MediaTek MT6779 imgsys"
depends on COMMON_CLK_MT6779
help
This driver supports MediaTek MT6779 imgsys clocks.
config COMMON_CLK_MT6779_IPESYS
- bool "Clock driver for MediaTek MT6779 ipesys"
+ tristate "Clock driver for MediaTek MT6779 ipesys"
depends on COMMON_CLK_MT6779
help
This driver supports MediaTek MT6779 ipesys clocks.
config COMMON_CLK_MT6779_CAMSYS
- bool "Clock driver for MediaTek MT6779 camsys"
+ tristate "Clock driver for MediaTek MT6779 camsys"
depends on COMMON_CLK_MT6779
help
This driver supports MediaTek MT6779 camsys clocks.
config COMMON_CLK_MT6779_VDECSYS
- bool "Clock driver for MediaTek MT6779 vdecsys"
+ tristate "Clock driver for MediaTek MT6779 vdecsys"
depends on COMMON_CLK_MT6779
help
This driver supports MediaTek MT6779 vdecsys clocks.
config COMMON_CLK_MT6779_VENCSYS
- bool "Clock driver for MediaTek MT6779 vencsys"
+ tristate "Clock driver for MediaTek MT6779 vencsys"
depends on COMMON_CLK_MT6779
help
This driver supports MediaTek MT6779 vencsys clocks.
config COMMON_CLK_MT6779_MFGCFG
- bool "Clock driver for MediaTek MT6779 mfgcfg"
+ tristate "Clock driver for MediaTek MT6779 mfgcfg"
depends on COMMON_CLK_MT6779
help
This driver supports MediaTek MT6779 mfgcfg clocks.
config COMMON_CLK_MT6779_AUDSYS
- bool "Clock driver for Mediatek MT6779 audsys"
+ tristate "Clock driver for Mediatek MT6779 audsys"
depends on COMMON_CLK_MT6779
help
This driver supports Mediatek MT6779 audsys clocks.
--
2.18.0
^ permalink raw reply related [flat|nested] 9+ messages in thread
* Re: [RESEND PATCH 3/4] clk: mediatek: support COMMON_CLK_MT6779 module build
2021-08-13 3:24 ` [RESEND PATCH 3/4] clk: mediatek: support COMMON_CLK_MT6779 " Miles Chen
@ 2021-08-29 4:14 ` Stephen Boyd
2021-08-30 18:43 ` Miles Chen
0 siblings, 1 reply; 9+ messages in thread
From: Stephen Boyd @ 2021-08-29 4:14 UTC (permalink / raw)
To: Matthias Brugger, Michael Turquette, Miles Chen
Cc: Wendell Lin, Hanks Chen, linux-clk, linux-kernel,
linux-arm-kernel, linux-mediatek, wsd_upstream, Miles Chen,
Lee Jones
Quoting Miles Chen (2021-08-12 20:24:28)
> diff --git a/drivers/clk/mediatek/clk-mt6779-aud.c b/drivers/clk/mediatek/clk-mt6779-aud.c
> index 11b209f95e25..439c0bc94b73 100644
> --- a/drivers/clk/mediatek/clk-mt6779-aud.c
> +++ b/drivers/clk/mediatek/clk-mt6779-aud.c
> @@ -4,6 +4,7 @@
> * Author: Wendell Lin <wendell.lin@mediatek.com>
> */
>
> +#include <linux/module.h>
> #include <linux/clk-provider.h>
> #include <linux/of.h>
> #include <linux/of_address.h>
> @@ -115,3 +116,4 @@ static struct platform_driver clk_mt6779_aud_drv = {
> };
>
> builtin_platform_driver(clk_mt6779_aud_drv);
> +MODULE_LICENSE("GPL");
How does this work? builtin_platform_driver() means that it's not
modular code. Shouldn't that be module_platform_driver()? Have you tried
loading and unloading the module?
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [RESEND PATCH 3/4] clk: mediatek: support COMMON_CLK_MT6779 module build
2021-08-29 4:14 ` Stephen Boyd
@ 2021-08-30 18:43 ` Miles Chen
2021-09-01 5:32 ` Stephen Boyd
0 siblings, 1 reply; 9+ messages in thread
From: Miles Chen @ 2021-08-30 18:43 UTC (permalink / raw)
To: Stephen Boyd
Cc: Matthias Brugger, Michael Turquette, Wendell Lin, Hanks Chen,
linux-clk, linux-kernel, linux-arm-kernel, linux-mediatek,
wsd_upstream, Lee Jones
On Sat, 2021-08-28 at 21:14 -0700, Stephen Boyd wrote:
> Quoting Miles Chen (2021-08-12 20:24:28)
> > diff --git a/drivers/clk/mediatek/clk-mt6779-aud.c b/drivers/clk/mediatek/clk-mt6779-aud.c
> > index 11b209f95e25..439c0bc94b73 100644
> > --- a/drivers/clk/mediatek/clk-mt6779-aud.c
> > +++ b/drivers/clk/mediatek/clk-mt6779-aud.c
> > @@ -4,6 +4,7 @@
> > * Author: Wendell Lin <wendell.lin@mediatek.com>
> > */
> >
> > +#include <linux/module.h>
> > #include <linux/clk-provider.h>
> > #include <linux/of.h>
> > #include <linux/of_address.h>
> > @@ -115,3 +116,4 @@ static struct platform_driver clk_mt6779_aud_drv = {
> > };
> >
> > builtin_platform_driver(clk_mt6779_aud_drv);
> > +MODULE_LICENSE("GPL");
>
> How does this work? builtin_platform_driver() means that it's not
> modular code. Shouldn't that be module_platform_driver()? Have you tried
> loading and unloading the module?
sorry for my late response.
Thanks for pointing this out. I have the same question when I was
building this patch. That time I found some examples where
they are using builtin_platform_driver and can be built as
kernel modules:
config CLK_IMX8QXP (tristate) && drivers/clk/imx/clk-imx8qxp-lpcg.c
config CLK_RK3399 (tristate) && drivers/clk/rockchip/clk-rk3399.c
my load test:
load these moduless and do 'lsmod' on v5.14-rc1/mt6779 environment:
clk_mt6779_aud 16384 0 [permanent], Live 0xffff800008fd8000
clk_mt6779_mfg 16384 0 [permanent], Live 0xffff800008fd0000
clk_mt6779_venc 16384 0 [permanent], Live 0xffff800008fc8000
clk_mt6779_vdec 16384 0 [permanent], Live 0xffff800008fc0000
clk_mt6779_cam 16384 0 [permanent], Live 0xffff800008fb8000
clk_mt6779_ipe 16384 0 [permanent], Live 0xffff800008fb0000
clk_mt6779_img 16384 0 [permanent], Live 0xffff800008fa8000
clk_mt6779_mm 16384 0 [permanent], Live 0xffff800008fa0000
I did not test 'unload' kernel modules because I did not
define module_exit in this patch.
But as you pointed out, it should be module_platform_driver().
I will use module_platform_driver() in the next patch.
Miles
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [RESEND PATCH 3/4] clk: mediatek: support COMMON_CLK_MT6779 module build
2021-08-30 18:43 ` Miles Chen
@ 2021-09-01 5:32 ` Stephen Boyd
2021-09-01 22:04 ` Miles Chen
0 siblings, 1 reply; 9+ messages in thread
From: Stephen Boyd @ 2021-09-01 5:32 UTC (permalink / raw)
To: Miles Chen
Cc: Matthias Brugger, Michael Turquette, Wendell Lin, Hanks Chen,
linux-clk, linux-kernel, linux-arm-kernel, linux-mediatek,
wsd_upstream, Lee Jones
Quoting Miles Chen (2021-08-30 11:43:04)
>
> sorry for my late response.
>
> Thanks for pointing this out. I have the same question when I was
> building this patch. That time I found some examples where
> they are using builtin_platform_driver and can be built as
> kernel modules:
>
> config CLK_IMX8QXP (tristate) && drivers/clk/imx/clk-imx8qxp-lpcg.c
> config CLK_RK3399 (tristate) && drivers/clk/rockchip/clk-rk3399.c
We should fix those drivers. Care to send a patch?
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [RESEND PATCH 3/4] clk: mediatek: support COMMON_CLK_MT6779 module build
2021-09-01 5:32 ` Stephen Boyd
@ 2021-09-01 22:04 ` Miles Chen
0 siblings, 0 replies; 9+ messages in thread
From: Miles Chen @ 2021-09-01 22:04 UTC (permalink / raw)
To: Stephen Boyd
Cc: Matthias Brugger, Michael Turquette, Wendell Lin, Hanks Chen,
linux-clk, linux-kernel, linux-arm-kernel, linux-mediatek,
wsd_upstream, Lee Jones
On Tue, 2021-08-31 at 22:32 -0700, Stephen Boyd wrote:
> Quoting Miles Chen (2021-08-30 11:43:04)
> >
> > sorry for my late response.
> >
> > Thanks for pointing this out. I have the same question when I was
> > building this patch. That time I found some examples where
> > they are using builtin_platform_driver and can be built as
> > kernel modules:
> >
> > config CLK_IMX8QXP (tristate) && drivers/clk/imx/clk-imx8qxp-lpcg.c
> > config CLK_RK3399 (tristate) && drivers/clk/rockchip/clk-rk3399.c
>
> We should fix those drivers. Care to send a patch?
No problem. I will check drviers/clk and submit fix patches.
Miles
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2021-09-01 22:04 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-13 3:24 [RESEND PATCH 0/4] clk: mediatek: modularize COMMON_CLK_MT6779 Miles Chen
2021-08-13 3:24 ` [RESEND PATCH 1/4] clk: composite: export clk_register_composite Miles Chen
2021-08-13 3:24 ` [RESEND PATCH 2/4] clk: mediatek: support COMMON_CLK_MEDIATEK module build Miles Chen
2021-08-13 3:24 ` [RESEND PATCH 3/4] clk: mediatek: support COMMON_CLK_MT6779 " Miles Chen
2021-08-29 4:14 ` Stephen Boyd
2021-08-30 18:43 ` Miles Chen
2021-09-01 5:32 ` Stephen Boyd
2021-09-01 22:04 ` Miles Chen
2021-08-13 3:24 ` [RESEND PATCH 4/4] clk: mediatek: use tristate for COMMON_CLK_MEDAITEK and COMMON_CLK_MT6779 Miles Chen
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).