From patchwork Thu Nov 1 21:32:56 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 149985 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp1296847ljp; Thu, 1 Nov 2018 14:33:08 -0700 (PDT) X-Google-Smtp-Source: AJdET5dMC82Jab/tDJhobOKlRm7zbbP3PeQUI/ki7Q4hx+v3uxqPcmFCXGHyOViOVsiIbnJ9fXxL X-Received: by 2002:a63:c447:: with SMTP id m7mr6201190pgg.27.1541107988364; Thu, 01 Nov 2018 14:33:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1541107988; cv=none; d=google.com; s=arc-20160816; b=0sHEGsPp1ZxPeAoffIWX8Yj2YO0SB6Q6jPA4RxhxDIx7LQeBpTkc43WFnVstzxM0Wu oqmjGXmzYMd0F2+rno6C/dkhmT7nVsNxw0zvy2cwiRZgKuxgyjTJigi6kyKhOHf/ax+w 6nIeUgLWA5pitpyDZktNr9k6fLKXWTGLclmi0OPHqqySLPOnAwMESojExMUQxQ1RqWDc K/OcAmP1wMpb3SYm5zhgzjMGFXEERB+SiTo5hSKMV1zYgpCJ2QIUqxkqkLXpoW2f2aGI cM41pR/w8QZKrpg44OsAwb2NyrboGm8WzZeKxARMY8KrmqxTZacw68jZ4pJHRTc/ZtZG lwSQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:list-subscribe:list-help :list-post:list-archive:list-unsubscribe:list-id:precedence :mime-version:references:in-reply-to:message-id:date:subject:to:from :delivered-to; bh=THllP5BhYoD8gaT9SatI19TcM3sTDaEamv3FYfmnZxs=; b=JzpDUtWgZMwGfef5FeE+Xbr1Ee4rCCb1MEFeyre0uHYnZBW3EtuETV9aGHZdBc0+Hz YfFnqUSrpJTK+Z20Gbal0qoCGp+AMnO9d+5YBQ4q6fdC1EGIe8wNz2kfAZH436yX+jbc rF+yFVuV4nUJa7HF0ZDleAfe0qBZaGumXQTBQvWkfZusiaj25PlFsrcetQ81cmuCejLB zB0LLBVsXRcOa7c6II8uFVOGMn7JpnDyZtCAdHVULZd7EOHESU40JLyrAhGJG6z6YhVW JTGBy1lsQcDEafV8Tw5e0tWc9eLCcM7XVEjDdiS57pU66g+2/gmmcHqYg9Ufphgb9rSW xo+w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from gabe.freedesktop.org (gabe.freedesktop.org. [131.252.210.177]) by mx.google.com with ESMTPS id 101-v6si668594pld.398.2018.11.01.14.33.08 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 01 Nov 2018 14:33:08 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) client-ip=131.252.210.177; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 133D66E4B3; Thu, 1 Nov 2018 21:33:07 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-lj1-x241.google.com (mail-lj1-x241.google.com [IPv6:2a00:1450:4864:20::241]) by gabe.freedesktop.org (Postfix) with ESMTPS id ABAA46E4B3 for ; Thu, 1 Nov 2018 21:33:05 +0000 (UTC) Received: by mail-lj1-x241.google.com with SMTP id k19-v6so10886115lji.11 for ; Thu, 01 Nov 2018 14:33:05 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=85Wmj0gBy2z7XwKlf+dPDEvjcQEYbNGUrLShAIXYusw=; b=Kwn22R0msBE/T7yOqaClSDNdGvgnd9hDpjbEMveUjpNJlNnlKs+BrgxQin+GNdmFs+ sB742IlxqaRhgWqmypF91CKfGo2de6h8X77rV0qtuJrpE8oMKE48FJH5zgp0P0wkxYoP p/uFuv9pXSWRZV5ltfznyQ9HVdLLhOKvQEqdNepcE3ZY7DBP0T6vlN02Ko9b2N8O4QoA CRVc2/IDrVSAQ63NmgGMgxq9hscGFpqteW7Tt/8SgQ+9aqmW4WtN3BACAmJMU+jay37z BAuz/4JeLq0Pt/VCElllSIzcCmYwINLhjDnybQ1WF4AEkR1Q1pDIRB9tAhpbHQa6TJ09 tuPw== X-Gm-Message-State: AGRZ1gLIO5SbXTwP/G4dY6wLo3kC+HjAt0ILYJdJ/YsPeJ+WKuYgburW IGbH+xX/vV7t7iXd42XRF4OrUA1uTl8oyA== X-Received: by 2002:a2e:2b99:: with SMTP id r25-v6mr5822895ljr.91.1541107983779; Thu, 01 Nov 2018 14:33:03 -0700 (PDT) Received: from localhost.bredbandsbolaget (c-ae7b71d5.014-348-6c756e10.bbcust.telenor.se. [213.113.123.174]) by smtp.gmail.com with ESMTPSA id c20sm568982lfj.67.2018.11.01.14.33.01 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 01 Nov 2018 14:33:01 -0700 (PDT) From: Linus Walleij To: Thierry Reding , dri-devel@lists.freedesktop.org Subject: [PATCH 2/2 v4] drm/panel: Add a driver for the TPO TPG110 Date: Thu, 1 Nov 2018 22:32:56 +0100 Message-Id: <20181101213256.12097-2-linus.walleij@linaro.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181101213256.12097-1-linus.walleij@linaro.org> References: <20181101213256.12097-1-linus.walleij@linaro.org> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" The TPO (Toppoly) TPG110 is a pretty generic display driver similar in vein to the Ilitek 93xx devices. It is not a panel per se but a driver used with several low-cost noname panels. This is used on the Nomadik NHK15 combined with a OSD OSD057VA01CT display for WVGA 800x480. The driver is pretty minimalistic right now but can be extended to handle non-default polarities, gamma correction etc. The driver is based on the baked-in code in drivers/video/fbdev/amba-clcd-nomadik.c which will be decomissioned once this us upstream. Signed-off-by: Linus Walleij --- ChangeLog v3->v4: - Tag on the SPI_3WIRE_HIZ flag to the SPI slave mode. ChangeLog v2->v3: - Rewrite as an SPI child device. --- MAINTAINERS | 7 + drivers/gpu/drm/panel/Kconfig | 10 + drivers/gpu/drm/panel/Makefile | 1 + drivers/gpu/drm/panel/panel-tpo-tpg110.c | 506 +++++++++++++++++++++++ 4 files changed, 524 insertions(+) create mode 100644 drivers/gpu/drm/panel/panel-tpo-tpg110.c diff --git a/MAINTAINERS b/MAINTAINERS index 690c2f68a401..c3ca56c2a7a6 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -4746,6 +4746,13 @@ DRM DRIVER FOR TDFX VIDEO CARDS S: Orphan / Obsolete F: drivers/gpu/drm/tdfx/ +DRM DRIVER FOR TPO TPG110 PANELS +M: Linus Walleij +T: git git://anongit.freedesktop.org/drm/drm-misc +S: Maintained +F: drivers/gpu/drm/panel/panel-tpo-tpg110.c +F: Documentation/devicetree/bindings/display/panel/tpo,tpg110.txt + DRM DRIVER FOR USB DISPLAYLINK VIDEO ADAPTERS M: Dave Airlie R: Sean Paul diff --git a/drivers/gpu/drm/panel/Kconfig b/drivers/gpu/drm/panel/Kconfig index 6020c30a33b3..b2c8b02894b1 100644 --- a/drivers/gpu/drm/panel/Kconfig +++ b/drivers/gpu/drm/panel/Kconfig @@ -186,4 +186,14 @@ config DRM_PANEL_SITRONIX_ST7789V Say Y here if you want to enable support for the Sitronix ST7789V controller for 240x320 LCD panels +config DRM_PANEL_TPO_TPG110 + tristate "TPO TPG 800x400 panel" + depends on OF && SPI && GPIOLIB + depends on BACKLIGHT_CLASS_DEVICE + select VIDEOMODE_HELPERS + help + Say Y here if you want to enable support for TPO TPG110 + 400CH LTPS TFT LCD Single Chip Digital Driver for up to + 800x400 LCD panels. + endmenu diff --git a/drivers/gpu/drm/panel/Makefile b/drivers/gpu/drm/panel/Makefile index 5ccaaa9d13af..9b3a0629d255 100644 --- a/drivers/gpu/drm/panel/Makefile +++ b/drivers/gpu/drm/panel/Makefile @@ -19,3 +19,4 @@ obj-$(CONFIG_DRM_PANEL_SEIKO_43WVF1G) += panel-seiko-43wvf1g.o obj-$(CONFIG_DRM_PANEL_SHARP_LQ101R1SX01) += panel-sharp-lq101r1sx01.o obj-$(CONFIG_DRM_PANEL_SHARP_LS043T1LE01) += panel-sharp-ls043t1le01.o obj-$(CONFIG_DRM_PANEL_SITRONIX_ST7789V) += panel-sitronix-st7789v.o +obj-$(CONFIG_DRM_PANEL_TPO_TPG110) += panel-tpo-tpg110.o diff --git a/drivers/gpu/drm/panel/panel-tpo-tpg110.c b/drivers/gpu/drm/panel/panel-tpo-tpg110.c new file mode 100644 index 000000000000..8e517ea5e73b --- /dev/null +++ b/drivers/gpu/drm/panel/panel-tpo-tpg110.c @@ -0,0 +1,506 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * Panel driver for the TPO TPG110 400CH LTPS TFT LCD Single Chip + * Digital Driver. + * + * This chip drives a TFT LCD, so it does not know what kind of + * display is actually connected to it, so the width and height of that + * display needs to be supplied from the machine configuration. + * + * Author: + * Linus Walleij + */ +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +#include