Skip to content

Commit

Permalink
dtoverlays: Add an overlay for the Waveshare DSI screens
Browse files Browse the repository at this point in the history
They come in varying sizes, but all have the same MCU for
power control and touch controller.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
  • Loading branch information
6by9 committed Apr 24, 2023
1 parent b364442 commit 53e8cfb
Show file tree
Hide file tree
Showing 3 changed files with 153 additions and 0 deletions.
1 change: 1 addition & 0 deletions arch/arm/boot/dts/overlays/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,7 @@ dtbo-$(CONFIG_ARCH_BCM2835) += \
vc4-kms-dsi-7inch.dtbo \
vc4-kms-dsi-lt070me05000.dtbo \
vc4-kms-dsi-lt070me05000-v2.dtbo \
vc4-kms-dsi-waveshare-panel.dtbo \
vc4-kms-kippah-7inch.dtbo \
vc4-kms-v3d.dtbo \
vc4-kms-v3d-pi4.dtbo \
Expand Down
28 changes: 28 additions & 0 deletions arch/arm/boot/dts/overlays/README
Original file line number Diff line number Diff line change
Expand Up @@ -4493,6 +4493,34 @@ Load: dtoverlay=vc4-kms-dsi-lt070me05000-v2
Params: <None>


Name: vc4-kms-dsi-waveshare-panel
Info: Enable a Waveshare DSI touchscreen
Includes the Goodix driver for the touchscreen element.
The default is for the display to be using the I2C0 option for control.
Use the i2c1 override if using the I2C1 wiring with jumper wires from
GPIOs 2&3 (pins 3&5).
invx/invy/swapxy should be used with caution as the panel specifier will
set the default inversions for that panel. Always use them after the
panel specifier, and be aware that you may need to set them as =0, not
just adding it.
Requires vc4-kms-v3d to be loaded.
Load: dtoverlay=vc4-kms-dsi-waveshare-panel,<param>=<val>
2_8_inch 2.8" 480x640
3_4_inch 3.4" 800x800 round
4_0_inch 4.0" 480x800
7_0_inchC 7.0" C 1024x600
7_9_inch 7.9" 400x1280
8_0_inch 8.0" 1280x800
10_1_inch 10.1" 1280x800
11_9_inch 11.9" 320x1480
i2c1 Use i2c-1 with jumper wires from GPIOs 2&3
disable_touch Disable the touch controller
rotation Set the panel orientation property
invx Touchscreen inverted x axis
invy Touchscreen inverted y axis
swapxy Touchscreen swapped x y axis


Name: vc4-kms-kippah-7inch
Info: This overlay is now deprecated - see vc4-kms-dpi-panel,kippah-7inch
Load: <Deprecated>
Expand Down
124 changes: 124 additions & 0 deletions arch/arm/boot/dts/overlays/vc4-kms-dsi-waveshare-panel-overlay.dts
Original file line number Diff line number Diff line change
@@ -0,0 +1,124 @@
/*
* Device Tree overlay for Waveshare DSI Touchscreens
*
*/

/dts-v1/;
/plugin/;

/ {
compatible = "brcm,bcm2835";

fragment@0 {
target = <&dsi1>;
__overlay__ {
#address-cells = <1>;
#size-cells = <0>;
status = "okay";
port {
dsi_out: endpoint {
remote-endpoint = <&panel_in>;
};
};
};
};

fragment@1 {
target-path = "/";
__overlay__ {
};
};

frag2: fragment@2 {
target = <&i2c_csi_dsi>;
__overlay__ {
#address-cells = <1>;
#size-cells = <0>;
status = "okay";

panel: panel_disp1@45 {
reg = <0x45>;
compatible = "waveshare,10.1inch-panel";

port {
panel_in: endpoint {
remote-endpoint = <&dsi_out>;
};
};
};

touch: goodix@14 {
reg = <0x14>;
compatible = "goodix,gt911";
};
};
};

fragment@3 {
target = <&i2c0if>;
__overlay__ {
status = "okay";
};
};

fragment@4 {
target = <&i2c0mux>;
__overlay__ {
status = "okay";
};
};

fragment@5 {
target = <&i2c_arm>;
__dormant__ {
status = "okay";
};
};

__overrides__ {
2_8_inch = <&panel>, "compatible=waveshare,2.8inch-panel",
<&touch>, "touchscreen-size-x:0=640",
<&touch>, "touchscreen-size-y:0=480",
<&touch>, "touchscreen-inverted-y?",
<&touch>, "touchscreen-swapped-x-y?";
3_4_inch = <&panel>, "compatible=waveshare,3.4inch-panel",
<&touch>, "touchscreen-size-x:0=800",
<&touch>, "touchscreen-size-y:0=800";
4_0_inch = <&panel>, "compatible=waveshare,4.0inch-panel",
<&touch>, "touchscreen-size-x:0=800",
<&touch>, "touchscreen-size-y:0=480",
<&touch>, "touchscreen-inverted-x?",
<&touch>, "touchscreen-swapped-x-y?";
7_0_inchC = <&panel>, "compatible=waveshare,7.0inch-c-panel",
<&touch>, "touchscreen-size-x:0=800",
<&touch>, "touchscreen-size-y:0=480";
7_9_inch = <&panel>, "compatible=waveshare,7.9inch-panel",
<&touch>, "touchscreen-size-x:0=400",
<&touch>, "touchscreen-size-y:0=1280",
<&touch>, "touchscreen-inverted-x?",
<&touch>, "touchscreen-inverted-y?";
8_0_inch = <&panel>, "compatible=waveshare,8.0inch-panel",
<&touch>, "touchscreen-size-x:0=800",
<&touch>, "touchscreen-size-y:0=1280",
<&touch>, "touchscreen-inverted-x?",
<&touch>, "touchscreen-swapped-x-y?";
10_1_inch = <&panel>, "compatible=waveshare,10.1inch-panel",
<&touch>, "touchscreen-size-x:0=800",
<&touch>, "touchscreen-size-y:0=1280",
<&touch>, "touchscreen-inverted-x?",
<&touch>, "touchscreen-swapped-x-y?";
11_9_inch = <&panel>, "compatible=waveshare,11.9inch-panel",
<&touch>, "touchscreen-size-x:0=320",
<&touch>, "touchscreen-size-y:0=1480",
<&touch>, "touchscreen-inverted-x?",
<&touch>, "touchscreen-swapped-x-y?";
disable_touch = <&touch>, "status=disabled";
i2c1 = <&frag2>, "target:0=",<&i2c1>,
<0>, "-3-4+5";
rotation = <&panel>, "rotation:0";

invx = <&touch>,"touchscreen-inverted-x?";
invy = <&touch>,"touchscreen-inverted-y?";
swapxy = <&touch>,"touchscreen-swapped-x-y?";
};
};

0 comments on commit 53e8cfb

Please sign in to comment.