Re: [PATCH 2/3] iio: adc: ad4130: introduce chip info for future multidevice support
From: Andy Shevchenko
Date: Mon Mar 02 2026 - 07:46:56 EST
On Sat, Feb 28, 2026 at 09:38:53AM -0300, Jonathan Santos wrote:
> Introduce a chip_info structure to abstract device-specific parameters
> and prepare the driver for supporting multiple AD4130 family variants.
...
> +struct ad4130_chip_info {
> + const char *name;
> + unsigned int max_analog_pins;
> + const struct iio_info *info;
> + const unsigned int *reg_size;
> + const unsigned int reg_size_length;
> +};
Is `pahole` okay with the chosen layout?
...
> static const struct of_device_id ad4130_of_match[] = {
> - {
> - .compatible = "adi,ad4130",
> - },
> + { .compatible = "adi,ad4130", .data = &ad4130_8_chip_info },
Why touching the rest? Isn't just fine to add
.data = ...,
?
> { }
> };
...
> +static const struct spi_device_id ad4130_id_table[] = {
> + { "ad4130", (kernel_ulong_t)&ad4130_8_chip_info },
> + { }
> +};
> +MODULE_DEVICE_TABLE(spi, ad4130_id_table);
> + .id_table = ad4130_id_table,
Strictly speaking this can be a precursor change, while here you just add a
driver_data to it.
--
With Best Regards,
Andy Shevchenko