1 From 86356a59b7688f8080aab516f1723f2ffbf15090 Mon Sep 17 00:00:00 2001
2 From: Mark Williams <mwp@mwp.id.au>
3 Date: Thu, 8 Dec 2022 04:58:05 -0700
4 Subject: [PATCH] overlays: Add crystalfontz-cfa050_pi_m
6 Add support for the Crystalfontz CFA050-PI-M series of Raspberry Pi
7 CM4-based modules using the CFAF7201280A0_050Tx TFT LCD displays.
9 Signed-off-by: Mark Williams <mwp@mwp.id.au>
11 arch/arm/boot/dts/overlays/Makefile | 1 +
12 arch/arm/boot/dts/overlays/README | 9 ++
13 .../crystalfontz-cfa050_pi_m-overlay.dts | 124 ++++++++++++++++++
14 3 files changed, 134 insertions(+)
15 create mode 100644 arch/arm/boot/dts/overlays/crystalfontz-cfa050_pi_m-overlay.dts
17 --- a/arch/arm/boot/dts/overlays/Makefile
18 +++ b/arch/arm/boot/dts/overlays/Makefile
19 @@ -40,6 +40,7 @@ dtbo-$(CONFIG_ARCH_BCM2835) += \
23 + crystalfontz-cfa050_pi_m.dtbo \
27 --- a/arch/arm/boot/dts/overlays/README
28 +++ b/arch/arm/boot/dts/overlays/README
29 @@ -804,6 +804,15 @@ Params: cma-512 CMA is 5
30 cma-default Use upstream's default value
33 +Name: crystalfontz-cfa050_pi_m
34 +Info: Configures the Crystalfontz CFA050-PI-M series of Raspberry Pi CM4
35 + based modules using the CFA7201280A0_050Tx 7" TFT LCD displays,
36 + with or without capacitive touch screen.
37 + Requires use of vc4-kms-v3d.
38 +Load: dtoverlay=crystalfontz-cfa050_pi_m,<param>=<val>
39 +Params: captouch Enable capacitive touch display
43 Info: 8" TFT LCD display and touch panel used by cutiepi.io
44 Load: dtoverlay=cutiepi-panel
46 +++ b/arch/arm/boot/dts/overlays/crystalfontz-cfa050_pi_m-overlay.dts
49 + * crystalfontz-cfa050_pi_m-overlay.dts
50 + * Configures the Crystalfontz CFA050-PI-M series of modules
51 + * using CFAF7201280A0-050TC/TN panels with RaspberryPi CM4 DSI1
57 + compatible = "brcm,bcm2835";
58 +// PCF8574 I2C GPIO EXPANDER
60 + target = <&i2c_csi_dsi>;
62 + #address-cells = <1>;
65 + pcf8574a: pcf8574a@38 {
67 + compatible = "nxp,pcf8574";
71 + gpio-line-names = "TFT_RESET", "TOUCH_RESET", "EXT_P2", "EXT_P3",
72 + "EXT_P4", "EXT_P5", "EXT_P6", "EXT_P7";
76 +// LM3630a BACKLIGHT LED CONTROLLER
78 + target = <&i2c_csi_dsi>;
80 + #address-cells = <1>;
83 + lm3630a: backlight@36 {
85 + compatible = "ti,lm3630a";
86 + #address-cells = <1>;
90 + led-sources = <0 1>;
91 + label = "lcd-backlight";
92 + default-brightness = <128>;
93 + max-brightness = <255>;
98 +// CFAF7201280A0_050Tx TFT DSI PANEL
102 + #address-cells = <1>;
106 + dsi_out: endpoint {
107 + remote-endpoint = <&panel_in>;
110 + dsi_panel: dsi_panel@0 {
111 + compatible = "crystalfontz,cfaf7201280a0_050tx";
113 + reset-gpios = <&pcf8574a 0 1>;
114 + backlight = <&lm3630a>;
117 + panel_in: endpoint {
118 + remote-endpoint = <&dsi_out>;
124 +// rPI GPIO INPUT FOR TOUCH IC IRQ
128 + gt928intpins: gt928intpins {
130 + brcm,function = <0>;
135 +// GT928 TOUCH CONTROLLER IC
137 + target = <&i2c_csi_dsi>;
139 + #address-cells = <1>;
143 + compatible = "goodix,gt928";
145 + interrupt-parent = <&gpio>;
146 + interrupts = <26 2>;
147 + irq-gpios = <&gpio 26 0>;
148 + reset-gpios = <&pcf8574a 1 1>;
149 + touchscreen-inverted-x;
150 + touchscreen-inverted-y;
154 +// PCF85063A RTC on I2C
156 + target = <&i2c_csi_dsi>;
158 + #address-cells = <1>;
162 + compatible = "nxp,pcf85063a";
167 +// CAPACITIVE TOUCH OPTION FOR TFT PANEL
169 + captouch = <0>,"+3+4";