mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Nuno Sá" <noname.nuno@gmail.com>
To: "Pop Ioan Daniel" <pop.ioan-daniel@analog.com>,
	"Lars-Peter Clausen" <lars@metafoo.de>,
	"Michael Hennerich" <Michael.Hennerich@analog.com>,
	"Jonathan Cameron" <jic23@kernel.org>,
	"David Lechner" <dlechner@baylibre.com>,
	"Nuno Sá" <nuno.sa@analog.com>,
	"Andy Shevchenko" <andy@kernel.org>,
	"Rob Herring" <robh@kernel.org>,
	"Krzysztof Kozlowski" <krzk+dt@kernel.org>,
	"Conor Dooley" <conor+dt@kernel.org>,
	"Sergiu Cuciurean" <sergiu.cuciurean@analog.com>,
	"Dragos Bogdan" <dragos.bogdan@analog.com>,
	"Antoniu Miclaus" <antoniu.miclaus@analog.com>,
	"Olivier Moysan" <olivier.moysan@foss.st.com>,
	"Javier Carrasco" <javier.carrasco.cruz@gmail.com>,
	"Matti Vaittinen" <mazziesaccount@gmail.com>,
	"Tobias Sperling" <tobias.sperling@softing.com>,
	"Alisa-Dariana Roman" <alisadariana@gmail.com>,
	"Marcelo Schmitt" <marcelo.schmitt@analog.com>,
	"Herve Codina" <herve.codina@bootlin.com>,
	"Trevor Gamblin" <tgamblin@baylibre.com>,
	"Thomas Bonnefille" <thomas.bonnefille@bootlin.com>,
	linux-iio@vger.kernel.org, devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v4 2/6] iio: backend: update iio_backend_oversampling_ratio_set
Date: Mon, 26 May 2025 10:54:35 +0100	[thread overview]
Message-ID: <90194d4e3c48de7b3b4948aeb536708a4bed2354.camel@gmail.com> (raw)
In-Reply-To: <20250519140220.81489-3-pop.ioan-daniel@analog.com>

On Mon, 2025-05-19 at 17:02 +0300, Pop Ioan Daniel wrote:
> Add chan parameter to iio_backed_oversampling_ration_set() to allow
> for contexts where the channel must be specified. Modify all
> existing users.
> 
> Signed-off-by: Pop Ioan Daniel <pop.ioan-daniel@analog.com>
> ---

With the change requested by David in the following patch:

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

