Skip to content

Commit 6f2d1b4

Browse files
6by9pelwell
authored andcommitted
dtoverlays: Add an overlay for Waveshare's 800x480 4.3" DSI screen
It tried to be a clone of the Pi 7" display, but isn't, and gives corrupt images with the current timings. Add a new overlay for it. Signed-off-by: Dave Stevenson <[email protected]>
1 parent 239df14 commit 6f2d1b4

File tree

3 files changed

+137
-0
lines changed

3 files changed

+137
-0
lines changed

arch/arm/boot/dts/overlays/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -319,6 +319,7 @@ dtbo-$(CONFIG_ARCH_BCM2835) += \
319319
vc4-kms-dsi-ili9881-7inch.dtbo \
320320
vc4-kms-dsi-lt070me05000.dtbo \
321321
vc4-kms-dsi-lt070me05000-v2.dtbo \
322+
vc4-kms-dsi-waveshare-800x480.dtbo \
322323
vc4-kms-dsi-waveshare-panel.dtbo \
323324
vc4-kms-kippah-7inch.dtbo \
324325
vc4-kms-v3d.dtbo \

arch/arm/boot/dts/overlays/README

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5248,6 +5248,23 @@ Load: dtoverlay=vc4-kms-dsi-lt070me05000-v2
52485248
Params: <None>
52495249

52505250

5251+
Name: vc4-kms-dsi-waveshare-800x480
5252+
Info: Enable the Waveshare 4.3" 800x480 DSI screen.
5253+
It tries to look like the Pi 7" display, but won't accept some of the
5254+
timings.
5255+
Includes the edt-ft5406 for the touchscreen element.
5256+
Requires vc4-kms-v3d to be loaded.
5257+
Load: dtoverlay=vc4-kms-dsi-waveshare-800x480,<param>=<val>
5258+
Params: sizex Touchscreen size x (default 800)
5259+
sizey Touchscreen size y (default 480)
5260+
invx Touchscreen inverted x axis
5261+
invy Touchscreen inverted y axis
5262+
swapxy Touchscreen swapped x y axis
5263+
disable_touch Disables the touch screen overlay driver
5264+
dsi0 Use DSI0 and i2c_csi_dsi0 (rather than
5265+
the default DSI1 and i2c_csi_dsi).
5266+
5267+
52515268
Name: vc4-kms-dsi-waveshare-panel
52525269
Info: Enable a Waveshare DSI touchscreen
52535270
Includes the Goodix driver for the touchscreen element.
Lines changed: 119 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,119 @@
1+
/*
2+
* Device Tree overlay for Waveshare 4.3" 800x480 panel.
3+
* It tries to look like a Pi 7" panel, but fails with some of the timing
4+
* options.
5+
*/
6+
7+
/dts-v1/;
8+
/plugin/;
9+
10+
#include "edt-ft5406.dtsi"
11+
12+
/ {
13+
/* No compatible as it will have come from edt-ft5406.dtsi */
14+
15+
dsi_frag: fragment@0 {
16+
target = <&dsi1>;
17+
__overlay__ {
18+
#address-cells = <1>;
19+
#size-cells = <0>;
20+
status = "okay";
21+
port {
22+
dsi_out: endpoint {
23+
remote-endpoint = <&panel_dsi_port>;
24+
};
25+
};
26+
27+
panel: panel-dsi-generic@0 {
28+
// See panel-dsi.yaml binding
29+
compatible = "waveshare,4-3-inch-dsi","panel-dsi";
30+
reg = <0>;
31+
power-supply = <&reg_display>;
32+
backlight = <&reg_display>;
33+
dsi-color-format = "RGB888";
34+
mode = "MODE_VIDEO";
35+
width-mm = <0>;
36+
height-mm = <0>;
37+
38+
port {
39+
panel_dsi_port: endpoint {
40+
data-lanes = <1>;
41+
remote-endpoint = <&dsi_out>;
42+
};
43+
};
44+
45+
timing: panel-timing {
46+
clock-frequency = <27777000>;
47+
hactive = <800>;
48+
vactive = <480>;
49+
hfront-porch = <59>;
50+
hsync-len = <2>;
51+
hback-porch = <45>;
52+
vfront-porch = <7>;
53+
vsync-len = <2>;
54+
vback-porch = <22>;
55+
};
56+
};
57+
};
58+
};
59+
60+
fragment@1 {
61+
target-path = "/";
62+
__overlay__ {
63+
reg_bridge: reg_bridge@1 {
64+
reg = <1>;
65+
compatible = "regulator-fixed";
66+
regulator-name = "bridge_reg";
67+
gpio = <&reg_display 0 0>;
68+
vin-supply = <&reg_display>;
69+
enable-active-high;
70+
};
71+
};
72+
};
73+
74+
i2c_frag: fragment@2 {
75+
target = <&i2c_csi_dsi>;
76+
__overlay__ {
77+
#address-cells = <1>;
78+
#size-cells = <0>;
79+
status = "okay";
80+
81+
reg_display: reg_display@45 {
82+
compatible = "raspberrypi,7inch-touchscreen-panel-regulator";
83+
reg = <0x45>;
84+
gpio-controller;
85+
#gpio-cells = <2>;
86+
};
87+
};
88+
};
89+
90+
fragment@3 {
91+
target = <&i2c0if>;
92+
__overlay__ {
93+
status = "okay";
94+
};
95+
};
96+
97+
fragment@4 {
98+
target = <&i2c0mux>;
99+
__overlay__ {
100+
status = "okay";
101+
};
102+
};
103+
fragment@5 {
104+
target = <&ft5406>;
105+
__overlay__ {
106+
vcc-supply = <&reg_display>;
107+
reset-gpio = <&reg_display 1 1>;
108+
};
109+
};
110+
111+
__overrides__ {
112+
dsi0 = <&dsi_frag>, "target:0=",<&dsi0>,
113+
<&i2c_frag>, "target:0=",<&i2c_csi_dsi0>,
114+
<&ts_i2c_frag>, "target:0=",<&i2c_csi_dsi0>,
115+
<&reg_bridge>, "reg:0=0",
116+
<&reg_bridge>, "regulator-name=bridge_reg_0";
117+
disable_touch = <&ft5406>, "status=disabled";
118+
};
119+
};

0 commit comments

Comments
 (0)