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
7 They come in varying sizes, but all have the same MCU for
8 power control and touch controller.
10 Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
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
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 \
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
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
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
62 Name: vc4-kms-kippah-7inch
63 Info: This overlay is now deprecated - see vc4-kms-dpi-panel,kippah-7inch
66 +++ b/arch/arm/boot/dts/overlays/vc4-kms-dsi-waveshare-panel-overlay.dts
69 + * Device Tree overlay for Waveshare DSI Touchscreens
77 + compatible = "brcm,bcm2835";
82 + #address-cells = <1>;
87 + remote-endpoint = <&panel_in>;
100 + target = <&i2c_csi_dsi>;
102 + #address-cells = <1>;
106 + panel: panel_disp1@45 {
108 + compatible = "waveshare,10.1inch-panel";
111 + panel_in: endpoint {
112 + remote-endpoint = <&dsi_out>;
119 + compatible = "goodix,gt911";
125 + target = <&i2c0if>;
132 + target = <&i2c0mux>;
139 + target = <&i2c_arm>;
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>,
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?";