From: Sean Anderson <seanga2@gmail.com>
To: Igor Prusov <ivprusov@sberdevices.ru>,
Michal Simek <michal.simek@amd.com>,
Daniel Schwierzeck <daniel.schwierzeck@gmail.com>,
Lukasz Majewski <lukma@denx.de>,
Ryan Chen <ryan_chen@aspeedtech.com>,
Chia-Wei Wang <chiawei_wang@aspeedtech.com>,
Neil Armstrong <neil.armstrong@linaro.org>,
Stefan Roese <sr@denx.de>,
Patrick Delaunay <patrick.delaunay@foss.st.com>,
Patrice Chotard <patrice.chotard@foss.st.com>
Cc: prusovigor@gmail.com, kernel@sberdevices.ru,
Aspeed BMC SW team <BMC-SW@aspeedtech.com>,
Joel Stanley <joel@jms.id.au>,
u-boot@lists.denx.de, u-boot-amlogic@groups.io,
uboot-stm32@st-md-mailman.stormreply.com
Subject: Re: [PATCH v4 3/8] clk: k210: Move soc_clk_dump function
Date: Wed, 1 Nov 2023 13:12:11 -0400 [thread overview]
Message-ID: <d4bc9fbc-d8de-0a72-d8cd-c54dcf5a4d5e@gmail.com> (raw)
In-Reply-To: <20231017165649.1492-4-ivprusov@sberdevices.ru>
On 10/17/23 12:56, Igor Prusov wrote:
> Move clock dump function to avoid forward declaration after switching to
> dump in clk_ops.
>
> Signed-off-by: Igor Prusov <ivprusov@sberdevices.ru>
> ---
> drivers/clk/clk_k210.c | 92 +++++++++++++++++++++---------------------
> 1 file changed, 46 insertions(+), 46 deletions(-)
>
> diff --git a/drivers/clk/clk_k210.c b/drivers/clk/clk_k210.c
> index c534cc07e0..2f17152021 100644
> --- a/drivers/clk/clk_k210.c
> +++ b/drivers/clk/clk_k210.c
> @@ -1238,52 +1238,6 @@ static int k210_clk_request(struct clk *clk)
> return 0;
> }
>
> -static const struct clk_ops k210_clk_ops = {
> - .request = k210_clk_request,
> - .set_rate = k210_clk_set_rate,
> - .get_rate = k210_clk_get_rate,
> - .set_parent = k210_clk_set_parent,
> - .enable = k210_clk_enable,
> - .disable = k210_clk_disable,
> -};
> -
> -static int k210_clk_probe(struct udevice *dev)
> -{
> - int ret;
> - struct k210_clk_priv *priv = dev_get_priv(dev);
> -
> - priv->base = dev_read_addr_ptr(dev_get_parent(dev));
> - if (!priv->base)
> - return -EINVAL;
> -
> - ret = clk_get_by_index(dev, 0, &priv->in0);
> - if (ret)
> - return ret;
> -
> - /*
> - * Force setting defaults, even before relocation. This is so we can
> - * set the clock rate for PLL1 before we relocate into aisram.
> - */
> - if (!(gd->flags & GD_FLG_RELOC))
> - clk_set_defaults(dev, CLK_DEFAULTS_POST_FORCE);
> -
> - return 0;
> -}
> -
> -static const struct udevice_id k210_clk_ids[] = {
> - { .compatible = "canaan,k210-clk" },
> - { },
> -};
> -
> -U_BOOT_DRIVER(k210_clk) = {
> - .name = "k210_clk",
> - .id = UCLASS_CLK,
> - .of_match = k210_clk_ids,
> - .ops = &k210_clk_ops,
> - .probe = k210_clk_probe,
> - .priv_auto = sizeof(struct k210_clk_priv),
> -};
> -
> #if IS_ENABLED(CONFIG_CMD_CLK)
> static char show_enabled(struct k210_clk_priv *priv, int id)
> {
> @@ -1342,3 +1296,49 @@ int soc_clk_dump(void)
> return 0;
> }
> #endif
> +
> +static const struct clk_ops k210_clk_ops = {
> + .request = k210_clk_request,
> + .set_rate = k210_clk_set_rate,
> + .get_rate = k210_clk_get_rate,
> + .set_parent = k210_clk_set_parent,
> + .enable = k210_clk_enable,
> + .disable = k210_clk_disable,
> +};
> +
> +static int k210_clk_probe(struct udevice *dev)
> +{
> + int ret;
> + struct k210_clk_priv *priv = dev_get_priv(dev);
> +
> + priv->base = dev_read_addr_ptr(dev_get_parent(dev));
> + if (!priv->base)
> + return -EINVAL;
> +
> + ret = clk_get_by_index(dev, 0, &priv->in0);
> + if (ret)
> + return ret;
> +
> + /*
> + * Force setting defaults, even before relocation. This is so we can
> + * set the clock rate for PLL1 before we relocate into aisram.
> + */
> + if (!(gd->flags & GD_FLG_RELOC))
> + clk_set_defaults(dev, CLK_DEFAULTS_POST_FORCE);
> +
> + return 0;
> +}
> +
> +static const struct udevice_id k210_clk_ids[] = {
> + { .compatible = "canaan,k210-clk" },
> + { },
> +};
> +
> +U_BOOT_DRIVER(k210_clk) = {
> + .name = "k210_clk",
> + .id = UCLASS_CLK,
> + .of_match = k210_clk_ids,
> + .ops = &k210_clk_ops,
> + .probe = k210_clk_probe,
> + .priv_auto = sizeof(struct k210_clk_priv),
> +};
Reviewed-by: Sean Anderson <seanga2@gmail.com>
next prev parent reply other threads:[~2023-11-01 17:12 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-10-17 16:56 [PATCH v4 0/8] clk: Switch from soc_clk_dump to clk_ops function Igor Prusov
2023-10-17 16:56 ` [PATCH v4 1/8] clk: zynq: Move soc_clk_dump to Zynq clock driver Igor Prusov
2023-10-17 16:56 ` [PATCH v4 2/8] clk: ast2600: Move soc_clk_dump function Igor Prusov
2023-10-17 16:56 ` [PATCH v4 3/8] clk: k210: " Igor Prusov
2023-11-01 17:12 ` Sean Anderson [this message]
2023-10-17 16:56 ` [PATCH v4 4/8] clk: amlogic: Move driver and ops structs Igor Prusov
2023-10-18 7:42 ` Neil Armstrong
2023-10-17 16:56 ` [PATCH v4 5/8] clk: Add dump operation to clk_ops Igor Prusov
2023-11-01 17:11 ` Sean Anderson
2023-10-17 16:56 ` [PATCH v4 6/8] cmd: clk: Use dump function from clk_ops Igor Prusov
2023-11-01 17:10 ` Sean Anderson
2023-10-17 16:56 ` [PATCH v4 7/8] clk: treewide: switch to clock dump " Igor Prusov
2023-11-01 17:13 ` Sean Anderson
2023-10-17 16:56 ` [PATCH v4 8/8] cmd: clk: Make soc_clk_dump static Igor Prusov
2023-11-01 17:13 ` Sean Anderson
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=d4bc9fbc-d8de-0a72-d8cd-c54dcf5a4d5e@gmail.com \
--to=seanga2@gmail.com \
--cc=BMC-SW@aspeedtech.com \
--cc=chiawei_wang@aspeedtech.com \
--cc=daniel.schwierzeck@gmail.com \
--cc=ivprusov@sberdevices.ru \
--cc=joel@jms.id.au \
--cc=kernel@sberdevices.ru \
--cc=lukma@denx.de \
--cc=michal.simek@amd.com \
--cc=neil.armstrong@linaro.org \
--cc=patrice.chotard@foss.st.com \
--cc=patrick.delaunay@foss.st.com \
--cc=prusovigor@gmail.com \
--cc=ryan_chen@aspeedtech.com \
--cc=sr@denx.de \
--cc=u-boot-amlogic@groups.io \
--cc=u-boot@lists.denx.de \
--cc=uboot-stm32@st-md-mailman.stormreply.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