From: "Nuno Sá" <noname.nuno@gmail.com>
To: "David Lechner" <dlechner@baylibre.com>,
"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>,
"Rob Herring" <robh@kernel.org>,
"Krzysztof Kozlowski" <krzk+dt@kernel.org>,
"Conor Dooley" <conor+dt@kernel.org>,
"Nuno Sa" <nuno.sa@analog.com>,
"Olivier Moysan" <olivier.moysan@foss.st.com>,
"Javier Carrasco" <javier.carrasco.cruz@gmail.com>,
"Andy Shevchenko" <andriy.shevchenko@linux.intel.com>,
"Guillaume Stols" <gstols@baylibre.com>,
"Trevor Gamblin" <tgamblin@baylibre.com>,
"Dumitru Ceclan" <mitrutzceclan@gmail.com>,
"Matteo Martelli" <matteomartelli3@gmail.com>,
"João Paulo Gonçalves" <joao.goncalves@toradex.com>,
"Alisa-Dariana Roman" <alisadariana@gmail.com>,
"Thomas Bonnefille" <thomas.bonnefille@bootlin.com>,
"Herve Codina" <herve.codina@bootlin.com>,
"Marcelo Schmitt" <marcelo.schmitt@analog.com>,
"Dragos Bogdan" <dragos.bogdan@analog.com>,
linux-iio@vger.kernel.org, devicetree@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/5] iio: backend: add support for decimation ratio set
Date: Fri, 28 Mar 2025 08:31:25 +0000 [thread overview]
Message-ID: <c8ab344480e57ffe7eb0ec73d509de25ea5cea3a.camel@gmail.com> (raw)
In-Reply-To: <9b565cb2-815b-4ca9-a7dc-8ca2e8eb5f72@baylibre.com>
On Mon, 2025-03-24 at 13:53 -0500, David Lechner wrote:
> On 3/24/25 4:07 AM, Pop Ioan Daniel wrote:
> > Add backend support for setting the decimation ratio used.
> >
> > Signed-off-by: Pop Ioan Daniel <pop.ioan-daniel@analog.com>
> > ---
> > drivers/iio/industrialio-backend.c | 18 ++++++++++++++++++
> > include/linux/iio/backend.h | 3 +++
> > 2 files changed, 21 insertions(+)
> >
> > diff --git a/drivers/iio/industrialio-backend.c b/drivers/iio/industrialio-
> > backend.c
> > index 363281272035..f4db6514944a 100644
> > --- a/drivers/iio/industrialio-backend.c
> > +++ b/drivers/iio/industrialio-backend.c
> > @@ -417,6 +417,24 @@ int iio_backend_test_pattern_set(struct iio_backend *back,
> > }
> > EXPORT_SYMBOL_NS_GPL(iio_backend_test_pattern_set, "IIO_BACKEND");
> >
> > +/**
> > + * iio_backend_set_dec_rate - set decimation ratio
>
> In [1], we decided that for a similar chip we could use "decimation rate" and
> "oversampling ratio" interchangeably. And in [2], we recently added a backend
> op for setting the oversampling ratio. Would it make sense to use that here
> as well instead of introducing a new function? If not, we'll want more of an
> explanation here on what the difference is. But from what I can tell, this
> sounds very similar to the other case where they are essentially the same thing.
> On the other hand, this is internal API and not userspace ABI, so having a
> separate name might not be so bad, especially if there is a chance we would ever
> have both at the same time.
If it fits, I have preference for using existent interfaces...
- Nuno Sá
>
> [1]: https://lore.kernel.org/linux-iio/20250112122047.1e1978e0@jic23-huawei/
> [2]:
> https://web.git.kernel.org/pub/scm/linux/kernel/git/jic23/iio.git/commit/drivers/iio/industrialio-backend.c?h=testing&id=22894e0be908791e3df011cdfac02589c2f340bd
>
> > + * @back: Backend device
> > + * @rate: Rate in decimal
> > +
> > + * Return:
> > + * 0 on success, negative error number on failure.
> > + */
> > +
> > +int iio_backend_set_dec_rate(struct iio_backend *back, unsigned int rate)
> > +{
> > + if (!rate)
> > + return -EINVAL;
> > +
> > + return iio_backend_op_call(back, set_dec_rate, rate);
> > +}
> > +EXPORT_SYMBOL_NS_GPL(iio_backend_set_dec_rate, "IIO_BACKEND");
> > +
next prev parent reply other threads:[~2025-03-28 8:31 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-24 9:07 [PATCH 0/5] Add support for AD7405/ADUM770x Pop Ioan Daniel
2025-03-24 9:07 ` [PATCH 1/5] iio: backend: add support for decimation ratio set Pop Ioan Daniel
2025-03-24 10:13 ` Andy Shevchenko
2025-03-24 18:53 ` David Lechner
2025-03-28 8:31 ` Nuno Sá [this message]
2025-03-24 9:07 ` [PATCH 2/5] iio: adc: adi-axi-adc: add set decimation rate Pop Ioan Daniel
2025-03-24 10:15 ` Andy Shevchenko
2025-03-24 18:54 ` David Lechner
2025-03-24 9:07 ` [PATCH 3/5] dt-bindings: iio: adc: add ad7405 axi variant Pop Ioan Daniel
2025-03-24 18:55 ` David Lechner
2025-03-24 9:07 ` [PATCH 4/5] dt-bindings: iio: adc: add ad7405 Pop Ioan Daniel
2025-03-24 18:56 ` David Lechner
2025-03-24 20:04 ` Rob Herring
2025-03-30 15:40 ` Jonathan Cameron
2025-03-24 9:08 ` [PATCH 5/5] iio: adc: ad7405: add ad7405 driver Pop Ioan Daniel
2025-03-24 10:21 ` Andy Shevchenko
2025-03-24 19:09 ` David Lechner
2025-03-30 16:01 ` 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=c8ab344480e57ffe7eb0ec73d509de25ea5cea3a.camel@gmail.com \
--to=noname.nuno@gmail.com \
--cc=Michael.Hennerich@analog.com \
--cc=alisadariana@gmail.com \
--cc=andriy.shevchenko@linux.intel.com \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=dlechner@baylibre.com \
--cc=dragos.bogdan@analog.com \
--cc=gstols@baylibre.com \
--cc=herve.codina@bootlin.com \
--cc=javier.carrasco.cruz@gmail.com \
--cc=jic23@kernel.org \
--cc=joao.goncalves@toradex.com \
--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=matteomartelli3@gmail.com \
--cc=mitrutzceclan@gmail.com \
--cc=nuno.sa@analog.com \
--cc=olivier.moysan@foss.st.com \
--cc=pop.ioan-daniel@analog.com \
--cc=robh@kernel.org \
--cc=tgamblin@baylibre.com \
--cc=thomas.bonnefille@bootlin.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.