> changes in v4:
>  - pass 0 in the list of parameters instead of chan
>  drivers/iio/adc/ad4851.c           | 4 ++--
>  drivers/iio/industrialio-backend.c | 3 ++-
>  include/linux/iio/backend.h        | 3 ++-
>  3 files changed, 6 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/iio/adc/ad4851.c b/drivers/iio/adc/ad4851.c
> index 12f90aa3a156..1f975858c496 100644
> --- a/drivers/iio/adc/ad4851.c
> +++ b/drivers/iio/adc/ad4851.c
> @@ -319,8 +319,8 @@ static int ad4851_set_oversampling_ratio(struct iio_dev
> *indio_dev,
>  		if (ret)
>  			return ret;
>  	}
> -
> -	ret = iio_backend_oversampling_ratio_set(st->back, osr);
> +	/* Channel is ignored by the backend being used here */
> +	ret = iio_backend_oversampling_ratio_set(st->back, 0, osr);
>  	if (ret)
>  		return ret;
>  
> diff --git a/drivers/iio/industrialio-backend.c b/drivers/iio/industrialio-
> backend.c
> index c1eb9ef9db08..a4e3e54fecb1 100644
> --- a/drivers/iio/industrialio-backend.c
> +++ b/drivers/iio/industrialio-backend.c
> @@ -720,9 +720,10 @@ EXPORT_SYMBOL_NS_GPL(iio_backend_data_size_set,
> "IIO_BACKEND");
>   * 0 on success, negative error number on failure.
>   */
>  int iio_backend_oversampling_ratio_set(struct iio_backend *back,
> +				       unsigned int chan,
>  				       unsigned int ratio)
>  {
> -	return iio_backend_op_call(back, oversampling_ratio_set, ratio);
> +	return iio_backend_op_call(back, oversampling_ratio_set, chan,
> ratio);
>  }
>  EXPORT_SYMBOL_NS_GPL(iio_backend_oversampling_ratio_set, "IIO_BACKEND");
>  
> diff --git a/include/linux/iio/backend.h b/include/linux/iio/backend.h
> index e59d909cb659..dbf4e4a5f4b1 100644
> --- a/include/linux/iio/backend.h
> +++ b/include/linux/iio/backend.h
> @@ -144,7 +144,7 @@ struct iio_backend_ops {
>  				  enum iio_backend_interface_type *type);
>  	int (*data_size_set)(struct iio_backend *back, unsigned int size);
>  	int (*oversampling_ratio_set)(struct iio_backend *back,
> -				      unsigned int ratio);
> +				      unsigned int chan, unsigned int ratio);
>  	int (*read_raw)(struct iio_backend *back,
>  			struct iio_chan_spec const *chan, int *val, int
> *val2,
>  			long mask);
> @@ -209,6 +209,7 @@ int iio_backend_interface_type_get(struct iio_backend
> *back,
>  				   enum iio_backend_interface_type *type);
>  int iio_backend_data_size_set(struct iio_backend *back, unsigned int size);
>  int iio_backend_oversampling_ratio_set(struct iio_backend *back,
> +				       unsigned int chan,
>  				       unsigned int ratio);
>  int iio_backend_read_raw(struct iio_backend *back,
>  			 struct iio_chan_spec const *chan, int *val, int
> *val2,

  parent reply	other threads:[~2025-05-26  9:54 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-05-19 14:02 [PATCH v4 0/6] Add support for AD7405/ADUM770x Pop Ioan Daniel
2025-05-19 14:02 ` [PATCH v4 1/6] iio: adc: ad4851: ad4851_set_oversampling_ratio parameters update Pop Ioan Daniel
2025-05-19 15:15   ` David Lechner
2025-05-19 14:02 ` [PATCH v4 2/6] iio: backend: update iio_backend_oversampling_ratio_set Pop Ioan Daniel
2025-05-19 15:15   ` David Lechner
2025-05-26  9:54   ` Nuno Sá [this message]
2025-05-19 14:02 ` [PATCH v4 3/6] iio: adc: adi-axi-adc: add axi_adc_oversampling_ratio_set Pop Ioan Daniel
2025-05-19 15:15   ` David Lechner
2025-05-26  9:53     ` Nuno Sá
2025-05-26  9:54   ` Nuno Sá
2025-05-19 14:02 ` [PATCH v4 4/6] dt-bindings: iio: adc: add ad7405 Pop Ioan Daniel
2025-05-19 15:16   ` David Lechner
2025-05-20  6:41   ` Krzysztof Kozlowski
2025-05-19 14:02 ` [PATCH v4 5/6] dt-bindings: iio: adc: adi-axi-adc: add ad7405 example Pop Ioan Daniel
2025-05-19 15:19   ` David Lechner
2025-05-20  6:39   ` Krzysztof Kozlowski
2025-05-19 14:02 ` [PATCH v4 6/6] iio: adc: ad7405: add ad7405 driver Pop Ioan Daniel
2025-05-19 15:18   ` David Lechner
2025-05-25 11:03   ` Jonathan Cameron
2025-05-26 10:00   ` Nuno Sá
2025-05-19 15:22 ` [PATCH v4 0/6] Add support for AD7405/ADUM770x David Lechner

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=90194d4e3c48de7b3b4948aeb536708a4bed2354.camel@gmail.com \
    --to=noname.nuno@gmail.com \
    --cc=Michael.Hennerich@analog.com \
    --cc=alisadariana@gmail.com \
    --cc=andy@kernel.org \
    --cc=antoniu.miclaus@analog.com \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=dlechner@baylibre.com \
    --cc=dragos.bogdan@analog.com \
    --cc=herve.codina@bootlin.com \
    --cc=javier.carrasco.cruz@gmail.com \
    --cc=jic23@kernel.org \
    --cc=krzk+dt@kernel.org \
    --cc=lars@metafoo.de \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marcelo.schmitt@analog.com \
    --cc=mazziesaccount@gmail.com \
    --cc=nuno.sa@analog.com \
    --cc=olivier.moysan@foss.st.com \
    --cc=pop.ioan-daniel@analog.com \
    --cc=robh@kernel.org \
    --cc=sergiu.cuciurean@analog.com \
    --cc=tgamblin@baylibre.com \
    --cc=thomas.bonnefille@bootlin.com \
    --cc=tobias.sperling@softing.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

all inboxes | Powered by JetHome®