Linux clock framework development
 help / color / mirror / Atom feed
From: Jerome Brunet <jbrunet@baylibre.com>
To: Philipp Zabel <p.zabel@pengutronix.de>,
	Stephen Boyd <sboyd@kernel.org>,
	Neil Armstrong <neil.armstrong@linaro.org>
Cc: Jerome Brunet <jbrunet@baylibre.com>,
	Jan Dakinevich <jan.dakinevich@salutedevices.com>,
	linux-kernel@vger.kernel.org, linux-amlogic@lists.infradead.org,
	linux-clk@vger.kernel.org
Subject: [PATCH v2 5/9] reset: amlogic: use reset number instead of register count
Date: Thu, 18 Jul 2024 11:57:49 +0200	[thread overview]
Message-ID: <20240718095755.3511992-6-jbrunet@baylibre.com> (raw)
In-Reply-To: <20240718095755.3511992-1-jbrunet@baylibre.com>

The reset driver from audio clock controller may register less
reset than a register can hold. To avoid making any change while
switching to auxiliary support, use the number of reset instead of the
register count to define the bounds of the reset controller.

Signed-off-by: Jerome Brunet <jbrunet@baylibre.com>
---
 drivers/reset/reset-meson.c | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/drivers/reset/reset-meson.c b/drivers/reset/reset-meson.c
index 09b23f320f57..5a5e1c2358b6 100644
--- a/drivers/reset/reset-meson.c
+++ b/drivers/reset/reset-meson.c
@@ -17,7 +17,7 @@
 #include <linux/types.h>
 
 struct meson_reset_param {
-	unsigned int reg_count;
+	unsigned int reset_num;
 	unsigned int reset_offset;
 	unsigned int level_offset;
 	bool level_low_reset;
@@ -88,21 +88,21 @@ static const struct reset_control_ops meson_reset_ops = {
 };
 
 static const struct meson_reset_param meson8b_param = {
-	.reg_count	= 8,
+	.reset_num	= 256,
 	.reset_offset	= 0x0,
 	.level_offset	= 0x7c,
 	.level_low_reset = true,
 };
 
 static const struct meson_reset_param meson_a1_param = {
-	.reg_count	= 3,
+	.reset_num	= 96,
 	.reset_offset	= 0x0,
 	.level_offset	= 0x40,
 	.level_low_reset = true,
 };
 
 static const struct meson_reset_param meson_s4_param = {
-	.reg_count	= 6,
+	.reset_num	= 192,
 	.reset_offset	= 0x0,
 	.level_offset	= 0x40,
 	.level_low_reset = true,
@@ -149,8 +149,7 @@ static int meson_reset_probe(struct platform_device *pdev)
 				     "can't init regmap mmio region\n");
 
 	data->rcdev.owner = THIS_MODULE;
-	data->rcdev.nr_resets = data->param->reg_count * BITS_PER_BYTE
-		* regmap_config.reg_stride;
+	data->rcdev.nr_resets = data->param->reset_num;
 	data->rcdev.ops = &meson_reset_ops;
 	data->rcdev.of_node = dev->of_node;
 
-- 
2.43.0


  parent reply	other threads:[~2024-07-18  9:58 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-18  9:57 [PATCH v2 0/9] reset: amlogic: move audio reset drivers out of CCF Jerome Brunet
2024-07-18  9:57 ` [PATCH v2 1/9] reset: amlogic: convert driver to regmap Jerome Brunet
2024-07-18 12:45   ` Neil Armstrong
2024-07-18 17:19     ` Jerome Brunet
2024-07-18  9:57 ` [PATCH v2 2/9] reset: amlogic: use generic data matching function Jerome Brunet
2024-07-18  9:57 ` [PATCH v2 3/9] reset: amlogic: make parameters unsigned Jerome Brunet
2024-07-18  9:57 ` [PATCH v2 4/9] reset: amlogic: add driver parameters Jerome Brunet
2024-07-18  9:57 ` Jerome Brunet [this message]
2024-07-18  9:57 ` [PATCH v2 6/9] reset: amlogic: add reset status support Jerome Brunet
2024-07-18  9:57 ` [PATCH v2 7/9] reset: amlogic: move drivers to a dedicated directory Jerome Brunet
2024-07-18  9:57 ` [PATCH v2 8/9] reset: amlogic: split the device core and platform probe Jerome Brunet
2024-07-18  9:57 ` [PATCH v2 9/9] reset: amlogic: add auxiliary reset driver support Jerome Brunet
2024-07-24  1:18   ` Jan Dakinevich
2024-07-18 14:20 ` [PATCH v2 0/9] reset: amlogic: move audio reset drivers out of CCF Jan Dakinevich
2024-07-18 17:20   ` 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=20240718095755.3511992-6-jbrunet@baylibre.com \
    --to=jbrunet@baylibre.com \
    --cc=jan.dakinevich@salutedevices.com \
    --cc=linux-amlogic@lists.infradead.org \
    --cc=linux-clk@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=neil.armstrong@linaro.org \
    --cc=p.zabel@pengutronix.de \
    --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