Add device tree bindings and an example for the TI TPS389008 voltage monitor. Signed-off-by: Flaviu Nistor <flaviu.nistor@xxxxxxxxx> --- .../bindings/hwmon/ti,tps389008.yaml | 140 ++++++++++++++++++ 1 file changed, 140 insertions(+) create mode 100644 Documentation/devicetree/bindings/hwmon/ti,tps389008.yaml diff --git a/Documentation/devicetree/bindings/hwmon/ti,tps389008.yaml b/Documentation/devicetree/bindings/hwmon/ti,tps389008.yaml new file mode 100644 index 000000000000..5a32359894cc --- /dev/null +++ b/Documentation/devicetree/bindings/hwmon/ti,tps389008.yaml @@ -0,0 +1,140 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/hwmon/ti,tps389008.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: TPS389008 voltage monitor + +maintainers: + - Flaviu Nistor <flaviu.nistor@xxxxxxxxx> + +description: | + Voltage monitor from TI (TPS389008, TPS389006, TPS389004) on I2C bus. + + Datasheets: + https://www.ti.com/lit/ds/symlink/tps389006.pdf?ts=1741000787840&ref_url=https%253A%252F%252Fwww.ti.com%252Fproduct%252FTPS389006 + +properties: + compatible: + oneOf: + - const: ti,tps38908 + - items: + - enum: + - ti,tps38908 + - ti,tps38906 + - ti,tps38904 + - const: ti,tps38908 + + reg: + maxItems: 1 + + "#address-cells": + description: Required only if a child node is present. + const: 1 + + "#size-cells": + description: Required only if a child node is present. + const: 0 + +patternProperties: + "^vmon@[1-8]$": + description: | + The node contains optional child nodes for up to x channels. + There are 8 channels for TPS389008, 6 channels for TPS389006, + and 4 channels for TPS389004. Each child node describes the information + of the input source. Input channels default to disabled in the chip. + Unless channels are explicitly enabled in device-tree, + input channels will be disabled. + type: object + additionalProperties: false + properties: + reg: + description: | + Must be 1 to 8, corresponding to the VMONx + ports of the TPS389008, TPS389006, or TPS389004, respectively. + enum: [ 1, 2, 3, 4, 5, 6, 7, 8 ] + + label: + description: Name of the input source. + + ti,vrange-mult-4x: + description: | + Must have values 5 or 20 in order for the analog + conversion to be done correctly. + Value 5 indicates multiply by 1 (x1), and value 20 indicates + multiply by 4 (x4). + type: boolean + + ti,vmon-enable: + description: | + Sets each channel status. By default, all input channels are disabled. + - 0 = channel disabled + - 1 = channel active + type: boolean + + required: + - reg + +required: + - compatible + - reg + +additionalProperties: false + +examples: + - | + i2c { + #address-cells = <1>; + #size-cells = <0>; + + vmon@37 { + compatible = "ti,tps389008", "ti,tps389006", "ti,tps389004"; + reg = <0x37>; + #address-cells = <1>; + #size-cells = <0>; + + vmon1: vmon1@1 { + reg = <0x1>; + label = "input1"; + ti,vrange-mult-4x; + ti,vmon-enable; + }; + vmon2: vmon2@2 { + reg = <0x2>; + label = "input2"; + ti,vrange-mult-4x; + ti,vmon-enable; + }; + vmon3: vmon3@3 { + reg = <0x3>; + label = "input3"; + ti,vmon-enable; + }; + vmon4: vmon4@4 { + reg = <0x4>; + label = "input4"; + ti,vmon-enable; + }; + vmon5: vmon5@5 { + reg = <0x5>; + label = "input5"; + status = "disabled"; + }; + vmon6: vmon6@6 { + reg = <0x6>; + label = "input6"; + ti,vmon-enable; + }; + vmon7: vmon7@7 { + reg = <0x7>; + label = "input7"; + ti,vmon-enable; + }; + vmon8: vmon8@8 { + reg = <0x8>; + label = "input8"; + ti,vmon-enable; + }; + }; + }; -- 2.43.0