Skip to content

Add driver for the Waveshare DSI-TOUCH series panels. #6566

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Apr 28, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions arch/arm/boot/dts/overlays/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -334,6 +334,7 @@ dtbo-$(CONFIG_ARCH_BCM2835) += \
vc4-kms-dsi-lt070me05000-v2.dtbo \
vc4-kms-dsi-waveshare-800x480.dtbo \
vc4-kms-dsi-waveshare-panel.dtbo \
vc4-kms-dsi-waveshare-panel-v2.dtbo \
vc4-kms-kippah-7inch.dtbo \
vc4-kms-v3d.dtbo \
vc4-kms-v3d-pi4.dtbo \
Expand Down
20 changes: 20 additions & 0 deletions arch/arm/boot/dts/overlays/README
Original file line number Diff line number Diff line change
Expand Up @@ -5518,6 +5518,26 @@ Params: 2_8_inch 2.8" 480x640
the default DSI1 and i2c_csi_dsi).


Name: vc4-kms-dsi-waveshare-panel-v2
Info: Enable the Waveshare DSI-TOUCH series screen
Requires vc4-kms-v3d to be loaded.
Load: dtoverlay=vc4-kms-dsi-waveshare-panel-v2,<param>
Params: 5_0_inch_a 5.0" 720x1280 2lane
5_5_inch_a 5.5" 720x1280 2lane
7_0_inch_a 7.0" A 720x1280 2lane
7_0_inch_b 7.0" B 720x1280 2lane
8_0_inch_a 8.0" 800x1280 2lane
8_0_inch_a_4lane 8.0" 800x1280 4lane
10_1_inch_a 10.1" 800x1280 2lane
10_1_inch_a_4lane 10.1" 800x1280 4lane
disable_touch Disable the touch controller
invx Touchscreen inverted x axis
invy Touchscreen inverted y axis
swapxy Touchscreen swapped x y axis
dsi0 Use DSI0 and i2c_csi_dsi0 (rather than
the default DSI1 and i2c_csi_dsi).


Name: vc4-kms-kippah-7inch
Info: This overlay is now deprecated - see vc4-kms-dpi-panel,kippah-7inch
Load: <Deprecated>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
/*
* vc4-kms-dsi-waveshare-panel-v2-overlay.dts
*/

/dts-v1/;
/plugin/;

#include <dt-bindings/gpio/gpio.h>

/ {
compatible = "brcm,bcm2835";

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

display_mcu: display_mcu@45 {
compatible = "waveshare,touchscreen-panel-regulator";
reg = <0x45>;
gpio-controller;
#gpio-cells = <2>;
enable-gpio = <&display_mcu 2 GPIO_ACTIVE_HIGH>;
};

touch: goodix@5d {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seeing as we have no control over the interrupt line, I assume it is pulled down so that the touch controller will reliably come out of reset on address 0x5d. (Using the INT line to determine I2C address is a right pain with these Goodix controllers).

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The muc is connected to the INT pin. If necessary, we can set the INT pin level when exiting the reset through the MCU. By default, the I2C address of Goodix controllers is 0x5d

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As long as you have it in hand.

Avoiding a repeat of #6538 would be good, and I've been in exactly the same position with an early version of the Raspberry Pi Touch Display 2.
The vc4-dpi-hyperpixel4 overlay hacks around the issue by defining the touch controller on both addresses, and accepts that one will fail to probe.

compatible = "goodix,gt9271";
reg = <0x5d>;
reset-gpio = <&display_mcu 9 GPIO_ACTIVE_HIGH>;
};
};
};

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

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

