diff mbox series

[08/16] iio: adc: max1027: Explain better how the trigger state gets changed

Message ID 20210818111139.330636-9-miquel.raynal@bootlin.com (mailing list archive)
State Changes Requested
Headers show
Series Bring software triggers support to MAX1027-like ADCs | expand

Commit Message

Miquel Raynal Aug. 18, 2021, 11:11 a.m. UTC
It may appear strange to configure the trigger to start upon register
write while we want to disable the trigger. Explain why we do this in
the comment.

Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
---
 drivers/iio/adc/max1027.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

Comments

Nuno Sa Aug. 20, 2021, 7:17 a.m. UTC | #1
> -----Original Message-----
> From: Miquel Raynal <miquel.raynal@bootlin.com>
> Sent: Wednesday, August 18, 2021 1:12 PM
> To: Jonathan Cameron <jic23@kernel.org>; Lars-Peter Clausen
> <lars@metafoo.de>
> Cc: Thomas Petazzoni <thomas.petazzoni@bootlin.com>; linux-
> iio@vger.kernel.org; linux-kernel@vger.kernel.org; Miquel Raynal
> <miquel.raynal@bootlin.com>
> Subject: [PATCH 08/16] iio: adc: max1027: Explain better how the
> trigger state gets changed
> 
> [External]
> 
> It may appear strange to configure the trigger to start upon register
> write while we want to disable the trigger. Explain why we do this in
> the comment.
> 
> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
> ---
>  drivers/iio/adc/max1027.c | 7 ++++++-
>  1 file changed, 6 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/iio/adc/max1027.c b/drivers/iio/adc/max1027.c
> index 59914fcfd320..4a78c9cbc339 100644
> --- a/drivers/iio/adc/max1027.c
> +++ b/drivers/iio/adc/max1027.c
> @@ -401,7 +401,12 @@ static int
> max1027_set_cnvst_trigger_state(struct iio_trigger *trig, bool state)
>  		if (ret < 0)
>  			return ret;
>  	} else {
> -		/* Start acquisition on conversion register write */
> +		/*
> +		 * Start acquisition on conversion register write, which
> +		 * basically disables triggering conversions upon cnvst
> changes
> +		 * and thus has the effect of disabling the external
> hardware
> +		 * trigger.
> +		 */
>  		ret = max1027_configure_trigger(indio_dev);
>  		if (ret)
>  			return ret;
> --
> 2.27.0

Reviewed-by: Nuno Sá <nuno.sa@analog.com>
diff mbox series

Patch

diff --git a/drivers/iio/adc/max1027.c b/drivers/iio/adc/max1027.c
index 59914fcfd320..4a78c9cbc339 100644
--- a/drivers/iio/adc/max1027.c
+++ b/drivers/iio/adc/max1027.c
@@ -401,7 +401,12 @@  static int max1027_set_cnvst_trigger_state(struct iio_trigger *trig, bool state)
 		if (ret < 0)
 			return ret;
 	} else {
-		/* Start acquisition on conversion register write */
+		/*
+		 * Start acquisition on conversion register write, which
+		 * basically disables triggering conversions upon cnvst changes
+		 * and thus has the effect of disabling the external hardware
+		 * trigger.
+		 */
 		ret = max1027_configure_trigger(indio_dev);
 		if (ret)
 			return ret;