1*84943d6fSEmmanuel Vadot# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) 2*84943d6fSEmmanuel Vadot%YAML 1.2 3*84943d6fSEmmanuel Vadot--- 4*84943d6fSEmmanuel Vadot$id: http://devicetree.org/schemas/hwmon/ti,ina3221.yaml# 5*84943d6fSEmmanuel Vadot$schema: http://devicetree.org/meta-schemas/core.yaml# 6*84943d6fSEmmanuel Vadot 7*84943d6fSEmmanuel Vadottitle: Texas Instruments INA3221 Current and Voltage Monitor 8*84943d6fSEmmanuel Vadot 9*84943d6fSEmmanuel Vadotmaintainers: 10*84943d6fSEmmanuel Vadot - Jean Delvare <jdelvare@suse.com> 11*84943d6fSEmmanuel Vadot - Guenter Roeck <linux@roeck-us.net> 12*84943d6fSEmmanuel Vadot 13*84943d6fSEmmanuel Vadotproperties: 14*84943d6fSEmmanuel Vadot compatible: 15*84943d6fSEmmanuel Vadot const: ti,ina3221 16*84943d6fSEmmanuel Vadot 17*84943d6fSEmmanuel Vadot reg: 18*84943d6fSEmmanuel Vadot maxItems: 1 19*84943d6fSEmmanuel Vadot 20*84943d6fSEmmanuel Vadot ti,single-shot: 21*84943d6fSEmmanuel Vadot description: | 22*84943d6fSEmmanuel Vadot This chip has two power modes: single-shot (chip takes one measurement 23*84943d6fSEmmanuel Vadot and then shuts itself down) and continuous (chip takes continuous 24*84943d6fSEmmanuel Vadot measurements). The continuous mode is more reliable and suitable for 25*84943d6fSEmmanuel Vadot hardware monitor type device, but the single-shot mode is more power- 26*84943d6fSEmmanuel Vadot friendly and useful for battery-powered device which cares power 27*84943d6fSEmmanuel Vadot consumptions while still needs some measurements occasionally. 28*84943d6fSEmmanuel Vadot 29*84943d6fSEmmanuel Vadot If this property is present, the single-shot mode will be used, instead 30*84943d6fSEmmanuel Vadot of the default continuous one for monitoring. 31*84943d6fSEmmanuel Vadot $ref: /schemas/types.yaml#/definitions/flag 32*84943d6fSEmmanuel Vadot 33*84943d6fSEmmanuel Vadot "#address-cells": 34*84943d6fSEmmanuel Vadot description: Required only if a child node is present. 35*84943d6fSEmmanuel Vadot const: 1 36*84943d6fSEmmanuel Vadot 37*84943d6fSEmmanuel Vadot "#size-cells": 38*84943d6fSEmmanuel Vadot description: Required only if a child node is present. 39*84943d6fSEmmanuel Vadot const: 0 40*84943d6fSEmmanuel Vadot 41*84943d6fSEmmanuel VadotpatternProperties: 42*84943d6fSEmmanuel Vadot "^input@[0-2]$": 43*84943d6fSEmmanuel Vadot description: The node contains optional child nodes for three channels. 44*84943d6fSEmmanuel Vadot Each child node describes the information of input source. Input channels 45*84943d6fSEmmanuel Vadot default to enabled in the chip. Unless channels are explicitly disabled 46*84943d6fSEmmanuel Vadot in device-tree, input channels will be enabled. 47*84943d6fSEmmanuel Vadot type: object 48*84943d6fSEmmanuel Vadot additionalProperties: false 49*84943d6fSEmmanuel Vadot properties: 50*84943d6fSEmmanuel Vadot reg: 51*84943d6fSEmmanuel Vadot description: Must be 0, 1 and 2, corresponding to the IN1, IN2 or IN3 52*84943d6fSEmmanuel Vadot ports of the INA3221, respectively. 53*84943d6fSEmmanuel Vadot enum: [ 0, 1, 2 ] 54*84943d6fSEmmanuel Vadot 55*84943d6fSEmmanuel Vadot label: 56*84943d6fSEmmanuel Vadot description: name of the input source 57*84943d6fSEmmanuel Vadot 58*84943d6fSEmmanuel Vadot shunt-resistor-micro-ohms: 59*84943d6fSEmmanuel Vadot description: shunt resistor value in micro-Ohm 60*84943d6fSEmmanuel Vadot 61*84943d6fSEmmanuel Vadot ti,summation-disable: 62*84943d6fSEmmanuel Vadot description: | 63*84943d6fSEmmanuel Vadot The INA3221 has a critical alert pin that can be controlled by the 64*84943d6fSEmmanuel Vadot summation control function. This function adds the single 65*84943d6fSEmmanuel Vadot shunt-voltage conversions for the desired channels in order to 66*84943d6fSEmmanuel Vadot compare the combined sum to the programmed limit. The Shunt-Voltage 67*84943d6fSEmmanuel Vadot Sum Limit register contains the programmed value that is compared 68*84943d6fSEmmanuel Vadot to the value in the Shunt-Voltage Sum register in order to 69*84943d6fSEmmanuel Vadot determine if the total summed limit is exceeded. If the 70*84943d6fSEmmanuel Vadot shunt-voltage sum limit value is exceeded, the critical alert pin 71*84943d6fSEmmanuel Vadot is asserted. 72*84943d6fSEmmanuel Vadot 73*84943d6fSEmmanuel Vadot For the summation limit to have a meaningful value, it is necessary 74*84943d6fSEmmanuel Vadot to use the same shunt-resistor value on all enabled channels. If 75*84943d6fSEmmanuel Vadot this is not the case or if a channel should not be used for 76*84943d6fSEmmanuel Vadot triggering the critical alert pin, then this property can be used 77*84943d6fSEmmanuel Vadot exclude specific channels from the summation control function. 78*84943d6fSEmmanuel Vadot type: boolean 79*84943d6fSEmmanuel Vadot 80*84943d6fSEmmanuel Vadot required: 81*84943d6fSEmmanuel Vadot - reg 82*84943d6fSEmmanuel Vadot 83*84943d6fSEmmanuel Vadotrequired: 84*84943d6fSEmmanuel Vadot - compatible 85*84943d6fSEmmanuel Vadot - reg 86*84943d6fSEmmanuel Vadot 87*84943d6fSEmmanuel VadotadditionalProperties: false 88*84943d6fSEmmanuel Vadot 89*84943d6fSEmmanuel Vadotexamples: 90*84943d6fSEmmanuel Vadot - | 91*84943d6fSEmmanuel Vadot i2c { 92*84943d6fSEmmanuel Vadot #address-cells = <1>; 93*84943d6fSEmmanuel Vadot #size-cells = <0>; 94*84943d6fSEmmanuel Vadot 95*84943d6fSEmmanuel Vadot power-sensor@40 { 96*84943d6fSEmmanuel Vadot compatible = "ti,ina3221"; 97*84943d6fSEmmanuel Vadot reg = <0x40>; 98*84943d6fSEmmanuel Vadot #address-cells = <1>; 99*84943d6fSEmmanuel Vadot #size-cells = <0>; 100*84943d6fSEmmanuel Vadot 101*84943d6fSEmmanuel Vadot input@0 { 102*84943d6fSEmmanuel Vadot reg = <0x0>; 103*84943d6fSEmmanuel Vadot /* 104*84943d6fSEmmanuel Vadot * Input channels are enabled by default in the device and so 105*84943d6fSEmmanuel Vadot * to disable, must be explicitly disabled in device-tree. 106*84943d6fSEmmanuel Vadot */ 107*84943d6fSEmmanuel Vadot status = "disabled"; 108*84943d6fSEmmanuel Vadot }; 109*84943d6fSEmmanuel Vadot 110*84943d6fSEmmanuel Vadot input@1 { 111*84943d6fSEmmanuel Vadot reg = <0x1>; 112*84943d6fSEmmanuel Vadot shunt-resistor-micro-ohms = <5000>; 113*84943d6fSEmmanuel Vadot }; 114*84943d6fSEmmanuel Vadot 115*84943d6fSEmmanuel Vadot input@2 { 116*84943d6fSEmmanuel Vadot reg = <0x2>; 117*84943d6fSEmmanuel Vadot label = "VDD_5V"; 118*84943d6fSEmmanuel Vadot shunt-resistor-micro-ohms = <5000>; 119*84943d6fSEmmanuel Vadot }; 120*84943d6fSEmmanuel Vadot }; 121*84943d6fSEmmanuel Vadot }; 122