Re: [PATCH v3 2/2] iio: dac: ad5706r: Add support for AD5706R DAC

From: Andy Shevchenko

Date: Thu Mar 19 2026 - 03:07:44 EST


On Thu, Mar 19, 2026 at 05:23:07AM +0000, Torreno, Alexis Czezar wrote:
> > On Wed, Mar 18, 2026 at 01:13:36PM +0800, Alexis Czezar Torreno wrote:

...

> > > Changes since v1:
> > > - Removed PWM, GPIO, clock generator, debugfs, regmap, IIO_BUFFER
> >
> > Why was regmap removed?! Was it not used?
>
> As far as I understand it, regmap also gives access to debugfs. When I removed
> debugfs I also added regmap as removed.

Not only debugfs, and it's unrelated to the any custom debugfs interfaces in
the driver, it's just a feature out-of-the-box of regmap.

> For the spi write/read I am not using regmap as the device has some features
> that I think regmap_read/write couldn't support. Namely the variable data width,
> as the device only accepts exact amount of clock cycles. Future patches will also add
> variable SPI speed.

We have a lot of flexibility in regmap core. Do you think it can be improved /
extended to cover the cases like yours?

> > > - Removed all custom ext_info sysfs attributes
> > > - Simplified to basic raw read/write and read-only scale
> > > - SPI read/write can handle multibyte registers

...

> > > +#include <linux/array_size.h>
> > > +#include <linux/bits.h>
> > > +#include <linux/cleanup.h>
> >
> > + errno.h
> >
> > > +#include <linux/iio/iio.h>
> >
> > + mod_devicetable.h
> >
> > > +#include <linux/module.h>
> > > +#include <linux/mutex.h>
> > > +#include <linux/spi/spi.h>
> >
> > + types.h
> >
> > > +#include <linux/unaligned.h>
> >
> > Follow IWYU principle.
>
> I did miss errno.h

You missed more as I showed above.

> but it seems the IWYU is stricter than pragmatic.

No, it's not true. The required headers is exactly very pragmatic in order to
untangle the dependency hell we have in the kernel. You can browse the lore
archive for that keyword and find tons of problems people reported in the past
10+ years with that.

> Will adhere to it better.

Please, do.

--
With Best Regards,
Andy Shevchenko