From 793c581ca351bfa08e185c3625ede56cc4cabf3f Mon Sep 17 00:00:00 2001
From: Christian Hewitt <christianshewitt@gmail.com>
Date: Thu, 12 Jun 2025 10:30:51 +0000
Subject: [PATCH 34/37] WIP: dt-bindings: auxdisplay: add Titan Micro
 Electronics TM16XX
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Add documentation for auxiliary displays based on TM16XX and compatible
LED controllers.

Signed-off-by: Jean-François Lessard <jefflessard3@gmail.com>
Signed-off-by: Christian Hewitt <christianshewitt@gmail.com>
---
 .../bindings/auxdisplay/tm16xx.yaml           | 131 ++++++++++++++++++
 1 file changed, 131 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/auxdisplay/tm16xx.yaml

diff --git a/Documentation/devicetree/bindings/auxdisplay/tm16xx.yaml b/Documentation/devicetree/bindings/auxdisplay/tm16xx.yaml
new file mode 100644
index 000000000000..80b54572926c
--- /dev/null
+++ b/Documentation/devicetree/bindings/auxdisplay/tm16xx.yaml
@@ -0,0 +1,131 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/auxdisplay/tm16xx.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: TM16XX and Compatible Auxiliary Display Driver
+
+maintainers:
+  - Jean-François Lessard <jefflessard3@gmail.com>
+
+description: |
+  Bindings for auxiliary displays based on TM16XX and compatible LED controllers.
+
+properties:
+  compatible:
+    enum:
+      - titanmec,tm1618
+      - titanmec,tm1620
+      - titanmec,tm1628
+      - titanmec,tm1650
+      - fdhisi,fd620
+      - fdhisi,fd628
+      - fdhisi,fd650
+      - fdhisi,fd6551
+      - fdhisi,fd655
+      - princeton,pt6964
+      - hbs,hbs658
+
+  reg:
+    maxItems: 1
+
+  tm16xx,digits:
+    description: Array of grid indexes for each digit
+    $ref: /schemas/types.yaml#/definitions/uint8-array
+    items:
+      minimum: 0
+      maximum: 7
+    minItems: 1
+    maxItems: 8
+
+  tm16xx,segment-mapping:
+    description: Array specifying segment mapping (must be exactly 7 elements)
+    $ref: /schemas/types.yaml#/definitions/uint8-array
+    items:
+      minimum: 0
+      maximum: 7
+    minItems: 7
+    maxItems: 7
+
+  tm16xx,transposed:
+    description: |
+      Optional boolean flag indicating if the device output is transposed.
+      If not present, the default value is false.
+    $ref: /schemas/types.yaml#/definitions/flag
+
+  "#address-cells":
+    const: 2
+
+  "#size-cells":
+    const: 0
+
+patternProperties:
+  "^led@[0-7],[0-7]$":
+    $ref: /schemas/leds/common.yaml#
+    properties:
+      reg:
+        description: Grid and segment indexes
+    required:
+      - reg
+
+required:
+  - compatible
+  - reg
+  - tm16xx,digits
+  - tm16xx,segment-mapping
+
+additionalProperties: true
+
+examples:
+  - |
+    display_client: i2c {
+        #address-cells = <1>;
+        #size-cells = <0>;
+
+        display@24 {
+            compatible = "titanmec,tm1650";
+            reg = <0x24>;
+            tm16xx,digits = /bits/ 8 <0 1 2 3>;
+            tm16xx,segment-mapping = /bits/ 8 <0 1 2 3 4 5 6>;
+
+            #address-cells = <2>;
+            #size-cells = <0>;
+
+            led@4,0 {
+                reg = <4 0>;
+                function = "lan";
+            };
+
+            led@4,1 {
+                reg = <4 1>;
+                function = "wlan";
+            };
+        };
+    };
+  - |
+    display_client: spi {
+        #address-cells = <1>;
+        #size-cells = <0>;
+
+        display@0 {
+            compatible = "titanmec,tm1628";
+            reg = <0>;
+            tm16xx,transposed;
+            tm16xx,digits = /bits/ 8 <1 2 3 4>;
+            tm16xx,segment-mapping = /bits/ 8 <0 1 2 3 4 5 6>;
+
+            #address-cells = <2>;
+            #size-cells = <0>;
+
+            led@0,2 {
+                reg = <0 2>;
+                function = "usb";
+            };
+
+            led@0,3 {
+                reg = <0 3>;
+                function = "power";
+            };
+        };
+    };
-- 
2.34.1

