From: Dario Binacchi <dario.binacchi@amarulasolutions.com>
To: linux-kernel@vger.kernel.org
Cc: Peng Fan <peng.fan@nxp.com>, Stephen Boyd <sboyd@kernel.org>,
Shawn Guo <shawnguo@kernel.org>,
linux-amarula@amarulasolutions.com,
Abel Vesa <abelvesa@kernel.org>,
Dario Binacchi <dario.binacchi@amarulasolutions.com>,
Fabio Estevam <festevam@gmail.com>,
Michael Turquette <mturquette@baylibre.com>,
Pengutronix Kernel Team <kernel@pengutronix.de>,
Sascha Hauer <s.hauer@pengutronix.de>,
imx@lists.linux.dev, linux-arm-kernel@lists.infradead.org,
linux-clk@vger.kernel.org
Subject: [PATCH v12 10/19] clk: imx: add hw API imx_anatop_get_clk_hw
Date: Thu, 24 Apr 2025 08:21:40 +0200 [thread overview]
Message-ID: <20250424062154.2999219-11-dario.binacchi@amarulasolutions.com> (raw)
In-Reply-To: <20250424062154.2999219-1-dario.binacchi@amarulasolutions.com>
Get the hw of a clock registered by the anatop module. This function is
preparatory for future developments.
Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
---
(no changes since v9)
Changes in v9:
- Add 'Reviewed-by' tag of Peng Fan
Changes in v7:
- Add device_node type parameter to imx8m_anatop_get_clk_hw()
- Rename imx8m_anatop_get_clk_hw() to imx_anatop_get_clk_hw()
- Drop the gaurding macros so the code can be used also by i.MX9
Changes in v5:
- Consider CONFIG_CLK_IMX8M{M,N,P,Q}_MODULE to fix compilation errors
Changes in v4:
- New
drivers/clk/imx/clk.c | 15 +++++++++++++++
drivers/clk/imx/clk.h | 2 ++
2 files changed, 17 insertions(+)
diff --git a/drivers/clk/imx/clk.c b/drivers/clk/imx/clk.c
index df83bd939492..a906d3cd960b 100644
--- a/drivers/clk/imx/clk.c
+++ b/drivers/clk/imx/clk.c
@@ -128,6 +128,21 @@ struct clk_hw *imx_get_clk_hw_by_name(struct device_node *np, const char *name)
}
EXPORT_SYMBOL_GPL(imx_get_clk_hw_by_name);
+struct clk_hw *imx_anatop_get_clk_hw(struct device_node *np, int id)
+{
+ struct of_phandle_args args;
+ struct clk_hw *hw;
+
+ args.np = np;
+ args.args_count = 1;
+ args.args[0] = id;
+
+ hw = __clk_get_hw(of_clk_get_from_provider(&args));
+ pr_debug("%s: got clk: %s\n", __func__, clk_hw_get_name(hw));
+ return hw;
+}
+EXPORT_SYMBOL_GPL(imx_anatop_get_clk_hw);
+
/*
* This fixups the register CCM_CSCMR1 write value.
* The write/read/divider values of the aclk_podf field
diff --git a/drivers/clk/imx/clk.h b/drivers/clk/imx/clk.h
index aa5202f284f3..50e407cf48d9 100644
--- a/drivers/clk/imx/clk.h
+++ b/drivers/clk/imx/clk.h
@@ -487,4 +487,6 @@ struct clk_hw *imx_clk_gpr_mux(const char *name, const char *compatible,
u32 reg, const char **parent_names,
u8 num_parents, const u32 *mux_table, u32 mask);
+struct clk_hw *imx_anatop_get_clk_hw(struct device_node *np, int id);
+
#endif
--
2.43.0
next prev parent reply other threads:[~2025-04-24 6:22 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-24 6:21 [PATCH v12 00/19] Support spread spectrum clocking for i.MX8M PLLs Dario Binacchi
2025-04-24 6:21 ` [PATCH v12 01/19] dt-bindings: clock: imx8mm: add VIDEO_PLL clocks Dario Binacchi
2025-04-24 6:21 ` [PATCH v12 02/19] clk: imx8mm: rename video_pll1 to video_pll Dario Binacchi
2025-04-24 6:21 ` [PATCH v12 03/19] dt-bindings: clock: imx8mp: add VIDEO_PLL clocks Dario Binacchi
2025-04-24 6:21 ` [PATCH v12 04/19] clk: imx8mp: rename video_pll1 to video_pll Dario Binacchi
2025-04-24 6:21 ` [PATCH v12 05/19] dt-bindings: clock: imx8m-anatop: add oscillators and PLLs Dario Binacchi
2025-05-13 13:35 ` Krzysztof Kozlowski
2025-04-24 6:21 ` Dario Binacchi [this message]
2025-04-24 6:21 ` [PATCH v12 11/19] clk: imx: add support for i.MX8MM anatop clock driver Dario Binacchi
2025-05-09 1:52 ` Mark Brown
2025-05-09 8:34 ` Dario Binacchi
2025-05-09 9:00 ` Mark Brown
2025-05-09 12:45 ` Dario Binacchi
2025-05-16 11:54 ` Mark Brown
2025-04-24 6:21 ` [PATCH v12 12/19] clk: imx: add support for i.MX8MN " Dario Binacchi
2025-04-24 6:21 ` [PATCH v12 13/19] clk: imx: add support for i.MX8MP " Dario Binacchi
2025-04-24 6:21 ` [PATCH v12 14/19] clk: imx8mp: rename ccm_base to base Dario Binacchi
2025-04-24 6:21 ` [PATCH v12 16/19] dt-bindings: clock: imx8m-clock: add PLLs Dario Binacchi
2025-05-09 16:25 ` Rob Herring
2025-05-09 18:22 ` Dario Binacchi
2025-05-13 13:24 ` Abel Vesa
2025-05-13 13:33 ` Krzysztof Kozlowski
2025-05-13 13:31 ` Krzysztof Kozlowski
2025-05-13 13:35 ` Krzysztof Kozlowski
2025-05-05 7:52 ` (subset) [PATCH v12 00/19] Support spread spectrum clocking for i.MX8M PLLs Abel Vesa
2025-05-08 8:32 ` Dario Binacchi
2025-05-09 12:01 ` Shawn Guo
2025-05-09 12:43 ` Dario Binacchi
2025-05-13 13:34 ` Krzysztof Kozlowski
2025-05-23 15:19 ` Dario Binacchi
2025-05-27 18:42 ` Krzysztof Kozlowski
2025-05-27 19:32 ` Dario Binacchi
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=20250424062154.2999219-11-dario.binacchi@amarulasolutions.com \
--to=dario.binacchi@amarulasolutions.com \
--cc=abelvesa@kernel.org \
--cc=festevam@gmail.com \
--cc=imx@lists.linux.dev \
--cc=kernel@pengutronix.de \
--cc=linux-amarula@amarulasolutions.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-clk@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mturquette@baylibre.com \
--cc=peng.fan@nxp.com \
--cc=s.hauer@pengutronix.de \
--cc=sboyd@kernel.org \
--cc=shawnguo@kernel.org \
/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