From patchwork Wed Dec 25 11:56:10 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 11310161 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 3DF7414B7 for ; Wed, 25 Dec 2019 11:56:37 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id BC8AF2073B for ; Wed, 25 Dec 2019 11:56:36 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="dosHz1RE"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="ProZdKCO" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org BC8AF2073B Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=yARwCU4ZqjYdkqMgZk3GmiPiM1F+eMqda5LNbHsIeOg=; b=dosHz1REwrbSx5 SucA0nvavsPhYElgEOxNfqagGF3uUoguIHD5TxjeaNGuq968Cb8xu2yucTYLWf2pw9X73JYkn5YlO 0NLd1fodk0W1zdWPVhWFsDriwWBoAzz3+AsEnYKtFVlaQ0qHpfL5F+w84MviUKftK77i461CX7/gQ rKsriZQBB2JZV9gpRdpYANFv8M/H3wvZD8/CwQ/AYp4yHgpWOjUZg6uIROm12chGdIxLvGj2l1Hqs NL70Hv0YSwImfK4C6e5t/unpgqN9LnAmQrdyMg+FcpBTaZctwP1czQrJcPjVgKm8IUtZPs88U/Mk2 WuPVCnV7Dthlc2ZFQILA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1ik5HG-0002X4-AE; Wed, 25 Dec 2019 11:56:34 +0000 Received: from mail-lj1-x242.google.com ([2a00:1450:4864:20::242]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1ik5H7-0002Pr-Sr for linux-arm-kernel@lists.infradead.org; Wed, 25 Dec 2019 11:56:29 +0000 Received: by mail-lj1-x242.google.com with SMTP id j1so15344066lja.2 for ; Wed, 25 Dec 2019 03:56:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=bNjs2HUU56KM7kmDPHbEdYcY20eoRdyRKYasVNZVZnw=; b=ProZdKCOjcKF3AeEbOFac2t6MgYi4BZxyeoiOYK5HugVrtdd+T3IL/s4bZV+D2h7tC +/hpAZbw+N/QJVjy0dZfVMGtAWKsKJg6+VczEJpFzuBRqxdbui1vKuRuid2/Gh44Tn/Z oLGP7SHgFYZX+E9M33giS7ivyh+Kw09NYsPz9GBV1u2vOmMcgsNwTGHli4zuCPRjr3+6 064Q4Tir4hAd+eS31Twa/pFYvywkHYc1l86FS1x1/qPSmoRx5fac7yMuVQhrImE95wSq rV30hyfsvvAjg+A/EHA3H7Nw3WYo7HXyrcj8jdPgcCtwpsvIraUscOS3KCjxgAKCEE1c cHEQ== 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=bNjs2HUU56KM7kmDPHbEdYcY20eoRdyRKYasVNZVZnw=; b=nSzbJwIX8xnV+AfgcC9QqoFcHIPiQo6ahAGeOyBjWGVcZLpJV9ebsvB8r82XnurZKK dsXhdsXwEoQGTv1E3T2JNvtuTukGqPqov/xQZAkcuy+GBDwWe1K4i9jvwkcy3AVy3Nfd 7TFvA7Svsrj9Otp5RtV8AZfUi4/Is3t82DpHOXRs7YKbJ9HCzRa3H+rspYZv1Cens8j4 0aAAvKgOGpfQEQQjaBL1C1nMSojs9GSL7Rybo4rwtapxJFhBo7Ve5ZjZy7i7l6CDEMTS XePIxe/MTO54Wnb/T33bhtd9tFarMxJz6KsnBcck3a0kfsiA07u7DkGCT7kftpf5msDZ kz9g== X-Gm-Message-State: APjAAAWwzyEndltuRa9bOHJ5nia9gRyQgKmtGaSWUsd/aBEr4w2SthWr KrhHyLMcLMPSbMfno1mgM+aQnw== X-Google-Smtp-Source: APXvYqyvf/Xmi0yk4+d2WZaUm7G87iU7YKMLBHEyDTSJZS3G7cOy4N9ogJHiqGpV6JMAxD0l6k/MEA== X-Received: by 2002:a2e:8544:: with SMTP id u4mr21457150ljj.70.1577274983013; Wed, 25 Dec 2019 03:56:23 -0800 (PST) Received: from localhost.bredbandsbolaget (c-21cd225c.014-348-6c756e10.bbcust.telenor.se. [92.34.205.33]) by smtp.gmail.com with ESMTPSA id o19sm13544465lji.54.2019.12.25.03.56.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 25 Dec 2019 03:56:21 -0800 (PST) From: Linus Walleij To: dri-devel@lists.freedesktop.org, Maarten Lankhorst , Maxime Ripard , Sean Paul Subject: [PATCH 2/2] drm/panel: Add driver for Novatek NT35510-based panels Date: Wed, 25 Dec 2019 12:56:10 +0100 Message-Id: <20191225115610.14518-2-linus.walleij@linaro.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20191225115610.14518-1-linus.walleij@linaro.org> References: <20191225115610.14518-1-linus.walleij@linaro.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191225_035626_114728_827C3E93 X-CRM114-Status: GOOD ( 23.29 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2a00:1450:4864:20:0:0:0:242 listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Linus Walleij , Stephan Gerhold , linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org This adds a driver for panels based on the Novatek NT35510 display driver IC, such as the Hydis HVA40WV1 panel found in the Samsung GT-S7710. The NT35510 can be used with both internal and external backlight (such as GPIO backlight) so we support both: if no external backlight is found, we register a subdriver for the internal backlight. Cc: Stephan Gerhold Signed-off-by: Linus Walleij --- MAINTAINERS | 7 + drivers/gpu/drm/panel/Kconfig | 11 + drivers/gpu/drm/panel/Makefile | 1 + drivers/gpu/drm/panel/panel-novatek-nt35510.c | 1126 +++++++++++++++++ 4 files changed, 1145 insertions(+) create mode 100644 drivers/gpu/drm/panel/panel-novatek-nt35510.c diff --git a/MAINTAINERS b/MAINTAINERS index e6db3889cb19..1372b4139ebd 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -5244,6 +5244,13 @@ F: drivers/gpu/drm/msm/ F: include/uapi/drm/msm_drm.h F: Documentation/devicetree/bindings/display/msm/ +DRM DRIVER FOR NOVATEK NT35510 PANELS +M: Linus Walleij +T: git git://anongit.freedesktop.org/drm/drm-misc +S: Maintained +F: drivers/gpu/drm/panel/panel-novatek-nt35510* +F: Documentation/devicetree/bindings/display/panel/novatek-nt35510.yaml + DRM DRIVER FOR NVIDIA GEFORCE/QUADRO GPUS M: Ben Skeggs L: dri-devel@lists.freedesktop.org diff --git a/drivers/gpu/drm/panel/Kconfig b/drivers/gpu/drm/panel/Kconfig index 46e3c931e5d9..620a0fd1e816 100644 --- a/drivers/gpu/drm/panel/Kconfig +++ b/drivers/gpu/drm/panel/Kconfig @@ -127,6 +127,17 @@ config DRM_PANEL_NEC_NL8048HL11 panel (found on the Zoom2/3/3630 SDP boards). To compile this driver as a module, choose M here. +config DRM_PANEL_NOVATEK_NT35510 + tristate "Novatek NT35510 RGB panel driver" + depends on OF + depends on DRM_MIPI_DSI + depends on BACKLIGHT_CLASS_DEVICE + select VIDEOMODE_HELPERS + help + Say Y here if you want to enable support for the panels built + around the Novatek NT35510 display controller, such as some + Hydis panels. + config DRM_PANEL_NOVATEK_NT39016 tristate "Novatek NT39016 RGB/SPI panel" depends on OF && SPI diff --git a/drivers/gpu/drm/panel/Makefile b/drivers/gpu/drm/panel/Makefile index 0e5bd44601c7..304261196eab 100644 --- a/drivers/gpu/drm/panel/Makefile +++ b/drivers/gpu/drm/panel/Makefile @@ -11,6 +11,7 @@ obj-$(CONFIG_DRM_PANEL_KINGDISPLAY_KD097D04) += panel-kingdisplay-kd097d04.o obj-$(CONFIG_DRM_PANEL_LG_LB035Q02) += panel-lg-lb035q02.o obj-$(CONFIG_DRM_PANEL_LG_LG4573) += panel-lg-lg4573.o obj-$(CONFIG_DRM_PANEL_NEC_NL8048HL11) += panel-nec-nl8048hl11.o +obj-$(CONFIG_DRM_PANEL_NOVATEK_NT35510) += panel-novatek-nt35510.o obj-$(CONFIG_DRM_PANEL_NOVATEK_NT39016) += panel-novatek-nt39016.o obj-$(CONFIG_DRM_PANEL_OLIMEX_LCD_OLINUXINO) += panel-olimex-lcd-olinuxino.o obj-$(CONFIG_DRM_PANEL_ORISETECH_OTM8009A) += panel-orisetech-otm8009a.o diff --git a/drivers/gpu/drm/panel/panel-novatek-nt35510.c b/drivers/gpu/drm/panel/panel-novatek-nt35510.c new file mode 100644 index 000000000000..b312a8848c25 --- /dev/null +++ b/drivers/gpu/drm/panel/panel-novatek-nt35510.c @@ -0,0 +1,1126 @@ +// SPDX-License-Identifier: GPL-2.0-only +/* + * Novatek NT35510 panel driver + * Copyright (C) 2019 Linus Walleij + * Based on code by Robert Teather (C) 2012 Samsung + * + * This display driver (and I refer to the physical component NT35510, + * not this Linux kernel software driver) can handle: + * 480x864, 480x854, 480x800, 480x720 and 480x640 pixel displays. + * It has 480x840x24bit SRAM embedded for storing a frame. + * When powered on the display is by default in 480x800 mode. + * + * The actual panels using this component have different names, but + * the code needed to set up and configure the panel will be similar, + * so they should all use the NT35510 driver with appropriate configuration + * per-panel, e.g. for physical size. + * + * This driver is for the DSI interface to panels using the NT35510. + * + * The NT35510 can also use an RGB (DPI) interface combined with an + * I2C or SPI interface for setting up the NT35510. If this is needed I + * this panel driver should be refactored to also support that use + * case. + */ +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +#include