[PATCH v3 2/4] dt-bindings: display: add new bus-format property for panel-dpi

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Max Krummenacher <max.krummenacher@xxxxxxxxxxx>

The property is used to set the enum bus_format and infer the bpc
for a panel defined by 'panel-dpi'.
This specifies how the panel is connected to the display interface.

Signed-off-by: Max Krummenacher <max.krummenacher@xxxxxxxxxxx>

---

Changes in v3:
- Changed the V4L number space as suggested by Rob Herring
- Set constraints for bus-format as suggested by Rob Herring, used
  the range reserved for RGB formats.
- Editorial changes as suggested by Rob Herring
- Moved the bus-format property under the port/endpoint node as
  suggested by Rob Herring

Changes in v2:
- Fix errors found by dt_binding_check

 .../bindings/display/panel/panel-dpi.yaml     | 26 ++++++++++++++++++-
 .../dt-bindings/display/dt-media-bus-format.h | 23 ++++++++++++++++
 2 files changed, 48 insertions(+), 1 deletion(-)
 create mode 100644 include/dt-bindings/display/dt-media-bus-format.h

diff --git a/Documentation/devicetree/bindings/display/panel/panel-dpi.yaml b/Documentation/devicetree/bindings/display/panel/panel-dpi.yaml
index dae0676b5c6e..52f5db03b6a8 100644
--- a/Documentation/devicetree/bindings/display/panel/panel-dpi.yaml
+++ b/Documentation/devicetree/bindings/display/panel/panel-dpi.yaml
@@ -26,7 +26,28 @@ properties:
   height-mm: true
   label: true
   panel-timing: true
-  port: true
+
+  port:
+    $ref: /schemas/graph.yaml#/$defs/port-base
+    description:
+      Input port node, receives the panel data.
+
+    properties:
+      endpoint:
+        $ref: /schemas/graph.yaml#/$defs/endpoint-base
+
+        properties:
+          bus-format:
+            $ref: /schemas/types.yaml#/definitions/uint32
+            minimum: 0x1001
+            maximum: 0x1fff
+            description: |
+              Describes how the display panel is connected to the display interface.
+              Valid values are defined in <dt-bindings/display/dt-media-bus-format.h>.
+              The mapping between the color/significance of the panel lines to the
+              parallel data lines are defined in:
+              https://www.kernel.org/doc/html/v5.17/userspace-api/media/v4l/subdev-formats.html#packed-rgb-formats
+
   power-supply: true
   reset-gpios: true
   width-mm: true
@@ -39,6 +60,8 @@ additionalProperties: false
 
 examples:
   - |
+    #include <dt-bindings/display/dt-media-bus-format.h>
+
     panel {
         compatible = "startek,startek-kd050c", "panel-dpi";
         label = "osddisplay";
@@ -47,6 +70,7 @@ examples:
 
         port {
             lcd_in: endpoint {
+                bus-format = <DT_MEDIA_BUS_FMT_RGB888_1X24>;
                 remote-endpoint = <&dpi_out>;
             };
         };
diff --git a/include/dt-bindings/display/dt-media-bus-format.h b/include/dt-bindings/display/dt-media-bus-format.h
new file mode 100644
index 000000000000..a032d9724ed4
--- /dev/null
+++ b/include/dt-bindings/display/dt-media-bus-format.h
@@ -0,0 +1,23 @@
+/* SPDX-License-Identifier: GPL-2.0-only OR MIT */
+/*
+ * Copyright 2022 Max Krummenacher <max.krummenacher@xxxxxxxxxxx>
+ */
+
+#ifndef __DT_BINDINGS_DT_MEDIA_BUS_FORMAT_H
+#define __DT_BINDINGS_DT_MEDIA_BUS_FORMAT_H
+
+/*
+ * Attention: Keep these macro names in sync with
+ * include/uapi/linux/media-bus-format.h
+ */
+
+#define DT_MEDIA_BUS_FMT_RGB565_1X16		0x1017
+#define DT_MEDIA_BUS_FMT_RGB666_1X18		0x1009
+#define DT_MEDIA_BUS_FMT_RBG888_1X24		0x100e
+#define DT_MEDIA_BUS_FMT_RGB666_1X24_CPADHI	0x1015
+#define DT_MEDIA_BUS_FMT_BGR888_1X24		0x1013
+#define DT_MEDIA_BUS_FMT_GBR888_1X24		0x1014
+#define DT_MEDIA_BUS_FMT_RGB888_1X24		0x100a
+#define DT_MEDIA_BUS_FMT_RGB888_1X32_PADHI	0x100f
+
+#endif /* __DT_BINDINGS_DT_MEDIA_BUS_FORMAT_H */
-- 
2.20.1




[Index of Archives]     [Device Tree Compilter]     [Device Tree Spec]     [Linux Driver Backports]     [Video for Linux]     [Linux USB Devel]     [Linux PCI Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Yosemite Backpacking]


  Powered by Linux