41331381eb6c3d15211a8de04ca0682830b67dda
[openwrt/staging/dangole.git] /
1 From e39c2eeca4868a7cf34e34fb9a9ca7119c30372a Mon Sep 17 00:00:00 2001
2 From: =?UTF-8?q?Noralf=20Tr=C3=B8nnes?= <noralf@tronnes.org>
3 Date: Sun, 27 Feb 2022 13:47:09 +0100
4 Subject: [PATCH] dt-bindings: display: add bindings for MIPI DBI
5 compatible SPI panels
6 MIME-Version: 1.0
7 Content-Type: text/plain; charset=UTF-8
8 Content-Transfer-Encoding: 8bit
9
10 commit 2f3468b upstream.
11
12 Add binding for MIPI DBI compatible SPI panels.
13
14 v6:
15 - Fix indentation (Rob)
16
17 v5:
18 - Add sainsmart18 to compatible items (Rob)
19 - Expand write-only description (Sam)
20
21 v4:
22 - There should only be two compatible (Maxime)
23 - s/panel-dbi-spi/panel-mipi-dbi-spi/in compatible
24
25 v3:
26 - Move properties to Device Tree (Maxime)
27 - Use contains for compatible (Maxime)
28 - Add backlight property to example
29 - Flesh out description
30
31 v2:
32 - Fix path for panel-common.yaml
33 - Use unevaluatedProperties
34 - Drop properties which are in the allOf section
35 - Drop model property (Rob)
36
37 Acked-by: Maxime Ripard <maxime@cerno.tech>
38 Acked-by: Sam Ravnborg <sam@ravnborg.org>
39 Reviewed-by: Rob Herring <robh@kernel.org>
40 Signed-off-by: Noralf Trønnes <noralf@tronnes.org>
41 Signed-off-by: Maxime Ripard <maxime@cerno.tech>
42 Link: https://patchwork.freedesktop.org/patch/msgid/20220227124713.39766-2-noralf@tronnes.org
43 ---
44 .../display/panel/panel-mipi-dbi-spi.yaml | 126 ++++++++++++++++++
45 1 file changed, 126 insertions(+)
46 create mode 100644 Documentation/devicetree/bindings/display/panel/panel-mipi-dbi-spi.yaml
47
48 --- /dev/null
49 +++ b/Documentation/devicetree/bindings/display/panel/panel-mipi-dbi-spi.yaml
50 @@ -0,0 +1,126 @@
51 +# SPDX-License-Identifier: (GPL-2.0-only or BSD-2-Clause)
52 +%YAML 1.2
53 +---
54 +$id: http://devicetree.org/schemas/display/panel/panel-mipi-dbi-spi.yaml#
55 +$schema: http://devicetree.org/meta-schemas/core.yaml#
56 +
57 +title: MIPI DBI SPI Panel
58 +
59 +maintainers:
60 + - Noralf Trønnes <noralf@tronnes.org>
61 +
62 +description: |
63 + This binding is for display panels using a MIPI DBI compatible controller
64 + in SPI mode.
65 +
66 + The MIPI Alliance Standard for Display Bus Interface defines the electrical
67 + and logical interfaces for display controllers historically used in mobile
68 + phones. The standard defines 4 display architecture types and this binding is
69 + for type 1 which has full frame memory. There are 3 interface types in the
70 + standard and type C is the serial interface.
71 +
72 + The standard defines the following interface signals for type C:
73 + - Power:
74 + - Vdd: Power supply for display module
75 + - Vddi: Logic level supply for interface signals
76 + Combined into one in this binding called: power-supply
77 + - Interface:
78 + - CSx: Chip select
79 + - SCL: Serial clock
80 + - Dout: Serial out
81 + - Din: Serial in
82 + - SDA: Bidrectional in/out
83 + - D/CX: Data/command selection, high=data, low=command
84 + Called dc-gpios in this binding.
85 + - RESX: Reset when low
86 + Called reset-gpios in this binding.
87 +
88 + The type C interface has 3 options:
89 +
90 + - Option 1: 9-bit mode and D/CX as the 9th bit
91 + | Command | the next command or following data |
92 + |<0><D7><D6><D5><D4><D3><D2><D1><D0>|<D/CX><D7><D6><D5><D4><D3><D2><D1><D0>|
93 +
94 + - Option 2: 16-bit mode and D/CX as a 9th bit
95 + | Command or data |
96 + |<X><X><X><X><X><X><X><D/CX><D7><D6><D5><D4><D3><D2><D1><D0>|
97 +
98 + - Option 3: 8-bit mode and D/CX as a separate interface line
99 + | Command or data |
100 + |<D7><D6><D5><D4><D3><D2><D1><D0>|
101 +
102 + The panel resolution is specified using the panel-timing node properties
103 + hactive (width) and vactive (height). The other mandatory panel-timing
104 + properties should be set to zero except clock-frequency which can be
105 + optionally set to inform about the actual pixel clock frequency.
106 +
107 + If the panel is wired to the controller at an offset specify this using
108 + hback-porch (x-offset) and vback-porch (y-offset).
109 +
110 +allOf:
111 + - $ref: panel-common.yaml#
112 + - $ref: /schemas/spi/spi-peripheral-props.yaml#
113 +
114 +properties:
115 + compatible:
116 + items:
117 + - enum:
118 + - sainsmart18
119 + - const: panel-mipi-dbi-spi
120 +
121 + write-only:
122 + type: boolean
123 + description:
124 + Controller is not readable (ie. Din (MISO on the SPI interface) is not
125 + wired up).
126 +
127 + dc-gpios:
128 + maxItems: 1
129 + description: |
130 + Controller data/command selection (D/CX) in 4-line SPI mode.
131 + If not set, the controller is in 3-line SPI mode.
132 +
133 +required:
134 + - compatible
135 + - reg
136 + - panel-timing
137 +
138 +unevaluatedProperties: false
139 +
140 +examples:
141 + - |
142 + #include <dt-bindings/gpio/gpio.h>
143 +
144 + spi {
145 + #address-cells = <1>;
146 + #size-cells = <0>;
147 +
148 + display@0{
149 + compatible = "sainsmart18", "panel-mipi-dbi-spi";
150 + reg = <0>;
151 + spi-max-frequency = <40000000>;
152 +
153 + dc-gpios = <&gpio 24 GPIO_ACTIVE_HIGH>;
154 + reset-gpios = <&gpio 25 GPIO_ACTIVE_HIGH>;
155 + write-only;
156 +
157 + backlight = <&backlight>;
158 +
159 + width-mm = <35>;
160 + height-mm = <28>;
161 +
162 + panel-timing {
163 + hactive = <160>;
164 + vactive = <128>;
165 + hback-porch = <0>;
166 + vback-porch = <0>;
167 + clock-frequency = <0>;
168 + hfront-porch = <0>;
169 + hsync-len = <0>;
170 + vfront-porch = <0>;
171 + vsync-len = <0>;
172 + };
173 + };
174 + };
175 +
176 +...