Re: [PATCH 11/15] iio: adc: ad4030: Add clock mode option parse and setup

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sat, Aug 30, 2025 at 3:44 AM Marcelo Schmitt
<marcelo.schmitt@xxxxxxxxxx> 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





[Index of Archives]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux FS]     [Yosemite Forum]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]     [Linux Resources]

  Powered by Linux