Re: [PATCH v6 11/11] iio: adc: hx711: add support for HX710B

Jonathan Cameron
2026-05-04T16:59:18Z

On Mon, 4 May 2026 18:52:56 +0300
Andy Shevchenko <andriy.shevchenko@intel.com> wrote:

> On Sun, May 03, 2026 at 05:39:40PM +0530, Piyush Patle wrote:
> > Add support for the AVIA HX710B ADC, which shares the HX711 GPIO
> > interface but uses trailing PD_SCK pulses to select the active mode.
> >
> > Model the HX710B with variant-specific channel tables and IIO info,
> > track the active channel across conversions, and use the fixed gain
> > value when computing scale.
> >
> > Also update the adjacent Kconfig text, file header, and module
> > description so the driver text matches the newly supported variant.
>
> ...
>
> > /*
> > * triggered buffer
> > - * 2x32-bit channel + 64-bit naturally aligned timestamp
> > + * up to 3x32-bit channels + pad + 64-bit naturally aligned timestamp
> > */
> > struct {
> > - u32 channel[2];
> > + u32 channel[3];
> > + u32 pad;
> > aligned_s64 timestamp;
> > } buffer;
>
> Maybe it's obvious to everybody, but me, however I find it difficult to see if
> there is no ABI breakage. Can you add a comment explaining why this is not a
> problem?
>
I replied in v5 (after this was out :)

It's not actually an ABI breakage, but only because the timestamp doesn't
land where this would make you think it does. If there are less than 3 channels
enabled it lands 8 bytes in, so on top of channel[2] and the pad.

It is misleading which is why we don't use structures when it is possible to enable
a smaller set of channels and have the ones after them move up in the structure.
David add the stuff to declare buffers for this form - so we should use that.
See v5 reply as I've forgotten what the macro is called again ;)

Jonathan