dsi_panel: dsi_panel@0 {
reg = <0>;
compatible = "waveshare,10.1-dsi-touch-a";
reset-gpio = <&display_mcu 1 GPIO_ACTIVE_HIGH>;
backlight = <&display_mcu>;

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

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

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

__overrides__ {
5_0_inch_a = <&dsi_panel>, "compatible=waveshare,5.0-dsi-touch-a";
5_5_inch_a = <&dsi_panel>, "compatible=waveshare,5.5-dsi-touch-a";
7_0_inch_a = <&dsi_panel>, "compatible=waveshare,7.0-dsi-touch-a";
7_0_inch_b = <&dsi_panel>, "compatible=waveshare,7.0-dsi-touch-b";
8_0_inch_a = <&dsi_panel>, "compatible=waveshare,8.0-dsi-touch-a";
8_0_inch_a_4lane = <&dsi_panel>, "compatible=waveshare,8.0-dsi-touch-a-4lane";
10_1_inch_a = <&dsi_panel>, "compatible=waveshare,10.1-dsi-touch-a";
10_1_inch_a_4lane = <&dsi_panel>, "compatible=waveshare,10.1-dsi-touch-a-4lane";
disable_touch = <&touch>, "status=disabled";
invx = <&touch>,"touchscreen-inverted-x?";
invy = <&touch>,"touchscreen-inverted-y?";
swapxy = <&touch>,"touchscreen-swapped-x-y?";
dsi0 = <&dsi_frag>, "target:0=",<&dsi0>,
<&i2c_frag>, "target:0=",<&i2c_csi_dsi0>;
};
};
2 changes: 2 additions & 0 deletions arch/arm/configs/bcm2709_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -772,6 +772,7 @@ CONFIG_REGULATOR_ARIZONA_LDO1=m
CONFIG_REGULATOR_ARIZONA_MICSUPP=m
CONFIG_REGULATOR_RASPBERRYPI_TOUCHSCREEN_ATTINY=m
CONFIG_REGULATOR_RASPBERRYPI_TOUCHSCREEN_V2=m
CONFIG_REGULATOR_WAVESHARE_TOUCHSCREEN=m
CONFIG_RC_CORE=y
CONFIG_BPF_LIRC_MODE2=y
CONFIG_LIRC=y
Expand Down Expand Up @@ -978,6 +979,7 @@ CONFIG_DRM_PANEL_SITRONIX_ST7701=m
CONFIG_DRM_PANEL_SIMPLE=m
CONFIG_DRM_PANEL_TPO_Y17P=m
CONFIG_DRM_PANEL_WAVESHARE_TOUCHSCREEN=m
CONFIG_DRM_PANEL_WAVESHARE_TOUCHSCREEN_V2=m
CONFIG_DRM_DISPLAY_CONNECTOR=m
CONFIG_DRM_SIMPLE_BRIDGE=m
CONFIG_DRM_TOSHIBA_TC358762=m
Expand Down
2 changes: 2 additions & 0 deletions arch/arm/configs/bcm2711_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -798,6 +798,7 @@ CONFIG_REGULATOR_ARIZONA_MICSUPP=m
CONFIG_REGULATOR_GPIO=y
CONFIG_REGULATOR_RASPBERRYPI_TOUCHSCREEN_ATTINY=m
CONFIG_REGULATOR_RASPBERRYPI_TOUCHSCREEN_V2=m
CONFIG_REGULATOR_WAVESHARE_TOUCHSCREEN=m
CONFIG_RC_CORE=y
CONFIG_BPF_LIRC_MODE2=y
CONFIG_LIRC=y
Expand Down Expand Up @@ -1007,6 +1008,7 @@ CONFIG_DRM_PANEL_SITRONIX_ST7701=m
CONFIG_DRM_PANEL_SIMPLE=m
CONFIG_DRM_PANEL_TPO_Y17P=m
CONFIG_DRM_PANEL_WAVESHARE_TOUCHSCREEN=m
CONFIG_DRM_PANEL_WAVESHARE_TOUCHSCREEN_V2=m
CONFIG_DRM_DISPLAY_CONNECTOR=m
CONFIG_DRM_SIMPLE_BRIDGE=m
CONFIG_DRM_TOSHIBA_TC358762=m
Expand Down
2 changes: 2 additions & 0 deletions arch/arm/configs/bcmrpi_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -765,6 +765,7 @@ CONFIG_REGULATOR_ARIZONA_LDO1=m
CONFIG_REGULATOR_ARIZONA_MICSUPP=m
CONFIG_REGULATOR_RASPBERRYPI_TOUCHSCREEN_ATTINY=m
CONFIG_REGULATOR_RASPBERRYPI_TOUCHSCREEN_V2=m
CONFIG_REGULATOR_WAVESHARE_TOUCHSCREEN=m
CONFIG_RC_CORE=y
CONFIG_BPF_LIRC_MODE2=y
CONFIG_LIRC=y
Expand Down Expand Up @@ -971,6 +972,7 @@ CONFIG_DRM_PANEL_SITRONIX_ST7701=m
CONFIG_DRM_PANEL_SIMPLE=m
CONFIG_DRM_PANEL_TPO_Y17P=m
CONFIG_DRM_PANEL_WAVESHARE_TOUCHSCREEN=m
CONFIG_DRM_PANEL_WAVESHARE_TOUCHSCREEN_V2=m
CONFIG_DRM_DISPLAY_CONNECTOR=m
CONFIG_DRM_SIMPLE_BRIDGE=m
CONFIG_DRM_TOSHIBA_TC358762=m
Expand Down
2 changes: 2 additions & 0 deletions arch/arm64/configs/bcm2711_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -840,6 +840,7 @@ CONFIG_REGULATOR_ARIZONA_MICSUPP=m
CONFIG_REGULATOR_GPIO=y
CONFIG_REGULATOR_RASPBERRYPI_TOUCHSCREEN_ATTINY=m
CONFIG_REGULATOR_RASPBERRYPI_TOUCHSCREEN_V2=m
CONFIG_REGULATOR_WAVESHARE_TOUCHSCREEN=m
CONFIG_RC_CORE=y
CONFIG_BPF_LIRC_MODE2=y
CONFIG_LIRC=y
Expand Down Expand Up @@ -1056,6 +1057,7 @@ CONFIG_DRM_PANEL_SITRONIX_ST7701=m
CONFIG_DRM_PANEL_SIMPLE=m
CONFIG_DRM_PANEL_TPO_Y17P=m
CONFIG_DRM_PANEL_WAVESHARE_TOUCHSCREEN=m
CONFIG_DRM_PANEL_WAVESHARE_TOUCHSCREEN_V2=m
CONFIG_DRM_DISPLAY_CONNECTOR=m
CONFIG_DRM_SIMPLE_BRIDGE=m
CONFIG_DRM_TOSHIBA_TC358762=m
Expand Down
2 changes: 2 additions & 0 deletions arch/arm64/configs/bcm2711_rt_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -840,6 +840,7 @@ CONFIG_REGULATOR_ARIZONA_MICSUPP=m
CONFIG_REGULATOR_GPIO=y
CONFIG_REGULATOR_RASPBERRYPI_TOUCHSCREEN_ATTINY=m
CONFIG_REGULATOR_RASPBERRYPI_TOUCHSCREEN_V2=m
CONFIG_REGULATOR_WAVESHARE_TOUCHSCREEN=m
CONFIG_RC_CORE=y
CONFIG_BPF_LIRC_MODE2=y
CONFIG_LIRC=y
Expand Down Expand Up @@ -1056,6 +1057,7 @@ CONFIG_DRM_PANEL_SITRONIX_ST7701=m
CONFIG_DRM_PANEL_SIMPLE=m
CONFIG_DRM_PANEL_TPO_Y17P=m
CONFIG_DRM_PANEL_WAVESHARE_TOUCHSCREEN=m
CONFIG_DRM_PANEL_WAVESHARE_TOUCHSCREEN_V2=m
CONFIG_DRM_DISPLAY_CONNECTOR=m
CONFIG_DRM_SIMPLE_BRIDGE=m
CONFIG_DRM_TOSHIBA_TC358762=m
Expand Down
2 changes: 2 additions & 0 deletions arch/arm64/configs/bcm2712_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -842,6 +842,7 @@ CONFIG_REGULATOR_ARIZONA_MICSUPP=m
CONFIG_REGULATOR_GPIO=y
CONFIG_REGULATOR_RASPBERRYPI_TOUCHSCREEN_ATTINY=m
CONFIG_REGULATOR_RASPBERRYPI_TOUCHSCREEN_V2=m
CONFIG_REGULATOR_WAVESHARE_TOUCHSCREEN=m
CONFIG_RC_CORE=y
CONFIG_BPF_LIRC_MODE2=y
CONFIG_LIRC=y
Expand Down Expand Up @@ -1058,6 +1059,7 @@ CONFIG_DRM_PANEL_SITRONIX_ST7701=m
CONFIG_DRM_PANEL_SIMPLE=m
CONFIG_DRM_PANEL_TPO_Y17P=m
CONFIG_DRM_PANEL_WAVESHARE_TOUCHSCREEN=m
CONFIG_DRM_PANEL_WAVESHARE_TOUCHSCREEN_V2=m
CONFIG_DRM_DISPLAY_CONNECTOR=m
CONFIG_DRM_SIMPLE_BRIDGE=m
CONFIG_DRM_TOSHIBA_TC358762=m
Expand Down
10 changes: 10 additions & 0 deletions drivers/gpu/drm/panel/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -1001,6 +1001,16 @@
DSI Touchscreens. To compile this driver as a module,
choose M here.

