855ea9bd4cb50e3ce0a54125ae371e79a86c11f8
[openwrt/staging/pepe2k.git] /
1 From 6e1ccf7cfe1b758963743b88fa1b078b011c77b3 Mon Sep 17 00:00:00 2001
2 From: Dave Stevenson <dave.stevenson@raspberrypi.com>
3 Date: Fri, 14 Apr 2023 13:57:52 +0100
4 Subject: [PATCH] dtoverlays: Add an overlay for the Waveshare DSI
5 screens
6
7 They come in varying sizes, but all have the same MCU for
8 power control and touch controller.
9
10 Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
11 ---
12 arch/arm/boot/dts/overlays/Makefile | 1 +
13 arch/arm/boot/dts/overlays/README | 28 ++++
14 .../vc4-kms-dsi-waveshare-panel-overlay.dts | 123 ++++++++++++++++++
15 3 files changed, 152 insertions(+)
16 create mode 100644 arch/arm/boot/dts/overlays/vc4-kms-dsi-waveshare-panel-overlay.dts
17
18 --- a/arch/arm/boot/dts/overlays/Makefile
19 +++ b/arch/arm/boot/dts/overlays/Makefile
20 @@ -272,6 +272,7 @@ dtbo-$(CONFIG_ARCH_BCM2835) += \
21 vc4-kms-dsi-7inch.dtbo \
22 vc4-kms-dsi-lt070me05000.dtbo \
23 vc4-kms-dsi-lt070me05000-v2.dtbo \
24 + vc4-kms-dsi-waveshare-panel.dtbo \
25 vc4-kms-kippah-7inch.dtbo \
26 vc4-kms-v3d.dtbo \
27 vc4-kms-v3d-pi4.dtbo \
28 --- a/arch/arm/boot/dts/overlays/README
29 +++ b/arch/arm/boot/dts/overlays/README
30 @@ -4493,6 +4493,34 @@ Load: dtoverlay=vc4-kms-dsi-lt070me050
31 Params: <None>
32
33
34 +Name: vc4-kms-dsi-waveshare-panel
35 +Info: Enable a Waveshare DSI touchscreen
36 + Includes the Goodix driver for the touchscreen element.
37 + The default is for the display to be using the I2C0 option for control.
38 + Use the i2c1 override if using the I2C1 wiring with jumper wires from
39 + GPIOs 2&3 (pins 3&5).
40 + invx/invy/swapxy should be used with caution as the panel specifier will
41 + set the default inversions for that panel. Always use them after the
42 + panel specifier, and be aware that you may need to set them as =0, not
43 + just adding it.
44 + Requires vc4-kms-v3d to be loaded.
45 +Load: dtoverlay=vc4-kms-dsi-waveshare-panel,<param>=<val>
46 +Params: 2_8_inch 2.8" 480x640
47 + 3_4_inch 3.4" 800x800 round
48 + 4_0_inch 4.0" 480x800
49 + 7_0_inchC 7.0" C 1024x600
50 + 7_9_inch 7.9" 400x1280
51 + 8_0_inch 8.0" 1280x800
52 + 10_1_inch 10.1" 1280x800
53 + 11_9_inch 11.9" 320x1480
54 + i2c1 Use i2c-1 with jumper wires from GPIOs 2&3
55 + disable_touch Disable the touch controller
56 + rotation Set the panel orientation property
57 + invx Touchscreen inverted x axis
58 + invy Touchscreen inverted y axis
59 + swapxy Touchscreen swapped x y axis
60 +
61 +
62 Name: vc4-kms-kippah-7inch
63 Info: This overlay is now deprecated - see vc4-kms-dpi-panel,kippah-7inch
64 Load: <Deprecated>
65 --- /dev/null
66 +++ b/arch/arm/boot/dts/overlays/vc4-kms-dsi-waveshare-panel-overlay.dts
67 @@ -0,0 +1,123 @@
68 +/*
69 + * Device Tree overlay for Waveshare DSI Touchscreens
70 + *
71 + */
72 +
73 +/dts-v1/;
74 +/plugin/;
75 +
76 +/ {
77 + compatible = "brcm,bcm2835";
78 +
79 + fragment@0 {
80 + target = <&dsi1>;
81 + __overlay__ {
82 + #address-cells = <1>;
83 + #size-cells = <0>;
84 + status = "okay";
85 + port {
86 + dsi_out: endpoint {
87 + remote-endpoint = <&panel_in>;
88 + };
89 + };
90 + };
91 + };
92 +
93 + fragment@1 {
94 + target-path = "/";
95 + __overlay__ {
96 + };
97 + };
98 +
99 + frag2: fragment@2 {
100 + target = <&i2c_csi_dsi>;
101 + __overlay__ {
102 + #address-cells = <1>;
103 + #size-cells = <0>;
104 + status = "okay";
105 +
106 + panel: panel_disp1@45 {
107 + reg = <0x45>;
108 + compatible = "waveshare,10.1inch-panel";
109 +
110 + port {
111 + panel_in: endpoint {
112 + remote-endpoint = <&dsi_out>;
113 + };
114 + };
115 + };
116 +
117 + touch: goodix@14 {
118 + reg = <0x14>;
119 + compatible = "goodix,gt911";
120 + };
121 + };
122 + };
123 +
124 + fragment@3 {
125 + target = <&i2c0if>;
126 + __overlay__ {
127 + status = "okay";
128 + };
129 + };
130 +
131 + fragment@4 {
132 + target = <&i2c0mux>;
133 + __overlay__ {
134 + status = "okay";
135 + };
136 + };
137 +
138 + fragment@5 {
139 + target = <&i2c_arm>;
140 + __dormant__ {
141 + status = "okay";
142 + };
143 + };
144 +
145 + __overrides__ {
146 + 2_8_inch = <&panel>, "compatible=waveshare,2.8inch-panel",
147 + <&touch>, "touchscreen-size-x:0=640",
148 + <&touch>, "touchscreen-size-y:0=480",
149 + <&touch>, "touchscreen-inverted-y?",
150 + <&touch>, "touchscreen-swapped-x-y?";
151 + 3_4_inch = <&panel>, "compatible=waveshare,3.4inch-panel",
152 + <&touch>, "touchscreen-size-x:0=800",
153 + <&touch>, "touchscreen-size-y:0=800";
154 + 4_0_inch = <&panel>, "compatible=waveshare,4.0inch-panel",
155 + <&touch>, "touchscreen-size-x:0=800",
156 + <&touch>, "touchscreen-size-y:0=480",
157 + <&touch>, "touchscreen-inverted-x?",
158 + <&touch>, "touchscreen-swapped-x-y?";
159 + 7_0_inchC = <&panel>, "compatible=waveshare,7.0inch-c-panel",
160 + <&touch>, "touchscreen-size-x:0=800",
161 + <&touch>, "touchscreen-size-y:0=480";
162 + 7_9_inch = <&panel>, "compatible=waveshare,7.9inch-panel",
163 + <&touch>, "touchscreen-size-x:0=400",
164 + <&touch>, "touchscreen-size-y:0=1280",
165 + <&touch>, "touchscreen-inverted-x?",
166 + <&touch>, "touchscreen-inverted-y?";
167 + 8_0_inch = <&panel>, "compatible=waveshare,8.0inch-panel",
168 + <&touch>, "touchscreen-size-x:0=800",
169 + <&touch>, "touchscreen-size-y:0=1280",
170 + <&touch>, "touchscreen-inverted-x?",
171 + <&touch>, "touchscreen-swapped-x-y?";
172 + 10_1_inch = <&panel>, "compatible=waveshare,10.1inch-panel",
173 + <&touch>, "touchscreen-size-x:0=800",
174 + <&touch>, "touchscreen-size-y:0=1280",
175 + <&touch>, "touchscreen-inverted-x?",
176 + <&touch>, "touchscreen-swapped-x-y?";
177 + 11_9_inch = <&panel>, "compatible=waveshare,11.9inch-panel",
178 + <&touch>, "touchscreen-size-x:0=320",
179 + <&touch>, "touchscreen-size-y:0=1480",
180 + <&touch>, "touchscreen-inverted-x?",
181 + <&touch>, "touchscreen-swapped-x-y?";
182 + i2c1 = <&frag2>, "target:0=",<&i2c1>,
183 + <0>, "-3-4+5";
184 + disable_touch = <&touch>, "status=disabled";
185 + rotation = <&panel>, "rotation:0";
186 + invx = <&touch>,"touchscreen-inverted-x?";
187 + invy = <&touch>,"touchscreen-inverted-y?";
188 + swapxy = <&touch>,"touchscreen-swapped-x-y?";
189 + };
190 +};