From 29826b4444c016adf4a550d25ba2610d5e4b8af7 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Fri, 14 Apr 2023 13:50:08 +0100 Subject: [PATCH] drm/panel: Add panel driver for Waveshare DSI touchscreens Waveshare sell a range of DSI panels of varying sizes, all using a common MCU to control the panel and backlight. Add a panel driver that supports these panels. Signed-off-by: Dave Stevenson drm/panel: waveshare: Fix up timings for 10.1" panel The 10.1" panel doesn't work with the timings defined. vc4 will always have been fixing up the timing due to the limited integer divider, so compute the fixed up mode and use it directly. Signed-off-by: Dave Stevenson drivers/gpu/drm/panel:fix waveshare panel software restart/shutdown display is abnormal Fixed the screen stays white when the user restarts or shuts down Signed-off-by: eng33 drivers/gpu/drm/panel:Modify the DSI mode to fix the problem that 7.9inch cannot be displayed Signed-off-by: eng33 drivers/gpu/drm/panel:Modified the timing of 11.9inch to fix the issue that 11.9inch was displayed abnormally Signed-off-by: eng33 Driver:add waveshare 4inch dsi lcd (C) driver Signed-off-by: Eng33 drivers:gpu:drm:panel: Added waveshare 5.0inch, 6.25inch, and 8.8inch dsi screen devices Signed-off-by: eng33 drm: panel: Added waveshare 13.3inch panel Signed-off-by: eng33 drm: panel: Added waveshare 7.0inch h dsi screen support Signed-off-by: Waveshare_Team drivers/gpu/drm/panel : Add the device for the Waveshare DSI-TOUCH series panels. the driver are provided for the Waveshare DSI-TOUCH series panels, modelled after the other Ilitek controller drivers, but not limited to Ilitek series controllers. The aim is to offer a more consistent operation and experience for the Waveshare DSI-TOUCH series panels. Signed-off-by: Waveshare_Team drivers/gpu/drm/panel : Update display driver 1) Add LCD power control 2) Added support for: A) Add support for 3.4-DSI-TOUCH-C B) Add support for 4-DSI-TOUCH-C C) Add support for 8-DSI-TOUCH-A D) Add support for 9-DSI-TOUCH-B E) Add support for 10.1-DSI-TOUCH-B F) Add support for 12.3-DSI-TOUCH-A Signed-off-by: Waveshare_Team --- drivers/gpu/drm/panel/Kconfig | 20 + drivers/gpu/drm/panel/Makefile | 2 + .../gpu/drm/panel/panel-waveshare-dsi-v2.c | 2284 +++++++++++++++++ drivers/gpu/drm/panel/panel-waveshare-dsi.c | 633 +++++ 4 files changed, 2939 insertions(+) create mode 100644 drivers/gpu/drm/panel/panel-waveshare-dsi-v2.c create mode 100644 drivers/gpu/drm/panel/panel-waveshare-dsi.c diff --git a/drivers/gpu/drm/panel/Kconfig b/drivers/gpu/drm/panel/Kconfig index d3ef7b5e3141..33c484be76ab 100644 --- a/drivers/gpu/drm/panel/Kconfig +++ b/drivers/gpu/drm/panel/Kconfig @@ -1148,6 +1148,26 @@ config DRM_PANEL_VISIONOX_VTDR6130 Say Y here if you want to enable support for Visionox VTDR6130 1080x2400 AMOLED DSI panel. +config DRM_PANEL_WAVESHARE_TOUCHSCREEN + tristate "Waveshare touchscreen panels" + 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_WAVESHARE_TOUCHSCREEN_V2 + 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 diff --git a/drivers/gpu/drm/panel/Makefile b/drivers/gpu/drm/panel/Makefile index 82c704f6603b..d04639d9dbd4 100644 --- a/drivers/gpu/drm/panel/Makefile +++ b/drivers/gpu/drm/panel/Makefile @@ -115,5 +115,7 @@ obj-$(CONFIG_DRM_PANEL_VISIONOX_RM69299) += panel-visionox-rm69299.o obj-$(CONFIG_DRM_PANEL_VISIONOX_RM692E5) += panel-visionox-rm692e5.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 diff --git a/drivers/gpu/drm/panel/panel-waveshare-dsi-v2.c b/drivers/gpu/drm/panel/panel-waveshare-dsi-v2.c new file mode 100644 index 000000000000..cfff92ead5e6 --- /dev/null +++ b/drivers/gpu/drm/panel/panel-waveshare-dsi-v2.c @@ -0,0 +1,2284 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * Copyright (C) 2024 Waveshare International Limited + * + * Based on panel-raspberrypi-touchscreen by Broadcom + */ + +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include +#include +#include + +#include