Skip to content

Commit 81b75e3

Browse files
Ninad Malwadegroeck
authored andcommitted
dt-bindings: hwmon: ina3221: Convert to json-schema
Convert the TI INA3221 bindings from the free-form text format to json-schema. Note that the INA3221 input channels default to enabled in the chip. Unless channels are explicitly disabled in device-tree, input channels will be enabled. Signed-off-by: Thierry Reding <[email protected]> Signed-off-by: Ninad Malwade <[email protected]> Signed-off-by: Jon Hunter <[email protected]> Reviewed-by: Rob Herring <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Guenter Roeck <[email protected]>
1 parent fe0eba1 commit 81b75e3

File tree

2 files changed

+102
-54
lines changed

2 files changed

+102
-54
lines changed

Documentation/devicetree/bindings/hwmon/ina3221.txt

Lines changed: 0 additions & 54 deletions
This file was deleted.
Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2+
%YAML 1.2
3+
---
4+
$id: http://devicetree.org/schemas/hwmon/ti,ina3221.yaml#
5+
$schema: http://devicetree.org/meta-schemas/core.yaml#
6+
7+
title: Texas Instruments INA3221 Current and Voltage Monitor
8+
9+
maintainers:
10+
- Jean Delvare <[email protected]>
11+
- Guenter Roeck <[email protected]>
12+
13+
properties:
14+
compatible:
15+
const: ti,ina3221
16+
17+
reg:
18+
maxItems: 1
19+
20+
ti,single-shot:
21+
description: |
22+
This chip has two power modes: single-shot (chip takes one measurement
23+
and then shuts itself down) and continuous (chip takes continuous
24+
measurements). The continuous mode is more reliable and suitable for
25+
hardware monitor type device, but the single-shot mode is more power-
26+
friendly and useful for battery-powered device which cares power
27+
consumptions while still needs some measurements occasionally.
28+
29+
If this property is present, the single-shot mode will be used, instead
30+
of the default continuous one for monitoring.
31+
$ref: /schemas/types.yaml#/definitions/flag
32+
33+
"#address-cells":
34+
description: Required only if a child node is present.
35+
const: 1
36+
37+
"#size-cells":
38+
description: Required only if a child node is present.
39+
const: 0
40+
41+
patternProperties:
42+
"^input@[0-2]$":
43+
description: The node contains optional child nodes for three channels.
44+
Each child node describes the information of input source. Input channels
45+
default to enabled in the chip. Unless channels are explicitly disabled
46+
in device-tree, input channels will be enabled.
47+
type: object
48+
additionalProperties: false
49+
properties:
50+
reg:
51+
description: Must be 0, 1 and 2, corresponding to the IN1, IN2 or IN3
52+
ports of the INA3221, respectively.
53+
enum: [ 0, 1, 2 ]
54+
55+
label:
56+
description: name of the input source
57+
58+
shunt-resistor-micro-ohms:
59+
description: shunt resistor value in micro-Ohm
60+
61+
required:
62+
- reg
63+
64+
required:
65+
- compatible
66+
- reg
67+
68+
additionalProperties: false
69+
70+
examples:
71+
- |
72+
i2c {
73+
#address-cells = <1>;
74+
#size-cells = <0>;
75+
76+
power-sensor@40 {
77+
compatible = "ti,ina3221";
78+
reg = <0x40>;
79+
#address-cells = <1>;
80+
#size-cells = <0>;
81+
82+
input@0 {
83+
reg = <0x0>;
84+
/*
85+
* Input channels are enabled by default in the device and so
86+
* to disable, must be explicitly disabled in device-tree.
87+
*/
88+
status = "disabled";
89+
};
90+
91+
input@1 {
92+
reg = <0x1>;
93+
shunt-resistor-micro-ohms = <5000>;
94+
};
95+
96+
input@2 {
97+
reg = <0x2>;
98+
label = "VDD_5V";
99+
shunt-resistor-micro-ohms = <5000>;
100+
};
101+
};
102+
};

0 commit comments

Comments
 (0)