Re: [PATCH v2 4/8] dt-bindings: iio: adc: add input-channel-rotation property
From: Conor Dooley
Date: Thu Jul 02 2026 - 15:04:54 EST
On Wed, Jul 01, 2026 at 08:41:33PM +0100, Jonathan Cameron wrote:
> On Fri, 26 Jun 2026 13:27:44 -0500
> David Lechner <dlechner@xxxxxxxxxxxx> wrote:
>
> > On 6/26/26 11:14 AM, Conor Dooley wrote:
> > > On Thu, Jun 25, 2026 at 04:55:06PM -0500, David Lechner (TI) wrote:
> > >> Add a generic input-channel-rotation property to adc.yaml. This is a
> > >> feature seen frequently in ADCs that are designed to measure resistive
> > >> loads, such as RTDs and strain gauges. Enabling this can reduce offset
> > >> errors by swapping the positive and negative input channels on every
> > >> other conversion. This can have side-effects in timing and filter
> > >> response, so it is not always desirable to enable this feature in some
> > >> applications. Therefore, it is best to make this a property that can be
> > >> enabled or disabled in the device tree.
> > >>
> > >> Signed-off-by: David Lechner (TI) <dlechner@xxxxxxxxxxxx>
> > >> ---
> > >> v2 changes:
> > >> * New patch.
> > >> ---
> > >> Documentation/devicetree/bindings/iio/adc/adc.yaml | 7 +++++++
> > >> 1 file changed, 7 insertions(+)
> > >>
> > >> diff --git a/Documentation/devicetree/bindings/iio/adc/adc.yaml b/Documentation/devicetree/bindings/iio/adc/adc.yaml
> > >> index 9ec1f447b565..3d52c00922c9 100644
> > >> --- a/Documentation/devicetree/bindings/iio/adc/adc.yaml
> > >> +++ b/Documentation/devicetree/bindings/iio/adc/adc.yaml
> > >> @@ -81,6 +81,13 @@ properties:
> > >> ADCs usually allow choosing between internal reference sources or a pair
> > >> of external pins.
> > >>
> > >> + input-channel-rotation:
> >
> > I got some internal feedback after I sent this patch that "chopping" is the
> > more common terminology for this feature industry-wide, so in the next revision
> > I plan to change it into `input-chopping`.
> >
> > >> + type: boolean
> > >> + description:
> > >> + If set, the positive and negative input channels are allowed to be swapped
> > >> + on every other conversion to reduce offset errors. This is also referred
> > >> + to as "chop" in some datasheets.
> > >
> > > "allowed to be swapped" means that this property says the feature can be
> > > used, but userspace may have to be the thing that ultimately turns it
> > > on?
> >
> > No, I don't expect a userspace control for it. More like the driver should
> > enable it when possible, but a driver doesn't necessarily have to implement
> > it and everything will still work, just with less accuracy.
>
> Perhaps we need something in this text to say when it should not be set
> in dt?
I think I would like a wording change from "allowed", to something that
is akin to "If set, the hardware supports swapping...". Allows sounds
too much like something that should be a userspace control.
Attachment:
signature.asc
Description: PGP signature