Add device tree bindings documentation for the Texas Instruments
ADS131M0x analog-to-digital converters. This family includes the ADS131M02,
ADS131M03, ADS131M04, ADS131M06, and ADS131M08 variants.
Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>
---
.../bindings/iio/adc/ti,ads131m08.yaml | 162 ++++++++++++++++++
1 file changed, 162 insertions(+)
create mode 100644 Documentation/devicetree/bindings/iio/adc/ti,ads131m08.yaml
diff --git a/Documentation/devicetree/bindings/iio/adc/ti,ads131m08.yaml b/Documentation/devicetree/bindings/iio/adc/ti,ads131m08.yaml
new file mode 100644
index 000000000000..193ac84c41cd
--- /dev/null
+++ b/Documentation/devicetree/bindings/iio/adc/ti,ads131m08.yaml
@@ -0,0 +1,162 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/iio/adc/ti,ads131m08.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Texas Instruments ADS131M0x 2-, 3-, 4-, 6- and 8-Channel ADCs
+
+maintainers:
+ - Oleksij Rempel <o.rempel@pengutronix.de>
+
+description: |
+ The ADS131M0x are a family of multichannel, simultaneous sampling,
+ 24-bit, delta-sigma, analog-to-digital converters (ADCs) with a
+ built-in programmable gain amplifier (PGA) and internal reference.
+ Communication with the ADC chip is via SPI.
+
+ Datasheets:
+ - ADS131M08: https://www.ti.com/lit/ds/symlink/ads131m08.pdf
+ - ADS131M06: https://www.ti.com/lit/ds/symlink/ads131m06.pdf
+ - ADS131M04: https://www.ti.com/lit/ds/symlink/ads131m04.pdf
+ - ADS131M03: https://www.ti.com/lit/ds/symlink/ads131m03.pdf
+ - ADS131M02: https://www.ti.com/lit/ds/symlink/ads131m02.pdf
+
+properties:
+ compatible:
+ enum:
+ - ti,ads131m02
+ - ti,ads131m03
+ - ti,ads131m04
+ - ti,ads131m06
+ - ti,ads131m08
+
+ reg:
+ description: SPI chip select number.
+
+ clocks:
+ description:
+ Phandle to the external clock source required by the ADC's CLKIN pin.
+ The datasheet recommends specific frequencies based on the desired power
+ mode (e.g., 8.192 MHz for High-Resolution mode).
+ maxItems: 1
+
+ '#address-cells':
+ const: 1
+
+ '#size-cells':
+ const: 0
+
+required:
+ - compatible
+ - reg
+ - clocks
+
+patternProperties:
+ "^channel@([0-7])$":
+ type: object
+ $ref: /schemas/iio/adc/adc.yaml#
+ description: |
+ Properties for a single ADC channel. The maximum valid channel number
+ depends on the specific compatible string used (e.g., 0-1 for ads131m02,
+ 0-7 for ads131m08).
+
+ properties:
+ reg:
+ description: The channel index (0-7).
+ minimum: 0
+ maximum: 7 # Max channels on ADS131M08
+
+ label: true
+
+ required:
+ - reg
+
+ unevaluatedProperties: false
+
+allOf:
+ - $ref: /schemas/spi/spi-peripheral-props.yaml#
+
+ - if:
+ properties:
+ compatible:
+ contains:
+ const: ti,ads131m02
+ then:
+ patternProperties:
+ "^channel@[0-7]$":
+ properties:
+ reg:
+ maximum: 1
+ "^channel@([2-7])$": false
+
+ - if:
+ properties:
+ compatible:
+ contains:
+ const: ti,ads131m03
+ then:
+ patternProperties:
+ "^channel@[0-7]$":
+ properties:
+ reg:
+ maximum: 2
+ "^channel@([3-7])$": false
+
+ - if:
+ properties:
+ compatible:
+ contains:
+ const: ti,ads131m04
+ then:
+ patternProperties:
+ "^channel@[0-7]$":
+ properties:
+ reg:
+ maximum: 3
+ "^channel@([4-7])$": false
+
+ - if:
+ properties:
+ compatible:
+ contains:
+ const: ti,ads131m06
+ then:
+ patternProperties:
+ "^channel@[0-7]$":
+ properties:
+ reg:
+ maximum: 5
+ "^channel@([6-7])$": false
+
+unevaluatedProperties: false
+
+examples:
+ - |
+ #include <dt-bindings/clock/stm32mp1-clks.h>
+
+ spi1 {
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ adc@0 {
+ compatible = "ti,ads131m02";
+ reg = <0>;
+ spi-max-frequency = <8000000>;
+
+ clocks = <&rcc CK_MCO2>;
+
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ channel@0 {
+ reg = <0>;
+ label = "input_voltage";
+ };
+
+ channel@1 {
+ reg = <1>;
+ label = "input_current";
+ };
+ };
+ };
--
2.47.3
On 11/5/25 8:38 AM, Oleksij Rempel wrote:
> Add device tree bindings documentation for the Texas Instruments
> ADS131M0x analog-to-digital converters. This family includes the ADS131M02,
> ADS131M03, ADS131M04, ADS131M06, and ADS131M08 variants.
>
> Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>
> ---
> .../bindings/iio/adc/ti,ads131m08.yaml | 162 ++++++++++++++++++
For consistency, I always try to name the file after the lowest part number.
Since we usually list things from lowest to highest it makes the file name
match the first item in the compatible: list. Not sure how widely that is
done in general though.
> 1 file changed, 162 insertions(+)
> create mode 100644 Documentation/devicetree/bindings/iio/adc/ti,ads131m08.yaml
>
> diff --git a/Documentation/devicetree/bindings/iio/adc/ti,ads131m08.yaml b/Documentation/devicetree/bindings/iio/adc/ti,ads131m08.yaml
> new file mode 100644
> index 000000000000..193ac84c41cd
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/iio/adc/ti,ads131m08.yaml
> @@ -0,0 +1,162 @@
> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/iio/adc/ti,ads131m08.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Texas Instruments ADS131M0x 2-, 3-, 4-, 6- and 8-Channel ADCs
The more interesting thing to me than the number of channels is that
these are simultaneous sampling. But I guess it says that below already.
> +
> +maintainers:
> + - Oleksij Rempel <o.rempel@pengutronix.de>
> +
> +description: |
> + The ADS131M0x are a family of multichannel, simultaneous sampling,
> + 24-bit, delta-sigma, analog-to-digital converters (ADCs) with a
> + built-in programmable gain amplifier (PGA) and internal reference.
> + Communication with the ADC chip is via SPI.
> +
> + Datasheets:
> + - ADS131M08: https://www.ti.com/lit/ds/symlink/ads131m08.pdf
> + - ADS131M06: https://www.ti.com/lit/ds/symlink/ads131m06.pdf
> + - ADS131M04: https://www.ti.com/lit/ds/symlink/ads131m04.pdf
> + - ADS131M03: https://www.ti.com/lit/ds/symlink/ads131m03.pdf
> + - ADS131M02: https://www.ti.com/lit/ds/symlink/ads131m02.pdf
> +
> +properties:
> + compatible:
> + enum:
> + - ti,ads131m02
> + - ti,ads131m03
> + - ti,ads131m04
> + - ti,ads131m06
> + - ti,ads131m08
> +
> + reg:
> + description: SPI chip select number.
> +
> + clocks:
> + description:
> + Phandle to the external clock source required by the ADC's CLKIN pin.
> + The datasheet recommends specific frequencies based on the desired power
> + mode (e.g., 8.192 MHz for High-Resolution mode).
> + maxItems: 1
We probably also need to know what is wired to the clock pin so that the driver
can correctly set XTAL_DIS in the CLOCK register.
clock-names:
description:
Indicates if a crystal oscillator (XTAL) or CMOS signal is connected (CLKIN).
enum: [xtal, clkin]
> +
> + '#address-cells':
> + const: 1
> +
> + '#size-cells':
> + const: 0
> +
In addition to the supplies that Jonathan mentioned, we can also add
an interrupts property for the DRDY output signal.
And a reset-gpios for the reset signal.
These are all trivial bindings we know are going to be correct even if
the driver doesn't use them yet.
> +required:
> + - compatible
> + - reg
> + - clocks
> +
> +patternProperties:
> + "^channel@([0-7])$":
> + type: object
> + $ref: /schemas/iio/adc/adc.yaml#
> + description: |
> + Properties for a single ADC channel. The maximum valid channel number
> + depends on the specific compatible string used (e.g., 0-1 for ads131m02,
> + 0-7 for ads131m08).
I think this description would be better as a comment on the if statements
below so that it isn't so far away from the relevant code.
> +
> + properties:
> + reg:
> + description: The channel index (0-7).
> + minimum: 0
> + maximum: 7 # Max channels on ADS131M08
> +
> + label: true
> +
> + required:
> + - reg
> +
> + unevaluatedProperties: false
> +
> +allOf:
> + - $ref: /schemas/spi/spi-peripheral-props.yaml#
> +
> + - if:
> + properties:
> + compatible:
> + contains:
> + const: ti,ads131m02
> + then:
> + patternProperties:
> + "^channel@[0-7]$":
"^channel@[0-1]$":
Same pattern applies to the similar statements below (that I trimmed from the reply).
> + properties:
> + reg:
> + maximum: 1
> + "^channel@([2-7])$": false
> +
On Wed, 5 Nov 2025 15:38:13 +0100
Oleksij Rempel <o.rempel@pengutronix.de> wrote:
> Add device tree bindings documentation for the Texas Instruments
> ADS131M0x analog-to-digital converters. This family includes the ADS131M02,
> ADS131M03, ADS131M04, ADS131M06, and ADS131M08 variants.
Hi Olkesij,
Add a clear statement of difference between them that means we can't
use a single fallback compatible. You kind of state it in the binding
(number of channels) but having it here explicitly makes for easier review.
>
> Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>
> ---
> .../bindings/iio/adc/ti,ads131m08.yaml | 162 ++++++++++++++++++
> 1 file changed, 162 insertions(+)
> create mode 100644 Documentation/devicetree/bindings/iio/adc/ti,ads131m08.yaml
>
> diff --git a/Documentation/devicetree/bindings/iio/adc/ti,ads131m08.yaml b/Documentation/devicetree/bindings/iio/adc/ti,ads131m08.yaml
> new file mode 100644
> index 000000000000..193ac84c41cd
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/iio/adc/ti,ads131m08.yaml
> @@ -0,0 +1,162 @@
> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/iio/adc/ti,ads131m08.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Texas Instruments ADS131M0x 2-, 3-, 4-, 6- and 8-Channel ADCs
> +
> +maintainers:
> + - Oleksij Rempel <o.rempel@pengutronix.de>
> +
> +description: |
> + The ADS131M0x are a family of multichannel, simultaneous sampling,
> + 24-bit, delta-sigma, analog-to-digital converters (ADCs) with a
> + built-in programmable gain amplifier (PGA) and internal reference.
> + Communication with the ADC chip is via SPI.
> +
> + Datasheets:
> + - ADS131M08: https://www.ti.com/lit/ds/symlink/ads131m08.pdf
> + - ADS131M06: https://www.ti.com/lit/ds/symlink/ads131m06.pdf
> + - ADS131M04: https://www.ti.com/lit/ds/symlink/ads131m04.pdf
> + - ADS131M03: https://www.ti.com/lit/ds/symlink/ads131m03.pdf
> + - ADS131M02: https://www.ti.com/lit/ds/symlink/ads131m02.pdf
Trivial but seems a little odd to have these in reverse order of the compatibles.
> +
> +properties:
> + compatible:
> + enum:
> + - ti,ads131m02
> + - ti,ads131m03
> + - ti,ads131m04
> + - ti,ads131m06
> + - ti,ads131m08
> +
> + reg:
> + description: SPI chip select number.
> +
> + clocks:
> + description:
> + Phandle to the external clock source required by the ADC's CLKIN pin.
> + The datasheet recommends specific frequencies based on the desired power
> + mode (e.g., 8.192 MHz for High-Resolution mode).
> + maxItems: 1
> +
> + '#address-cells':
> + const: 1
> +
> + '#size-cells':
> + const: 0
There should be some supplies here.
Looks like REFIN is optional but AVDD and DVDD are required.
> +
> +required:
> + - compatible
> + - reg
> + - clocks
> +
> +patternProperties:
> + "^channel@([0-7])$":
> + type: object
> + $ref: /schemas/iio/adc/adc.yaml#
> + description: |
No need for | on this one as I don't think formatting needs to be controlled.
> + Properties for a single ADC channel. The maximum valid channel number
> + depends on the specific compatible string used (e.g., 0-1 for ads131m02,
> + 0-7 for ads131m08).
> +
> + properties:
> + reg:
> + description: The channel index (0-7).
> + minimum: 0
> + maximum: 7 # Max channels on ADS131M08
> +
> + label: true
> +
> + required:
> + - reg
> +
> + unevaluatedProperties: false
> +
> +allOf:
> + - $ref: /schemas/spi/spi-peripheral-props.yaml#
> +
> + - if:
> + properties:
> + compatible:
> + contains:
> + const: ti,ads131m02
> + then:
> + patternProperties:
> + "^channel@[0-7]$":
> + properties:
> + reg:
> + maximum: 1
> + "^channel@([2-7])$": false
> +
> + - if:
> + properties:
> + compatible:
> + contains:
> + const: ti,ads131m03
> + then:
> + patternProperties:
> + "^channel@[0-7]$":
> + properties:
> + reg:
> + maximum: 2
> + "^channel@([3-7])$": false
> +
> + - if:
> + properties:
> + compatible:
> + contains:
> + const: ti,ads131m04
> + then:
> + patternProperties:
> + "^channel@[0-7]$":
> + properties:
> + reg:
> + maximum: 3
> + "^channel@([4-7])$": false
> +
> + - if:
> + properties:
> + compatible:
> + contains:
> + const: ti,ads131m06
> + then:
> + patternProperties:
> + "^channel@[0-7]$":
> + properties:
> + reg:
> + maximum: 5
> + "^channel@([6-7])$": false
> +
> +unevaluatedProperties: false
> +
> +examples:
> + - |
> + #include <dt-bindings/clock/stm32mp1-clks.h>
> +
> + spi1 {
> + #address-cells = <1>;
> + #size-cells = <0>;
> +
> + adc@0 {
> + compatible = "ti,ads131m02";
> + reg = <0>;
> + spi-max-frequency = <8000000>;
> +
> + clocks = <&rcc CK_MCO2>;
> +
> + #address-cells = <1>;
> + #size-cells = <0>;
> +
> + channel@0 {
> + reg = <0>;
> + label = "input_voltage";
> + };
> +
> + channel@1 {
> + reg = <1>;
> + label = "input_current";
> + };
> + };
> + };
© 2016 - 2025 Red Hat, Inc.