config DRM_PANEL_WAVESHARE_TOUCHSCREEN_V2

Check failure on line 1004 in drivers/gpu/drm/panel/Kconfig

View workflow job for this annotation

GitHub Actions / checkpatch review

WARNING: please write a help paragraph that fully describes the config symbol

Check failure on line 1004 in drivers/gpu/drm/panel/Kconfig

View workflow job for this annotation

GitHub Actions / checkpatch review

WARNING: please write a help paragraph that fully describes the config symbol
tristate "Waveshare touchscreen panels V2"
depends on DRM_MIPI_DSI
depends on I2C
depends on BACKLIGHT_CLASS_DEVICE
help
Say Y here if you want to enable support for the Waveshare
DSI Touchscreens. To compile this driver as a module,
choose M here.

config DRM_PANEL_WIDECHIPS_WS2401
tristate "Widechips WS2401 DPI panel driver"
depends on SPI && GPIOLIB
Expand Down
1 change: 1 addition & 0 deletions drivers/gpu/drm/panel/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -101,5 +101,6 @@ obj-$(CONFIG_DRM_PANEL_VISIONOX_RM69299) += panel-visionox-rm69299.o
obj-$(CONFIG_DRM_PANEL_VISIONOX_VTDR6130) += panel-visionox-vtdr6130.o
obj-$(CONFIG_DRM_PANEL_VISIONOX_R66451) += panel-visionox-r66451.o
obj-$(CONFIG_DRM_PANEL_WAVESHARE_TOUCHSCREEN) += panel-waveshare-dsi.o
obj-$(CONFIG_DRM_PANEL_WAVESHARE_TOUCHSCREEN_V2) += panel-waveshare-dsi-v2.o
obj-$(CONFIG_DRM_PANEL_WIDECHIPS_WS2401) += panel-widechips-ws2401.o
obj-$(CONFIG_DRM_PANEL_XINPENG_XPP055C272) += panel-xinpeng-xpp055c272.o
Loading