From: Neil Armstrong <neil.armstrong@linaro.org>
To: Jerome Brunet <jbrunet@baylibre.com>, Stephen Boyd <sboyd@kernel.org>
Cc: linux-kernel@vger.kernel.org, linux-amlogic@lists.infradead.org,
linux-clk@vger.kernel.org, devicetree@vger.kernel.org,
Rob Herring <robh@kernel.org>,
Krzysztof Kozlowski <krzk+dt@kernel.org>,
Conor Dooley <conor+dt@kernel.org>
Subject: Re: [PATCH 2/3] clk: meson: axg-audio: setup regmap max_register based on the SoC
Date: Fri, 19 Jul 2024 11:59:13 +0200 [thread overview]
Message-ID: <5c57fbc8-d911-46ee-b421-ec31a00e0f91@linaro.org> (raw)
In-Reply-To: <20240719093934.3985139-3-jbrunet@baylibre.com>
On 19/07/2024 11:39, Jerome Brunet wrote:
> The register region of axg-audio tends to grow with the addition of
> new supported SoC. Mapping slightly more has not been causing problem
> so far but it is not viable to continue like this long term.
>
> Setup the max register based on what is necessary on the related SoC.
>
> Signed-off-by: Jerome Brunet <jbrunet@baylibre.com>
> ---
> drivers/clk/meson/axg-audio.c | 8 ++++++--
> 1 file changed, 6 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/clk/meson/axg-audio.c b/drivers/clk/meson/axg-audio.c
> index e03a5bf899c0..2426f3dbb7a2 100644
> --- a/drivers/clk/meson/axg-audio.c
> +++ b/drivers/clk/meson/axg-audio.c
> @@ -1726,11 +1726,10 @@ static const struct reset_control_ops axg_audio_rstc_ops = {
> .status = axg_audio_reset_status,
> };
>
> -static const struct regmap_config axg_audio_regmap_cfg = {
> +static struct regmap_config axg_audio_regmap_cfg = {
> .reg_bits = 32,
> .val_bits = 32,
> .reg_stride = 4,
> - .max_register = AUDIO_CLK_SPDIFOUT_B_CTRL,
> };
>
> struct audioclk_data {
> @@ -1739,6 +1738,7 @@ struct audioclk_data {
> struct meson_clk_hw_data hw_clks;
> unsigned int reset_offset;
> unsigned int reset_num;
> + unsigned int max_register;
> };
>
> static int axg_audio_clkc_probe(struct platform_device *pdev)
> @@ -1760,6 +1760,7 @@ static int axg_audio_clkc_probe(struct platform_device *pdev)
> if (IS_ERR(regs))
> return PTR_ERR(regs);
>
> + axg_audio_regmap_cfg.max_register = data->max_register;
> map = devm_regmap_init_mmio(dev, regs, &axg_audio_regmap_cfg);
> if (IS_ERR(map)) {
> dev_err(dev, "failed to init regmap: %ld\n", PTR_ERR(map));
> @@ -1828,6 +1829,7 @@ static const struct audioclk_data axg_audioclk_data = {
> .hws = axg_audio_hw_clks,
> .num = ARRAY_SIZE(axg_audio_hw_clks),
> },
> + .max_register = AUDIO_CLK_PDMIN_CTRL1,
> };
>
> static const struct audioclk_data g12a_audioclk_data = {
> @@ -1839,6 +1841,7 @@ static const struct audioclk_data g12a_audioclk_data = {
> },
> .reset_offset = AUDIO_SW_RESET,
> .reset_num = 26,
> + .max_register = AUDIO_CLK_SPDIFOUT_B_CTRL,
> };
>
> static const struct audioclk_data sm1_audioclk_data = {
> @@ -1850,6 +1853,7 @@ static const struct audioclk_data sm1_audioclk_data = {
> },
> .reset_offset = AUDIO_SM1_SW_RESET0,
> .reset_num = 39,
> + .max_register = AUDIO_CLK_SPDIFOUT_B_CTRL,
> };
>
> static const struct of_device_id clkc_match_table[] = {
Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
next prev parent reply other threads:[~2024-07-19 9:59 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-07-19 9:39 [PATCH 0/3] clk: meson: sm1: add earcrx clocks Jerome Brunet
2024-07-19 9:39 ` [PATCH 1/3] dt-bindings: clock: axg-audio: add earcrx clock ids Jerome Brunet
2024-07-19 14:56 ` Conor Dooley
2024-07-19 9:39 ` [PATCH 2/3] clk: meson: axg-audio: setup regmap max_register based on the SoC Jerome Brunet
2024-07-19 9:59 ` Neil Armstrong [this message]
2024-07-19 9:39 ` [PATCH 3/3] clk: meson: axg-audio: add sm1 earcrx clocks Jerome Brunet
2024-07-19 9:59 ` Neil Armstrong
2024-07-29 17:03 ` [PATCH 0/3] clk: meson: sm1: add " Jerome Brunet
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=5c57fbc8-d911-46ee-b421-ec31a00e0f91@linaro.org \
--to=neil.armstrong@linaro.org \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=jbrunet@baylibre.com \
--cc=krzk+dt@kernel.org \
--cc=linux-amlogic@lists.infradead.org \
--cc=linux-clk@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=robh@kernel.org \
--cc=sboyd@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;
as well as URLs for NNTP newsgroup(s).