Re: [PATCH 2/5] iio: adc: adi-axi-adc: add set decimation rate

From: Andy Shevchenko
Date: Mon Mar 24 2025 - 06:15:26 EST


On Mon, Mar 24, 2025 at 11:07:57AM +0200, Pop Ioan Daniel wrote:
> Add support for setting decimation rate.
>
> Add separate compatible string for the custom AD7405 IP and implement
> the necessary changes.

...

> +static int axi_adc_set_dec_rate(struct iio_backend *back,
> + unsigned int rate)
> +{
> + struct adi_axi_adc_state *st = iio_backend_get_priv(back);
> +
> + return regmap_update_bits(st->regmap, (ADI_AXI_ADC_REG_CHAN_USR_CTRL_2),

What' the purpose of the parentheses, please?

> + ADI_AXI_ADC_DEC_RATE_MASK,
> + FIELD_PREP(ADI_AXI_ADC_DEC_RATE_MASK, rate));
> +}

...

> /* Match table for of_platform binding */
> static const struct of_device_id adi_axi_adc_of_match[] = {
> { .compatible = "adi,axi-adc-10.0.a", .data = &adc_generic },
> { .compatible = "adi,axi-ad7606x", .data = &adc_ad7606 },
> + { .compatible = "adi,axi-ad7405", .data = &adi_axi_ad7405},

You really need to be as much as possible consistent with the style in the
current code.

> { /* end of list */ }
> };

--
With Best Regards,
Andy Shevchenko