bcm27xx: 6.1: add kernel patches
[openwrt/openwrt.git] / target / linux / bcm27xx / patches-6.1 / 950-0512-overlays-Add-crystalfontz-cfa050_pi_m.patch
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
5
6 Add support for the Crystalfontz CFA050-PI-M series of Raspberry Pi
7 CM4-based modules using the CFAF7201280A0_050Tx TFT LCD displays.
8
9 Signed-off-by: Mark Williams <mwp@mwp.id.au>
10 ---
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
16
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) += \
20 chipdip-dac.dtbo \
21 cirrus-wm5102.dtbo \
22 cma.dtbo \
23 + crystalfontz-cfa050_pi_m.dtbo \
24 cutiepi-panel.dtbo \
25 dacberry400.dtbo \
26 dht11.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
31
32
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
40 +
41 +
42 Name: cutiepi-panel
43 Info: 8" TFT LCD display and touch panel used by cutiepi.io
44 Load: dtoverlay=cutiepi-panel
45 --- /dev/null
46 +++ b/arch/arm/boot/dts/overlays/crystalfontz-cfa050_pi_m-overlay.dts
47 @@ -0,0 +1,124 @@
48 +/*
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
52 + */
53 +/dts-v1/;
54 +/plugin/;
55 +/{
56 +// RaspberryPi CM4
57 + compatible = "brcm,bcm2835";
58 +// PCF8574 I2C GPIO EXPANDER
59 + fragment@0 {
60 + target = <&i2c_csi_dsi>;
61 + __overlay__ {
62 + #address-cells = <1>;
63 + #size-cells = <0>;
64 + status = "okay";
65 + pcf8574a: pcf8574a@38 {
66 + reg = <0x38>;
67 + compatible = "nxp,pcf8574";
68 + gpio-controller;
69 + #gpio-cells = <2>;
70 + ngpios = <8>;
71 + gpio-line-names = "TFT_RESET", "TOUCH_RESET", "EXT_P2", "EXT_P3",
72 + "EXT_P4", "EXT_P5", "EXT_P6", "EXT_P7";
73 + };
74 + };
75 + };
76 +// LM3630a BACKLIGHT LED CONTROLLER
77 + fragment@1 {
78 + target = <&i2c_csi_dsi>;
79 + __overlay__ {
80 + #address-cells = <1>;
81 + #size-cells = <0>;
82 + status = "okay";
83 + lm3630a: backlight@36 {
84 + reg = <0x36>;
85 + compatible = "ti,lm3630a";
86 + #address-cells = <1>;
87 + #size-cells = <0>;
88 + led@0 {
89 + reg = <0>;
90 + led-sources = <0 1>;
91 + label = "lcd-backlight";
92 + default-brightness = <128>;
93 + max-brightness = <255>;
94 + };
95 + };
96 + };
97 + };
98 +// CFAF7201280A0_050Tx TFT DSI PANEL
99 + fragment@2 {
100 + target = <&dsi1>;
101 + __overlay__ {
102 + #address-cells = <1>;
103 + #size-cells = <0>;
104 + status = "okay";
105 + port {
106 + dsi_out: endpoint {
107 + remote-endpoint = <&panel_in>;
108 + };
109 + };
110 + dsi_panel: dsi_panel@0 {
111 + compatible = "crystalfontz,cfaf7201280a0_050tx";
112 + reg = <0>;
113 + reset-gpios = <&pcf8574a 0 1>;
114 + backlight = <&lm3630a>;
115 + fps = <60>;
116 + port {
117 + panel_in: endpoint {
118 + remote-endpoint = <&dsi_out>;
119 + };
120 + };
121 + };
122 + };
123 + };
124 +// rPI GPIO INPUT FOR TOUCH IC IRQ
125 + fragment@3 {
126 + target = <&gpio>;
127 + __dormant__ {
128 + gt928intpins: gt928intpins {
129 + brcm,pins = <26>;
130 + brcm,function = <0>;
131 + brcm,pull = <1>;
132 + };
133 + };
134 + };
135 +// GT928 TOUCH CONTROLLER IC
136 + fragment@4 {
137 + target = <&i2c_csi_dsi>;
138 + __dormant__ {
139 + #address-cells = <1>;
140 + #size-cells = <0>;
141 + status = "okay";
142 + gt928@5d {
143 + compatible = "goodix,gt928";
144 + reg = <0x5d>;
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;
151 + };
152 + };
153 + };
154 +// PCF85063A RTC on I2C
155 + fragment@5 {
156 + target = <&i2c_csi_dsi>;
157 + __overlay__ {
158 + #address-cells = <1>;
159 + #size-cells = <0>;
160 + status = "okay";
161 + pcf85063a@51 {
162 + compatible = "nxp,pcf85063a";
163 + reg = <0x51>;
164 + };
165 + };
166 + };
167 +// CAPACITIVE TOUCH OPTION FOR TFT PANEL
168 + __overrides__ {
169 + captouch = <0>,"+3+4";
170 + };
171 +};