[PATCH v2 1/2] dt-bindings: iio: adc: avia-hx711: add avia,hx710b compatible

From: Piyush Patle

Date: Sun Apr 19 2026 - 13:47:42 EST


The HX710B shares the same two-wire interface as the HX711 but differs
in its channel and gain model: gain is fixed at 128 and the number of
trailing PD_SCK pulses selects the input channel rather than the gain.

Add avia,hx710b to the compatible enum. Document the chip differences
in the description and add chip-specific supply properties (dvdd-supply,
vsup-supply) for the HX711, a rate-gpios property for the HX711 RATE
pin, and an allOf constraint that forbids HX711-only properties on
HX710B nodes. Clarify the clock-frequency description to reflect its
actual purpose: controlling the SCK bit-bang timing. Note that AVDD
serves as the voltage reference on both chips so no separate
vref-supply is needed.

Signed-off-by: Piyush Patle <piyushpatle228@xxxxxxxxx>
---
Changes in v2:
- Remove driver implementation details (bit-banging, channel-selection
mechanics) from the description; describe hardware behaviour only
- Drop unrelated punctuation cleanup (trailing period on PD_SCK description)
- Add dvdd-supply and vsup-supply optional properties for HX711
- Add rate-gpios optional property for the HX711 RATE pin; forbid it on
HX710B via the allOf if/then block
- Add note to avdd-supply clarifying it serves as voltage reference on
both chips (no separate vref-supply needed)
- Add allOf if/then block forbidding HX711-only properties on HX710B
- Fix clock-frequency description to reflect its true purpose (SCK
bit-bang timing control, not a crystal/external clock frequency)
- Sort compatible enum alphabetically (hx710b before hx711)
- Remove redundant example comments (compatible already identifies part)
- Update HX711 example to exercise the new rate-gpios property

.../bindings/iio/adc/avia-hx711.yaml | 61 ++++++++++++++++---
1 file changed, 51 insertions(+), 10 deletions(-)

diff --git a/Documentation/devicetree/bindings/iio/adc/avia-hx711.yaml b/Documentation/devicetree/bindings/iio/adc/avia-hx711.yaml
index 9c57eb13f892..35ac74a490b1 100644
--- a/Documentation/devicetree/bindings/iio/adc/avia-hx711.yaml
+++ b/Documentation/devicetree/bindings/iio/adc/avia-hx711.yaml
@@ -4,24 +4,24 @@
$id: http://devicetree.org/schemas/iio/adc/avia-hx711.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

-title: AVIA HX711 ADC chip for weight cells
+title: AVIA HX711 and HX710B ADCs

maintainers:
- Andreas Klinger <ak@xxxxxxxxxxxxx>

description: |
- Bit-banging driver using two GPIOs:
- - sck-gpio gives a clock to the sensor with 24 cycles for data retrieval
- and up to 3 cycles for selection of the input channel and gain for the
- next measurement
- - dout-gpio is the sensor data the sensor responds to the clock
+ The HX711 is a 24-bit ADC with selectable gain (32/64/128) and two
+ differential input channels. Channel A supports gain 64 and 128;
+ channel B supports gain 32.

- Specifications about the driver can be found at:
- http://www.aviaic.com/ENProducts.aspx
+ The HX710B is a 24-bit ADC with fixed gain of 128. Channel 0 is the
+ differential input and channel 1 measures the DVDD-AVDD supply
+ voltage difference.

properties:
compatible:
enum:
+ - avia,hx710b
- avia,hx711

sck-gpios:
@@ -40,13 +40,45 @@ properties:

avdd-supply:
description:
- Definition of the regulator used as analog supply
+ Analog supply voltage (AVDD). Also serves as the voltage reference on
+ both chips; no separate vref-supply is required.
+
+ dvdd-supply:
+ description:
+ Digital supply voltage (DVDD). HX711 only.
+
+ vsup-supply:
+ description:
+ Supply voltage for the on-chip regulator (VSUP). HX711 only.
+
+ rate-gpios:
+ description:
+ GPIO connected to the RATE pin (HX711 only). When driven low the
+ output data rate is 10 SPS; when driven high it is 80 SPS. If
+ omitted the RATE pin state is determined by the board wiring.
+ maxItems: 1

clock-frequency:
+ description:
+ Controls the SCK bit-bang timing. The value is used to derive the
+ delay between SCK edges; keep the SCK high time below 60 us to
+ avoid triggering chip power-down mode. Defaults to 400 kHz if not
+ specified.
minimum: 20000
maximum: 2500000
default: 400000

+allOf:
+ - if:
+ properties:
+ compatible:
+ const: avia,hx710b
+ then:
+ properties:
+ vsup-supply: false
+ dvdd-supply: false
+ rate-gpios: false
+
required:
- compatible
- sck-gpios
@@ -58,10 +90,19 @@ additionalProperties: false
examples:
- |
#include <dt-bindings/gpio/gpio.h>
- weight {
+ weight0 {
compatible = "avia,hx711";
sck-gpios = <&gpio3 10 GPIO_ACTIVE_HIGH>;
dout-gpios = <&gpio0 7 GPIO_ACTIVE_HIGH>;
+ rate-gpios = <&gpio0 9 GPIO_ACTIVE_HIGH>;
avdd-supply = <&avdd>;
clock-frequency = <100000>;
};
+ - |
+ #include <dt-bindings/gpio/gpio.h>
+ weight1 {
+ compatible = "avia,hx710b";
+ sck-gpios = <&gpio3 11 GPIO_ACTIVE_HIGH>;
+ dout-gpios = <&gpio0 8 GPIO_ACTIVE_HIGH>;
+ avdd-supply = <&avdd>;
+ };
--
2.43.0