74d35109f61497593cfa0b9477a18cb94778aa7e
[openwrt/staging/wigyori.git] /
1 From 4aa526733f16267bf28ee312e0b5b2ce3246f246 Mon Sep 17 00:00:00 2001
2 From: Dave Stevenson <dave.stevenson@raspberrypi.com>
3 Date: Thu, 6 Jan 2022 13:04:34 +0000
4 Subject: [PATCH] dtoverlays: Add overlays for Pimoroni Hyperpixel
5 displays
6
7 Adds an overlays for the Pimoroni HyperPixel4, HyperPixel 4
8 Square, and HyperPixel 2 Round DPI displays.
9
10 We have a conflict over the use of GPIO 27 for touch screen
11 interrupt and SPI CLK for configuring the display on the
12 two HyperPixel4 displays.
13
14 Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
15 ---
16 arch/arm/boot/dts/overlays/Makefile | 3 +
17 arch/arm/boot/dts/overlays/README | 33 +++++
18 .../dts/overlays/vc4-kms-dpi-hyperpixel.dtsi | 94 +++++++++++++++
19 .../vc4-kms-dpi-hyperpixel2r-overlay.dts | 114 ++++++++++++++++++
20 .../vc4-kms-dpi-hyperpixel4-overlay.dts | 57 +++++++++
21 .../vc4-kms-dpi-hyperpixel4sq-overlay.dts | 36 ++++++
22 6 files changed, 337 insertions(+)
23 create mode 100644 arch/arm/boot/dts/overlays/vc4-kms-dpi-hyperpixel.dtsi
24 create mode 100644 arch/arm/boot/dts/overlays/vc4-kms-dpi-hyperpixel2r-overlay.dts
25 create mode 100644 arch/arm/boot/dts/overlays/vc4-kms-dpi-hyperpixel4-overlay.dts
26 create mode 100644 arch/arm/boot/dts/overlays/vc4-kms-dpi-hyperpixel4sq-overlay.dts
27
28 --- a/arch/arm/boot/dts/overlays/Makefile
29 +++ b/arch/arm/boot/dts/overlays/Makefile
30 @@ -235,6 +235,9 @@ dtbo-$(CONFIG_ARCH_BCM2835) += \
31 vc4-fkms-v3d.dtbo \
32 vc4-fkms-v3d-pi4.dtbo \
33 vc4-kms-dpi-generic.dtbo \
34 + vc4-kms-dpi-hyperpixel2r.dtbo \
35 + vc4-kms-dpi-hyperpixel4.dtbo \
36 + vc4-kms-dpi-hyperpixel4sq.dtbo \
37 vc4-kms-dpi-panel.dtbo \
38 vc4-kms-dsi-7inch.dtbo \
39 vc4-kms-dsi-lt070me05000.dtbo \
40 --- a/arch/arm/boot/dts/overlays/README
41 +++ b/arch/arm/boot/dts/overlays/README
42 @@ -3676,6 +3676,39 @@ Params: clock-frequency Display
43 rotate Display rotation {0,90,180,270} (default 0)
44
45
46 +Name: vc4-kms-dpi-hyperpixel2r
47 +Info: Enable the KMS drivers for the Pimoroni HyperPixel2 Round DPI display.
48 + Requires vc4-kms-v3d to be loaded.
49 +Load: dtoverlay=vc4-kms-dpi-hyperpixel2r,<param>=<val>
50 +Params: disable-touch Disables the touch controller
51 + touchscreen-inverted-x Inverts X direction of touch controller
52 + touchscreen-inverted-y Inverts Y direction of touch controller
53 + touchscreen-swapped-x-y Swaps X & Y axes of touch controller
54 + rotate Display rotation {0,90,180,270} (default 0)
55 +
56 +
57 +Name: vc4-kms-dpi-hyperpixel4
58 +Info: Enable the KMS drivers for the Pimoroni HyperPixel4 DPI display.
59 + Requires vc4-kms-v3d to be loaded.
60 +Load: dtoverlay=vc4-kms-dpi-hyperpixel4,<param>=<val>
61 +Params: disable-touch Disables the touch controller
62 + touchscreen-inverted-x Inverts X direction of touch controller
63 + touchscreen-inverted-y Inverts Y direction of touch controller
64 + touchscreen-swapped-x-y Swaps X & Y axes of touch controller
65 + rotate Display rotation {0,90,180,270} (default 0)
66 +
67 +
68 +Name: vc4-kms-dpi-hyperpixel4sq
69 +Info: Enable the KMS drivers for the Pimoroni HyperPixel4 Square DPI display.
70 + Requires vc4-kms-v3d to be loaded.
71 +Load: dtoverlay=vc4-kms-dpi-hyperpixel4sq,<param>=<val>
72 +Params: disable-touch Disables the touch controller
73 + touchscreen-inverted-x Inverts X direction of touch controller
74 + touchscreen-inverted-y Inverts Y direction of touch controller
75 + touchscreen-swapped-x-y Swaps X & Y axes of touch controller
76 + rotate Display rotation {0,90,180,270} (default 0)
77 +
78 +
79 Name: vc4-kms-dpi-panel
80 Info: Enable a preconfigured KMS DPI panel.
81 Requires vc4-kms-v3d to be loaded.
82 --- /dev/null
83 +++ b/arch/arm/boot/dts/overlays/vc4-kms-dpi-hyperpixel.dtsi
84 @@ -0,0 +1,94 @@
85 +/*
86 + * vc4-kms-dpi-hyperpixel4.dtsi
87 + * Commmon initialisation for HyperPixel DPI displays
88 + */
89 +
90 +#include <dt-bindings/gpio/gpio.h>
91 +#include <dt-bindings/pinctrl/bcm2835.h>
92 +
93 +/ {
94 + compatible = "brcm,bcm2835";
95 +
96 + fragment@0 {
97 + target-path = "/";
98 + __overlay__ {
99 + spi {
100 + compatible = "spi-gpio";
101 + #address-cells = <1>;
102 + #size-cells = <0>;
103 + pinctrl-0 = <&spi_pins>;
104 + pinctrl-names = "default";
105 +
106 + sck-gpios = <&gpio 27 GPIO_ACTIVE_HIGH>;
107 + mosi-gpios = <&gpio 26 GPIO_ACTIVE_HIGH>;
108 + cs-gpios = <&gpio 18 GPIO_ACTIVE_LOW>;
109 + num-chipselects = <1>;
110 + sck-idle-input;
111 +
112 + panel: display@0 {
113 + reg = <0>;
114 + /* 100 kHz */
115 + spi-max-frequency = <100000>;
116 + backlight = <&backlight>;
117 + rotation = <0>;
118 +
119 + port {
120 + panel_in: endpoint {
121 + remote-endpoint = <&dpi_out>;
122 + };
123 + };
124 + };
125 + };
126 +
127 + backlight: backlight {
128 + compatible = "gpio-backlight";
129 + gpios = <&gpio 19 0>;
130 + };
131 + };
132 + };
133 +
134 + fragment@1 {
135 + target = <&dpi>;
136 + __overlay__ {
137 + status = "okay";
138 +
139 + pinctrl-names = "default";
140 + pinctrl-0 = <&dpi_18bit_cpadhi_gpio0>;
141 +
142 + port {
143 + dpi_out: endpoint {
144 + remote-endpoint = <&panel_in>;
145 + };
146 + };
147 + };
148 + };
149 +
150 + fragment@2 {
151 + target = <&gpio>;
152 + __overlay__ {
153 + spi_pins: hyperpixel4_spi_pins {
154 + brcm,pins = <27 18 26>;
155 + brcm,pull = <BCM2835_PUD_UP BCM2835_PUD_UP BCM2835_PUD_OFF>;
156 + brcm,function = <0>;
157 + };
158 + };
159 + };
160 +
161 + fragment@3 {
162 + target-path = "/";
163 + __overlay__ {
164 + i2c_gpio: i2c@0 {
165 + compatible = "i2c-gpio";
166 + gpios = <&gpio 10 0 /* sda */
167 + &gpio 11 0>; /* scl */
168 + i2c-gpio,delay-us = <4>; /* ~100 kHz */
169 + #address-cells = <1>;
170 + #size-cells = <0>;
171 + };
172 + };
173 + };
174 +
175 + __overrides__ {
176 + rotate = <&panel>, "rotation:0";
177 + };
178 +};
179 --- /dev/null
180 +++ b/arch/arm/boot/dts/overlays/vc4-kms-dpi-hyperpixel2r-overlay.dts
181 @@ -0,0 +1,114 @@
182 +/*
183 + * vc4-kms-dpi-hyperpixel2r-overlay.dts
184 + */
185 +
186 +#include <dt-bindings/gpio/gpio.h>
187 +#include <dt-bindings/pinctrl/bcm2835.h>
188 +
189 +/dts-v1/;
190 +/plugin/;
191 +
192 +/ {
193 + compatible = "brcm,bcm2835";
194 +
195 + fragment@0 {
196 + target-path = "/";
197 + __overlay__ {
198 + spi {
199 + compatible = "spi-gpio";
200 + #address-cells = <1>;
201 + #size-cells = <0>;
202 + pinctrl-0 = <&spi_pins>;
203 + pinctrl-names = "default";
204 +
205 + sck-gpios = <&gpio 11 GPIO_ACTIVE_HIGH>;
206 + mosi-gpios = <&gpio 10 GPIO_ACTIVE_HIGH>;
207 + cs-gpios = <&gpio 18 GPIO_ACTIVE_LOW>;
208 + num-chipselects = <1>;
209 +
210 + panel: display@0 {
211 + compatible = "pimoroni,hyperpixel2round";
212 + reg = <0>;
213 + /* 100 kHz */
214 + spi-max-frequency = <100000>;
215 + backlight = <&backlight>;
216 + rotation = <0>;
217 +
218 + port {
219 + panel_in: endpoint {
220 + remote-endpoint = <&dpi_out>;
221 + };
222 + };
223 + };
224 + };
225 +
226 + backlight: backlight {
227 + compatible = "gpio-backlight";
228 + gpios = <&gpio 19 0>;
229 + };
230 + };
231 + };
232 +
233 + fragment@1 {
234 + target = <&dpi>;
235 + __overlay__ {
236 + status = "okay";
237 +
238 + pinctrl-names = "default";
239 + pinctrl-0 = <&dpi_18bit_cpadhi_gpio0>;
240 +
241 + port {
242 + dpi_out: endpoint {
243 + remote-endpoint = <&panel_in>;
244 + };
245 + };
246 + };
247 + };
248 +
249 + fragment@2 {
250 + target = <&gpio>;
251 + __overlay__ {
252 + spi_pins: hyperpixel4_spi_pins {
253 + brcm,pins = <27 18 26>;
254 + brcm,pull = <BCM2835_PUD_UP BCM2835_PUD_UP BCM2835_PUD_OFF>;
255 + brcm,function = <0>;
256 + };
257 + };
258 + };
259 +
260 + fragment@3 {
261 + target-path = "/";
262 + __overlay__ {
263 + i2c_gpio: i2c@0 {
264 + compatible = "i2c-gpio";
265 + status = "disabled";
266 +
267 + gpios = <&gpio 10 GPIO_ACTIVE_HIGH /* sda */
268 + &gpio 11 GPIO_ACTIVE_HIGH>; /* scl */
269 + i2c-gpio,delay-us = <4>; /* ~100 kHz */
270 + #address-cells = <1>;
271 + #size-cells = <0>;
272 +
273 + polytouch: edt-ft5x06@15 {
274 + #address-cells = <1>;
275 + #size-cells = <0>;
276 + compatible = "edt,edt-ft5406";
277 + reg = <0x15>;
278 + interrupt-parent = <&gpio>;
279 + interrupts = <27 0x02>;
280 + touchscreen-size-x = <240>;
281 + touchscreen-size-y = <240>;
282 + };
283 + };
284 + };
285 + };
286 +
287 + __overrides__ {
288 + disable-touch = <0>,"-3";
289 + touchscreen-inverted-x = <&polytouch>,"touchscreen-inverted-x?";
290 + touchscreen-inverted-y = <&polytouch>,"touchscreen-inverted-y!";
291 + touchscreen-swapped-x-y = <&polytouch>,"touchscreen-swapped-x-y!";
292 + rotate = <&panel>, "rotation:0";
293 + };
294 +
295 +};
296 --- /dev/null
297 +++ b/arch/arm/boot/dts/overlays/vc4-kms-dpi-hyperpixel4-overlay.dts
298 @@ -0,0 +1,57 @@
299 +/*
300 + * vc4-kms-dpi-hyperpixel4sq-overlay.dts
301 + */
302 +
303 +/dts-v1/;
304 +/plugin/;
305 +
306 +#include "vc4-kms-dpi-hyperpixel.dtsi"
307 +
308 +&panel {
309 + compatible = "pimoroni,hyperpixel4";
310 +};
311 +
312 +/ {
313 + fragment@11 {
314 + target = <&i2c_gpio>;
315 + __overlay__ {
316 + /* needed to avoid dtc warning */
317 + #address-cells = <1>;
318 + #size-cells = <0>;
319 + ft6236_14: ft6236@14 {
320 + compatible = "goodix,gt911";
321 + reg = <0x14>;
322 + interrupt-parent = <&gpio>;
323 + interrupts = <27 2>;
324 + touchscreen-size-x = <480>;
325 + touchscreen-size-y = <800>;
326 + touchscreen-x-mm = <51>;
327 + touchscreen-y-mm = <85>;
328 + touchscreen-inverted-y;
329 + touchscreen-swapped-x-y;
330 + };
331 + ft6236_5d: ft6236@5d {
332 + compatible = "goodix,gt911";
333 + reg = <0x5d>;
334 + interrupt-parent = <&gpio>;
335 + interrupts = <27 2>;
336 + touchscreen-size-x = <480>;
337 + touchscreen-size-y = <800>;
338 + touchscreen-x-mm = <51>;
339 + touchscreen-y-mm = <85>;
340 + touchscreen-inverted-y;
341 + touchscreen-swapped-x-y;
342 + };
343 + };
344 + };
345 +
346 + __overrides__ {
347 + disable-touch = <0>,"-3-11";
348 + touchscreen-inverted-x = <&ft6236_14>,"touchscreen-inverted-x?",
349 + <&ft6236_5d>,"touchscreen-inverted-x?";
350 + touchscreen-inverted-y = <&ft6236_14>,"touchscreen-inverted-y!",
351 + <&ft6236_5d>,"touchscreen-inverted-y!";
352 + touchscreen-swapped-x-y = <&ft6236_14>,"touchscreen-swapped-x-y!",
353 + <&ft6236_5d>,"touchscreen-swapped-x-y!";
354 + };
355 +};
356 --- /dev/null
357 +++ b/arch/arm/boot/dts/overlays/vc4-kms-dpi-hyperpixel4sq-overlay.dts
358 @@ -0,0 +1,36 @@
359 +/*
360 + * vc4-kms-dpi-hyperpixel4-overlay.dts
361 + */
362 +
363 +/dts-v1/;
364 +/plugin/;
365 +
366 +#include "vc4-kms-dpi-hyperpixel.dtsi"
367 +
368 +&panel {
369 + compatible = "pimoroni,hyperpixel4square";
370 +};
371 +
372 +/ {
373 + fragment@11 {
374 + target = <&i2c_gpio>;
375 + __overlay__ {
376 + polytouch: edt-ft5x06@48 {
377 + #address-cells = <1>;
378 + #size-cells = <0>;
379 + compatible = "edt,edt-ft5406";
380 + reg = <0x48>;
381 + interrupt-parent = <&gpio>;
382 + interrupts = <27 0x02>;
383 + touchscreen-size-x = <720>;
384 + touchscreen-size-y = <720>;
385 + };
386 + };
387 + };
388 + __overrides__ {
389 + disable-touch = <0>,"-3-11";
390 + touchscreen-inverted-x = <&polytouch>,"touchscreen-inverted-x?";
391 + touchscreen-inverted-y = <&polytouch>,"touchscreen-inverted-y!";
392 + touchscreen-swapped-x-y = <&polytouch>,"touchscreen-swapped-x-y!";
393 + };
394 +};