Re: [PATCH v3 2/2] iio: adc: add Axiado SARADC driver
From: Andy Shevchenko
Date: Mon Jun 29 2026 - 02:05:49 EST
On Mon, Jun 29, 2026 at 04:33:00AM +0200, Petar Stepanovic wrote:
...
> >> +static const struct iio_chan_spec axiado_saradc_iio_channels[] = {
> >> + AX_SARADC_CH(0, "adc0"), AX_SARADC_CH(1, "adc1"),
> >> + AX_SARADC_CH(2, "adc2"), AX_SARADC_CH(3, "adc3"),
> >> + AX_SARADC_CH(4, "adc4"), AX_SARADC_CH(5, "adc5"),
> >> + AX_SARADC_CH(6, "adc6"), AX_SARADC_CH(7, "adc7"),
> >> + AX_SARADC_CH(8, "adc8"), AX_SARADC_CH(9, "adc9"),
> >> + AX_SARADC_CH(10, "adc10"), AX_SARADC_CH(11, "adc11"),
> >> + AX_SARADC_CH(12, "adc12"), AX_SARADC_CH(13, "adc13"),
> >> + AX_SARADC_CH(14, "adc14"), AX_SARADC_CH(15, "adc15"),
> > Two columns looks a bit odd.
>
> I will also reformat the channel table to one entry per line.
I think with a new approach David proposed, 4 per line will be also acceptable.
> >> +};
...
> >> +static void axiado_saradc_disable(void *data)
> >> +{
> >> + struct axiado_saradc *info = data;
> >> +
> >> + writel(AX_SARADC_GLOBAL_CTRL_PD, info->regs + AX_SARADC_GLOBAL_CTRL_REG);
> > People usual make read and write wrappers or use regmap to avoid having
> > to write `info->regs + AX_SARADC_GLOBAL_CTRL_REG` so many times.
>
> My understanding is that simple read/write wrappers are not always
> preferred unless they provide additional value. Would switching the
> driver to regmap be acceptable here to avoid repeating the base address
> calculation?
This is the value of transition --> having that register base to be hidden and
not repeated all the times.
--
With Best Regards,
Andy Shevchenko