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
7 Adds an overlays for the Pimoroni HyperPixel4, HyperPixel 4
8 Square, and HyperPixel 2 Round DPI displays.
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.
14 Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
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
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) += \
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)
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)
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)
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)
79 Name: vc4-kms-dpi-panel
80 Info: Enable a preconfigured KMS DPI panel.
81 Requires vc4-kms-v3d to be loaded.
83 +++ b/arch/arm/boot/dts/overlays/vc4-kms-dpi-hyperpixel.dtsi
86 + * vc4-kms-dpi-hyperpixel4.dtsi
87 + * Commmon initialisation for HyperPixel DPI displays
90 +#include <dt-bindings/gpio/gpio.h>
91 +#include <dt-bindings/pinctrl/bcm2835.h>
94 + compatible = "brcm,bcm2835";
100 + compatible = "spi-gpio";
101 + #address-cells = <1>;
103 + pinctrl-0 = <&spi_pins>;
104 + pinctrl-names = "default";
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>;
115 + spi-max-frequency = <100000>;
116 + backlight = <&backlight>;
120 + panel_in: endpoint {
121 + remote-endpoint = <&dpi_out>;
127 + backlight: backlight {
128 + compatible = "gpio-backlight";
129 + gpios = <&gpio 19 0>;
139 + pinctrl-names = "default";
140 + pinctrl-0 = <&dpi_18bit_cpadhi_gpio0>;
143 + dpi_out: endpoint {
144 + remote-endpoint = <&panel_in>;
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>;
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>;
176 + rotate = <&panel>, "rotation:0";
180 +++ b/arch/arm/boot/dts/overlays/vc4-kms-dpi-hyperpixel2r-overlay.dts
183 + * vc4-kms-dpi-hyperpixel2r-overlay.dts
186 +#include <dt-bindings/gpio/gpio.h>
187 +#include <dt-bindings/pinctrl/bcm2835.h>
193 + compatible = "brcm,bcm2835";
199 + compatible = "spi-gpio";
200 + #address-cells = <1>;
202 + pinctrl-0 = <&spi_pins>;
203 + pinctrl-names = "default";
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>;
211 + compatible = "pimoroni,hyperpixel2round";
214 + spi-max-frequency = <100000>;
215 + backlight = <&backlight>;
219 + panel_in: endpoint {
220 + remote-endpoint = <&dpi_out>;
226 + backlight: backlight {
227 + compatible = "gpio-backlight";
228 + gpios = <&gpio 19 0>;
238 + pinctrl-names = "default";
239 + pinctrl-0 = <&dpi_18bit_cpadhi_gpio0>;
242 + dpi_out: endpoint {
243 + remote-endpoint = <&panel_in>;
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>;
264 + compatible = "i2c-gpio";
265 + status = "disabled";
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>;
273 + polytouch: edt-ft5x06@15 {
274 + #address-cells = <1>;
276 + compatible = "edt,edt-ft5406";
278 + interrupt-parent = <&gpio>;
279 + interrupts = <27 0x02>;
280 + touchscreen-size-x = <240>;
281 + touchscreen-size-y = <240>;
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";
297 +++ b/arch/arm/boot/dts/overlays/vc4-kms-dpi-hyperpixel4-overlay.dts
300 + * vc4-kms-dpi-hyperpixel4sq-overlay.dts
306 +#include "vc4-kms-dpi-hyperpixel.dtsi"
309 + compatible = "pimoroni,hyperpixel4";
314 + target = <&i2c_gpio>;
316 + /* needed to avoid dtc warning */
317 + #address-cells = <1>;
319 + ft6236_14: ft6236@14 {
320 + compatible = "goodix,gt911";
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;
331 + ft6236_5d: ft6236@5d {
332 + compatible = "goodix,gt911";
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;
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!";
357 +++ b/arch/arm/boot/dts/overlays/vc4-kms-dpi-hyperpixel4sq-overlay.dts
360 + * vc4-kms-dpi-hyperpixel4-overlay.dts
366 +#include "vc4-kms-dpi-hyperpixel.dtsi"
369 + compatible = "pimoroni,hyperpixel4square";
374 + target = <&i2c_gpio>;
376 + polytouch: edt-ft5x06@48 {
377 + #address-cells = <1>;
379 + compatible = "edt,edt-ft5406";
381 + interrupt-parent = <&gpio>;
382 + interrupts = <27 0x02>;
383 + touchscreen-size-x = <720>;
384 + touchscreen-size-y = <720>;
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!";