public inbox for linux-arm-kernel@lists.infradead.org
 help / color / mirror / Atom feed
From: Fabrice Gasnier <fabrice.gasnier@foss.st.com>
To: Olivier Moysan <olivier.moysan@foss.st.com>,
	Alexandre Torgue <alexandre.torgue@foss.st.com>,
	Jonathan Cameron <jic23@kernel.org>,
	Lars-Peter Clausen <lars@metafoo.de>,
	Maxime Coquelin <mcoquelin.stm32@gmail.com>,
	Paul Cercueil <paul@crapouillou.net>,
	Wan Jiabing <wanjiabing@vivo.com>
Cc: <linux-arm-kernel@lists.infradead.org>,
	<linux-iio@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
	<linux-stm32@st-md-mailman.stormreply.com>
Subject: Re: [PATCH 1/2] iio: adc: stm32-adc: make safe adc disable
Date: Tue, 21 Jun 2022 17:38:52 +0200	[thread overview]
Message-ID: <9b43b142-e62c-d46b-8b42-449720682463@foss.st.com> (raw)
In-Reply-To: <20220620154738.801706-2-olivier.moysan@foss.st.com>

On 6/20/22 17:47, Olivier Moysan wrote:
> From ADC reference manual the software is allowed to write the
> control bit ADDIS of the ADC_CR register only if the ADC is enabled.
> Return immediately from stm32h7_adc_disable() if ADC is already disabled.
> 
> Signed-off-by: Olivier Moysan <olivier.moysan@foss.st.com>

Hi Olivier,

You can add my:
Reviewed-by: Fabrice Gasnier <fabrice.gasnier@foss.st.com>

Thanks,
Fabrice

> ---
>  drivers/iio/adc/stm32-adc.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/drivers/iio/adc/stm32-adc.c b/drivers/iio/adc/stm32-adc.c
> index a68ecbda6480..80e333f65ddd 100644
> --- a/drivers/iio/adc/stm32-adc.c
> +++ b/drivers/iio/adc/stm32-adc.c
> @@ -876,6 +876,9 @@ static void stm32h7_adc_disable(struct iio_dev *indio_dev)
>  	int ret;
>  	u32 val;
>  
> +	if (!(stm32_adc_readl(adc, STM32H7_ADC_CR) & STM32H7_ADEN))
> +		return;
> +
>  	/* Disable ADC and wait until it's effectively disabled */
>  	stm32_adc_set_bits(adc, STM32H7_ADC_CR, STM32H7_ADDIS);
>  	ret = stm32_adc_readl_poll_timeout(STM32H7_ADC_CR, val,

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

  reply	other threads:[~2022-06-21 15:40 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-20 15:47 [PATCH 0/2] iio: adc: stm32-adc: add checks on adc state Olivier Moysan
2022-06-20 15:47 ` [PATCH 1/2] iio: adc: stm32-adc: make safe adc disable Olivier Moysan
2022-06-21 15:38   ` Fabrice Gasnier [this message]
2022-06-20 15:47 ` [PATCH 2/2] iio: adc: stm32-adc: disable adc before calibration Olivier Moysan
2022-06-21 15:39   ` Fabrice Gasnier
2022-06-25 13:28 ` [PATCH 0/2] iio: adc: stm32-adc: add checks on adc state Jonathan Cameron

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=9b43b142-e62c-d46b-8b42-449720682463@foss.st.com \
    --to=fabrice.gasnier@foss.st.com \
    --cc=alexandre.torgue@foss.st.com \
    --cc=jic23@kernel.org \
    --cc=lars@metafoo.de \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-stm32@st-md-mailman.stormreply.com \
    --cc=mcoquelin.stm32@gmail.com \
    --cc=olivier.moysan@foss.st.com \
    --cc=paul@crapouillou.net \
    --cc=wanjiabing@vivo.com \
    /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