clk: meson: enable building as modules
Kevin Hilman
maintainerPATCH 1/1 clk: meson: enable building as modules
Make it possible to build all clk drivers as modules, but default remains built-in.
No functional changes.
---
Depends on series adding new API to get clk consumer from clk_hw:
https://lore.kernel.org/linux-amlogic/[email protected]/
drivers/clk/meson/Kconfig | 7 ++++--- drivers/clk/meson/axg-aoclk.c | 5 ++++- drivers/clk/meson/axg.c | 5 ++++- drivers/clk/meson/g12a-aoclk.c | 5 ++++- drivers/clk/meson/g12a.c | 5 ++++- drivers/clk/meson/gxbb-aoclk.c | 5 ++++- drivers/clk/meson/gxbb.c | 5 ++++- drivers/clk/meson/meson-aoclk.c | 4 ++++ drivers/clk/meson/meson-eeclk.c | 3 +++ 9 files changed, 35 insertions(+), 9 deletions(-)
drivers/clk/meson/Kconfig +4 -3
@@ -58,7 +58,7 @@ config COMMON_CLK_MESON8B want peripherals and CPU frequency scaling to work. config COMMON_CLK_GXBB - bool "GXBB and GXL SoC clock controllers support" + tristate "GXBB and GXL SoC clock controllers support" depends on ARM64 default y select COMMON_CLK_MESON_REGMAP
@@ -74,7 +74,7 @@ config COMMON_CLK_GXBB Say Y if you want peripherals and CPU frequency scaling to work. config COMMON_CLK_AXG - bool "AXG SoC clock controllers support" + tristate "AXG SoC clock controllers support" depends on ARM64 default y select COMMON_CLK_MESON_REGMAP
@@ -100,7 +100,7 @@ config COMMON_CLK_AXG_AUDIO aka axg, Say Y if you want audio subsystem to work. config COMMON_CLK_G12A - bool "G12 and SM1 SoC clock controllers support" + tristate "G12 and SM1 SoC clock controllers support" depends on ARM64 default y select COMMON_CLK_MESON_REGMAP
@@ -110,6 +110,7 @@ config COMMON_CLK_G12A select COMMON_CLK_MESON_AO_CLKC select COMMON_CLK_MESON_EE_CLKC select COMMON_CLK_MESON_CPU_DYNDIV + select COMMON_CLK_MESON_VID_PLL_DIV select MFD_SYSCON help Support for the clock controller on Amlogic S905D2, S905X2 and S905Y2
drivers/clk/meson/axg-aoclk.c +4 -1
@@ -12,6 +12,7 @@#include <linux/platform_device.h> #include <linux/reset-controller.h> #include <linux/mfd/syscon.h> +#include <linux/module.h> #include "meson-aoclk.h" #include "axg-aoclk.h"
@@ -326,6 +327,7 @@ static const struct of_device_id axg_aoclkc_match_table[] = { }, { } }; +MODULE_DEVICE_TABLE (of, axg_aoclkc_match_table);static struct platform_driver axg_aoclkc_driver = { .probe = meson_aoclkc_probe,
@@ -335,4 +337,5 @@ static struct platform_driver axg_aoclkc_driver = { }, }; -builtin_platform_driver (axg_aoclkc_driver); +module_platform_driver (axg_aoclkc_driver); +MODULE_LICENSE ("GPL v2" );
drivers/clk/meson/axg.c +4 -1
@@ -13,6 +13,7 @@#include <linux/init.h> #include <linux/of_device.h> #include <linux/platform_device.h> +#include <linux/module.h> #include "clk-regmap.h" #include "clk-pll.h"
@@ -1354,6 +1355,7 @@ static const struct of_device_id clkc_match_table[] = { { .compatible = "amlogic,axg-clkc", .data = &axg_clkc_data }, {} }; +MODULE_DEVICE_TABLE (of, clkc_match_table);static struct platform_driver axg_driver = { .probe = meson_eeclkc_probe,
@@ -1363,4 +1365,5 @@ static struct platform_driver axg_driver = { }, }; -builtin_platform_driver (axg_driver); +module_platform_driver (axg_driver); +MODULE_LICENSE ("GPL v2" );
drivers/clk/meson/g12a-aoclk.c +4 -1
@@ -12,6 +12,7 @@#include <linux/platform_device.h> #include <linux/reset-controller.h> #include <linux/mfd/syscon.h> +#include <linux/module.h> #include "meson-aoclk.h" #include "g12a-aoclk.h"
@@ -461,6 +462,7 @@ static const struct of_device_id g12a_aoclkc_match_table[] = { }, { } }; +MODULE_DEVICE_TABLE (of, g12a_aoclkc_match_table);static struct platform_driver g12a_aoclkc_driver = { .probe = meson_aoclkc_probe,
@@ -470,4 +472,5 @@ static struct platform_driver g12a_aoclkc_driver = { }, }; -builtin_platform_driver (g12a_aoclkc_driver); +module_platform_driver (g12a_aoclkc_driver); +MODULE_LICENSE ("GPL v2" );
drivers/clk/meson/g12a.c +4 -1
@@ -15,6 +15,7 @@#include <linux/of_device.h> #include <linux/platform_device.h> #include <linux/clk.h> +#include <linux/module.h> #include "clk-mpll.h" #include "clk-pll.h"
@@ -5370,6 +5371,7 @@ static const struct of_device_id clkc_match_table[] = { }, {} }; +MODULE_DEVICE_TABLE (of, clkc_match_table);static struct platform_driver g12a_driver = { .probe = meson_g12a_probe,
@@ -5379,4 +5381,5 @@ static struct platform_driver g12a_driver = { }, }; -builtin_platform_driver (g12a_driver); +module_platform_driver (g12a_driver); +MODULE_LICENSE ("GPL v2" );
drivers/clk/meson/gxbb-aoclk.c +4 -1
@@ -5,6 +5,7 @@*/ #include <linux/platform_device.h> #include <linux/mfd/syscon.h> +#include <linux/module.h> #include "meson-aoclk.h" #include "gxbb-aoclk.h"
@@ -287,6 +288,7 @@ static const struct of_device_id gxbb_aoclkc_match_table[] = { }, { } }; +MODULE_DEVICE_TABLE (of, gxbb_aoclkc_match_table);static struct platform_driver gxbb_aoclkc_driver = { .probe = meson_aoclkc_probe,
@@ -295,4 +297,5 @@ static struct platform_driver gxbb_aoclkc_driver = { .of_match_table = gxbb_aoclkc_match_table, }, }; -builtin_platform_driver (gxbb_aoclkc_driver); +module_platform_driver (gxbb_aoclkc_driver); +MODULE_LICENSE ("GPL v2" );
drivers/clk/meson/gxbb.c +4 -1
@@ -8,6 +8,7 @@#include <linux/init.h> #include <linux/of_device.h> #include <linux/platform_device.h> +#include <linux/module.h> #include "gxbb.h" #include "clk-regmap.h"
@@ -3519,6 +3520,7 @@ static const struct of_device_id clkc_match_table[] = { { .compatible = "amlogic,gxl-clkc", .data = &gxl_clkc_data }, {}, }; +MODULE_DEVICE_TABLE (of, clkc_match_table);static struct platform_driver gxbb_driver = { .probe = meson_eeclkc_probe,
@@ -3528,4 +3530,5 @@ static struct platform_driver gxbb_driver = { }, }; -builtin_platform_driver (gxbb_driver); +module_platform_driver (gxbb_driver); +MODULE_LICENSE ("GPL v2" );
drivers/clk/meson/meson-aoclk.c +4 -0
@@ -14,6 +14,8 @@#include <linux/reset-controller.h> #include <linux/mfd/syscon.h> #include <linux/of_device.h> +#include <linux/module.h> +#include <linux/slab.h> #include "meson-aoclk.h"
@@ -84,3 +86,5 @@ int meson_aoclkc_probe(struct platform_device *pdev)return devm_of_clk_add_hw_provider (dev, of_clk_hw_onecell_get, (void *) data->hw_data); } +EXPORT_SYMBOL_GPL (meson_aoclkc_probe); +MODULE_LICENSE ("GPL v2" );
drivers/clk/meson/meson-eeclk.c +3 -0
@@ -9,6 +9,7 @@#include <linux/platform_device.h> #include <linux/mfd/syscon.h> #include <linux/regmap.h> +#include <linux/module.h> #include "clk-regmap.h" #include "meson-eeclk.h"
@@ -54,3 +55,5 @@ int meson_eeclkc_probe(struct platform_device *pdev)return devm_of_clk_add_hw_provider (dev, of_clk_hw_onecell_get, data->hw_onecell_data); } +EXPORT_SYMBOL_GPL (meson_eeclkc_probe); +MODULE_LICENSE ("GPL v2" );
Signature · 1 line
2.28.0
Jerome Brunet
maintainerQuoted 9 lines · Kevin Hilman
Make it possible to build all clk drivers as modules, but default remains built-in.
No functional changes.
Signed-off-by Kevin Hilman <[email protected]>---
Depends on series adding new API to get clk consumer fromclk_hw:
https://lore.kernel.org/linux-amlogic/[email protected]/
and
https://lore.kernel.org/r/[email protected]
Once these notifier allocations are dealt with, I'm happy to take this.
One minor details though ...
Quoted 44 lines
drivers/clk/meson/Kconfig | 7 ++++--- drivers/clk/meson/axg-aoclk.c | 5 ++++- drivers/clk/meson/axg.c | 5 ++++- drivers/clk/meson/g12a-aoclk.c | 5 ++++- drivers/clk/meson/g12a.c | 5 ++++- drivers/clk/meson/gxbb-aoclk.c | 5 ++++- drivers/clk/meson/gxbb.c | 5 ++++- drivers/clk/meson/meson-aoclk.c | 4 ++++ drivers/clk/meson/meson-eeclk.c | 3 +++ 9 files changed, 35 insertions(+), 9 deletions(-)drivers/clk/meson/Kconfig +3
-3@@ -58,7 +58,7 @@ config COMMON_CLK_MESON8B want peripherals and CPU frequency scaling to work. config COMMON_CLK_GXBB - bool "GXBB and GXL SoC clock controllers support" + tristate "GXBB and GXL SoC clock controllers support" depends on ARM64 default y select COMMON_CLK_MESON_REGMAP@@ -74,7 +74,7 @@ config COMMON_CLK_GXBB Say Y if you want peripherals and CPU frequency scaling to work. config COMMON_CLK_AXG - bool "AXG SoC clock controllers support" + tristate "AXG SoC clock controllers support" depends on ARM64 default y select COMMON_CLK_MESON_REGMAP@@ -100,7 +100,7 @@ config COMMON_CLK_AXG_AUDIO aka axg, Say Y if you want audio subsystem to work. config COMMON_CLK_G12A - bool "G12 and SM1 SoC clock controllers support" + tristate "G12 and SM1 SoC clock controllers support" depends on ARM64 default y select COMMON_CLK_MESON_REGMAP
drivers/clk/meson/Kconfig config COMMON_CLK_G12A · line 113
Quoted 4 lines
drivers/clk/meson/Kconfig +1
-0@@ -110,6 +110,7 @@ config COMMON_CLK_G12A select COMMON_CLK_MESON_AO_CLKC select COMMON_CLK_MESON_EE_CLKC select COMMON_CLK_MESON_CPU_DYNDIV + select COMMON_CLK_MESON_VID_PLL_DIV
This looks like a fix which could be sent separately with a fix tag, doesn't it ?
Quoted 202 lines
drivers/clk/meson/Kconfig +0
-0select MFD_SYSCON help Support for the clock controller on Amlogic S905D2, S905X2 and S905Y2drivers/clk/meson/axg-aoclk.c +4
-1@@ -12,6 +12,7 @@#include <linux/platform_device.h> #include <linux/reset-controller.h> #include <linux/mfd/syscon.h> +#include <linux/module.h> #include "meson-aoclk.h" #include "axg-aoclk.h" @@ -326,6 +327,7 @@ static const struct of_device_id axg_aoclkc_match_table[] = { }, { } }; +MODULE_DEVICE_TABLE (of, axg_aoclkc_match_table);static struct platform_driver axg_aoclkc_driver = { .probe = meson_aoclkc_probe,@@ -335,4 +337,5 @@ static struct platform_driver axg_aoclkc_driver = { }, }; -builtin_platform_driver (axg_aoclkc_driver); +module_platform_driver (axg_aoclkc_driver); +MODULE_LICENSE ("GPL v2" );drivers/clk/meson/axg.c +4
-1@@ -13,6 +13,7 @@#include <linux/init.h> #include <linux/of_device.h> #include <linux/platform_device.h> +#include <linux/module.h> #include "clk-regmap.h" #include "clk-pll.h" @@ -1354,6 +1355,7 @@ static const struct of_device_id clkc_match_table[] = { { .compatible = "amlogic,axg-clkc", .data = &axg_clkc_data }, {} }; +MODULE_DEVICE_TABLE (of, clkc_match_table);static struct platform_driver axg_driver = { .probe = meson_eeclkc_probe,@@ -1363,4 +1365,5 @@ static struct platform_driver axg_driver = { }, }; -builtin_platform_driver (axg_driver); +module_platform_driver (axg_driver); +MODULE_LICENSE ("GPL v2" );drivers/clk/meson/g12a-aoclk.c +4
-1@@ -12,6 +12,7 @@#include <linux/platform_device.h> #include <linux/reset-controller.h> #include <linux/mfd/syscon.h> +#include <linux/module.h> #include "meson-aoclk.h" #include "g12a-aoclk.h" @@ -461,6 +462,7 @@ static const struct of_device_id g12a_aoclkc_match_table[] = { }, { } }; +MODULE_DEVICE_TABLE (of, g12a_aoclkc_match_table);static struct platform_driver g12a_aoclkc_driver = { .probe = meson_aoclkc_probe,@@ -470,4 +472,5 @@ static struct platform_driver g12a_aoclkc_driver = { }, }; -builtin_platform_driver (g12a_aoclkc_driver); +module_platform_driver (g12a_aoclkc_driver); +MODULE_LICENSE ("GPL v2" );drivers/clk/meson/g12a.c +4
-1@@ -15,6 +15,7 @@#include <linux/of_device.h> #include <linux/platform_device.h> #include <linux/clk.h> +#include <linux/module.h> #include "clk-mpll.h" #include "clk-pll.h" @@ -5370,6 +5371,7 @@ static const struct of_device_id clkc_match_table[] = { }, {} }; +MODULE_DEVICE_TABLE (of, clkc_match_table);static struct platform_driver g12a_driver = { .probe = meson_g12a_probe,@@ -5379,4 +5381,5 @@ static struct platform_driver g12a_driver = { }, }; -builtin_platform_driver (g12a_driver); +module_platform_driver (g12a_driver); +MODULE_LICENSE ("GPL v2" );drivers/clk/meson/gxbb-aoclk.c +4
-1@@ -5,6 +5,7 @@*/ #include <linux/platform_device.h> #include <linux/mfd/syscon.h> +#include <linux/module.h> #include "meson-aoclk.h" #include "gxbb-aoclk.h" @@ -287,6 +288,7 @@ static const struct of_device_id gxbb_aoclkc_match_table[] = { }, { } }; +MODULE_DEVICE_TABLE (of, gxbb_aoclkc_match_table);static struct platform_driver gxbb_aoclkc_driver = { .probe = meson_aoclkc_probe,@@ -295,4 +297,5 @@ static struct platform_driver gxbb_aoclkc_driver = { .of_match_table = gxbb_aoclkc_match_table, }, }; -builtin_platform_driver (gxbb_aoclkc_driver); +module_platform_driver (gxbb_aoclkc_driver); +MODULE_LICENSE ("GPL v2" );drivers/clk/meson/gxbb.c +4
-1@@ -8,6 +8,7 @@#include <linux/init.h> #include <linux/of_device.h> #include <linux/platform_device.h> +#include <linux/module.h> #include "gxbb.h" #include "clk-regmap.h" @@ -3519,6 +3520,7 @@ static const struct of_device_id clkc_match_table[] = { { .compatible = "amlogic,gxl-clkc", .data = &gxl_clkc_data }, {}, }; +MODULE_DEVICE_TABLE (of, clkc_match_table);static struct platform_driver gxbb_driver = { .probe = meson_eeclkc_probe,@@ -3528,4 +3530,5 @@ static struct platform_driver gxbb_driver = { }, }; -builtin_platform_driver (gxbb_driver); +module_platform_driver (gxbb_driver); +MODULE_LICENSE ("GPL v2" );drivers/clk/meson/meson-aoclk.c +4
-0@@ -14,6 +14,8 @@#include <linux/reset-controller.h> #include <linux/mfd/syscon.h> #include <linux/of_device.h> +#include <linux/module.h> +#include <linux/slab.h> #include "meson-aoclk.h" @@ -84,3 +86,5 @@ int meson_aoclkc_probe(struct platform_device *pdev)return devm_of_clk_add_hw_provider (dev, of_clk_hw_onecell_get, (void *) data->hw_data); } +EXPORT_SYMBOL_GPL (meson_aoclkc_probe); +MODULE_LICENSE ("GPL v2" );drivers/clk/meson/meson-eeclk.c +3
-0@@ -9,6 +9,7 @@#include <linux/platform_device.h> #include <linux/mfd/syscon.h> #include <linux/regmap.h> +#include <linux/module.h> #include "clk-regmap.h" #include "meson-eeclk.h" @@ -54,3 +55,5 @@ int meson_eeclkc_probe(struct platform_device *pdev)return devm_of_clk_add_hw_provider (dev, of_clk_hw_onecell_get, data->hw_onecell_data); } +EXPORT_SYMBOL_GPL (meson_eeclkc_probe); +MODULE_LICENSE ("GPL v2" );
Quoting Kevin Hilman (2020-11-09 15:36:22)
Quoted 7 lines
Make it possible to build all clk drivers as modules, but default remains built-in.
No functional changes.
Signed-off-by Kevin Hilman <[email protected]>---
Kevin Hilman
maintainerQuoted 19 lines · Jerome Brunet
Quoted 9 lines · Kevin Hilman
Make it possible to build all clk drivers as modules, but default remains built-in.
No functional changes.
Signed-off-by Kevin Hilman <[email protected]>---
Depends on series adding new API to get clk consumer fromclk_hw:
https://lore.kernel.org/linux-amlogic/[email protected]/and
https://lore.kernel.org/r/[email protected]
Once these notifier allocations are dealt with, I'm happy to take this.
One minor details though ...
[...]
Quoted 6 lines
Quoted 6 lines
config
COMMON_CLK_G12Adrivers/clk/meson/Kconfig +1
-1- bool "G12 and SM1 SoC clock controllers support" + tristate "G12 and SM1 SoC clock controllers support" depends on ARM64 default y select COMMON_CLK_MESON_REGMAP
Quoted 8 lines
drivers/clk/meson/Kconfig config COMMON_CLK_G12A · line 113
Quoted 5 lines
drivers/clk/meson/Kconfig +1
-0@@ -110,6 +110,7 @@ config COMMON_CLK_G12A select COMMON_CLK_MESON_AO_CLKC select COMMON_CLK_MESON_EE_CLKC select COMMON_CLK_MESON_CPU_DYNDIV + select COMMON_CLK_MESON_VID_PLL_DIVThis looks like a fix which could be sent separately with a fix tag, doesn't it ?
Ah, yes. This is a fix which should be sent separately. I'll split it out and resend.
Thanks for the review,
Kevin