mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Neil Armstrong <neil.armstrong@linaro.org>
To: Jerome Brunet <jbrunet@baylibre.com>,
	Philipp Zabel <p.zabel@pengutronix.de>,
	Stephen Boyd <sboyd@kernel.org>,
	Kevin Hilman <khilman@baylibre.com>,
	Martin Blumenstingl <martin.blumenstingl@googlemail.com>,
	Jiucheng Xu <jiucheng.xu@amlogic.com>
Cc: linux-arm-kernel@lists.infradead.org,
	linux-amlogic@lists.infradead.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v5 4/9] reset: amlogic: add driver parameters
Date: Wed, 11 Sep 2024 12:24:51 +0200	[thread overview]
Message-ID: <9f753151-b908-4585-aae2-4a2ff5dd41af@linaro.org> (raw)
In-Reply-To: <20240910-meson-rst-aux-v5-4-60be62635d3e@baylibre.com>

On 10/09/2024 18:32, Jerome Brunet wrote:
> To allow using the same driver for the main reset controller and the
> auxiliary ones embedded in the clock controllers, allow to customise
> the reset offset, same as the level offset. Also add an option to make
> the level reset active low or high.
> 
> Signed-off-by: Jerome Brunet <jbrunet@baylibre.com>
> ---
>   drivers/reset/reset-meson.c | 14 +++++++++++++-
>   1 file changed, 13 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/reset/reset-meson.c b/drivers/reset/reset-meson.c
> index 50bd2241ef2f..6a90613c8095 100644
> --- a/drivers/reset/reset-meson.c
> +++ b/drivers/reset/reset-meson.c
> @@ -18,7 +18,9 @@
>   
>   struct meson_reset_param {
>   	unsigned int reg_count;
> +	unsigned int reset_offset;
>   	unsigned int level_offset;
> +	bool level_low_reset;
>   };
>   
>   struct meson_reset {
> @@ -46,6 +48,7 @@ static int meson_reset_reset(struct reset_controller_dev *rcdev,
>   	unsigned int offset, bit;
>   
>   	meson_reset_offset_and_bit(data, id, &offset, &bit);
> +	offset += data->param->reset_offset;
>   
>   	return regmap_write(data->map, offset, BIT(bit));
>   }
> @@ -59,9 +62,10 @@ static int meson_reset_level(struct reset_controller_dev *rcdev,
>   
>   	meson_reset_offset_and_bit(data, id, &offset, &bit);
>   	offset += data->param->level_offset;
> +	assert ^= data->param->level_low_reset;
>   
>   	return regmap_update_bits(data->map, offset,
> -				  BIT(bit), assert ? 0 : BIT(bit));
> +				  BIT(bit), assert ? BIT(bit) : 0);
>   }
>   
>   static int meson_reset_assert(struct reset_controller_dev *rcdev,
> @@ -84,22 +88,30 @@ static const struct reset_control_ops meson_reset_ops = {
>   
>   static const struct meson_reset_param meson8b_param = {
>   	.reg_count	= 8,
> +	.reset_offset	= 0x0,
>   	.level_offset	= 0x7c,
> +	.level_low_reset = true,
>   };
>   
>   static const struct meson_reset_param meson_a1_param = {
>   	.reg_count	= 3,
> +	.reset_offset	= 0x0,
>   	.level_offset	= 0x40,
> +	.level_low_reset = true,
>   };
>   
>   static const struct meson_reset_param meson_s4_param = {
>   	.reg_count	= 6,
> +	.reset_offset	= 0x0,
>   	.level_offset	= 0x40,
> +	.level_low_reset = true,
>   };
>   
>   static const struct meson_reset_param t7_param = {
>   	.reg_count      = 7,
> +	.reset_offset	= 0x0,
>   	.level_offset   = 0x40,
> +	.level_low_reset = true,
>   };
>   
>   static const struct of_device_id meson_reset_dt_ids[] = {
> 

Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>

  reply	other threads:[~2024-09-11 10:24 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-10 16:32 [PATCH v5 0/9] reset: amlogic: move audio reset drivers out of CCF Jerome Brunet
2024-09-10 16:32 ` [PATCH v5 1/9] reset: amlogic: convert driver to regmap Jerome Brunet
2024-09-10 16:32 ` [PATCH v5 2/9] reset: amlogic: use generic data matching function Jerome Brunet
2024-09-10 16:32 ` [PATCH v5 3/9] reset: amlogic: make parameters unsigned Jerome Brunet
2024-09-10 16:32 ` [PATCH v5 4/9] reset: amlogic: add driver parameters Jerome Brunet
2024-09-11 10:24   ` Neil Armstrong [this message]
2024-09-10 16:32 ` [PATCH v5 5/9] reset: amlogic: use reset number instead of register count Jerome Brunet
2024-09-10 16:32 ` [PATCH v5 6/9] reset: amlogic: add reset status support Jerome Brunet
2024-09-10 16:32 ` [PATCH v5 7/9] reset: amlogic: move drivers to a dedicated directory Jerome Brunet
2024-09-10 16:32 ` [PATCH v5 8/9] reset: amlogic: split the device core and platform probe Jerome Brunet
2024-09-11 10:24   ` Neil Armstrong
2024-09-12  8:12   ` Philipp Zabel
2024-09-13  6:53     ` Jerome Brunet
2024-09-30 16:56       ` Philipp Zabel
2024-10-04 13:30         ` Jerome Brunet
2024-10-07  8:37           ` Philipp Zabel
2024-10-08  7:51             ` Jerome Brunet
2024-09-10 16:32 ` [PATCH v5 9/9] reset: amlogic: add auxiliary reset driver support Jerome Brunet
2024-09-12  8:11 ` [PATCH v5 0/9] reset: amlogic: move audio reset drivers out of CCF Philipp Zabel

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=9f753151-b908-4585-aae2-4a2ff5dd41af@linaro.org \
    --to=neil.armstrong@linaro.org \
    --cc=jbrunet@baylibre.com \
    --cc=jiucheng.xu@amlogic.com \
    --cc=khilman@baylibre.com \
    --cc=linux-amlogic@lists.infradead.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=martin.blumenstingl@googlemail.com \
    --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

all inboxes | Powered by JetHome®