Skip to contentSkip to conversation

drm: panel: Add Generic MIPI Panel Driver

PATCH Superseded Hironori KIKUCHI 2 participants 5 messages Jan 31, 2025 – Feb 1, 2025

Subsystems (4)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

cover drm: panel: Add Generic MIPI Panel Driver

This is a Generic MIPI-DSI / DPI(+SPI) dual stack panel driver.

Although the MIPI specifications define how to communicate with a panel to display an image, some panels still require a panel-specific initialization sequence to be sent.

While there are many dedicated drivers for such panels, they are very similar to each other, except for the configuration parameters, including the initialization sequence for each panel.
Since there are numerous panels in the wild, adding parameters to the driver for each panel every time is a pain.

Instead, this driver offers more generic and convenient method.

Its fundamental approach is similar to the panel-mipi-dbi driver, which sends an initialization sequence stored in a firmware file.

Moreover, this driver allows display modes, timings, and panel configuration parameters to be stored in the same file or in DT.

I've also come up with a firmware generator:
https://kikuchan.github.io/panel-firmware-generator/
It helps to create and configure the panel parameters on the web.

As a reference, similar generic drivers currently exist:
* drivers/gpu/drm/panel/panel-simple.c
- Supports wide variety of panels, but no init-sequence support
* drivers/gpu/drm/tiny/panel-mipi-dbi.c
- Supports init-sequence, but only supports DBI panels
* drivers/gpu/drm/panel/panel-dsi-cm.c
- Supports DSI Command Mode, but no init-sequence support

Regards,
kikuchan.

Hironori KIKUCHI (2):
dt-bindings: display: panel: Add generic MIPI-DSI/DPI panels
drm: panel: Add a driver for Generic MIPI-DSI/DPI(+SPI) panels

 .../bindings/display/panel/panel-mipi.yaml    |  244 +++
 drivers/gpu/drm/panel/Kconfig                 |   10 +
 drivers/gpu/drm/panel/Makefile                |    1 +
 drivers/gpu/drm/panel/panel-mipi.c            | 1355 +++++++++++++++++
 4 files changed, 1610 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/display/panel/panel-mipi.yaml
 create mode 100644 drivers/gpu/drm/panel/panel-mipi.c
Signature · 1 line
2.48.1
#1 lore raw

PATCH 1/2 dt-bindings: display: panel: Add generic MIPI-DSI/DPI panels

This is a binding for generic MIPI-DSI/DPI panels that require initialization with a simple command sequence before use.

Although the panel-simple binding exists for generic panels, it is not suitable for panels that require initialization via their communication bus, as such panels cannot be considered "simple".

While many dedicated bindings exist for such panels, the generic panels are not complex enough to warrant a dedicated binding because they only require a "simple" initialization before use.

This binding addresses that gap.

---
 .../bindings/display/panel/panel-mipi.yaml    | 244 ++++++++++++++++++
 1 file changed, 244 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/display/panel/panel-mipi.yaml
