public inbox for devicetree@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v3 0/3] iio: adc: hx711: add HX710B support
@ 2026-04-22 17:59 Piyush Patle
  2026-04-22 17:59 ` [PATCH v3 1/3] dt-bindings: iio: adc: avia-hx711: add avia,hx710b compatible Piyush Patle
                   ` (2 more replies)
  0 siblings, 3 replies; 13+ messages in thread
From: Piyush Patle @ 2026-04-22 17:59 UTC (permalink / raw)
  To: Jonathan Cameron, Andreas Klinger
  Cc: David Lechner, Nuno Sá, Andy Shevchenko, Andy Shevchenko,
	Rob Herring, Krzysztof Kozlowski, Conor Dooley, linux-iio,
	devicetree, linux-kernel

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

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2026-04-26 16:44 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-04-22 17:59 [PATCH v3 0/3] iio: adc: hx711: add HX710B support Piyush Patle
2026-04-22 17:59 ` [PATCH v3 1/3] dt-bindings: iio: adc: avia-hx711: add avia,hx710b compatible Piyush Patle
2026-04-23  8:05   ` Krzysztof Kozlowski
2026-04-24 12:00   ` Jonathan Cameron
2026-04-26 16:28   ` David Lechner
2026-04-26 16:43     ` Piyush Patle
2026-04-22 17:59 ` [PATCH v3 2/3] iio: adc: hx711: refactor to per-chip hx711_chip_info structure Piyush Patle
2026-04-22 20:16   ` Andy Shevchenko
2026-04-24 11:53   ` Jonathan Cameron
2026-04-24 12:14   ` Jonathan Cameron
2026-04-22 17:59 ` [PATCH v3 3/3] iio: adc: hx711: add support for HX710B Piyush Patle
2026-04-22 20:20   ` Andy Shevchenko
2026-04-24 12:19   ` Jonathan Cameron

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox