From: Daniel Golle <daniel@makrotopia.org>
To: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Cc: mturquette@baylibre.com, sboyd@kernel.org,
matthias.bgg@gmail.com, wenst@chromium.org,
johnson.wang@mediatek.com, miles.chen@mediatek.com,
chun-jie.chen@mediatek.com, fparent@baylibre.com,
msp@baylibre.com, nfraprado@collabora.com,
rex-bc.chen@mediatek.com, zhaojh329@gmail.com,
sam.shih@mediatek.com, edward-jw.yang@mediatek.com,
yangyingliang@huawei.com, granquet@baylibre.com,
pablo.sun@mediatek.com, sean.wang@mediatek.com,
chen.zhong@mediatek.com, linux-kernel@vger.kernel.org,
linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
linux-mediatek@lists.infradead.org
Subject: Re: [PATCH v5 34/54] clk: mediatek: mt7986-eth: Migrate to common probe mechanism
Date: Wed, 22 Feb 2023 18:02:40 +0000 [thread overview]
Message-ID: <Y/ZYwOoHhO0328qY@makrotopia.org> (raw)
In-Reply-To: <20230222092543.19187-35-angelogioacchino.delregno@collabora.com>
On Wed, Feb 22, 2023 at 10:25:23AM +0100, AngeloGioacchino Del Regno wrote:
> Convert this driver to use the common mtk_clk_simple_probe() mechanism.
> While at it, also remove __initconst annotations (as these structures
> are used also at runtime).
>
> Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
> Reviewed-by: Chen-Yu Tsai <wenst@chromium.org>
Tested-by: Daniel Golle <daniel@makrotopia.org>
(on BananaPi BPi-R3)
> ---
> drivers/clk/mediatek/clk-mt7986-eth.c | 83 +++++++++++----------------
> 1 file changed, 32 insertions(+), 51 deletions(-)
>
> diff --git a/drivers/clk/mediatek/clk-mt7986-eth.c b/drivers/clk/mediatek/clk-mt7986-eth.c
> index e04bc6845ea6..138ba0a47221 100644
> --- a/drivers/clk/mediatek/clk-mt7986-eth.c
> +++ b/drivers/clk/mediatek/clk-mt7986-eth.c
> @@ -25,7 +25,7 @@ static const struct mtk_gate_regs sgmii0_cg_regs = {
> #define GATE_SGMII0(_id, _name, _parent, _shift) \
> GATE_MTK(_id, _name, _parent, &sgmii0_cg_regs, _shift, &mtk_clk_gate_ops_no_setclr_inv)
>
> -static const struct mtk_gate sgmii0_clks[] __initconst = {
> +static const struct mtk_gate sgmii0_clks[] = {
> GATE_SGMII0(CLK_SGMII0_TX250M_EN, "sgmii0_tx250m_en", "top_xtal", 2),
> GATE_SGMII0(CLK_SGMII0_RX250M_EN, "sgmii0_rx250m_en", "top_xtal", 3),
> GATE_SGMII0(CLK_SGMII0_CDR_REF, "sgmii0_cdr_ref", "top_xtal", 4),
> @@ -41,7 +41,7 @@ static const struct mtk_gate_regs sgmii1_cg_regs = {
> #define GATE_SGMII1(_id, _name, _parent, _shift) \
> GATE_MTK(_id, _name, _parent, &sgmii1_cg_regs, _shift, &mtk_clk_gate_ops_no_setclr_inv)
>
> -static const struct mtk_gate sgmii1_clks[] __initconst = {
> +static const struct mtk_gate sgmii1_clks[] = {
> GATE_SGMII1(CLK_SGMII1_TX250M_EN, "sgmii1_tx250m_en", "top_xtal", 2),
> GATE_SGMII1(CLK_SGMII1_RX250M_EN, "sgmii1_rx250m_en", "top_xtal", 3),
> GATE_SGMII1(CLK_SGMII1_CDR_REF, "sgmii1_cdr_ref", "top_xtal", 4),
> @@ -57,7 +57,7 @@ static const struct mtk_gate_regs eth_cg_regs = {
> #define GATE_ETH(_id, _name, _parent, _shift) \
> GATE_MTK(_id, _name, _parent, ð_cg_regs, _shift, &mtk_clk_gate_ops_no_setclr_inv)
>
> -static const struct mtk_gate eth_clks[] __initconst = {
> +static const struct mtk_gate eth_clks[] = {
> GATE_ETH(CLK_ETH_FE_EN, "eth_fe_en", "netsys_2x_sel", 6),
> GATE_ETH(CLK_ETH_GP2_EN, "eth_gp2_en", "sgm_325m_sel", 7),
> GATE_ETH(CLK_ETH_GP1_EN, "eth_gp1_en", "sgm_325m_sel", 8),
> @@ -65,56 +65,37 @@ static const struct mtk_gate eth_clks[] __initconst = {
> GATE_ETH(CLK_ETH_WOCPU0_EN, "eth_wocpu0_en", "netsys_mcu_sel", 15),
> };
>
> -static void __init mtk_sgmiisys_0_init(struct device_node *node)
> -{
> - struct clk_hw_onecell_data *clk_data;
> - int r;
> -
> - clk_data = mtk_alloc_clk_data(ARRAY_SIZE(sgmii0_clks));
> -
> - mtk_clk_register_gates(NULL, node, sgmii0_clks,
> - ARRAY_SIZE(sgmii0_clks), clk_data);
> -
> - r = of_clk_add_hw_provider(node, of_clk_hw_onecell_get, clk_data);
> - if (r)
> - pr_err("%s(): could not register clock provider: %d\n",
> - __func__, r);
> -}
> -CLK_OF_DECLARE(mtk_sgmiisys_0, "mediatek,mt7986-sgmiisys_0",
> - mtk_sgmiisys_0_init);
> -
> -static void __init mtk_sgmiisys_1_init(struct device_node *node)
> -{
> - struct clk_hw_onecell_data *clk_data;
> - int r;
> -
> - clk_data = mtk_alloc_clk_data(ARRAY_SIZE(sgmii1_clks));
> -
> - mtk_clk_register_gates(NULL, node, sgmii1_clks,
> - ARRAY_SIZE(sgmii1_clks), clk_data);
> -
> - r = of_clk_add_hw_provider(node, of_clk_hw_onecell_get, clk_data);
> -
> - if (r)
> - pr_err("%s(): could not register clock provider: %d\n",
> - __func__, r);
> -}
> -CLK_OF_DECLARE(mtk_sgmiisys_1, "mediatek,mt7986-sgmiisys_1",
> - mtk_sgmiisys_1_init);
> +static const struct mtk_clk_desc eth_desc = {
> + .clks = eth_clks,
> + .num_clks = ARRAY_SIZE(eth_clks),
> +};
>
> -static void __init mtk_ethsys_init(struct device_node *node)
> -{
> - struct clk_hw_onecell_data *clk_data;
> - int r;
> +static const struct mtk_clk_desc sgmii0_desc = {
> + .clks = sgmii0_clks,
> + .num_clks = ARRAY_SIZE(sgmii0_clks),
> +};
>
> - clk_data = mtk_alloc_clk_data(ARRAY_SIZE(eth_clks));
> +static const struct mtk_clk_desc sgmii1_desc = {
> + .clks = sgmii1_clks,
> + .num_clks = ARRAY_SIZE(sgmii1_clks),
> +};
>
> - mtk_clk_register_gates(NULL, node, eth_clks, ARRAY_SIZE(eth_clks), clk_data);
> +static const struct of_device_id of_match_clk_mt7986_eth[] = {
> + { .compatible = "mediatek,mt7986-ethsys", .data = ð_desc },
> + { .compatible = "mediatek,mt7986-sgmiisys_0", .data = &sgmii0_desc },
> + { .compatible = "mediatek,mt7986-sgmiisys_1", .data = &sgmii1_desc },
> + { /* sentinel */ }
> +};
>
> - r = of_clk_add_hw_provider(node, of_clk_hw_onecell_get, clk_data);
> +static struct platform_driver clk_mt7986_eth_drv = {
> + .driver = {
> + .name = "clk-mt7986-eth",
> + .of_match_table = of_match_clk_mt7986_eth,
> + },
> + .probe = mtk_clk_simple_probe,
> + .remove = mtk_clk_simple_remove,
> +};
> +module_platform_driver(clk_mt7986_eth_drv);
>
> - if (r)
> - pr_err("%s(): could not register clock provider: %d\n",
> - __func__, r);
> -}
> -CLK_OF_DECLARE(mtk_ethsys, "mediatek,mt7986-ethsys", mtk_ethsys_init);
> +MODULE_DESCRIPTION("MediaTek MT7986 Ethernet clocks driver");
> +MODULE_LICENSE("GPL");
> --
> 2.39.2
>
>
next prev parent reply other threads:[~2023-02-22 18:03 UTC|newest]
Thread overview: 62+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-02-22 9:24 [PATCH v5 00/54] MediaTek clocks: full module build and cleanups AngeloGioacchino Del Regno
2023-02-22 9:24 ` [PATCH v5 01/54] clk: mediatek: clk-mtk: Switch to device_get_match_data() AngeloGioacchino Del Regno
2023-02-22 9:24 ` [PATCH v5 02/54] clk: mediatek: clk-mtk: Introduce clk_mtk_pdev_{probe,remove}() AngeloGioacchino Del Regno
2023-02-22 9:24 ` [PATCH v5 03/54] clk: mediatek: Migrate to mtk_clk_pdev_probe() for multimedia clocks AngeloGioacchino Del Regno
2023-02-22 9:24 ` [PATCH v5 04/54] clk: mediatek: Add divider clocks to mtk_clk_simple_{probe,remove}() AngeloGioacchino Del Regno
2023-02-22 9:24 ` [PATCH v5 05/54] clk: mediatek: mt2712: Migrate topckgen/mcucfg to mtk_clk_simple_probe() AngeloGioacchino Del Regno
2023-02-22 9:24 ` [PATCH v5 06/54] clk: mediatek: mt2712: Compress clock arrays entries to 90 columns AngeloGioacchino Del Regno
2023-02-22 9:24 ` [PATCH v5 07/54] clk: mediatek: mt2712: Add error handling to clk_mt2712_apmixed_probe() AngeloGioacchino Del Regno
2023-02-22 9:24 ` [PATCH v5 08/54] clk: mediatek: mt2712: Move apmixedsys clock driver to its own file AngeloGioacchino Del Regno
2023-02-22 9:24 ` [PATCH v5 09/54] clk: mediatek: mt2712-apmixedsys: Add .remove() callback for module build AngeloGioacchino Del Regno
2023-02-22 9:24 ` [PATCH v5 10/54] clk: mediatek: mt2712: Change to use module_platform_driver macro AngeloGioacchino Del Regno
2023-02-22 9:25 ` [PATCH v5 11/54] clk: mediatek: mt8365: Move apmixedsys clock driver to its own file AngeloGioacchino Del Regno
2023-02-22 9:25 ` [PATCH v5 12/54] clk: mediatek: mt8365: Convert simple_gate to mtk_gate clocks AngeloGioacchino Del Regno
2023-02-22 9:25 ` [PATCH v5 13/54] clk: mediatek: mt8365: Join top_misc_mux_gates and top_misc_muxes arrays AngeloGioacchino Del Regno
2023-02-22 9:25 ` [PATCH v5 14/54] clk: mediatek: mt8365: Convert to mtk_clk_simple_{probe,remove}() AngeloGioacchino Del Regno
2023-02-22 9:25 ` [PATCH v5 15/54] clk: mediatek: mt8167: Compress GATE_TOPx macros AngeloGioacchino Del Regno
2023-02-22 9:25 ` [PATCH v5 16/54] clk: mediatek: mt8167: Move apmixedsys as platform_driver in new file AngeloGioacchino Del Regno
2023-02-22 9:25 ` [PATCH v5 17/54] clk: mediatek: mt8167: Remove __initconst annotation from arrays AngeloGioacchino Del Regno
2023-02-22 9:25 ` [PATCH v5 18/54] clk: mediatek: mt8167: Convert to mtk_clk_simple_{probe,remove}() AngeloGioacchino Del Regno
2023-02-22 9:25 ` [PATCH v5 19/54] clk: mediatek: mt8183: Move apmixedsys clock driver to its own file AngeloGioacchino Del Regno
2023-02-22 9:25 ` [PATCH v5 20/54] clk: mediatek: mt8183: Compress clocks arrays entries where possible AngeloGioacchino Del Regno
2023-02-22 9:25 ` [PATCH v5 21/54] clk: mediatek: mt8183: Convert all remaining clocks to common probe AngeloGioacchino Del Regno
2023-02-22 9:25 ` [PATCH v5 22/54] clk: mediatek: Consistently use GATE_MTK() macro AngeloGioacchino Del Regno
2023-02-22 9:25 ` [PATCH v5 23/54] clk: mediatek: mt7622: Properly use CLK_IS_CRITICAL flag AngeloGioacchino Del Regno
2023-02-22 9:25 ` [PATCH v5 24/54] clk: mediatek: mt7622: Move apmixedsys clock driver to its own file AngeloGioacchino Del Regno
2023-02-22 9:25 ` [PATCH v5 25/54] clk: mediatek: mt7622-apmixedsys: Add .remove() callback for module build AngeloGioacchino Del Regno
2023-02-22 9:25 ` [PATCH v5 26/54] clk: mediatek: mt7622: Move infracfg to clk-mt7622-infracfg.c AngeloGioacchino Del Regno
2023-02-22 9:25 ` [PATCH v5 27/54] clk: mediatek: mt7622: Convert to platform driver and simple probe AngeloGioacchino Del Regno
2023-02-22 9:25 ` [PATCH v5 28/54] clk: mediatek: mt8516: Move apmixedsys clock driver to its own file AngeloGioacchino Del Regno
2023-02-22 9:25 ` [PATCH v5 29/54] clk: mediatek: mt8516: Convert to platform driver and simple probe AngeloGioacchino Del Regno
2023-02-22 9:25 ` [PATCH v5 30/54] clk: mediatek: mt8516: Allow building clock drivers as modules AngeloGioacchino Del Regno
2023-02-22 9:25 ` [PATCH v5 31/54] clk: mediatek: Propagate struct device with mtk_clk_register_dividers() AngeloGioacchino Del Regno
2023-02-22 9:25 ` [PATCH v5 32/54] clk: mediatek: mt7986-apmixed: Use PLL_AO flag to set critical clock AngeloGioacchino Del Regno
2023-02-22 18:03 ` Daniel Golle
2023-02-22 9:25 ` [PATCH v5 33/54] clk: mediatek: mt7986-infracfg: Migrate to common probe mechanism AngeloGioacchino Del Regno
2023-02-22 18:02 ` Daniel Golle
2023-02-22 9:25 ` [PATCH v5 34/54] clk: mediatek: mt7986-eth: " AngeloGioacchino Del Regno
2023-02-22 18:02 ` Daniel Golle [this message]
2023-02-22 9:25 ` [PATCH v5 35/54] clk: mediatek: mt8186-mcu: " AngeloGioacchino Del Regno
2023-02-22 9:25 ` [PATCH v5 36/54] clk: mediatek: Switch to module_platform_driver() where possible AngeloGioacchino Del Regno
2023-02-22 9:25 ` [PATCH v5 37/54] clk: mediatek: Add MODULE_LICENSE() where missing AngeloGioacchino Del Regno
2023-02-22 9:25 ` [PATCH v5 38/54] clk: mediatek: mt2712: Change Kconfig options to allow module build AngeloGioacchino Del Regno
2023-02-22 9:25 ` [PATCH v5 39/54] clk: mediatek: Split MT8195 clock drivers and " AngeloGioacchino Del Regno
2023-02-22 9:25 ` [PATCH v5 40/54] clk: mediatek: Allow building MT8192 non-critical clocks as modules AngeloGioacchino Del Regno
2023-02-22 9:25 ` [PATCH v5 41/54] clk: mediatek: Allow MT7622 clocks to be built " AngeloGioacchino Del Regno
2023-02-22 9:25 ` [PATCH v5 42/54] clk: mediatek: Allow all MT8167 " AngeloGioacchino Del Regno
2023-02-22 9:25 ` [PATCH v5 43/54] clk: mediatek: Allow all MT8183 " AngeloGioacchino Del Regno
2023-02-22 9:25 ` [PATCH v5 44/54] clk: mediatek: Allow building most MT6765 clock drivers " AngeloGioacchino Del Regno
2023-02-22 9:25 ` [PATCH v5 45/54] clk: mediatek: Allow building most MT6797 " AngeloGioacchino Del Regno
2023-02-22 9:25 ` [PATCH v5 46/54] clk: mediatek: Split configuration options for MT8186 clock drivers AngeloGioacchino Del Regno
2023-02-22 9:25 ` [PATCH v5 47/54] clk: mediatek: mt8192: Move apmixedsys clock driver to its own file AngeloGioacchino Del Regno
2023-02-22 9:25 ` [PATCH v5 48/54] clk: mediatek: Kconfig: Allow module build for core mt8192 clocks AngeloGioacchino Del Regno
2023-02-22 9:25 ` [PATCH v5 49/54] clk: mediatek: Add MODULE_DEVICE_TABLE() where appropriate AngeloGioacchino Del Regno
2023-02-23 7:13 ` Miles Chen
2023-02-22 9:25 ` [PATCH v5 50/54] clk: mediatek: mt8135: Move apmixedsys to its own file AngeloGioacchino Del Regno
2023-02-22 9:25 ` [PATCH v5 51/54] clk: mediatek: mt8135: Properly use CLK_IS_CRITICAL flag AngeloGioacchino Del Regno
2023-02-22 9:25 ` [PATCH v5 52/54] clk: mediatek: mt8135-apmixedsys: Convert to platform_driver and module AngeloGioacchino Del Regno
2023-02-22 9:25 ` [PATCH v5 53/54] clk: mediatek: mt8135: Join root_clk_alias and top_divs arrays AngeloGioacchino Del Regno
2023-02-24 7:53 ` Chen-Yu Tsai
2023-02-22 9:25 ` [PATCH v5 54/54] clk: mediatek: mt8135: Convert to simple probe and enable module build AngeloGioacchino Del Regno
2023-02-23 10:15 ` [PATCH v5 00/54] MediaTek clocks: full module build and cleanups Chen-Yu Tsai
2023-03-01 13:19 ` AngeloGioacchino Del Regno
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=Y/ZYwOoHhO0328qY@makrotopia.org \
--to=daniel@makrotopia.org \
--cc=angelogioacchino.delregno@collabora.com \
--cc=chen.zhong@mediatek.com \
--cc=chun-jie.chen@mediatek.com \
--cc=edward-jw.yang@mediatek.com \
--cc=fparent@baylibre.com \
--cc=granquet@baylibre.com \
--cc=johnson.wang@mediatek.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-clk@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mediatek@lists.infradead.org \
--cc=matthias.bgg@gmail.com \
--cc=miles.chen@mediatek.com \
--cc=msp@baylibre.com \
--cc=mturquette@baylibre.com \
--cc=nfraprado@collabora.com \
--cc=pablo.sun@mediatek.com \
--cc=rex-bc.chen@mediatek.com \
--cc=sam.shih@mediatek.com \
--cc=sboyd@kernel.org \
--cc=sean.wang@mediatek.com \
--cc=wenst@chromium.org \
--cc=yangyingliang@huawei.com \
--cc=zhaojh329@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®