From 71119ac764200717ba9fe26a4157bfeb60d5a7f4 Mon Sep 17 00:00:00 2001 From: Jason Yuan Date: Wed, 22 Feb 2023 13:45:48 -0800 Subject: [PATCH] dts: bindings: adc: add shunt sensor Add bindings for a current sensor using a shunt resistor. Signed-off-by: Jason Yuan --- dts/bindings/adc/current-sense-shunt.yaml | 34 +++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 dts/bindings/adc/current-sense-shunt.yaml diff --git a/dts/bindings/adc/current-sense-shunt.yaml b/dts/bindings/adc/current-sense-shunt.yaml new file mode 100644 index 00000000000000..b181f82eb33406 --- /dev/null +++ b/dts/bindings/adc/current-sense-shunt.yaml @@ -0,0 +1,34 @@ +# Copyright 2023 The ChromiumOS Authors +# SPDX-License-Identifier: Apache-2.0 + +description: | + When an io-channel measures the voltage over a current sense shunt, + the interesting measurement is almost always the current through the + shunt, not the voltage over it. This binding describes such a current + sense circuit. + + This is based on Linux, documentation: + https://www.kernel.org/doc/Documentation/devicetree/bindings/iio/afe/ + current-sense-shunt.yaml + +compatible: "current-sense-shunt" + +include: base.yaml + +properties: + io-channels: + required: true + description: | + Channels available with this divider configuration. + + shunt-resistor-micro-ohms: + type: int + required: true + description: | + Resistance of the shunt resistor in micro-ohms + + gain: + type: int + default: 1 + description: | + Gain used to amplify the voltage measured across the shunt resistor.