13cf3cdeaSCosmin Tanislav# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) 23cf3cdeaSCosmin Tanislav%YAML 1.2 33cf3cdeaSCosmin Tanislav--- 43cf3cdeaSCosmin Tanislav$id: http://devicetree.org/schemas/iio/addac/adi,ad74413r.yaml# 53cf3cdeaSCosmin Tanislav$schema: http://devicetree.org/meta-schemas/core.yaml# 63cf3cdeaSCosmin Tanislav 73cf3cdeaSCosmin Tanislavtitle: Analog Devices AD74412R/AD74413R device 83cf3cdeaSCosmin Tanislav 93cf3cdeaSCosmin Tanislavmaintainers: 103cf3cdeaSCosmin Tanislav - Cosmin Tanislav <cosmin.tanislav@analog.com> 113cf3cdeaSCosmin Tanislav 123cf3cdeaSCosmin Tanislavdescription: | 133cf3cdeaSCosmin Tanislav The AD74412R and AD74413R are quad-channel software configurable input/output 143cf3cdeaSCosmin Tanislav solutions for building and process control applications. They contain 153cf3cdeaSCosmin Tanislav functionality for analog output, analog input, digital input, resistance 163cf3cdeaSCosmin Tanislav temperature detector, and thermocouple measurements integrated 173cf3cdeaSCosmin Tanislav into a single chip solution with an SPI interface. 183cf3cdeaSCosmin Tanislav The devices feature a 16-bit ADC and four configurable 13-bit DACs to provide 193cf3cdeaSCosmin Tanislav four configurable input/output channels and a suite of diagnostic functions. 203cf3cdeaSCosmin Tanislav The AD74413R differentiates itself from the AD74412R by being HART-compatible. 213cf3cdeaSCosmin Tanislav https://www.analog.com/en/products/ad74412r.html 223cf3cdeaSCosmin Tanislav https://www.analog.com/en/products/ad74413r.html 233cf3cdeaSCosmin Tanislav 243cf3cdeaSCosmin Tanislavproperties: 253cf3cdeaSCosmin Tanislav compatible: 263cf3cdeaSCosmin Tanislav enum: 273cf3cdeaSCosmin Tanislav - adi,ad74412r 283cf3cdeaSCosmin Tanislav - adi,ad74413r 293cf3cdeaSCosmin Tanislav 303cf3cdeaSCosmin Tanislav reg: 313cf3cdeaSCosmin Tanislav maxItems: 1 323cf3cdeaSCosmin Tanislav 333cf3cdeaSCosmin Tanislav '#address-cells': 343cf3cdeaSCosmin Tanislav const: 1 353cf3cdeaSCosmin Tanislav 363cf3cdeaSCosmin Tanislav '#size-cells': 373cf3cdeaSCosmin Tanislav const: 0 383cf3cdeaSCosmin Tanislav 393cf3cdeaSCosmin Tanislav spi-max-frequency: 403cf3cdeaSCosmin Tanislav maximum: 1000000 413cf3cdeaSCosmin Tanislav 423cf3cdeaSCosmin Tanislav spi-cpol: true 433cf3cdeaSCosmin Tanislav 443cf3cdeaSCosmin Tanislav interrupts: 453cf3cdeaSCosmin Tanislav maxItems: 1 463cf3cdeaSCosmin Tanislav 473cf3cdeaSCosmin Tanislav refin-supply: true 483cf3cdeaSCosmin Tanislav 493cf3cdeaSCosmin Tanislav shunt-resistor-micro-ohms: 503cf3cdeaSCosmin Tanislav description: 513cf3cdeaSCosmin Tanislav Shunt (sense) resistor value in micro-Ohms. 523cf3cdeaSCosmin Tanislav default: 100000000 533cf3cdeaSCosmin Tanislav 546aaf7045SRasmus Villemoes reset-gpios: 556aaf7045SRasmus Villemoes maxItems: 1 566aaf7045SRasmus Villemoes 573cf3cdeaSCosmin Tanislavrequired: 583cf3cdeaSCosmin Tanislav - compatible 593cf3cdeaSCosmin Tanislav - reg 603cf3cdeaSCosmin Tanislav - spi-max-frequency 613cf3cdeaSCosmin Tanislav - spi-cpol 623cf3cdeaSCosmin Tanislav - refin-supply 633cf3cdeaSCosmin Tanislav 643cf3cdeaSCosmin TanislavpatternProperties: 653cf3cdeaSCosmin Tanislav "^channel@[0-3]$": 663cf3cdeaSCosmin Tanislav type: object 67c682c963SRob Herring additionalProperties: false 683cf3cdeaSCosmin Tanislav description: Represents the external channels which are connected to the device. 693cf3cdeaSCosmin Tanislav 703cf3cdeaSCosmin Tanislav properties: 713cf3cdeaSCosmin Tanislav reg: 723cf3cdeaSCosmin Tanislav description: | 733cf3cdeaSCosmin Tanislav The channel number. It can have up to 4 channels numbered from 0 to 3. 743cf3cdeaSCosmin Tanislav minimum: 0 753cf3cdeaSCosmin Tanislav maximum: 3 763cf3cdeaSCosmin Tanislav 773cf3cdeaSCosmin Tanislav adi,ch-func: 783cf3cdeaSCosmin Tanislav $ref: /schemas/types.yaml#/definitions/uint32 793cf3cdeaSCosmin Tanislav description: | 803cf3cdeaSCosmin Tanislav Channel function. 813cf3cdeaSCosmin Tanislav HART functions are not supported on AD74412R. 823cf3cdeaSCosmin Tanislav 0 - CH_FUNC_HIGH_IMPEDANCE 833cf3cdeaSCosmin Tanislav 1 - CH_FUNC_VOLTAGE_OUTPUT 843cf3cdeaSCosmin Tanislav 2 - CH_FUNC_CURRENT_OUTPUT 853cf3cdeaSCosmin Tanislav 3 - CH_FUNC_VOLTAGE_INPUT 863cf3cdeaSCosmin Tanislav 4 - CH_FUNC_CURRENT_INPUT_EXT_POWER 873cf3cdeaSCosmin Tanislav 5 - CH_FUNC_CURRENT_INPUT_LOOP_POWER 883cf3cdeaSCosmin Tanislav 6 - CH_FUNC_RESISTANCE_INPUT 893cf3cdeaSCosmin Tanislav 7 - CH_FUNC_DIGITAL_INPUT_LOGIC 903cf3cdeaSCosmin Tanislav 8 - CH_FUNC_DIGITAL_INPUT_LOOP_POWER 913cf3cdeaSCosmin Tanislav 9 - CH_FUNC_CURRENT_INPUT_EXT_POWER_HART 923cf3cdeaSCosmin Tanislav 10 - CH_FUNC_CURRENT_INPUT_LOOP_POWER_HART 933cf3cdeaSCosmin Tanislav minimum: 0 943cf3cdeaSCosmin Tanislav maximum: 10 953cf3cdeaSCosmin Tanislav default: 0 963cf3cdeaSCosmin Tanislav 973cf3cdeaSCosmin Tanislav adi,gpo-comparator: 983cf3cdeaSCosmin Tanislav type: boolean 993cf3cdeaSCosmin Tanislav description: | 1003cf3cdeaSCosmin Tanislav Whether to configure GPO as a comparator or not. 1013cf3cdeaSCosmin Tanislav When not configured as a comparator, the GPO will be treated as an 1023cf3cdeaSCosmin Tanislav output-only GPIO. 1033cf3cdeaSCosmin Tanislav 104*954ea91fSRasmus Villemoes drive-strength-microamp: 105*954ea91fSRasmus Villemoes description: | 106*954ea91fSRasmus Villemoes For channels configured as digital input, this configures the sink 107*954ea91fSRasmus Villemoes current. 108*954ea91fSRasmus Villemoes minimum: 0 109*954ea91fSRasmus Villemoes maximum: 1800 110*954ea91fSRasmus Villemoes default: 0 111*954ea91fSRasmus Villemoes multipleOf: 120 112*954ea91fSRasmus Villemoes 1133cf3cdeaSCosmin Tanislav required: 1143cf3cdeaSCosmin Tanislav - reg 1153cf3cdeaSCosmin Tanislav 116d26b7973SKrzysztof KozlowskiallOf: 117d26b7973SKrzysztof Kozlowski - $ref: /schemas/spi/spi-peripheral-props.yaml# 118d26b7973SKrzysztof Kozlowski 119d26b7973SKrzysztof KozlowskiunevaluatedProperties: false 120d26b7973SKrzysztof Kozlowski 1213cf3cdeaSCosmin Tanislavexamples: 1223cf3cdeaSCosmin Tanislav - | 1233cf3cdeaSCosmin Tanislav #include <dt-bindings/gpio/gpio.h> 1243cf3cdeaSCosmin Tanislav #include <dt-bindings/interrupt-controller/irq.h> 1253cf3cdeaSCosmin Tanislav #include <dt-bindings/iio/addac/adi,ad74413r.h> 1263cf3cdeaSCosmin Tanislav 1273cf3cdeaSCosmin Tanislav spi { 1283cf3cdeaSCosmin Tanislav #address-cells = <1>; 1293cf3cdeaSCosmin Tanislav #size-cells = <0>; 1303cf3cdeaSCosmin Tanislav 1311b96d663SKrzysztof Kozlowski addac@0 { 1323cf3cdeaSCosmin Tanislav compatible = "adi,ad74413r"; 1333cf3cdeaSCosmin Tanislav reg = <0>; 1343cf3cdeaSCosmin Tanislav spi-max-frequency = <1000000>; 1353cf3cdeaSCosmin Tanislav spi-cpol; 1363cf3cdeaSCosmin Tanislav 1373cf3cdeaSCosmin Tanislav #address-cells = <1>; 1383cf3cdeaSCosmin Tanislav #size-cells = <0>; 1393cf3cdeaSCosmin Tanislav 1403cf3cdeaSCosmin Tanislav interrupt-parent = <&gpio>; 1413cf3cdeaSCosmin Tanislav interrupts = <26 IRQ_TYPE_EDGE_FALLING>; 1423cf3cdeaSCosmin Tanislav 1433cf3cdeaSCosmin Tanislav refin-supply = <&ad74413r_refin>; 1446aaf7045SRasmus Villemoes reset-gpios = <&gpio2 6 GPIO_ACTIVE_LOW>; 1453cf3cdeaSCosmin Tanislav 1463cf3cdeaSCosmin Tanislav channel@0 { 1473cf3cdeaSCosmin Tanislav reg = <0>; 1483cf3cdeaSCosmin Tanislav 1493cf3cdeaSCosmin Tanislav adi,ch-func = <CH_FUNC_VOLTAGE_OUTPUT>; 1503cf3cdeaSCosmin Tanislav }; 1513cf3cdeaSCosmin Tanislav 1523cf3cdeaSCosmin Tanislav channel@1 { 1533cf3cdeaSCosmin Tanislav reg = <1>; 1543cf3cdeaSCosmin Tanislav 1553cf3cdeaSCosmin Tanislav adi,ch-func = <CH_FUNC_CURRENT_OUTPUT>; 1563cf3cdeaSCosmin Tanislav }; 1573cf3cdeaSCosmin Tanislav 1583cf3cdeaSCosmin Tanislav channel@2 { 1593cf3cdeaSCosmin Tanislav reg = <2>; 1603cf3cdeaSCosmin Tanislav 1613cf3cdeaSCosmin Tanislav adi,ch-func = <CH_FUNC_DIGITAL_INPUT_LOGIC>; 1623cf3cdeaSCosmin Tanislav adi,gpo-comparator; 1633cf3cdeaSCosmin Tanislav }; 1643cf3cdeaSCosmin Tanislav 1653cf3cdeaSCosmin Tanislav channel@3 { 1663cf3cdeaSCosmin Tanislav reg = <3>; 1673cf3cdeaSCosmin Tanislav 1683cf3cdeaSCosmin Tanislav adi,ch-func = <CH_FUNC_CURRENT_INPUT_EXT_POWER>; 1693cf3cdeaSCosmin Tanislav }; 1703cf3cdeaSCosmin Tanislav }; 1713cf3cdeaSCosmin Tanislav }; 1723cf3cdeaSCosmin Tanislav... 173