Documentation/devicetree/bindings/display/panel/panel-mipi.yaml new file +244 -0
new file mode 100644
index 00000000000..681614333d8
@@ -0,0 +1,244 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/display/panel/panel-mipi.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Generic MIPI-DSI/DPI Panels Requiring Initialization
+
+maintainers:
+  - Hironori KIKUCHI <[email protected]>
+
+description:
+  This is a binding for generic MIPI-DSI/DPI panels that require
+  initialization with a simple command sequence before use.
+
+properties:
+  compatible:
+    oneOf:
+      - enum:
+          - panel-mipi-dsi
+          - panel-mipi-dpi-spi
+      - items:
+          - {}
+          - enum:
+              - panel-mipi-dsi
+              - panel-mipi-dpi-spi
+
+  reg:
+    description: DSI / SPI channel used by that screen
+    maxItems: 1
+
+  power-supply: true
+
+  io-supply:
+    description: I/O system regulator.
+      No need to set if this is the same as polwer-supply.
+
+  dc-gpios:
+    maxItems: 1
+    description: Controller data/command selection (D/CX) in 4-line SPI mode.
+      If not set, the controller is in 3-line SPI mode.
+      Disallowed for DSI.
+
+  width-mm: true
+  height-mm: true
+  panel-timing: true
+  display-timings: true
+
+  reset-delay:
+    description: Delay (in ms) after the reset command
+    $ref: /schemas/types.yaml#/definitions/uint32
+
+  init-delay:
+    description: Delay (in ms) for sending the initial command sequence
+    $ref: /schemas/types.yaml#/definitions/uint32
+
+  sleep-delay:
+    description: Delay (in ms) after the sleep command
+    $ref: /schemas/types.yaml#/definitions/uint32
+
+  backlight-delay:
+    description: Delay (in ms) for enabling the backlight
+    $ref: /schemas/types.yaml#/definitions/uint32
+
+  port: true
+  reset-gpios: true
+  rotation: true
+
+  backlight: true
+
+  init-sequence:
+    description: Encoded initial command sequence.
+    $ref: /schemas/types.yaml#/definitions/uint8-array
+
+  firmware-name:
+    maxItems: 1
+
+  dsi-mode-video:
+    description: Enable MIPI_DSI_MODE_VIDEO.
+      Disallowed for SPI.
+    type: boolean
+
+  dsi-mode-video-burst:
+    description: Enable MIPI_DSI_MODE_VIDEO_BURST.
+      Disallowed for SPI.
+    type: boolean
+
+  dsi-mode-video-sync-pulse:
+    description: Enable MIPI_DSI_MODE_VIDEO_SYNC_PULSE.
+      Disallowed for SPI.
+    type: boolean
+
+  dsi-mode-video-auto-vert:
+    description: Enable MIPI_DSI_MODE_VIDEO_AUTO_VERT.
+      Disallowed for SPI.
+    type: boolean
+
+  dsi-mode-video-hse:
+    description: Enable MIPI_DSI_MODE_VIDEO_HSE.
+      Disallowed for SPI.
+    type: boolean
+
+  dsi-mode-video-no-hfp:
+    description: Enable MIPI_DSI_MODE_VIDEO_NO_HFP.
+      Disallowed for SPI.
+    type: boolean
+
+  dsi-mode-video-no-hbp:
+    description: Enable MIPI_DSI_MODE_VIDEO_NO_HBP.
+      Disallowed for SPI.
+    type: boolean
+
+  dsi-mode-video-no-hsa:
+    description: Enable MIPI_DSI_MODE_VIDEO_NO_HSA.
+      Disallowed for SPI.
+    type: boolean
+
+  dsi-mode-vsync-flush:
+    description: Enable MIPI_DSI_MODE_VSYNC_FLUSH.
+      Disallowed for SPI.
+    type: boolean
+
+  dsi-mode-no-eot-packet:
+    description: Enable MIPI_DSI_MODE_NO_EOT_PACKET.
+      Disallowed for SPI.
+    type: boolean
+
+  dsi-clock-non-continuous:
+    description: Enable MIPI_DSI_CLOCK_NON_CONTINUOUS.
+      Disallowed for SPI.
+    type: boolean
+
+  dsi-mode-lpm:
+    description: Enable MIPI_DSI_MODE_LPM.
+      Disallowed for SPI.
+    type: boolean
+
+  dsi-hs-pkt-end-aligned:
+    description: Enable MIPI_DSI_HS_PKT_END_ALIGNED.
+      Disallowed for SPI.
+    type: boolean
+
+required:
+  - compatible
+  - reg
+
+allOf:
+  - $ref: panel-common.yaml#
+  - if:
+      properties:
+        compatible:
+          contains:
+            enum:
+              - panel-mipi-dpi-spi
+    then:
+      # SPI mode
+      $ref: /schemas/spi/spi-peripheral-props.yaml#
+      properties:
+        dsi-mode-video: false
+        dsi-mode-video-burst: false
+        dsi-mode-video-sync-pulse: false
+        dsi-mode-video-auto-vert: false
+        dsi-mode-video-hse: false
+        dsi-mode-video-no-hfp: false
+        dsi-mode-video-no-hbp: false
+        dsi-mode-video-no-hsa: false
+        dsi-mode-vsync-flush: false
+        dsi-mode-no-eot-packet: false
+        dsi-clock-non-continuous: false
+        dsi-mode-lpm: false
+        dsi-hs-pkt-end-aligned: false
+
+  - if:
+      properties:
+        compatible:
+          contains:
+            enum:
+              - panel-mipi-dsi
+    then:
+      # DSI mode
+      properties:
+        dc-gpios: false
+
+unevaluatedProperties: false
+
+examples:
+  - |
+    dsi {
+        #address-cells = <1>;
+        #size-cells = <0>;
+
+        panel@0 {
+            compatible = "vendor,some-panel", "panel-mipi-dsi";
+            reg = <0>;
+
+            port {
+                mipi_in_panel: endpoint {
+                    remote-endpoint = <&mipi_out_panel>;
+                };
+            };
+        };
+    };
+  - |
+    #include <dt-bindings/gpio/gpio.h>
+
+    spi {
+        #address-cells = <1>;
+        #size-cells = <0>;
+
+        panel@0{
+            compatible = "panel-mipi-dpi-spi";
+            reg = <0>;
+
+            spi-max-frequency = <40000000>;
+
+            dc-gpios = <&gpio 24 GPIO_ACTIVE_HIGH>;
+            reset-gpios = <&gpio 25 GPIO_ACTIVE_HIGH>;
+
+            backlight = <&backlight>;
+
+            init-sequence = [
+              01 11
+              00
+              04 b1 01 2c 2d
+              01 29
+              80 00 00 00
+            ];
+
+            width-mm = <35>;
+            height-mm = <28>;
+
+            panel-timing {
+                hactive = <160>;
+                vactive = <128>;
+                hback-porch = <0>;
+                vback-porch = <0>;
+                clock-frequency = <0>;
+                hfront-porch = <0>;
+                hsync-len = <0>;
+                vfront-porch = <0>;
+                vsync-len = <0>;
+            };
+        };
+    };
Signature · 1 line
2.48.1
#2 lore raw

