From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm1-f43.google.com (mail-wm1-f43.google.com [209.85.128.43]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id EF2A94218AB for ; Wed, 21 Jan 2026 14:20:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.43 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769005220; cv=none; b=uHV/UO9jaN288/Dm6GPZPA8J0xq9JHYoOstT8eBZJhXhyoKhp6PQuu61fwk0tUvpxQ4xcALclueCP20WQyA3XRXaESfiDi02FOTjEKDR/rZ7TzMEvUNpX2QNrNA1HDVeAw4CYGhOu3At1qQIfgDF/IKh8HJNGCOY8eowXx/Ba8Q= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769005220; c=relaxed/simple; bh=O7m4ZpKhedGqokJhJAmLBqTyG3gdL+OWB9GtYVZR0c4=; h=Message-ID:Subject:From:To:Cc:Date:In-Reply-To:References: Content-Type:MIME-Version; b=FViRCue3n+GmVxwjwDXhS0cxL3HSc9GHbEgFWdqfH5zPBFSluBb/rzPv8iCsaD4nXQdrSw7Xdn+F+PvUVcuj8EYRCZ/0BuXz5LcPgxJCrjj29UUZY68+AMa5u2KE/0WggQxZuMEDi7ebTY4YUL24cMssYa5aUKcGmXrg+v/kpZM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=Q93RR6f8; arc=none smtp.client-ip=209.85.128.43 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Q93RR6f8" Received: by mail-wm1-f43.google.com with SMTP id 5b1f17b1804b1-4801c2fae63so45000075e9.2 for ; Wed, 21 Jan 2026 06:20:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1769005217; x=1769610017; darn=vger.kernel.org; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:cc:to:from:subject:message-id:from:to:cc:subject :date:message-id:reply-to; bh=O7m4ZpKhedGqokJhJAmLBqTyG3gdL+OWB9GtYVZR0c4=; b=Q93RR6f81EvQkB7iBQ5VLbGCFlzm6A6J8eQHyh9cWoZYBy4CBEySyHTFCFXSQ/F1Kx tPzkABGWcmySKGB4bYXWrV8iTKxWYOjAjPcK2TdxTlGWlftBxFkPEjrwFyzzU0DDoMYt zl3HYaYU4ce0nGCSZYp7nHjJTmX1uIRk1sfv7nMlTMkmVnWVaq7DO3PiVHJfPYqV1vNr nA3XKRB0HsMBysyxW9HhNHHCrj8X/vYIrPX9zXeA0S9JDAHdQkZqHvqTNCm4HnzlOShb v5JUJul67ZvarcQTIOPQ32UHuCBSpn1AVKdy+ybwXIALXjsUrm9wdFDKA+P/sNiJxs+P 45cg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1769005217; x=1769610017; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:cc:to:from:subject:message-id:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=O7m4ZpKhedGqokJhJAmLBqTyG3gdL+OWB9GtYVZR0c4=; b=i3aJXxORnoMS/UuqEqUk1CjfiHod19YjBbHq+EYjUs6Sor79od3nMkkc7twBJoUzt0 zBFYJUmkxtKMqCoWS2q5t7x2icTmJHkjEmZVu4R3VIJ6ctW5f/lM2enQFcaszfisG2pG tHFad3yOuAPPJzEZw2vGxj4qvxujFeoGGf5Dqrl/67/uCLWIRMCrFSTiobPb6Fl2JMvX Go5HAP8oxPXyj+GofxDCZOsqw0q7a3oy2/ZPwprhDKxBNA5PI1dTjyuKRT28BDBBLz8A Utvi8sX/p9GqpsecZWKpyMASheOhAkBSuJhGmsUa/dncxQSvG+0t5ohzc2TuEQTGSEFZ T+MQ== X-Forwarded-Encrypted: i=1; AJvYcCWQhgkN2O3nDhd2iKkXu/IyLjrk2uEiotjd84/bu+40cxrL4R+ZmZtQQ5DYiX7MRLg/kW47+bNYQH1fw3c=@vger.kernel.org X-Gm-Message-State: AOJu0YxQbJA0AXq7HvAAL43R/oeQvWmtazKKp05DJvOREPEgq6sKjb+d mGTJ8iuym91D9ivybYAJj8XWjoV5pFulnR/wzqDzaBZlFWc0nyQ8Jxe0 X-Gm-Gg: AZuq6aKWNae6ik0yeL3/xhOzE0uCRxDHbN57HtrEd2RQkqw29pcctbB4888yXQHG3CN ga421Ym8DK/Cl4sq5o/rUDMdZLsKTCQy+JtGqVlVStXaruP6oemFMbvoC3dWJftHs2e8YevUuIb u0BFAgSTG5rzwawGPAGcXCnfYEaKyDBRk9lhb27Ph3lvF4Vhe5/IRGtXAgO85b9aFtQxMo4rEwY YKPnXB7YHWQzvmlKZdlggasEUZ5SJPDG8JWgm49w7cT2fTHLbL0OJMc9PH2F6zmtC7m+XX2hACR U8CeT9eJPv7cXv7R8QiwNFO81uV0zKAMVctDYQKv0R3Uhh9xzJJ9CTTWSm2wesSyU6dOjZXYF7Q eNq+p8mXdGbFIwg9VFyZrE2hUW2xMTjMp8jL6spvL/FKpxMqUImHroYje5rLO2jCinmf8kko7SM Iwo23r4g+KfjzQ7QU2q88= X-Received: by 2002:a05:600c:4e50:b0:47e:e2ec:9947 with SMTP id 5b1f17b1804b1-4801e34dfdamr242339415e9.33.1769005217144; Wed, 21 Jan 2026 06:20:17 -0800 (PST) Received: from [192.168.1.187] ([148.63.225.166]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4801e886829sm311971825e9.8.2026.01.21.06.20.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Jan 2026 06:20:16 -0800 (PST) Message-ID: <99789eb34873eca976a3324c363a1dc70a2f0d3d.camel@gmail.com> Subject: Re: [PATCH v4 3/7] iio: frequency: adf41513: driver implementation From: Nuno =?ISO-8859-1?Q?S=E1?= To: Andy Shevchenko , Rodrigo Alencar <455.rodrigo.alencar@gmail.com> Cc: Andy Shevchenko , rodrigo.alencar@analog.com, linux-kernel@vger.kernel.org, linux-iio@vger.kernel.org, devicetree@vger.kernel.org, linux-doc@vger.kernel.org, Jonathan Cameron , David Lechner , Andy Shevchenko , Lars-Peter Clausen , Michael Hennerich , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Jonathan Corbet Date: Wed, 21 Jan 2026 14:21:00 +0000 In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.58.2 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 On Wed, 2026-01-21 at 11:52 +0200, Andy Shevchenko wrote: > On Wed, Jan 21, 2026 at 09:41:25AM +0000, Rodrigo Alencar wrote: > > On 26/01/20 03:38PM, Andy Shevchenko wrote: > > > 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=E2=80=AFPM Rodrigo Alencar > > > > > <455.rodrigo.alencar@gmail.com> wrote: > > > > > > On 26/01/19 07:07PM, Andy Shevchenko wrote: > > > > > > > On Mon, Jan 19, 2026 at 04:37:09PM +0000, Rodrigo Alencar wro= te: > > > > > > > > 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 Ale= ncar via B4 Relay wrote: >=20 > ... >=20 > > > > > > > > > > The current implementation is kind of a stripped versio= n of > > > > > > > > > > __iio_str_to_fixpoint(). Would you prefer something lik= e this, then?: > > > > > > > > >=20 > > > > > > > > > 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 slightl= y refactor > > > > > > > > > that to give us the results we need here? > > > > > > > >=20 > > > > > > > > __iio_str_to_fixpoint() only parses "int" chunks, adf41513_= parse_uhz > > > > > > > > was modified to accomodate the u64 parsing removing unneces= sary stuff. > > > > > > >=20 > > > > > > > But why? The fractional part most likely will be kept int (it= 's up to 10=E2=81=BB=E2=81=B9). > > > > > > > The integer can be bigger than 10=E2=81=B9? > > > > > >=20 > > > > > > Correct, integer part of the frequency value goes up to 26.5 GH= z > > > > > > (uint_max is approx 4.3 GHz). Also, with the dual modulus, the = PLL can > > > > > > achieve micro Hz resolution. > > > > >=20 > > > > > =C2=B5Hz 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 th= e > > > > > __iio_str_to_fixpoint() cases? > > > >=20 > > > > I am not sure what you are suggesting, > > >=20 > > > To make changes to reuse the code. > > >=20 > > > > but I am avoiding changes to iio core at this point. > > >=20 > > > Why? > >=20 > > I understood that core changes would require more than one user > > supporting the change. >=20 > At least one. And we have tons of them as the callers of > __iio_str_to_fixpoint() are not going to disappear. Basically it's a surg= ery in > the middle of the existing chain of APIs. To me one user is enough justif= ication > for such a surgery. For the newly introduced API (imagine __iio_str_to_fi= xpoint() > as an example) it's indeed one user not enough. >=20 > > > > If any other user needs similar behavior, > > > > I'd say we would need to have __iio_str_to_fixpoint() implementatio= n > > > > modified, so to create a version of iio_str_to_fixpoint() that hand= les > > > > long long variables. Possibly consuming simple_strtoull instead of > > > > doing the manual parsing. > > >=20 > > > That's the problem here. With Yet Another Cool Parser this all become= s > > > unmaintainable very soon > >=20 > > Considering that the need for a new parser for 64-bit parts is only dri= ven > > by this specific PLL driver, I wonder how things become that unmaintain= able. >=20 > Because there is a duplication of the code (to some extent) and if we fou= nd > a bug in the one implementation it will be hard to fix (or even remeber) = about > the other. Agreed! >=20 > > > (basically as you said when new comer needs a third > > > variant of it). This is not good. Instead better to create (amend, ex= pand) > > > existing test cases, split out a foundation API that parses 64-bit pa= rts > > > (maybe even for fractional as well, dunno) and evolve a needed (sub)A= PI > > > from it. > >=20 > > I don't disagree with you though, I suppose I will need a green light t= o > > move on with this? >=20 > Fine with me, let's gather opinions of David, Nuno, Jonathan, and others. Fine with me. - Nuno S=C3=A1