From patchwork Sun Nov 18 19:30:39 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 151431 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp1831638ljp; Sun, 18 Nov 2018 11:30:52 -0800 (PST) X-Google-Smtp-Source: AJdET5dacoWnV6TN6tjlthtJ4jfjwjRfWhDZ/NEPdqSWMW9Mft6jUDT42s6t73UiKE8qXRTRApo6 X-Received: by 2002:a63:ea4f:: with SMTP id l15mr17136014pgk.102.1542569452330; Sun, 18 Nov 2018 11:30:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542569452; cv=none; d=google.com; s=arc-20160816; b=jXvZIx8hHJLyBI3pC84ZOrRctT7KsuxfK27U2c0UhfJm06aXIbx/wTMFgE54y6guqK SNFPytqlbTFMaZtiBB02zCzDkPqs3CBK/xEH5G60NxdnfRDDcAsNAauanpxX3CB79R64 1m9fTU15VS8w8KnGgWfsXS7pKOzEIAdyjFZMHPZI9hZr7yv04U3mZeB/vYmC3xYGTDqK H2pijTzQTC44yh36wC2EuTwmPBcBTHZy2kmXVAxEiWmVcwildt23PMulCdaKWEd61b7k Kpsi/c3T7blcRYX9BnWjfgAFULmOcyXeOmbDOKbeuLDzqgBcrceo47W/nY8ZAsglfNyV +03Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:cc:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:mime-version:message-id:date:subject:to:from :delivered-to; bh=rgb3BYwi+P7yoTexBUMDRvqzSCyThQpfvmZ9xLxuCUw=; b=g52X1Jp3hH1hw/ag5hs6SeujWhnhTaBeQalOW+3THjN6yYhMO72GOrprx1725fn2su sxOk1kTndg+WTkkdc5Ly3kCNmCInesTY4okntZzN8umv6mweoSAHcAUKiATadRH2AyET HVQpDI+4yJT6SV+78gBQXM/uBGMg/YMTVvJRYnDCJLIBaZpwZX3PNNj380j7F4MkfPfo bMIgoK1Gb3W44M+vs+CSCKLUYTPDftUH8/lUTuVCbm3Ue2VKbyfwC10T1o9NqBegwBcb tVAALrkq318XZ9lEVB4LIVjPnnLnUJ0QNHg+k/wMFFFWaqEb2I0RK8vfLLTSOss7YtAM e9qA== 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 2610:10:20:722:a800:ff:fe36:1795 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. [2610:10:20:722:a800:ff:fe36:1795]) by mx.google.com with ESMTPS id w2si35659358pgs.264.2018.11.18.11.30.52 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 18 Nov 2018 11:30:52 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 2610:10:20:722:a800:ff:fe36:1795 as permitted sender) client-ip=2610:10:20:722:a800:ff:fe36:1795; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 2610:10:20:722:a800:ff:fe36:1795 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 E40B189C25; Sun, 18 Nov 2018 19:30:49 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-lj1-x242.google.com (mail-lj1-x242.google.com [IPv6:2a00:1450:4864:20::242]) by gabe.freedesktop.org (Postfix) with ESMTPS id 67EB089C25 for ; Sun, 18 Nov 2018 19:30:48 +0000 (UTC) Received: by mail-lj1-x242.google.com with SMTP id g11-v6so11704344ljk.3 for ; Sun, 18 Nov 2018 11:30:48 -0800 (PST) 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:mime-version :content-transfer-encoding; bh=7rNY98CKcL5PMSV9T7FlBWwlV5JoFK0IeRuUGOLDa2U=; b=SeZb+sE4xTIHvWvr2XZMY8eJopVCo6PQKob+1rFkTWFchZwQ8oLyz7ZGezNai3iSmh Cu3afvnt2g8KmTeuVSNjKWPbJn1GAxAvNg7VD25et8eedSh624HBXkGzNiPqz7tik87x DCTlDTGoYWQm/JE+ZxmBCrnlBCf6s5BgmFWISm0NGTdkk3RzNRUiSzUooiAqX08LS1NM XVwNjFLBCeIBsQEkE5uQ4Zw38Ubcthsl/Hhs+ci5xfkurPChRgInWNiDXntP/r5qLBRz aVcJFVkA0D+svl3Acojs93h8GCCzhsYhEZCA8JWqhIQ2McqhLMgOtGJRbpT0ewZWFBi+ vIvw== X-Gm-Message-State: AGRZ1gJ/FDiDSXLkKOB22/T6ez8AIKi/r4nw/2fut8zP3D7nT43gwmyr 2appvEqFw0yQddmcew07ERyONQ== X-Received: by 2002:a2e:4942:: with SMTP id b2-v6mr7806891ljd.168.1542569446470; Sun, 18 Nov 2018 11:30:46 -0800 (PST) Received: from localhost.bredbandsbolaget (c-ae7b71d5.014-348-6c756e10.bbcust.telenor.se. [213.113.123.174]) by smtp.gmail.com with ESMTPSA id r26-v6sm5491523lji.25.2018.11.18.11.30.44 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 18 Nov 2018 11:30:45 -0800 (PST) From: Linus Walleij To: Thierry Reding , dri-devel@lists.freedesktop.org Subject: [PATCH v5] drm/panel: Add a driver for the TPO TPG110 Date: Sun, 18 Nov 2018 20:30:39 +0100 Message-Id: <20181118193040.25002-1-linus.walleij@linaro.org> X-Mailer: git-send-email 2.19.1 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: , Cc: Sam Ravnborg 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. Cc: Sam Ravnborg Signed-off-by: Linus Walleij Acked-by: Sam Ravnborg --- ChangeLog v4->v5: - Assign proper bus_flags. - This is now the only remaining patch. 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 | 511 +++++++++++++++++++++++ 4 files changed, 529 insertions(+) create mode 100644 drivers/gpu/drm/panel/panel-tpo-tpg110.c diff --git a/MAINTAINERS b/MAINTAINERS index f4855974f325..6905d002cf17 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -4751,6 +4751,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..99bf4b274ef1 --- /dev/null +++ b/drivers/gpu/drm/panel/panel-tpo-tpg110.c @@ -0,0 +1,511 @@ +// 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