Re: [PATCH 1/2] dt-bindings: display: panel: Add generic MIPI-DSI/DPI panels

Quoted 10 lines · Hironori KIKUCHI

This is a binding for generic MIPI-DSI/DPI panels that require initialization with a simple command sequence before use.

Although the panel-simple binding exists for generic panels, it is not suitable for panels that require initialization via their communication bus, as such panels cannot be considered "simple".

While many dedicated bindings exist for such panels, the generic panels are not complex enough to warrant a dedicated binding because they only require a "simple" initialization before use.

All hardware warrants a dedicated binding. I don't get from where did you take such rule that you can skip actual hardware specific aspects.

Quoted 26 lines

This binding addresses that gap.

---
 .../bindings/display/panel/panel-mipi.yaml    | 244 ++++++++++++++++++
 1 file changed, 244 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/display/panel/panel-mipi.yaml
Documentation/devicetree/bindings/display/panel/panel-mipi.yaml new file +11 -0
new file mode 100644
index 00000000000..681614333d8
@@ -0,0 +1,244 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/display/panel/panel-mipi.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Generic MIPI-DSI/DPI Panels Requiring Initialization
+
+maintainers:
+  - Hironori KIKUCHI <[email protected]>
+

Documentation/devicetree/bindings/display/panel/panel-mipi.yaml line 21

Quoted 10 lines
Documentation/devicetree/bindings/display/panel/panel-mipi.yaml new file +10 -0
+description:
+  This is a binding for generic MIPI-DSI/DPI panels that require
+  initialization with a simple command sequence before use.
+
+properties:
+  compatible:
+    oneOf:
+      - enum:
+          - panel-mipi-dsi
+          - panel-mipi-dpi-spi

Missing device specific compatibles.

Quoted 19 lines
Documentation/devicetree/bindings/display/panel/panel-mipi.yaml new file +19 -0
+      - items:
+          - {}
+          - enum:
+              - panel-mipi-dsi
+              - panel-mipi-dpi-spi
+
+  reg:
+    description: DSI / SPI channel used by that screen
+    maxItems: 1
+
+  power-supply: true
+
+  io-supply:
+    description: I/O system regulator.
+      No need to set if this is the same as polwer-supply.
+
+  dc-gpios:
+    maxItems: 1
+    description: Controller data/command selection (D/CX) in 4-line SPI mode.

Documentation/devicetree/bindings/display/panel/panel-mipi.yaml line 50

Quoted 10 lines
Documentation/devicetree/bindings/display/panel/panel-mipi.yaml new file +10 -0
+      If not set, the controller is in 3-line SPI mode.
+      Disallowed for DSI.
+
+  width-mm: true
+  height-mm: true
+  panel-timing: true
+  display-timings: true
+
+  reset-delay:
+    description: Delay (in ms) after the reset command

