[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <aW-Fai68pk1tAeyY@smile.fi.intel.com>
Date: Tue, 20 Jan 2026 15:38:50 +0200
From: Andy Shevchenko <andriy.shevchenko@...el.com>
To: Rodrigo Alencar <455.rodrigo.alencar@...il.com>
Cc: Andy Shevchenko <andy.shevchenko@...il.com>, rodrigo.alencar@...log.com,
linux-kernel@...r.kernel.org, linux-iio@...r.kernel.org,
devicetree@...r.kernel.org, linux-doc@...r.kernel.org,
Jonathan Cameron <jic23@...nel.org>,
David Lechner <dlechner@...libre.com>,
Andy Shevchenko <andy@...nel.org>,
Lars-Peter Clausen <lars@...afoo.de>,
Michael Hennerich <Michael.Hennerich@...log.com>,
Rob Herring <robh@...nel.org>,
Krzysztof Kozlowski <krzk+dt@...nel.org>,
Conor Dooley <conor+dt@...nel.org>,
Jonathan Corbet <corbet@....net>
Subject: Re: [PATCH v4 3/7] iio: frequency: adf41513: driver implementation
On Tue, Jan 20, 2026 at 01:07:49PM +0000, Rodrigo Alencar wrote:
> On 26/01/20 01:24PM, Andy Shevchenko wrote:
> > On Tue, Jan 20, 2026 at 12:43 PM Rodrigo Alencar
> > <455.rodrigo.alencar@...il.com> wrote:
> > > On 26/01/19 07:07PM, Andy Shevchenko wrote:
> > > > On Mon, Jan 19, 2026 at 04:37:09PM +0000, Rodrigo Alencar wrote:
> > > > > On 26/01/19 03:42PM, Andy Shevchenko wrote:
> > > > > > On Mon, Jan 19, 2026 at 11:21:59AM +0000, Rodrigo Alencar wrote:
> > > > > > > On 26/01/19 09:31AM, Andy Shevchenko wrote:
> > > > > > > > On Fri, Jan 16, 2026 at 02:32:22PM +0000, Rodrigo Alencar via B4 Relay wrote:
...
> > > > > > > The current implementation is kind of a stripped version of
> > > > > > > __iio_str_to_fixpoint(). Would you prefer something like this, then?:
> > > > > >
> > > > > > Do they have most of the parts in common? If so, why can't we use
> > > > > > __iio_str_to_fixpoint() directly? Or why can't we slightly refactor
> > > > > > that to give us the results we need here?
> > > > >
> > > > > __iio_str_to_fixpoint() only parses "int" chunks, adf41513_parse_uhz
> > > > > was modified to accomodate the u64 parsing removing unnecessary stuff.
> > > >
> > > > But why? The fractional part most likely will be kept int (it's up to 10⁻⁹).
> > > > The integer can be bigger than 10⁹?
> > >
> > > Correct, integer part of the frequency value goes up to 26.5 GHz
> > > (uint_max is approx 4.3 GHz). Also, with the dual modulus, the PLL can
> > > achieve micro Hz resolution.
> >
> > µHz is not a problem since it's up to nHz.
> > So, the difference so far is the integer part that can be 64-bit.
> > Again, can we factor out something to be used for this and for the
> > __iio_str_to_fixpoint() cases?
>
> I am not sure what you are suggesting,
To make changes to reuse the code.
> but I am avoiding changes to iio core at this point.
Why?
> If any other user needs similar behavior,
> I'd say we would need to have __iio_str_to_fixpoint() implementation
> modified, so to create a version of iio_str_to_fixpoint() that handles
> long long variables. Possibly consuming simple_strtoull instead of
> doing the manual parsing.
That's the problem here. With Yet Another Cool Parser this all becomes
unmaintainable very soon (basically as you said when new comer needs a third
variant of it). This is not good. Instead better to create (amend, expand)
existing test cases, split out a foundation API that parses 64-bit parts
(maybe even for fractional as well, dunno) and evolve a needed (sub)API
from it.
--
With Best Regards,
Andy Shevchenko
Powered by blists - more mailing lists