bcm27xx: update 6.1 patches from RPi foundation
[openwrt/staging/stintel.git] / target / linux / bcm27xx / patches-6.1 / 950-1262-Update-touch-PiTFT-overlays.patch
1 From 1c2a93ce0e1cf6d278cf565346183d7592cfbb24 Mon Sep 17 00:00:00 2001
2 From: Melissa LeBlanc-Williams <melissa@adafruit.com>
3 Date: Fri, 26 Jan 2024 14:41:42 -0800
4 Subject: [PATCH 1262/1295] Update touch PiTFT overlays
5
6 Expose the invert and swap touch parameters on 2.8" and 3.5" resistive touchscreens. Add
7 the DRM parameter to the PiTFT 2.2" and 2.8" Capacitive overlay in the same
8 way it is on the resistive overlays. Change the DRM driver to `adafruit,yx240qv29`
9 because the rotations are consistent with the FBTFT Driver. Fix the override size parameters
10 on the 2.8" capacitive PiTFT.
11
12 Signed-off-by: Melissa LeBlanc-Williams <melissa@adafruit.com>
13 ---
14 arch/arm/boot/dts/overlays/README | 20 +++
15 .../arm/boot/dts/overlays/pitft22-overlay.dts | 102 +++++++-------
16 .../overlays/pitft28-capacitive-overlay.dts | 132 +++++++++---------
17 .../overlays/pitft28-resistive-overlay.dts | 12 +-
18 .../overlays/pitft35-resistive-overlay.dts | 10 +-
19 5 files changed, 156 insertions(+), 120 deletions(-)
20
21 --- a/arch/arm/boot/dts/overlays/README
22 +++ b/arch/arm/boot/dts/overlays/README
23 @@ -3526,6 +3526,10 @@ Params: speed Display
24
25 debug Debug output level {0-7}
26
27 + drm Force the use of the mi0283qt DRM driver (by
28 + default the ili9340 framebuffer driver will
29 + be used in preference if available)
30 +
31
32 Name: pitft28-capacitive
33 Info: Adafruit PiTFT 2.8" capacitive touch screen
34 @@ -3538,6 +3542,10 @@ Params: speed Display
35
36 debug Debug output level {0-7}
37
38 + drm Force the use of the mi0283qt DRM driver (by
39 + default the ili9340 framebuffer driver will
40 + be used in preference if available)
41 +
42 touch-sizex Touchscreen size x (default 240)
43
44 touch-sizey Touchscreen size y (default 320)
45 @@ -3564,6 +3572,12 @@ Params: speed Display
46 default the ili9340 framebuffer driver will
47 be used in preference if available)
48
49 + touch-invx Touchscreen inverted x axis
50 +
51 + touch-invy Touchscreen inverted y axis
52 +
53 + touch-swapxy Touchscreen swapped x y axis
54 +
55
56 Name: pitft35-resistive
57 Info: Adafruit PiTFT 3.5" resistive touch screen
58 @@ -3580,6 +3594,12 @@ Params: speed Display
59 default the fb_hx8357d framebuffer driver will
60 be used in preference if available)
61
62 + touch-invx Touchscreen inverted x axis
63 +
64 + touch-invy Touchscreen inverted y axis
65 +
66 + touch-swapxy Touchscreen swapped x y axis
67 +
68
69 Name: pps-gpio
70 Info: Configures the pps-gpio (pulse-per-second time signal via GPIO).
71 --- a/arch/arm/boot/dts/overlays/pitft22-overlay.dts
72 +++ b/arch/arm/boot/dts/overlays/pitft22-overlay.dts
73 @@ -7,63 +7,65 @@
74 /plugin/;
75
76 / {
77 - compatible = "brcm,bcm2835";
78 + compatible = "brcm,bcm2835";
79
80 - fragment@0 {
81 - target = <&spidev0>;
82 - __overlay__ {
83 - status = "disabled";
84 - };
85 + fragment@0 {
86 + target = <&spidev0>;
87 + __overlay__ {
88 + status = "disabled";
89 + };
90 };
91
92 - fragment@1 {
93 - target = <&spidev1>;
94 - __overlay__ {
95 - status = "disabled";
96 - };
97 - };
98 -
99 - fragment@2 {
100 - target = <&gpio>;
101 - __overlay__ {
102 - pitft_pins: pitft_pins {
103 - brcm,pins = <25>;
104 - brcm,function = <1>; /* out */
105 - brcm,pull = <0>; /* none */
106 - };
107 - };
108 - };
109 -
110 - fragment@3 {
111 - target = <&spi0>;
112 - __overlay__ {
113 - /* needed to avoid dtc warning */
114 - #address-cells = <1>;
115 - #size-cells = <0>;
116 - status = "okay";
117 -
118 - pitft: pitft@0{
119 - compatible = "ilitek,ili9340";
120 - reg = <0>;
121 - pinctrl-names = "default";
122 - pinctrl-0 = <&pitft_pins>;
123 -
124 - spi-max-frequency = <32000000>;
125 - rotate = <90>;
126 - fps = <25>;
127 - bgr;
128 - buswidth = <8>;
129 - dc-gpios = <&gpio 25 0>;
130 - debug = <0>;
131 - };
132 -
133 - };
134 - };
135 -
136 - __overrides__ {
137 - speed = <&pitft>,"spi-max-frequency:0";
138 - rotate = <&pitft>,"rotate:0";
139 - fps = <&pitft>,"fps:0";
140 - debug = <&pitft>,"debug:0";
141 - };
142 + fragment@1 {
143 + target = <&spidev1>;
144 + __overlay__ {
145 + status = "disabled";
146 + };
147 + };
148 +
149 + fragment@2 {
150 + target = <&gpio>;
151 + __overlay__ {
152 + pitft_pins: pitft_pins {
153 + brcm,pins = <25>;
154 + brcm,function = <1>; /* out */
155 + brcm,pull = <0>; /* none */
156 + };
157 + };
158 + };
159 +
160 + fragment@3 {
161 + target = <&spi0>;
162 + __overlay__ {
163 + /* needed to avoid dtc warning */
164 + #address-cells = <1>;
165 + #size-cells = <0>;
166 + status = "okay";
167 +
168 + pitft: pitft@0{
169 + compatible = "ilitek,ili9340";
170 + reg = <0>;
171 + pinctrl-names = "default";
172 + pinctrl-0 = <&pitft_pins>;
173 +
174 + spi-max-frequency = <32000000>;
175 + rotate = <90>;
176 + fps = <25>;
177 + bgr;
178 + buswidth = <8>;
179 + dc-gpios = <&gpio 25 0>;
180 + debug = <0>;
181 + };
182 +
183 + };
184 + };
185 +
186 + __overrides__ {
187 + speed = <&pitft>,"spi-max-frequency:0";
188 + rotate = <&pitft>,"rotate:0", /* fbtft */
189 + <&pitft>,"rotation:0"; /* drm */
190 + fps = <&pitft>,"fps:0";
191 + debug = <&pitft>,"debug:0";
192 + drm = <&pitft>,"compatible=adafruit,yx240qv29";
193 + };
194 };
195 --- a/arch/arm/boot/dts/overlays/pitft28-capacitive-overlay.dts
196 +++ b/arch/arm/boot/dts/overlays/pitft28-capacitive-overlay.dts
197 @@ -7,14 +7,14 @@
198 /plugin/;
199
200 / {
201 - compatible = "brcm,bcm2835";
202 + compatible = "brcm,bcm2835";
203
204 - fragment@0 {
205 - target = <&spi0>;
206 - __overlay__ {
207 - status = "okay";
208 - };
209 - };
210 + fragment@0 {
211 + target = <&spi0>;
212 + __overlay__ {
213 + status = "okay";
214 + };
215 + };
216
217 fragment@1 {
218 target = <&spidev0>;
219 @@ -23,69 +23,71 @@
220 };
221 };
222
223 - fragment@2 {
224 - target = <&gpio>;
225 - __overlay__ {
226 - pitft_pins: pitft_pins {
227 - brcm,pins = <24 25>;
228 - brcm,function = <0 1>; /* in out */
229 - brcm,pull = <2 0>; /* pullup none */
230 - };
231 - };
232 - };
233 -
234 - fragment@3 {
235 - target = <&spi0>;
236 - __overlay__ {
237 - /* needed to avoid dtc warning */
238 - #address-cells = <1>;
239 - #size-cells = <0>;
240 -
241 - pitft: pitft@0{
242 - compatible = "ilitek,ili9340";
243 - reg = <0>;
244 - pinctrl-names = "default";
245 - pinctrl-0 = <&pitft_pins>;
246 -
247 - spi-max-frequency = <32000000>;
248 - rotate = <90>;
249 - fps = <25>;
250 - bgr;
251 - buswidth = <8>;
252 - dc-gpios = <&gpio 25 0>;
253 - debug = <0>;
254 - };
255 - };
256 - };
257 -
258 - fragment@4 {
259 - target = <&i2c1>;
260 - __overlay__ {
261 - /* needed to avoid dtc warning */
262 - #address-cells = <1>;
263 - #size-cells = <0>;
264 -
265 - ft6236: ft6236@38 {
266 - compatible = "focaltech,ft6236";
267 - reg = <0x38>;
268 -
269 - interrupt-parent = <&gpio>;
270 - interrupts = <24 2>;
271 - touchscreen-size-x = <240>;
272 - touchscreen-size-y = <320>;
273 - };
274 - };
275 - };
276 -
277 - __overrides__ {
278 - speed = <&pitft>,"spi-max-frequency:0";
279 - rotate = <&pitft>,"rotate:0";
280 - fps = <&pitft>,"fps:0";
281 - debug = <&pitft>,"debug:0";
282 - touch-sizex = <&ft6236>,"touchscreen-size-x?";
283 - touch-sizey = <&ft6236>,"touchscreen-size-y?";
284 - touch-invx = <&ft6236>,"touchscreen-inverted-x?";
285 - touch-invy = <&ft6236>,"touchscreen-inverted-y?";
286 - touch-swapxy = <&ft6236>,"touchscreen-swapped-x-y?";
287 - };
288 + fragment@2 {
289 + target = <&gpio>;
290 + __overlay__ {
291 + pitft_pins: pitft_pins {
292 + brcm,pins = <24 25>;
293 + brcm,function = <0 1>; /* in out */
294 + brcm,pull = <2 0>; /* pullup none */
295 + };
296 + };
297 + };
298 +
299 + fragment@3 {
300 + target = <&spi0>;
301 + __overlay__ {
302 + /* needed to avoid dtc warning */
303 + #address-cells = <1>;
304 + #size-cells = <0>;
305 +
306 + pitft: pitft@0{
307 + compatible = "ilitek,ili9340";
308 + reg = <0>;
309 + pinctrl-names = "default";
310 + pinctrl-0 = <&pitft_pins>;
311 +
312 + spi-max-frequency = <32000000>;
313 + rotate = <90>;
314 + fps = <25>;
315 + bgr;
316 + buswidth = <8>;
317 + dc-gpios = <&gpio 25 0>;
318 + debug = <0>;
319 + };
320 + };
321 + };
322 +
323 + fragment@4 {
324 + target = <&i2c1>;
325 + __overlay__ {
326 + /* needed to avoid dtc warning */
327 + #address-cells = <1>;
328 + #size-cells = <0>;
329 +
330 + ft6236: ft6236@38 {
331 + compatible = "focaltech,ft6236";
332 + reg = <0x38>;
333 +
334 + interrupt-parent = <&gpio>;
335 + interrupts = <24 2>;
336 + touchscreen-size-x = <240>;
337 + touchscreen-size-y = <320>;
338 + };
339 + };
340 + };
341 +
342 + __overrides__ {
343 + speed = <&pitft>,"spi-max-frequency:0";
344 + rotate = <&pitft>,"rotate:0", /* fbtft */
345 + <&pitft>,"rotation:0"; /* drm */
346 + fps = <&pitft>,"fps:0";
347 + debug = <&pitft>,"debug:0";
348 + drm = <&pitft>,"compatible=adafruit,yx240qv29";
349 + touch-sizex = <&ft6236>,"touchscreen-size-x:0";
350 + touch-sizey = <&ft6236>,"touchscreen-size-y:0";
351 + touch-invx = <&ft6236>,"touchscreen-inverted-x?";
352 + touch-invy = <&ft6236>,"touchscreen-inverted-y?";
353 + touch-swapxy = <&ft6236>,"touchscreen-swapped-x-y?";
354 + };
355 };
356 --- a/arch/arm/boot/dts/overlays/pitft28-resistive-overlay.dts
357 +++ b/arch/arm/boot/dts/overlays/pitft28-resistive-overlay.dts
358 @@ -49,7 +49,7 @@
359 #size-cells = <0>;
360
361 pitft: pitft@0{
362 - compatible = "ilitek,ili9340", "multi-inno,mi0283qt";
363 + compatible = "ilitek,ili9340";
364 reg = <0>;
365 pinctrl-names = "default";
366 pinctrl-0 = <&pitft_pins>;
367 @@ -64,6 +64,9 @@
368 };
369
370 pitft_ts@1 {
371 + /* needed to avoid dtc warning */
372 + #address-cells = <1>;
373 + #interrupt-cells = <1>;
374 compatible = "st,stmpe610";
375 reg = <1>;
376
377 @@ -72,7 +75,7 @@
378 interrupt-parent = <&gpio>;
379 interrupt-controller;
380
381 - stmpe_touchscreen {
382 + stmpe_touchscreen: stmpe_touchscreen {
383 compatible = "st,stmpe-ts";
384 st,sample-time = <4>;
385 st,mod-12b = <1>;
386 @@ -115,6 +118,9 @@
387 <&pitft>,"rotation:0"; /* drm */
388 fps = <&pitft>,"fps:0";
389 debug = <&pitft>,"debug:0";
390 - drm = <&pitft>,"compatible=multi-inno,mi0283qt";
391 + drm = <&pitft>,"compatible=adafruit,yx240qv29";
392 + touch-invx = <&stmpe_touchscreen>,"touchscreen-inverted-x?";
393 + touch-invy = <&stmpe_touchscreen>,"touchscreen-inverted-y?";
394 + touch-swapxy = <&stmpe_touchscreen>,"touchscreen-swapped-x-y?";
395 };
396 };
397 --- a/arch/arm/boot/dts/overlays/pitft35-resistive-overlay.dts
398 +++ b/arch/arm/boot/dts/overlays/pitft35-resistive-overlay.dts
399 @@ -49,7 +49,7 @@
400 #size-cells = <0>;
401
402 pitft: pitft@0{
403 - compatible = "himax,hx8357d", "adafruit,yx350hv15";
404 + compatible = "himax,hx8357d";
405 reg = <0>;
406 pinctrl-names = "default";
407 pinctrl-0 = <&pitft_pins>;
408 @@ -64,6 +64,9 @@
409 };
410
411 pitft_ts@1 {
412 + /* needed to avoid dtc warning */
413 + #address-cells = <1>;
414 + #interrupt-cells = <1>;
415 compatible = "st,stmpe610";
416 reg = <1>;
417
418 @@ -72,7 +75,7 @@
419 interrupt-parent = <&gpio>;
420 interrupt-controller;
421
422 - stmpe_touchscreen {
423 + stmpe_touchscreen: stmpe_touchscreen {
424 compatible = "st,stmpe-ts";
425 st,sample-time = <4>;
426 st,mod-12b = <1>;
427 @@ -117,5 +120,8 @@
428 debug = <&pitft>,"debug:0";
429 drm = <&pitft>,"compatible=adafruit,yx350hv15",
430 <&pitft>,"backlight:0=",<&backlight>;
431 + touch-invx = <&stmpe_touchscreen>,"touchscreen-inverted-x?";
432 + touch-invy = <&stmpe_touchscreen>,"touchscreen-inverted-y?";
433 + touch-swapxy = <&stmpe_touchscreen>,"touchscreen-swapped-x-y?";
434 };
435 };