From 5bf84a1a0a282a18bf9dd2d752537525aefc2e05 Mon Sep 17 00:00:00 2001 From: Max Fierke Date: Wed, 1 Jun 2022 00:17:48 -0500 Subject: [PATCH 107/117] drm: panel: Add driver for Clockwork cwd686 panel The Clockwork DevTerm (all models) uses a 6.86" IPS display of unknown provenance, which uses the Chipone ICNL9707 IC driver. The display panel I have has two model numbers: TXW686001 and WTL068601G, but cannot find any manufacturer associated with either, so opting for the Clockwork model number. This driver is based on the GPL-licensed driver released by Clockwork, authored by Pinfan Zhu, with some additional cleanup, rotation support, and display sleep re-enabling done by me. Original driver here for reference: https://github.com/clockworkpi/DevTerm/blob/main/Code/patch/armbian_build_a06/patch/kernel-004-panel.patch Display IC datasheet provided here: https://github.com/clockworkpi/DevTerm/blob/main/Schematics/ICNL9707_Datasheet.pdf Signed-off-by: Max Fierke Signed-off-by: Samuel Holland --- drivers/gpu/drm/panel/Kconfig | 12 + drivers/gpu/drm/panel/Makefile | 1 + .../gpu/drm/panel/panel-clockwork-cwd686.c | 456 ++++++++++++++++++ 3 files changed, 469 insertions(+) create mode 100644 drivers/gpu/drm/panel/panel-clockwork-cwd686.c --- a/drivers/gpu/drm/panel/Kconfig +++ b/drivers/gpu/drm/panel/Kconfig @@ -68,6 +68,18 @@ config DRM_PANEL_BOE_TV101WUM_NL6 Say Y here if you want to support for BOE TV101WUM and AUO KD101N80 45NA WUXGA PANEL DSI Video Mode panel +config DRM_PANEL_CLOCKWORK_CWD686 + tristate "Clockwork CWD686 panel" + depends on OF + depends on DRM_MIPI_DSI + depends on BACKLIGHT_CLASS_DEVICE + help + Say Y here if you want to enable support for the Clockwork CWD686 + ICNL9707-based panel, e.g. as used within the Clockwork DevTerm. + The panel has a 480x1280 resolution and uses 24 bit RGB per pixel. + + To compile this driver as a module, choose M here. + config DRM_PANEL_DSI_CM tristate "Generic DSI command mode panels" depends on OF --- a/drivers/gpu/drm/panel/Makefile +++ b/drivers/gpu/drm/panel/Makefile @@ -5,6 +5,7 @@ obj-$(CONFIG_DRM_PANEL_ASUS_Z00T_TM5P5_N obj-$(CONFIG_DRM_PANEL_BOE_BF060Y8M_AJ0) += panel-boe-bf060y8m-aj0.o obj-$(CONFIG_DRM_PANEL_BOE_HIMAX8279D) += panel-boe-himax8279d.o obj-$(CONFIG_DRM_PANEL_BOE_TV101WUM_NL6) += panel-boe-tv101wum-nl6.o +obj-$(CONFIG_DRM_PANEL_CLOCKWORK_CWD686) += panel-clockwork-cwd686.o obj-$(CONFIG_DRM_PANEL_DSI_CM) += panel-dsi-cm.o obj-$(CONFIG_DRM_PANEL_LVDS) += panel-lvds.o obj-$(CONFIG_DRM_PANEL_SIMPLE) += panel-simple.o --- /dev/null +++ b/drivers/gpu/drm/panel/panel-clockwork-cwd686.c @@ -0,0 +1,456 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* + * Copyright (c) 2021 Clockwork Tech LLC + * Copyright (c) 2021-2022 Max Fierke + * + * Based on Pinfan Zhu's work on panel-cwd686.c for ClockworkPi's 5.10 BSP + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include