[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20250830204824.2f9d7a48@jic23-huawei>
Date: Sat, 30 Aug 2025 20:48:24 +0100
From: Jonathan Cameron <jic23@...nel.org>
To: Andy Shevchenko <andy.shevchenko@...il.com>
Cc: David Lechner <dlechner@...libre.com>, Michael Hennerich
<Michael.Hennerich@...log.com>, Nuno Sá <nuno.sa@...log.com>,
Andy Shevchenko <andy@...nel.org>, Rob Herring <robh@...nel.org>, Krzysztof
Kozlowski <krzk+dt@...nel.org>, Conor Dooley <conor+dt@...nel.org>,
linux-iio@...r.kernel.org, devicetree@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH v3 3/4] iio: adc: ad7124: add external clock support
On Fri, 29 Aug 2025 22:11:12 +0300
Andy Shevchenko <andy.shevchenko@...il.com> wrote:
> On Fri, Aug 29, 2025 at 8:19 PM David Lechner <dlechner@...libre.com> wrote:
> > On 8/29/25 10:53 AM, Andy Shevchenko wrote:
> > > On Fri, Aug 29, 2025 at 12:55 AM David Lechner <dlechner@...libre.com> wrote:
>
> ...
>
> > >> + if (clk_hz > MEGA) {
> > >
> > > I read your answer, but maybe I missed something? Can we use (1 *
> > > HZ_PER_MHZ) here?
> >
> > I suppose we can. But it doesn't add any additional information.
> > We already know we are dealing with Hz because of clk_hz and 1
> > is implicit. So it is just a matter of style preference. Since I
> > read a lot of code, I tend to prefer the minimal approach - it is
> > less to read and still has the same meaning.
>
> Physicist in me prefers pedantism in comparison of the units. We don't
> compare kilometers with kilograms (maybe not the best example, though,
> if you understand what I mean :-).
>
As I don't think either of you have particularly strong opinions on this
(or at least you'll both be flexible) and I want to merge it.
I tweaked to 1 * HZ_PER_MHZ and applied the series.
Thanks,
Jonathan
> > >> + clk_sel = AD7124_ADC_CONTROL_CLK_SEL_EXT_DIV4;
> > >> + st->clk_hz = clk_hz / 4;
> > >> + } else {
> > >> + clk_sel = AD7124_ADC_CONTROL_CLK_SEL_EXT;
> > >> + st->clk_hz = clk_hz;
> > >> + }
>
>
Powered by blists - more mailing lists