mirror of https://lore.kernel.org/linux-amlogic/
 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>
Cc: linux-kernel@vger.kernel.org, linux-amlogic@lists.infradead.org,
	linux-clk@vger.kernel.org
Subject: Re: [PATCH v3 6/9] reset: amlogic: add reset status support
Date: Mon, 19 Aug 2024 18:31:06 +0200	[thread overview]
Message-ID: <0bbbf439-9722-4140-8044-78b71b2f23af@linaro.org> (raw)
In-Reply-To: <20240808102742.4095904-7-jbrunet@baylibre.com>

On 08/08/2024 12:27, Jerome Brunet wrote:
> Add a callback to check the status of the level reset, as done in
> the reset driver of the audio clock controller.
> 
> This is done keep the functionality when the audio reset controller
> get migrated to meson-reset.
> 
> Signed-off-by: Jerome Brunet <jbrunet@baylibre.com>
> ---
>   drivers/reset/reset-meson.c | 20 ++++++++++++++++++--
>   1 file changed, 18 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/reset/reset-meson.c b/drivers/reset/reset-meson.c
> index 5b6f934c0265..b16d9c32adb1 100644
> --- a/drivers/reset/reset-meson.c
> +++ b/drivers/reset/reset-meson.c
> @@ -56,8 +56,7 @@ static int meson_reset_reset(struct reset_controller_dev *rcdev,
>   static int meson_reset_level(struct reset_controller_dev *rcdev,
>   			    unsigned long id, bool assert)
>   {
> -	struct meson_reset *data =
> -		container_of(rcdev, struct meson_reset, rcdev);
> +	struct meson_reset *data = container_of(rcdev, struct meson_reset, rcdev);

Unrelated change

>   	unsigned int offset, bit;
>   
>   	meson_reset_offset_and_bit(data, id, &offset, &bit);
> @@ -68,6 +67,22 @@ static int meson_reset_level(struct reset_controller_dev *rcdev,
>   				  BIT(bit), assert ? BIT(bit) : 0);
>   }
>   
> +static int meson_reset_status(struct reset_controller_dev *rcdev,
> +			      unsigned long id)
> +{
> +	struct meson_reset *data =
> +		container_of(rcdev, struct meson_reset, rcdev);
> +	unsigned int val, offset, bit;
> +
> +	meson_reset_offset_and_bit(data, id, &offset, &bit);
> +	offset += data->param->level_offset;
> +
> +	regmap_read(data->map, offset, &val);
> +	val = !!(BIT(bit) & val);
> +
> +	return val ^ data->param->level_low_reset;
> +}
> +
>   static int meson_reset_assert(struct reset_controller_dev *rcdev,
>   			      unsigned long id)
>   {
> @@ -84,6 +99,7 @@ static const struct reset_control_ops meson_reset_ops = {
>   	.reset		= meson_reset_reset,
>   	.assert		= meson_reset_assert,
>   	.deassert	= meson_reset_deassert,
> +	.status		= meson_reset_status,
>   };
>   
>   static const struct meson_reset_param meson8b_param = {


with the first change removed:
Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>


_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic

  reply	other threads:[~2024-08-19 16:31 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-08 10:27 [PATCH v3 0/9] reset: amlogic: move audio reset drivers out of CCF Jerome Brunet
2024-08-08 10:27 ` [PATCH v3 1/9] reset: amlogic: convert driver to regmap Jerome Brunet
2024-08-19 15:55   ` Neil Armstrong
2024-08-08 10:27 ` [PATCH v3 2/9] reset: amlogic: use generic data matching function Jerome Brunet
2024-08-19 16:29   ` Neil Armstrong
2024-08-08 10:27 ` [PATCH v3 3/9] reset: amlogic: make parameters unsigned Jerome Brunet
2024-08-19 16:29   ` Neil Armstrong
2024-08-08 10:27 ` [PATCH v3 4/9] reset: amlogic: add driver parameters Jerome Brunet
2024-08-19 15:57   ` Neil Armstrong
2024-08-19 16:40     ` Jerome Brunet
2024-08-19 17:03       ` Neil Armstrong
2024-08-08 10:27 ` [PATCH v3 5/9] reset: amlogic: use reset number instead of register count Jerome Brunet
2024-08-19 16:30   ` Neil Armstrong
2024-08-08 10:27 ` [PATCH v3 6/9] reset: amlogic: add reset status support Jerome Brunet
2024-08-19 16:31   ` Neil Armstrong [this message]
2024-08-08 10:27 ` [PATCH v3 7/9] reset: amlogic: move drivers to a dedicated directory Jerome Brunet
2024-08-19 16:31   ` Neil Armstrong
2024-08-08 10:27 ` [PATCH v3 8/9] reset: amlogic: split the device core and platform probe Jerome Brunet
2024-08-19 16:33   ` Neil Armstrong
2024-08-19 16:49     ` Jerome Brunet
2024-08-19 16:57       ` Neil Armstrong
2024-09-02  9:47       ` Philipp Zabel
2024-09-02  9:53         ` Jerome Brunet
2024-09-02 10:40           ` Philipp Zabel
2024-09-02 10:37   ` Philipp Zabel
2024-08-08 10:27 ` [PATCH v3 9/9] reset: amlogic: add auxiliary reset driver support Jerome Brunet
2024-08-19 16:35   ` Neil Armstrong

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=0bbbf439-9722-4140-8044-78b71b2f23af@linaro.org \
    --to=neil.armstrong@linaro.org \
    --cc=jbrunet@baylibre.com \
    --cc=linux-amlogic@lists.infradead.org \
    --cc=linux-clk@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.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

all inboxes | Powered by JetHome®