[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAHp75VeTqm+aAt47rSRznpZe5=wd_X24ZtvjXJNj=b3HGu5Sxw@mail.gmail.com>
Date: Sat, 30 Aug 2025 10:42:40 +0300
From: Andy Shevchenko <andy.shevchenko@...il.com>
To: Marcelo Schmitt <marcelo.schmitt@...log.com>
Cc: linux-iio@...r.kernel.org, linux-kernel@...r.kernel.org,
linux-doc@...r.kernel.org, devicetree@...r.kernel.org,
linux-spi@...r.kernel.org, jic23@...nel.org, Michael.Hennerich@...log.com,
nuno.sa@...log.com, eblanc@...libre.com, dlechner@...libre.com,
andy@...nel.org, corbet@....net, robh@...nel.org, krzk+dt@...nel.org,
conor+dt@...nel.org, broonie@...nel.org, Jonathan.Cameron@...wei.com,
andriy.shevchenko@...ux.intel.com, ahaslam@...libre.com,
sergiu.cuciurean@...log.com, marcelo.schmitt1@...il.com
Subject: Re: [PATCH 11/15] iio: adc: ad4030: Add clock mode option parse and setup
On Sat, Aug 30, 2025 at 3:44 AM Marcelo Schmitt
<marcelo.schmitt@...log.com> wrote:
>
> AD4030 series of ADCs support three different options for the clock that
> frames data output. Since each clock option implies a different hardware
> setup, the clock mode to use is specified in firmware. Read the designated
> clock option from firmware and configure the device to work accordingly.
...
> + ret = device_property_match_property_string(dev, "adi,clock-mode",
> + ad4030_clock_mode_str,
> + ARRAY_SIZE(ad4030_clock_mode_str));
> + /* Default to SPI clock mode. */
> + reg_modes |= FIELD_PREP(AD4030_REG_MODES_MASK_CLOCK_MODE,
> + ret >= 0 ? ret : AD4030_SPI_CLOCK_MODE);
FIELD_MODIFY() ?
Also, I would rather put it as proper if
if (ret >= 0)
FIELD_MODIFY(...)
else
FIELD_MODIFY(...)
> +
I would not add this blank line as these are coupled.
> ret = regmap_write(st->regmap, AD4030_REG_MODES, reg_modes);
> if (ret)
> return ret;
--
With Best Regards,
Andy Shevchenko
Powered by blists - more mailing lists