All of lore.kernel.org
 help / color / mirror / Atom feed
From: Max Krummenacher <max.oss.09@gmail.com>
To: max.krummenacher@toradex.com
Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>,
	Rob Herring <robh@kernel.org>,
	Dave Stevenson <dave.stevenson@raspberrypi.com>,
	Maxime Ripard <mripard@kernel.org>, Marek Vasut <marex@denx.de>,
	Christoph Niedermaier <cniedermaier@dh-electronics.com>,
	Francesco Dolcini <francesco.dolcini@toradex.com>,
	Daniel Vetter <daniel@ffwll.ch>, David Airlie <airlied@linux.ie>,
	Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>,
	Rob Herring <robh+dt@kernel.org>, Sam Ravnborg <sam@ravnborg.org>,
	Thierry Reding <thierry.reding@gmail.com>,
	devicetree@vger.kernel.org, dri-devel@lists.freedesktop.org,
	linux-kernel@vger.kernel.org
Subject: [PATCH v3 2/4] dt-bindings: display: add new bus-format property for panel-dpi
Date: Tue, 28 Jun 2022 20:18:36 +0200	[thread overview]
Message-ID: <20220628181838.2031-3-max.oss.09@gmail.com> (raw)
In-Reply-To: <20220628181838.2031-1-max.oss.09@gmail.com>

From: Max Krummenacher <max.krummenacher@toradex.com>

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@toradex.com>

---

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@toradex.com>
+ */
+
+#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


WARNING: multiple messages have this Message-ID (diff)
From: Max Krummenacher <max.oss.09@gmail.com>
To: max.krummenacher@toradex.com
Cc: Marek Vasut <marex@denx.de>,
	Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>,
	Dave Stevenson <dave.stevenson@raspberrypi.com>,
	David Airlie <airlied@linux.ie>, Sam Ravnborg <sam@ravnborg.org>,
	dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org,
	devicetree@vger.kernel.org, Rob Herring <robh+dt@kernel.org>,
	Thierry Reding <thierry.reding@gmail.com>,
	Laurent Pinchart <laurent.pinchart@ideasonboard.com>,
	Francesco Dolcini <francesco.dolcini@toradex.com>,
	Christoph Niedermaier <cniedermaier@dh-electronics.com>
Subject: [PATCH v3 2/4] dt-bindings: display: add new bus-format property for panel-dpi
Date: Tue, 28 Jun 2022 20:18:36 +0200	[thread overview]
Message-ID: <20220628181838.2031-3-max.oss.09@gmail.com> (raw)
In-Reply-To: <20220628181838.2031-1-max.oss.09@gmail.com>

From: Max Krummenacher <max.krummenacher@toradex.com>

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@toradex.com>

---

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@toradex.com>
+ */
+
+#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


  parent reply	other threads:[~2022-06-28 18:19 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-28 18:18 [PATCH v3 0/4] drm/panel: simple: add bus-format support for panel-dpi Max Krummenacher
2022-06-28 18:18 ` Max Krummenacher
2022-06-28 18:18 ` [PATCH v3 1/4] dt-bindings: display: panel-common: allow for additional port node properties Max Krummenacher
2022-06-28 18:18   ` Max Krummenacher
2022-07-01 17:08   ` Rob Herring
2022-07-01 17:08     ` Rob Herring
2022-06-28 18:18 ` Max Krummenacher [this message]
2022-06-28 18:18   ` [PATCH v3 2/4] dt-bindings: display: add new bus-format property for panel-dpi Max Krummenacher
2022-08-03  8:21   ` Marek Vasut
2022-08-03  8:21     ` Marek Vasut
2022-08-08 13:56     ` Max Krummenacher
2022-08-08 13:56       ` Max Krummenacher
2022-08-09  1:25       ` Marek Vasut
2022-08-09  1:25         ` Marek Vasut
2022-10-13 12:58   ` Francesco Dolcini
2022-10-13 12:58     ` Francesco Dolcini
2022-10-14 14:08     ` Dave Stevenson
2022-10-14 14:08       ` Dave Stevenson
2022-10-16  1:32       ` Laurent Pinchart
2022-10-16  1:32         ` Laurent Pinchart
2022-10-19 12:53         ` Max Krummenacher
2022-10-19 12:53           ` Max Krummenacher
2022-10-19 15:37         ` Dave Stevenson
2022-10-19 15:37           ` Dave Stevenson
2022-06-28 18:18 ` [PATCH v3 3/4] dt-bindings: display: startek,startek-kd050c: allow bus-format property Max Krummenacher
2022-06-28 18:18   ` [PATCH v3 3/4] dt-bindings: display: startek, startek-kd050c: " Max Krummenacher
2022-06-28 18:18 ` [PATCH v3 4/4] drm/panel: simple: add bus-format support for panel-dpi Max Krummenacher
2022-06-28 18:18   ` Max Krummenacher
2022-08-03  6:45   ` Aradhya Bhatia
2022-08-03  6:45     ` Aradhya Bhatia
2022-08-08 14:01     ` Max Krummenacher
2022-08-08 14:01       ` Max Krummenacher
2022-07-26 11:53 ` [PATCH v3 0/4] " Francesco Dolcini
2022-07-26 11:53   ` Francesco Dolcini

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=20220628181838.2031-3-max.oss.09@gmail.com \
    --to=max.oss.09@gmail.com \
    --cc=airlied@linux.ie \
    --cc=cniedermaier@dh-electronics.com \
    --cc=daniel@ffwll.ch \
    --cc=dave.stevenson@raspberrypi.com \
    --cc=devicetree@vger.kernel.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=francesco.dolcini@toradex.com \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marex@denx.de \
    --cc=max.krummenacher@toradex.com \
    --cc=mripard@kernel.org \
    --cc=robh+dt@kernel.org \
    --cc=robh@kernel.org \
    --cc=sam@ravnborg.org \
    --cc=thierry.reding@gmail.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.