[PATCH v3 0/3] iio: adc: hx711: add HX710B support

Piyush Patle
2026-04-22T17:59:18Z

Add support for the HX710B ADC, a variant of the HX711 with the same
GPIO interface but a different channel and gain model.

The first patch updates the devicetree binding to add the
`avia,hx710b` compatible, document the variant-specific behavior, and
add chip-specific properties for supplies, the RATE pin, and an allOf
constraint for HX710B nodes.
The second patch refactors the driver with per-chip configuration and
keeps the existing HX711 behavior unchanged.
The third patch adds HX710B support using that infrastructure, with
pulse counts stored in chan->address, a dedicated fixed_gain flag, and
the differential channel descriptor for the HX710B input.

Tested on PocketBeagle2 with an HX710B breakout module. The device
probed successfully, both channels returned stable raw readings, and
alternating reads confirmed channel switching between the differential
input and the DVDD-AVDD supply monitor path.

Build-tested with:
- make -s W=1 drivers/iio/adc/hx711.o
- pahole -C hx711_chip_info drivers/iio/adc/hx711.o

pahole reports hx711_chip_info as 40 bytes with no internal holes. The
remaining 7 bytes are tail padding from 8-byte alignment.

Changes in v3:
- See individual patch changelogs for full details.
- dt-bindings: remove vref-supply wording; drop repeated
clock-frequency default text; restore example node name; remove the
extra HX710B example
- driver: split the hx711_chip_info refactor from the HX710B support
patch; fix signedness; update channel_set only after successful
channel switching; keep HX710B scale based on the documented fixed
gain of 128; add direct ARRAY_SIZE/types includes; use pahole to
verify and improve hx711_chip_info field ordering
- Reworked Kconfig text to use "HX711 and compatible ADCs" and list
supported AVIA ADCs one per line.
- Restored/updated driver header and module description wording while
keeping the bitbanging context.

Changes in v2:
- See individual patch changelogs for full details.
- dt-bindings: add dvdd-supply, vsup-supply, rate-gpios; allOf if/then
for HX710B; fix clock-frequency description; remove dead vendor URL;
clarify AVDD as voltage reference on both chips
- driver: fix pulse count bug ({25,26}->{1,2}); move counts to
chan->address; add fixed_gain flag; add .differential/.channel2;
remove NULL check; drop reset_channel; pass iio_chan_spec * directly

Piyush Patle (3):
dt-bindings: iio: adc: avia-hx711: add avia,hx710b compatible
iio: adc: hx711: refactor to per-chip hx711_chip_info structure
iio: adc: hx711: add support for HX710B

.../bindings/iio/adc/avia-hx711.yaml | 50 +++-
drivers/iio/adc/Kconfig | 8 +-
drivers/iio/adc/hx711.c | 216 ++++++++++++++----
3 files changed, 221 insertions(+), 53 deletions(-)

--
2.43.0