[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <c8ab344480e57ffe7eb0ec73d509de25ea5cea3a.camel@gmail.com>
Date: Fri, 28 Mar 2025 08:31:25 +0000
From: Nuno Sá <noname.nuno@...il.com>
To: David Lechner <dlechner@...libre.com>, Pop Ioan Daniel
<pop.ioan-daniel@...log.com>, Lars-Peter Clausen <lars@...afoo.de>, Michael
Hennerich <Michael.Hennerich@...log.com>, Jonathan Cameron
<jic23@...nel.org>, Rob Herring <robh@...nel.org>, Krzysztof Kozlowski
<krzk+dt@...nel.org>, Conor Dooley <conor+dt@...nel.org>, Nuno Sa
<nuno.sa@...log.com>, Olivier Moysan <olivier.moysan@...s.st.com>, Javier
Carrasco <javier.carrasco.cruz@...il.com>, Andy Shevchenko
<andriy.shevchenko@...ux.intel.com>, Guillaume Stols <gstols@...libre.com>,
Trevor Gamblin <tgamblin@...libre.com>, Dumitru Ceclan
<mitrutzceclan@...il.com>, Matteo Martelli <matteomartelli3@...il.com>,
João Paulo Gonçalves
<joao.goncalves@...adex.com>, Alisa-Dariana Roman <alisadariana@...il.com>,
Thomas Bonnefille <thomas.bonnefille@...tlin.com>, Herve Codina
<herve.codina@...tlin.com>, Marcelo Schmitt <marcelo.schmitt@...log.com>,
Dragos Bogdan <dragos.bogdan@...log.com>, linux-iio@...r.kernel.org,
devicetree@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 1/5] iio: backend: add support for decimation ratio set
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@...log.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");
> > +
Powered by blists - more mailing lists