From 4d5992d474e75e58ceb0f3fe02e0f949c1255dcd Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Wed, 26 Jan 2022 16:02:31 +0000 Subject: [PATCH 0346/1085] drm/panel: Add panel driver for TDO Y17B based panels The Top DisplayOptoelectronics (TDO) T17B driver chip is used in the TL040HDS20CT panel (found in the Pimoroni HyperPixel4 Square display) and potentially other displays. The driver chip supports SPI for configuration and DPI video data. Signed-off-by: Dave Stevenson --- drivers/gpu/drm/panel/Kconfig | 11 + drivers/gpu/drm/panel/Makefile | 1 + drivers/gpu/drm/panel/panel-tdo-y17p.c | 277 +++++++++++++++++++++++++ 3 files changed, 289 insertions(+) create mode 100644 drivers/gpu/drm/panel/panel-tdo-y17p.c --- a/drivers/gpu/drm/panel/Kconfig +++ b/drivers/gpu/drm/panel/Kconfig @@ -767,6 +767,17 @@ config DRM_PANEL_TDO_TL070WSH30 24 bit RGB per pixel. It provides a MIPI DSI interface to the host, a built-in LED backlight and touch controller. +config DRM_PANEL_TPO_Y17P + tristate "TDO Y17P-based panels" + depends on OF && SPI + select DRM_KMS_HELPER + depends on DRM_GEM_CMA_HELPER + depends on BACKLIGHT_CLASS_DEVICE + select DRM_MIPI_DBI + help + Say Y if you want to enable support for panels based on the + TDO Y17P controller. + config DRM_PANEL_TPO_TD028TTEC1 tristate "Toppoly (TPO) TD028TTEC1 panel driver" depends on OF && SPI --- a/drivers/gpu/drm/panel/Makefile +++ b/drivers/gpu/drm/panel/Makefile @@ -77,6 +77,7 @@ obj-$(CONFIG_DRM_PANEL_SONY_TD4353_JDI) obj-$(CONFIG_DRM_PANEL_SONY_TULIP_TRULY_NT35521) += panel-sony-tulip-truly-nt35521.o obj-$(CONFIG_DRM_PANEL_STARTEK_KD070FHFID015) += panel-startek-kd070fhfid015.o obj-$(CONFIG_DRM_PANEL_TDO_TL070WSH30) += panel-tdo-tl070wsh30.o +obj-$(CONFIG_DRM_PANEL_TPO_Y17P) += panel-tdo-y17p.o obj-$(CONFIG_DRM_PANEL_TPO_TD028TTEC1) += panel-tpo-td028ttec1.o obj-$(CONFIG_DRM_PANEL_TPO_TD043MTEA1) += panel-tpo-td043mtea1.o obj-$(CONFIG_DRM_PANEL_TPO_TPG110) += panel-tpo-tpg110.o --- /dev/null +++ b/drivers/gpu/drm/panel/panel-tdo-y17p.c @@ -0,0 +1,277 @@ +// SPDX-License-Identifier: GPL-2.0-only +/* + * TDO Y17P TFT LCD drm_panel driver. + * + * SPI configured DPI display controller + * Copyright (C) 2022 Raspberry Pi Ltd + * + * Derived from drivers/drm/gpu/panel/panel-sitronix-st7789v.c + * Copyright (C) 2017 Free Electrons + */ + +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +#include