public inbox for devicetree@vger.kernel.org
 help / color / mirror / Atom feed
From: Flaviu Nistor <flaviu.nistor@googlemail.com>
Cc: Flaviu Nistor <flaviu.nistor@gmail.com>,
	Jean Delvare <jdelvare@suse.com>,
	Guenter Roeck <linux@roeck-us.net>, Rob Herring <robh@kernel.org>,
	Krzysztof Kozlowski <krzk+dt@kernel.org>,
	Conor Dooley <conor+dt@kernel.org>,
	Jonathan Corbet <corbet@lwn.net>,
	linux-hwmon@vger.kernel.org, devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org
Subject: [PATCH 2/2] dt-bindings: hwmon: Add TI TPS389008
Date: Wed, 19 Mar 2025 19:02:29 +0200	[thread overview]
Message-ID: <20250319170234.63723-3-flaviu.nistor@gmail.com> (raw)
In-Reply-To: <20250319170234.63723-1-flaviu.nistor@gmail.com>

Add device tree bindings and an example for the
TI TPS389008 voltage monitor.

Signed-off-by: Flaviu Nistor <flaviu.nistor@gmail.com>
---
 .../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@gmail.com>
+
+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


  parent reply	other threads:[~2025-03-19 17:03 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-19 17:02 [PATCH 0/2] hwmon: Add support for TI TPS389008 Flaviu Nistor
2025-03-19 17:02 ` [PATCH 1/2] " Flaviu Nistor
2025-03-19 21:21   ` Guenter Roeck
2025-03-19 17:02 ` Flaviu Nistor [this message]
2025-03-19 18:25   ` [PATCH 2/2] dt-bindings: hwmon: Add " Rob Herring (Arm)
2025-03-19 19:19   ` Krzysztof Kozlowski

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250319170234.63723-3-flaviu.nistor@gmail.com \
    --to=flaviu.nistor@googlemail.com \
    --cc=conor+dt@kernel.org \
    --cc=corbet@lwn.net \
    --cc=devicetree@vger.kernel.org \
    --cc=flaviu.nistor@gmail.com \
    --cc=jdelvare@suse.com \
    --cc=krzk+dt@kernel.org \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-hwmon@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@roeck-us.net \
    --cc=robh@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox