Re: [PATCH v3 6/8] iio: adc: rzt2h: Prepare for SoCs with different ADC info

From: Jonathan Cameron

Date: Fri Oct 23 2026 - 16:46:26 EST


On Fri, 23 Oct 2026 18:59:17 +0100
Prabhakar <prabhakar.csengg@xxxxxxxxx> wrote:

> From: Lad Prabhakar <prabhakar.mahadev-lad.rj@xxxxxxxxxxxxxx>
>
> Prepare the driver for RZ/V2H(P) support, where the ADC supports 8-bit and
> 12-bit conversion modes with channel configurations that differ from
> RZ/T2H.
>
> Allow each SoC to provide its own IIO info structure and use the
> chip-specific configuration when registering the IIO device.
>
> Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@xxxxxxxxxxxxxx>

FWIW as I'm not going to ask you to respin for this...
I think this should just have been squashed with patch 3 where
*_chip_info was originally introduced.

> ---
> v2->v3:
> - No change
>
> v1->v2:
> - No change
> ---
> drivers/iio/adc/rzt2h_adc.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/iio/adc/rzt2h_adc.c b/drivers/iio/adc/rzt2h_adc.c
> index 94dad479abff..dbe82939acc2 100644
> --- a/drivers/iio/adc/rzt2h_adc.c
> +++ b/drivers/iio/adc/rzt2h_adc.c
> @@ -68,6 +68,7 @@ struct rzt2h_adc;
> struct rzt2h_adc_chip_info {
> const struct iio_chan_spec *chan_template;
> int (*sst_to_freq)(struct rzt2h_adc *adc, u8 sst);
> + const struct iio_info *info;
> unsigned int num_channels;
> u8 features;
> };
> @@ -763,7 +764,7 @@ static int rzt2h_adc_probe(struct platform_device *pdev)
> return ret;
>
> indio_dev->name = "rzt2h-adc";
> - indio_dev->info = &rzt2h_adc_iio_info;
> + indio_dev->info = chip_info->info;
> indio_dev->modes = INDIO_DIRECT_MODE;
> indio_dev->channels = adc->channels;
> indio_dev->num_channels = adc->num_channels;
> @@ -778,6 +779,7 @@ static int rzt2h_adc_probe(struct platform_device *pdev)
> static const struct rzt2h_adc_chip_info rzt2h_adc_info = {
> .chan_template = &rzt2h_adc_chan_template,
> .sst_to_freq = rzt2h_adc_sst_to_freq,
> + .info = &rzt2h_adc_iio_info,
> .num_channels = 16,
> .features = RZT2H_ADC_FEATURE_CALIBRATION | RZT2H_ADC_FEATURE_SAMPLE_STATE,
> };