So use proper unit suffixes. Everywhere.

Quoted 78 lines
Documentation/devicetree/bindings/display/panel/panel-mipi.yaml new file +78 -0
+    $ref: /schemas/types.yaml#/definitions/uint32
+
+  init-delay:
+    description: Delay (in ms) for sending the initial command sequence
+    $ref: /schemas/types.yaml#/definitions/uint32
+
+  sleep-delay:
+    description: Delay (in ms) after the sleep command
+    $ref: /schemas/types.yaml#/definitions/uint32
+
+  backlight-delay:
+    description: Delay (in ms) for enabling the backlight
+    $ref: /schemas/types.yaml#/definitions/uint32
+
+  port: true
+  reset-gpios: true
+  rotation: true
+
+  backlight: true
+
+  init-sequence:
+    description: Encoded initial command sequence.
+    $ref: /schemas/types.yaml#/definitions/uint8-array
+
+  firmware-name:
+    maxItems: 1
+
+  dsi-mode-video:
+    description: Enable MIPI_DSI_MODE_VIDEO.
+      Disallowed for SPI.
+    type: boolean
+
+  dsi-mode-video-burst:
+    description: Enable MIPI_DSI_MODE_VIDEO_BURST.
+      Disallowed for SPI.
+    type: boolean
+
+  dsi-mode-video-sync-pulse:
+    description: Enable MIPI_DSI_MODE_VIDEO_SYNC_PULSE.
+      Disallowed for SPI.
+    type: boolean
+
+  dsi-mode-video-auto-vert:
+    description: Enable MIPI_DSI_MODE_VIDEO_AUTO_VERT.
+      Disallowed for SPI.
+    type: boolean
+
+  dsi-mode-video-hse:
+    description: Enable MIPI_DSI_MODE_VIDEO_HSE.
+      Disallowed for SPI.
+    type: boolean
+
+  dsi-mode-video-no-hfp:
+    description: Enable MIPI_DSI_MODE_VIDEO_NO_HFP.
+      Disallowed for SPI.
+    type: boolean
+
+  dsi-mode-video-no-hbp:
+    description: Enable MIPI_DSI_MODE_VIDEO_NO_HBP.
+      Disallowed for SPI.
+    type: boolean
+
+  dsi-mode-video-no-hsa:
+    description: Enable MIPI_DSI_MODE_VIDEO_NO_HSA.
+      Disallowed for SPI.
+    type: boolean
+
+  dsi-mode-vsync-flush:
+    description: Enable MIPI_DSI_MODE_VSYNC_FLUSH.
+      Disallowed for SPI.
+    type: boolean
+
+  dsi-mode-no-eot-packet:
+    description: Enable MIPI_DSI_MODE_NO_EOT_PACKET.
+      Disallowed for SPI.
+    type: boolean
+
+  dsi-clock-non-continuous:

Documentation/devicetree/bindings/display/panel/panel-mipi.yaml line 138

Quoted 10 lines
Documentation/devicetree/bindings/display/panel/panel-mipi.yaml new file +10 -0
+    description: Enable MIPI_DSI_CLOCK_NON_CONTINUOUS.
+      Disallowed for SPI.
+    type: boolean
+
+  dsi-mode-lpm:
+    description: Enable MIPI_DSI_MODE_LPM.
+      Disallowed for SPI.
+    type: boolean
+
+  dsi-hs-pkt-end-aligned:

All this must be deduced from the compatible which makes this binding redundant. This binding is a no-go for me for obvious reasons: is not specific and you try to bypass the exact rule of bindings to be specific about hardware.

Quoted 45 lines
Documentation/devicetree/bindings/display/panel/panel-mipi.yaml new file +45 -0
+    description: Enable MIPI_DSI_HS_PKT_END_ALIGNED.
+      Disallowed for SPI.
+    type: boolean
+
+required:
+  - compatible
+  - reg
+
+allOf:
+  - $ref: panel-common.yaml#
+  - if:
+      properties:
+        compatible:
+          contains:
+            enum:
+              - panel-mipi-dpi-spi
+    then:
+      # SPI mode
+      $ref: /schemas/spi/spi-peripheral-props.yaml#
+      properties:
+        dsi-mode-video: false
+        dsi-mode-video-burst: false
+        dsi-mode-video-sync-pulse: false
+        dsi-mode-video-auto-vert: false
+        dsi-mode-video-hse: false
+        dsi-mode-video-no-hfp: false
+        dsi-mode-video-no-hbp: false
+        dsi-mode-video-no-hsa: false
+        dsi-mode-vsync-flush: false
+        dsi-mode-no-eot-packet: false
+        dsi-clock-non-continuous: false
+        dsi-mode-lpm: false
+        dsi-hs-pkt-end-aligned: false
+
+  - if:
+      properties:
+        compatible:
+          contains:
+            enum:
+              - panel-mipi-dsi
+    then:
+      # DSI mode
+      properties:
+        dc-gpios: false
+

Documentation/devicetree/bindings/display/panel/panel-mipi.yaml line 193

