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

From: Jonathan Cameron

Date: Sun Jun 21 2026 - 12:49:50 EST


On Mon, 15 Jun 2026 14:20:15 +0800
Kim Seer Paller <kimseer.paller@xxxxxxxxxx> wrote:

> Replace direct register calls in ad3530r_setup() with per-chip register
> address arrays and bank helpers (ad3530r_set_reg_bank_bits,
> ad3530r_write_reg_banks). Convert sw_ldac_trig_reg from a static
> register address to a function pointer for per-bank LDAC trigger
> register selection. Switch spi_device_id to named initializers.
>
> Signed-off-by: Kim Seer Paller <kimseer.paller@xxxxxxxxxx>

>
> static const struct spi_device_id ad3530r_id[] = {
> - { "ad3530", (kernel_ulong_t)&ad3530_chip },
> - { "ad3530r", (kernel_ulong_t)&ad3530r_chip },
> - { "ad3531", (kernel_ulong_t)&ad3531_chip },
> - { "ad3531r", (kernel_ulong_t)&ad3531r_chip },
> + { .name = "ad3530", .driver_data = (kernel_ulong_t)&ad3530_chip },
> + { .name = "ad3530r", .driver_data = (kernel_ulong_t)&ad3530r_chip },
> + { .name = "ad3531", .driver_data = (kernel_ulong_t)&ad3531_chip },
> + { .name = "ad3531r", .driver_data = (kernel_ulong_t)&ad3531r_chip },

There is a high chance this will cross with Uwe's series that does
this change for all SPI drivers. Before you send each version have
a quick look to see if I've already picked that up. Or perhaps
better to just pick that up your self as a dependency to make
life easy. Just say you have done that in the cover letter.
> { }
> };
> MODULE_DEVICE_TABLE(spi, ad3530r_id);
>