Re: [PATCH 6/6] iio: adc: ad7793: add firmware support and drop platform data
From: Nuno Sá
Date: Thu Nov 26 2026 - 05:30:03 EST
On Thu, Nov 26, 2026 at 02:00:51AM +0000, Jonathan Cameron wrote:
> On Wed, 25 Nov 2026 11:11:48 +0000
> Nuno Sá <nuno.sa@xxxxxxxxxx> wrote:
>
> > On Wed, Nov 25, 2026 at 12:43:39PM +0200, Andy Shevchenko wrote:
> > > On Wed, Nov 25, 2026 at 10:19:22AM +0000, Nuno Sá wrote:
> > > > The driver refuses to probe without struct ad7793_platform_data, and
> > > > there are no in-tree users of it. That means the driver can not be used
> > > > at all on a modern system.
> > > >
> > > > Get the configuration from firmware properties instead, following the
> > > > new binding, and drop the platform data header:
> > > >
> > > > - The reference is REFIN (REFIN1) if refin-supply is present, REFIN2 if
> > > > refin2-supply is present, and the internal 1.17 V reference otherwise.
> > > > Parts without an internal reference need refin-supply.
> > > > - An external clock on the CLK pin is used if given. A 128 kHz clock
> > > > is divided by 2 internally.
> > > > - The input buffer stays enabled (as it is at power-up) unless
> > > > adi,buffer-disable is set, and unipolar coding is used unless bipolar
> > > > is set.
> > > > - The bias voltage generator, the burnout currents and the excitation
> > > > current sources get their own properties.
> > > >
> > > > While at it, also enable the AVDD and DVDD supplies, add an OF match
> > > > table and fold the platform data checks into the property parsing.
> > >
> > > First of all, can this be split to a few smaller changes?
> > > I will look at the rest later on.
> >
> > I could but is it worth it? In theory this is all actually resulting of
> > the same change which is dropping platdata which means supporting FW and
> > of_id_table (the extra supplies could another patch but it comes
> > down to the regulator bulk reg). I'll double check if something can be spitted
> > but I do prefer to keep s/platdata/of_id as one single patch.
> One churn reducing thing we've done before with these is to squash the header
> into the c file as a precursor. That gets you all the enums + lots of docs.
>
> The we get to see the switch to a firmware filled structure slightly more
> easily. Another thing I think we did once or twice is just leave
> the platform_data naming alone. That can also reduce the churn somewhat.
> I'm less keen on that one but you could do:
>
> 1. Code move for platform data into the c file.
> 2. Simple renames of platform data to cfg.
> 3. The new handling.
Alright! Will go in the above direction on v2.
- Nuno Sá
>
>
>
> >
> > - Nuno Sá
> >
> > >
> > > --
> > > With Best Regards,
> > > Andy Shevchenko
> > >
> > >
>