Quoted 10 lines
Documentation/devicetree/bindings/display/panel/panel-mipi.yaml new file +10 -0
+unevaluatedProperties: false
+
+examples:
+  - |
+    dsi {
+        #address-cells = <1>;
+        #size-cells = <0>;
+
+        panel@0 {
+            compatible = "vendor,some-panel", "panel-mipi-dsi";

Undocumented compatible.

Best regards,
Krzysztof

#3 lore raw

Re: [PATCH 1/2] dt-bindings: display: panel: Add generic MIPI-DSI/DPI panels

Hello Krzysztof,

Thank you for your feedback.

Quoted 173 lines · Krzysztof Kozlowski
Quoted 10 lines · Hironori KIKUCHI

This is a binding for generic MIPI-DSI/DPI panels that require initialization with a simple command sequence before use.

Although the panel-simple binding exists for generic panels, it is not suitable for panels that require initialization via their communication bus, as such panels cannot be considered "simple".

While many dedicated bindings exist for such panels, the generic panels are not complex enough to warrant a dedicated binding because they only require a "simple" initialization before use.

All hardware warrants a dedicated binding. I don't get from where did you take such rule that you can skip actual hardware specific aspects.

Quoted 26 lines

This binding addresses that gap.

---
 .../bindings/display/panel/panel-mipi.yaml    | 244 ++++++++++++++++++
 1 file changed, 244 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/display/panel/panel-mipi.yaml
Documentation/devicetree/bindings/display/panel/panel-mipi.yaml new file +11 -0
new file mode 100644
index 00000000000..681614333d8
@@ -0,0 +1,244 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/display/panel/panel-mipi.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Generic MIPI-DSI/DPI Panels Requiring Initialization
+
+maintainers:
+  - Hironori KIKUCHI <[email protected]>
+

Documentation/devicetree/bindings/display/panel/panel-mipi.yaml line 21

Quoted 10 lines
Documentation/devicetree/bindings/display/panel/panel-mipi.yaml new file +10 -0
+description:
+  This is a binding for generic MIPI-DSI/DPI panels that require
+  initialization with a simple command sequence before use.
+
+properties:
+  compatible:
+    oneOf:
+      - enum:
+          - panel-mipi-dsi
+          - panel-mipi-dpi-spi

Missing device specific compatibles.

Quoted 19 lines
Documentation/devicetree/bindings/display/panel/panel-mipi.yaml new file +19 -0
+      - items:
+          - {}
+          - enum:
+              - panel-mipi-dsi
+              - panel-mipi-dpi-spi
+
+  reg:
+    description: DSI / SPI channel used by that screen
+    maxItems: 1
+
+  power-supply: true
+
+  io-supply:
+    description: I/O system regulator.
+      No need to set if this is the same as polwer-supply.
+
+  dc-gpios:
+    maxItems: 1
+    description: Controller data/command selection (D/CX) in 4-line SPI mode.

Documentation/devicetree/bindings/display/panel/panel-mipi.yaml line 50

Quoted 10 lines
Documentation/devicetree/bindings/display/panel/panel-mipi.yaml new file +10 -0
+      If not set, the controller is in 3-line SPI mode.
+      Disallowed for DSI.
+
+  width-mm: true
+  height-mm: true
+  panel-timing: true
+  display-timings: true
+
+  reset-delay:
+    description: Delay (in ms) after the reset command

So use proper unit suffixes. Everywhere.

Quoted 85 lines
Documentation/devicetree/bindings/display/panel/panel-mipi.yaml new file +85 -0
+    $ref: /schemas/types.yaml#/definitions/uint32
+
+  init-delay:
+    description: Delay (in ms) for sending the initial command sequence
+    $ref: /schemas/types.yaml#/definitions/uint32
+
+  sleep-delay:
+    description: Delay (in ms) after the sleep command
+    $ref: /schemas/types.yaml#/definitions/uint32
+
+  backlight-delay:
+    description: Delay (in ms) for enabling the backlight
+    $ref: /schemas/types.yaml#/definitions/uint32
+
+  port: true
+  reset-gpios: true
+  rotation: true
+
+  backlight: true
+
+  init-sequence:
+    description: Encoded initial command sequence.
+    $ref: /schemas/types.yaml#/definitions/uint8-array
+
+  firmware-name:
+    maxItems: 1
+
+  dsi-mode-video:
+    description: Enable MIPI_DSI_MODE_VIDEO.
+      Disallowed for SPI.
+    type: boolean
+
+  dsi-mode-video-burst:
+    description: Enable MIPI_DSI_MODE_VIDEO_BURST.
+      Disallowed for SPI.
+    type: boolean
+
+  dsi-mode-video-sync-pulse:
+    description: Enable MIPI_DSI_MODE_VIDEO_SYNC_PULSE.
+      Disallowed for SPI.
+    type: boolean
+
+  dsi-mode-video-auto-vert:
+    description: Enable MIPI_DSI_MODE_VIDEO_AUTO_VERT.
+      Disallowed for SPI.
+    type: boolean
+
+  dsi-mode-video-hse:
+    description: Enable MIPI_DSI_MODE_VIDEO_HSE.
+      Disallowed for SPI.
+    type: boolean
+
+  dsi-mode-video-no-hfp:
+    description: Enable MIPI_DSI_MODE_VIDEO_NO_HFP.
+      Disallowed for SPI.
+    type: boolean
+
+  dsi-mode-video-no-hbp:
+    description: Enable MIPI_DSI_MODE_VIDEO_NO_HBP.
+      Disallowed for SPI.
+    type: boolean
+
+  dsi-mode-video-no-hsa:
+    description: Enable MIPI_DSI_MODE_VIDEO_NO_HSA.
+      Disallowed for SPI.
+    type: boolean
+
+  dsi-mode-vsync-flush:
+    description: Enable MIPI_DSI_MODE_VSYNC_FLUSH.
+      Disallowed for SPI.
+    type: boolean
+
+  dsi-mode-no-eot-packet:
+    description: Enable MIPI_DSI_MODE_NO_EOT_PACKET.
+      Disallowed for SPI.
+    type: boolean
+
+  dsi-clock-non-continuous:
+    description: Enable MIPI_DSI_CLOCK_NON_CONTINUOUS.
+      Disallowed for SPI.
+    type: boolean
+
+  dsi-mode-lpm:
+    description: Enable MIPI_DSI_MODE_LPM.
+      Disallowed for SPI.
Quoted 8 lines

Documentation/devicetree/bindings/display/panel/panel-mipi.yaml line 138

Quoted 3 lines
Documentation/devicetree/bindings/display/panel/panel-mipi.yaml new file +3 -0
+    type: boolean
+
+  dsi-hs-pkt-end-aligned:

All this must be deduced from the compatible which makes this binding redundant. This binding is a no-go for me for obvious reasons: is not specific and you try to bypass the exact rule of bindings to be specific about hardware.

Ok, I'll delete these redundant properties, and deduce from the compatible.

Quoted 59 lines
Quoted 46 lines
Documentation/devicetree/bindings/display/panel/panel-mipi.yaml new file +45 -0
+    description: Enable MIPI_DSI_HS_PKT_END_ALIGNED.
+      Disallowed for SPI.
+    type: boolean
+
+required:
+  - compatible
+  - reg
+
+allOf:
+  - $ref: panel-common.yaml#
+  - if:
+      properties:
+        compatible:
+          contains:
+            enum:
+              - panel-mipi-dpi-spi
+    then:
+      # SPI mode
+      $ref: /schemas/spi/spi-peripheral-props.yaml#
+      properties:
+        dsi-mode-video: false
+        dsi-mode-video-burst: false
+        dsi-mode-video-sync-pulse: false
+        dsi-mode-video-auto-vert: false
+        dsi-mode-video-hse: false
+        dsi-mode-video-no-hfp: false
+        dsi-mode-video-no-hbp: false
+        dsi-mode-video-no-hsa: false
+        dsi-mode-vsync-flush: false
+        dsi-mode-no-eot-packet: false
+        dsi-clock-non-continuous: false
+        dsi-mode-lpm: false
+        dsi-hs-pkt-end-aligned: false
+
+  - if:
+      properties:
+        compatible:
+          contains:
+            enum:
+              - panel-mipi-dsi
+    then:
+      # DSI mode
+      properties:
+        dc-gpios: false
+

Documentation/devicetree/bindings/display/panel/panel-mipi.yaml line 193

Quoted 10 lines
Documentation/devicetree/bindings/display/panel/panel-mipi.yaml new file +10 -0
+unevaluatedProperties: false
+
+examples:
+  - |
+    dsi {
+        #address-cells = <1>;
+        #size-cells = <0>;
+
+        panel@0 {
+            compatible = "vendor,some-panel", "panel-mipi-dsi";

Undocumented compatible.

Quoted 3 lines

Best regards,
Krzysztof

Regards,
kikuchan.

#4 lore raw

PATCH 2/2 drm: panel: Add a driver for Generic MIPI-DSI/DPI(+SPI) panels

In reply to Hironori KIKUCHI

Although the MIPI specifications define how to communicate with a panel to display an image, some panels still require a panel-specific initialization sequence to be sent.

This is a driver for such generic MIPI-DSI/DPI panels that require initialization with a simple command sequence before use.

Its fundamental approach is similar to panel-mipi-dbi driver, which sends an initialization sequence stored in a firmware file.

Moreover, this driver allows display modes, timings, and panel configuration parameters to be stored in the same file or in DT.

---
 drivers/gpu/drm/panel/Kconfig      |   10 +
 drivers/gpu/drm/panel/Makefile     |    1 +
 drivers/gpu/drm/panel/panel-mipi.c | 1355 ++++++++++++++++++++++++++++
 3 files changed, 1366 insertions(+)
 create mode 100644 drivers/gpu/drm/panel/panel-mipi.c
drivers/gpu/drm/panel/Kconfig +10 -0
index d7469c565d1..46eea1974a0 100644
@@ -408,6 +408,16 @@ config DRM_PANEL_MANTIX_MLAF057WE51
 	  has a resolution of 720x1440 pixels, a built in backlight and touch
 	  controller.
 
+config DRM_PANEL_MIPI
+	tristate "Generic MIPI-DSI/DPI(+SPI) panel"
+	depends on OF
+	depends on SPI || DRM_MIPI_DSI
+	select DRM_MIPI_DBI if SPI
+	depends on BACKLIGHT_CLASS_DEVICE
+	help
+	  Say Y here if you want to enable support for Generic MIPI-DSI /
+	  MIPI-DPI(+SPI) panels.
+
 config DRM_PANEL_NEC_NL8048HL11
 	tristate "NEC NL8048HL11 RGB panel"
 	depends on GPIOLIB && OF && SPI
drivers/gpu/drm/panel/Makefile +1 -0
index 7dcf72646ca..22276255a7b 100644
@@ -40,6 +40,7 @@ obj-$(CONFIG_DRM_PANEL_LG_LB035Q02) += panel-lg-lb035q02.o
 obj-$(CONFIG_DRM_PANEL_LG_LG4573) += panel-lg-lg4573.o
 obj-$(CONFIG_DRM_PANEL_LG_SW43408) += panel-lg-sw43408.o
 obj-$(CONFIG_DRM_PANEL_MAGNACHIP_D53E6EA8966) += panel-magnachip-d53e6ea8966.o
+obj-$(CONFIG_DRM_PANEL_MIPI) += panel-mipi.o
 obj-$(CONFIG_DRM_PANEL_NEC_NL8048HL11) += panel-nec-nl8048hl11.o
 obj-$(CONFIG_DRM_PANEL_NEWVISION_NV3051D) += panel-newvision-nv3051d.o
 obj-$(CONFIG_DRM_PANEL_NEWVISION_NV3052C) += panel-newvision-nv3052c.o
drivers/gpu/drm/panel/panel-mipi.c new file +1355 -0

1,355 lines not on this page · raw message

Signature · 1 line
2.48.1