public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v3 1/2] Documentation: devicetree: update bindings for tps23861
@ 2022-08-25 14:37 Andreas Böhler
  2022-08-25 14:37 ` [PATCH v3 2/2] hwmon: tps23861: add support for initializing the chip Andreas Böhler
                   ` (3 more replies)
  0 siblings, 4 replies; 10+ messages in thread
From: Andreas Böhler @ 2022-08-25 14:37 UTC (permalink / raw)
  Cc: dev, Robert Marko, Luka Perkov, Jean Delvare, Guenter Roeck,
	Rob Herring, Krzysztof Kozlowski, linux-hwmon, devicetree,
	linux-kernel

The tps23861 driver does not initialize the chip and relies on it being
in auto-mode by default. On some devices, these controllers default to
OFF-Mode and hence cannot be used at all.

This brings minimal support for initializing the controller in a user-
defined mode.

Signed-off-by: Andreas Böhler <dev@aboehler.at>
---
 .../bindings/hwmon/ti,tps23861.yaml           | 76 +++++++++++++++++++
 1 file changed, 76 insertions(+)

diff --git a/Documentation/devicetree/bindings/hwmon/ti,tps23861.yaml b/Documentation/devicetree/bindings/hwmon/ti,tps23861.yaml
index 3bc8e73dfbf0..ed3a703478fb 100644
--- a/Documentation/devicetree/bindings/hwmon/ti,tps23861.yaml
+++ b/Documentation/devicetree/bindings/hwmon/ti,tps23861.yaml
@@ -35,6 +35,50 @@ required:
   - compatible
   - reg
 
+patternProperties:
+  "^port@([0-3])$":
+    type: object
+    description: Represents ports of the device and their specific configuration.
+
+    properties:
+      reg:
+        description: The port number
+        items:
+          minimum: 0
+          maximum: 3
+
+      mode:
+        description: The operating mode the device should be initialized with
+        items:
+          - enum:
+              - auto
+              - semiauto
+              - manual
+              - off
+
+      enable:
+        description: Whether the port should be enabled
+        items:
+          minimum: 0
+          maximum: 1
+
+      power:
+        description: Whether the port should be powered on
+        items:
+          minimum: 0
+          maximum: 1
+
+      poe_plus:
+        description: Whether the port should support PoE+
+        items:
+          minimum: 0
+          maximum: 1
+
+    required:
+      - reg
+
+    additionalProperties: false
+
 additionalProperties: false
 
 examples:
@@ -47,5 +91,37 @@ examples:
               compatible = "ti,tps23861";
               reg = <0x30>;
               shunt-resistor-micro-ohms = <255000>;
+
+              port@0 {
+                  reg = <0>;
+                  mode = "auto";
+                  enable = <1>;
+                  power = <1>;
+                  poe_plus = <1>;
+              };
+
+              port@1 {
+                  reg = <1>;
+                  mode = "semiauto";
+                  enable = <1>;
+                  power = <0>;
+                  poe_plus = <1>;
+              };
+
+              port@2 {
+                  reg = <2>;
+                  mode = "manual";
+                  enable = <0>;
+                  power = <0>;
+                  poe_plus = <0>;
+              };
+
+              port@3 {
+                  reg = <3>;
+                  mode = "off";
+                  enable = <0>;
+                  power = <0>;
+                  poe_plus = <1>;
+              };
           };
     };
-- 
2.37.2


^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2022-08-26 12:22 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-08-25 14:37 [PATCH v3 1/2] Documentation: devicetree: update bindings for tps23861 Andreas Böhler
2022-08-25 14:37 ` [PATCH v3 2/2] hwmon: tps23861: add support for initializing the chip Andreas Böhler
2022-08-25 14:49 ` [PATCH v3 1/2] Documentation: devicetree: update bindings for tps23861 Krzysztof Kozlowski
2022-08-25 15:02 ` Guenter Roeck
2022-08-25 15:07   ` Robert Marko
2022-08-25 15:29     ` Guenter Roeck
2022-08-25 15:31       ` Robert Marko
2022-08-26  6:56         ` Krzysztof Kozlowski
2022-08-26 12:19           ` Guenter Roeck
2022-08-25 18:51 ` Rob Herring

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox