RE: [PATCH v13 2/6] iio: adc: ad4691: add initial driver for AD4691 family

From: Sabau, Radu bogdan

Date: Fri May 29 2026 - 07:19:07 EST


> -----Original Message-----
> From: Jonathan Cameron <jic23@xxxxxxxxxx>
> Sent: Wednesday, May 27, 2026 9:07 PM

...

> > +static bool ad4691_volatile_reg(struct device *dev, unsigned int reg)
> > +{
> > + switch (reg) {
> > + case AD4691_STATUS_REG:
> > + case AD4691_CLAMP_STATUS1_REG:
> > + case AD4691_CLAMP_STATUS2_REG:
> > + case AD4691_GPIO_READ:
> > + case AD4691_ACC_STATUS_FULL1_REG ...
> AD4691_ACC_STATUS_SAT2_REG:
> > + case AD4691_ACC_SAT_OVR_REG(0) ...
> AD4691_ACC_SAT_OVR_REG(15):
> > + return true;
> > + default:
> > + break;
> > + }
> > +
> > + /*
> > + * Multi-byte registers have non-unit strides; only accept base
> > + * addresses to prevent debugfs from triggering reads that cross
> > + * register boundaries.
> What does this have to do with preventing debugfs from doing anything.
> It should allow reading of volatile registers. Why is it not enough to
> make the non base aligned registers neither readable nor writeable?
>

You're right, the comment is wrong and the stride logic is misplaced.
readable_reg is what gates debugfs access, so the stride checks in
volatile_reg are redundant and the comment is incorrect.