Re: [PATCH v2 1/4] iio: dac: ad3530r: Refactor setup to table-driven register bank approach

From: Andy Shevchenko

Date: Fri Jun 26 2026 - 06:12:56 EST


On Fri, Jun 26, 2026 at 08:44:57AM +0000, Paller, Kim Seer wrote:
> > -----Original Message-----
> > From: Andy Shevchenko <andriy.shevchenko@xxxxxxxxx>
> > Sent: Monday, June 15, 2026 6:08 PM
> > On Mon, Jun 15, 2026 at 02:20:15PM +0800, Kim Seer Paller wrote:

...

> > > + for (unsigned int i = 0; i < num_regs; i++) {
> > > + ret = regmap_write(st->regmap, regs[i], val);
> > > + if (ret)
> > > + return ret;
> > > + }
> >
> > Can the above helpers use bulk operations or regmap_multi_reg_write()?
>
> I think bulk operations don't apply for the AD3532R case, since bank 0 is around 0x102x
> and bank 1 around 0x302x two register banks, not one continuous block.
> For regmap_multi_reg_write(), since all the registers get the same value, we would
> have to build a reg_sequence, and it ends up being the same number of writes with
> just more code. So I think the simple loop helper is better here, but happy to switch if
> regmap_multi_reg_write() is the preferred form.

No need, thanks for the explanation.

--
With Best Regards,
Andy Shevchenko