From f493a1250d55c4a61d94f631757186e8beef9d90 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Wed, 26 Jan 2022 16:02:31 +0000 Subject: [PATCH] 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 | 279 +++++++++++++++++++++++++ 3 files changed, 291 insertions(+) create mode 100644 drivers/gpu/drm/panel/panel-tdo-y17p.c --- a/drivers/gpu/drm/panel/Kconfig +++ b/drivers/gpu/drm/panel/Kconfig @@ -562,6 +562,17 @@ config DRM_PANEL_SONY_ACX565AKM Say Y here if you want to enable support for the Sony ACX565AKM 800x600 3.5" panel (found on the Nokia N900). +config DRM_PANEL_TPO_Y17P + tristate "TDO Y17P-based panels" + depends on OF && SPI + depends on DRM_KMS_HELPER + depends on DRM_KMS_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_TDO_TL070WSH30 tristate "TDO TL070WSH30 DSI panel" depends on OF --- a/drivers/gpu/drm/panel/Makefile +++ b/drivers/gpu/drm/panel/Makefile @@ -58,6 +58,7 @@ obj-$(CONFIG_DRM_PANEL_SITRONIX_ST7789V) obj-$(CONFIG_DRM_PANEL_SONY_ACX424AKP) += panel-sony-acx424akp.o obj-$(CONFIG_DRM_PANEL_SONY_ACX565AKM) += panel-sony-acx565akm.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,279 @@ +// 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