xref: /linux/Documentation/devicetree/bindings/hwmon/ti,ina3221.yaml (revision 0ea5c948cb64bab5bc7a5516774eb8536f05aa0d)
181b75e33SNinad Malwade# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
281b75e33SNinad Malwade%YAML 1.2
381b75e33SNinad Malwade---
481b75e33SNinad Malwade$id: http://devicetree.org/schemas/hwmon/ti,ina3221.yaml#
581b75e33SNinad Malwade$schema: http://devicetree.org/meta-schemas/core.yaml#
681b75e33SNinad Malwade
781b75e33SNinad Malwadetitle: Texas Instruments INA3221 Current and Voltage Monitor
881b75e33SNinad Malwade
981b75e33SNinad Malwademaintainers:
1081b75e33SNinad Malwade  - Jean Delvare <jdelvare@suse.com>
1181b75e33SNinad Malwade  - Guenter Roeck <linux@roeck-us.net>
1281b75e33SNinad Malwade
1381b75e33SNinad Malwadeproperties:
1481b75e33SNinad Malwade  compatible:
1581b75e33SNinad Malwade    const: ti,ina3221
1681b75e33SNinad Malwade
1781b75e33SNinad Malwade  reg:
1881b75e33SNinad Malwade    maxItems: 1
1981b75e33SNinad Malwade
2081b75e33SNinad Malwade  ti,single-shot:
2181b75e33SNinad Malwade    description: |
2281b75e33SNinad Malwade      This chip has two power modes: single-shot (chip takes one measurement
2381b75e33SNinad Malwade      and then shuts itself down) and continuous (chip takes continuous
2481b75e33SNinad Malwade      measurements). The continuous mode is more reliable and suitable for
2581b75e33SNinad Malwade      hardware monitor type device, but the single-shot mode is more power-
2681b75e33SNinad Malwade      friendly and useful for battery-powered device which cares power
2781b75e33SNinad Malwade      consumptions while still needs some measurements occasionally.
2881b75e33SNinad Malwade
2981b75e33SNinad Malwade      If this property is present, the single-shot mode will be used, instead
3081b75e33SNinad Malwade      of the default continuous one for monitoring.
3181b75e33SNinad Malwade    $ref: /schemas/types.yaml#/definitions/flag
3281b75e33SNinad Malwade
3381b75e33SNinad Malwade  "#address-cells":
3481b75e33SNinad Malwade    description: Required only if a child node is present.
3581b75e33SNinad Malwade    const: 1
3681b75e33SNinad Malwade
3781b75e33SNinad Malwade  "#size-cells":
3881b75e33SNinad Malwade    description: Required only if a child node is present.
3981b75e33SNinad Malwade    const: 0
4081b75e33SNinad Malwade
4181b75e33SNinad MalwadepatternProperties:
4281b75e33SNinad Malwade  "^input@[0-2]$":
4381b75e33SNinad Malwade    description: The node contains optional child nodes for three channels.
4481b75e33SNinad Malwade      Each child node describes the information of input source. Input channels
4581b75e33SNinad Malwade      default to enabled in the chip. Unless channels are explicitly disabled
4681b75e33SNinad Malwade      in device-tree, input channels will be enabled.
4781b75e33SNinad Malwade    type: object
4881b75e33SNinad Malwade    additionalProperties: false
4981b75e33SNinad Malwade    properties:
5081b75e33SNinad Malwade      reg:
5181b75e33SNinad Malwade        description: Must be 0, 1 and 2, corresponding to the IN1, IN2 or IN3
5281b75e33SNinad Malwade          ports of the INA3221, respectively.
5381b75e33SNinad Malwade        enum: [ 0, 1, 2 ]
5481b75e33SNinad Malwade
5581b75e33SNinad Malwade      label:
5681b75e33SNinad Malwade        description: name of the input source
5781b75e33SNinad Malwade
5881b75e33SNinad Malwade      shunt-resistor-micro-ohms:
5981b75e33SNinad Malwade        description: shunt resistor value in micro-Ohm
6081b75e33SNinad Malwade
61*13ab5fdcSJon Hunter      ti,summation-disable:
62*13ab5fdcSJon Hunter        description: |
63*13ab5fdcSJon Hunter          The INA3221 has a critical alert pin that can be controlled by the
64*13ab5fdcSJon Hunter          summation control function. This function adds the single
65*13ab5fdcSJon Hunter          shunt-voltage conversions for the desired channels in order to
66*13ab5fdcSJon Hunter          compare the combined sum to the programmed limit. The Shunt-Voltage
67*13ab5fdcSJon Hunter          Sum Limit register contains the programmed value that is compared
68*13ab5fdcSJon Hunter          to the value in the Shunt-Voltage Sum register in order to
69*13ab5fdcSJon Hunter          determine if the total summed limit is exceeded. If the
70*13ab5fdcSJon Hunter          shunt-voltage sum limit value is exceeded, the critical alert pin
71*13ab5fdcSJon Hunter          is asserted.
72*13ab5fdcSJon Hunter
73*13ab5fdcSJon Hunter          For the summation limit to have a meaningful value, it is necessary
74*13ab5fdcSJon Hunter          to use the same shunt-resistor value on all enabled channels. If
75*13ab5fdcSJon Hunter          this is not the case or if a channel should not be used for
76*13ab5fdcSJon Hunter          triggering the critical alert pin, then this property can be used
77*13ab5fdcSJon Hunter          exclude specific channels from the summation control function.
78*13ab5fdcSJon Hunter        type: boolean
79*13ab5fdcSJon Hunter
8081b75e33SNinad Malwade    required:
8181b75e33SNinad Malwade      - reg
8281b75e33SNinad Malwade
8381b75e33SNinad Malwaderequired:
8481b75e33SNinad Malwade  - compatible
8581b75e33SNinad Malwade  - reg
8681b75e33SNinad Malwade
8781b75e33SNinad MalwadeadditionalProperties: false
8881b75e33SNinad Malwade
8981b75e33SNinad Malwadeexamples:
9081b75e33SNinad Malwade  - |
9181b75e33SNinad Malwade    i2c {
9281b75e33SNinad Malwade        #address-cells = <1>;
9381b75e33SNinad Malwade        #size-cells = <0>;
9481b75e33SNinad Malwade
9581b75e33SNinad Malwade        power-sensor@40 {
9681b75e33SNinad Malwade            compatible = "ti,ina3221";
9781b75e33SNinad Malwade            reg = <0x40>;
9881b75e33SNinad Malwade            #address-cells = <1>;
9981b75e33SNinad Malwade            #size-cells = <0>;
10081b75e33SNinad Malwade
10181b75e33SNinad Malwade            input@0 {
10281b75e33SNinad Malwade                reg = <0x0>;
10381b75e33SNinad Malwade                /*
10481b75e33SNinad Malwade                 * Input channels are enabled by default in the device and so
10581b75e33SNinad Malwade                 * to disable, must be explicitly disabled in device-tree.
10681b75e33SNinad Malwade                 */
10781b75e33SNinad Malwade                status = "disabled";
10881b75e33SNinad Malwade            };
10981b75e33SNinad Malwade
11081b75e33SNinad Malwade            input@1 {
11181b75e33SNinad Malwade                reg = <0x1>;
11281b75e33SNinad Malwade                shunt-resistor-micro-ohms = <5000>;
11381b75e33SNinad Malwade            };
11481b75e33SNinad Malwade
11581b75e33SNinad Malwade            input@2 {
11681b75e33SNinad Malwade                reg = <0x2>;
11781b75e33SNinad Malwade                label = "VDD_5V";
11881b75e33SNinad Malwade                shunt-resistor-micro-ohms = <5000>;
11981b75e33SNinad Malwade            };
12081b75e33SNinad Malwade        };
12181b75e33SNinad Malwade    };
122