linux-iio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Nuno Sá" <noname.nuno@gmail.com>
To: "David Lechner" <dlechner@baylibre.com>,
	"Lars-Peter Clausen" <lars@metafoo.de>,
	"Michael Hennerich" <Michael.Hennerich@analog.com>,
	"Nuno Sá" <nuno.sa@analog.com>,
	"Esteban Blanc" <eblanc@baylibre.com>,
	"Jonathan Cameron" <jic23@kernel.org>
Cc: linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 3/5] iio: adc: ad4030: move setting mode to update_scan_mode
Date: Tue, 11 Mar 2025 09:27:57 +0000	[thread overview]
Message-ID: <822dec830a7e64dbb791a7e28b1c5fa182ccf993.camel@gmail.com> (raw)
In-Reply-To: <20250310-iio-adc-ad4030-check-scan-type-err-v1-3-589e4ebd9711@baylibre.com>

On Mon, 2025-03-10 at 15:43 -0500, David Lechner wrote:
> Move calling ad4030_set_mode() from the buffer preenable callback to
> the update_scan_mode callback. This doesn't change any functionality
> but is more logical since setting the mode is a function of the scan
> mask and doesn't require an "undo" operation when the buffer is
> disabled.
> 
> Signed-off-by: David Lechner <dlechner@baylibre.com>
> ---

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

>  drivers/iio/adc/ad4030.c | 13 +++++++------
>  1 file changed, 7 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/iio/adc/ad4030.c b/drivers/iio/adc/ad4030.c
> index
> f24b46164a477f9b6b5c93ffeba0a335f7b3de5a..c2117c7a296f22aeeec6911c8a8c74ed5762
> 96a0 100644
> --- a/drivers/iio/adc/ad4030.c
> +++ b/drivers/iio/adc/ad4030.c
> @@ -868,6 +868,12 @@ static int ad4030_get_current_scan_type(const struct
> iio_dev *indio_dev,
>  	return st->avg_log2 ? AD4030_SCAN_TYPE_AVG : AD4030_SCAN_TYPE_NORMAL;
>  }
>  
> +static int ad4030_update_scan_mode(struct iio_dev *indio_dev,
> +				   const unsigned long *scan_mask)
> +{
> +	return ad4030_set_mode(indio_dev, *scan_mask);
> +}
> +
>  static const struct iio_info ad4030_iio_info = {
>  	.read_avail = ad4030_read_avail,
>  	.read_raw = ad4030_read_raw,
> @@ -875,13 +881,9 @@ static const struct iio_info ad4030_iio_info = {
>  	.debugfs_reg_access = ad4030_reg_access,
>  	.read_label = ad4030_read_label,
>  	.get_current_scan_type = ad4030_get_current_scan_type,
> +	.update_scan_mode  = ad4030_update_scan_mode,
>  };
>  
> -static int ad4030_buffer_preenable(struct iio_dev *indio_dev)
> -{
> -	return ad4030_set_mode(indio_dev, *indio_dev->active_scan_mask);
> -}
> -
>  static bool ad4030_validate_scan_mask(struct iio_dev *indio_dev,
>  				      const unsigned long *scan_mask)
>  {
> @@ -895,7 +897,6 @@ static bool ad4030_validate_scan_mask(struct iio_dev
> *indio_dev,
>  }
>  
>  static const struct iio_buffer_setup_ops ad4030_buffer_setup_ops = {
> -	.preenable = ad4030_buffer_preenable,
>  	.validate_scan_mask = ad4030_validate_scan_mask,
>  };
>  
> 


  reply	other threads:[~2025-03-11  9:27 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-10 20:43 [PATCH 0/5] iio: adc: ad4030: scan_type cleanups David Lechner
2025-03-10 20:43 ` [PATCH 1/5] iio: adc: ad4030: check scan_type for error David Lechner
2025-03-11  9:26   ` Nuno Sá
2025-03-10 20:43 ` [PATCH 2/5] iio: adc: ad4030: remove some duplicate code David Lechner
2025-03-11  9:27   ` Nuno Sá
2025-03-10 20:43 ` [PATCH 3/5] iio: adc: ad4030: move setting mode to update_scan_mode David Lechner
2025-03-11  9:27   ` Nuno Sá [this message]
2025-03-10 20:43 ` [PATCH 4/5] iio: adc: ad4030: don't store scan_type in state David Lechner
2025-03-11  9:29   ` Nuno Sá
2025-03-10 20:43 ` [PATCH 5/5] iio: adc: ad4030: explain rearranging raw sample data David Lechner
2025-03-11  9:30   ` Nuno Sá
2025-03-15 13:04     ` 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=822dec830a7e64dbb791a7e28b1c5fa182ccf993.camel@gmail.com \
    --to=noname.nuno@gmail.com \
    --cc=Michael.Hennerich@analog.com \
    --cc=dlechner@baylibre.com \
    --cc=eblanc@baylibre.com \
    --cc=jic23@kernel.org \
    --cc=lars@metafoo.de \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nuno.sa@analog.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;
as well as URLs for NNTP newsgroup(s).