From patchwork Wed Dec 25 11:56:09 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 11310155 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 CBE24921 for ; Wed, 25 Dec 2019 11:56:22 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (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 9D38A2073B for ; Wed, 25 Dec 2019 11:56:22 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="WTk1X7px" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9D38A2073B Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 69D8C89F99; Wed, 25 Dec 2019 11:56:19 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-lf1-x143.google.com (mail-lf1-x143.google.com [IPv6:2a00:1450:4864:20::143]) by gabe.freedesktop.org (Postfix) with ESMTPS id C134B89F99 for ; Wed, 25 Dec 2019 11:56:18 +0000 (UTC) Received: by mail-lf1-x143.google.com with SMTP id 203so16713054lfa.12 for ; Wed, 25 Dec 2019 03:56:18 -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:mime-version :content-transfer-encoding; bh=5mol6HJrMqqa1NJdam/PhpUhWyScfd+EBsQoCUp51Ik=; b=WTk1X7pxTyAFammbLNK7vRIMYYVvfw2Eotomu0eqpjnsMjM6g4FkkLRl4IxXW8ZpYR fK9mC6m6vj+Zg0SSU0vc10/4HHMzIRVynhqg5xy7lo2sTGztVriSHbEOSxi0BQZzZ9ui J1zC5SbiH2jVooIrPLRpLazyUpTeJ2zJho5KmqhuOc555fPlEz20jYN6a3fmNubU8dGT G4hN36M/p1pF+1ecdDwRrO9Mm4JSYSDs89wvm+i/+k66eV5uFvQBHp1GTyl1BxPIDFeB qV600Xn8gcOKap9ze+D82ZENpg25e0KHWQ09Ma6HSLmfJEBtZ3Vj1/GDpmfcD+VqP8KH JKNQ== 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=5mol6HJrMqqa1NJdam/PhpUhWyScfd+EBsQoCUp51Ik=; b=f0agyHQf/mir67mYeSVdLT6v89A1s6WD+F9Z1BuOH/2XGBg96mIobOXITaDc+0Kifp eC7fniGyz2B7oHM8CPARC691OdJJUVwiMvnAMj3Q+r0nD3V2QZtT32IbdwtOTo7ZvydU jEGvhwYVV0HogXuvM+v1RsZr2/bspShkQ3vNHjQBYRq+k7dW87eveGUcfDNO6TAiXzvs JAD/z1z0MexGFHMHltqHYf4qnUXGqjQAMTKmy5f6yS2yy0KVlN1SCrZ8IeAuhNfRhJ0X 8aaZZvJUqOvswEy0xRA1yGCbJG45533EFw0bwrecShZguHrALFW6fEPgkyR8WKVGx+QB Shyw== X-Gm-Message-State: APjAAAXLZqx8JvHy9YC7owHtL99/npkyh1rcxvCavxZKeL49exsfcpKz e9bNT8Wfg+gLD4nTcox2yFFap8bhscU= X-Google-Smtp-Source: APXvYqxsFWA2taLpUG5L1Aq/k8Pfzo9J+USCKy6bqVt61nncQ1kFP0NTXJYLubmK+nxbJwNTqEfwCQ== X-Received: by 2002:a19:dc14:: with SMTP id t20mr22945983lfg.47.1577274976625; Wed, 25 Dec 2019 03:56:16 -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.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 25 Dec 2019 03:56:15 -0800 (PST) From: Linus Walleij To: dri-devel@lists.freedesktop.org, Maarten Lankhorst , Maxime Ripard , Sean Paul Subject: [PATCH 1/2] drm/panel: Add DT bindings for Novatek NT35510-based panels Date: Wed, 25 Dec 2019 12:56:09 +0100 Message-Id: <20191225115610.14518-1-linus.walleij@linaro.org> X-Mailer: git-send-email 2.21.0 MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devicetree@vger.kernel.org, Stephan Gerhold , linux-arm-kernel@lists.infradead.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" This adds device tree bindings for the Novatek NT35510-based family of panels. Since several such panels are in existence we define bindings common for all, and define the compatible string for one certain panel (Hydis HVA40WV1). As other panels are discovered and investigated, we can add more compatibles to the binding. Cc: Stephan Gerhold Cc: devicetree@vger.kernel.org Signed-off-by: Linus Walleij --- .../display/panel/novatek-nt35510.yaml | 53 +++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 Documentation/devicetree/bindings/display/panel/novatek-nt35510.yaml diff --git a/Documentation/devicetree/bindings/display/panel/novatek-nt35510.yaml b/Documentation/devicetree/bindings/display/panel/novatek-nt35510.yaml new file mode 100644 index 000000000000..a4a6b5adf15b --- /dev/null +++ b/Documentation/devicetree/bindings/display/panel/novatek-nt35510.yaml @@ -0,0 +1,53 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/display/panel/novatek-nt35510.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Novatek NT35510-based display panels + +maintainers: + - Linus Walleij + +allOf: + - $ref: panel-common.yaml# + +properties: + compatible: + const: hydis,hva40wv1 + description: This indicates the panel manufacturer of the panel + that is in turn using the NT35510 panel driver. The compatible + string determines how the NT35510 panel driver shall be configured + to work with the indicated panel. + reg: true + reset-gpios: true + vdd-supply: + description: regulator that supplies the vdd voltage + vddi-supply: + description: regulator that supplies the vddi voltage + backlight: true + +required: + - compatible + - reg + +additionalProperties: false + +examples: + - | + #include + + dsi@a0351000 { + #address-cells = <1>; + #size-cells = <0>; + panel { + compatible = "hydis,hva40wv1"; + reg = <0>; + vdd-supply = <&ab8500_ldo_aux4_reg>; + vddi-supply = <&ab8500_ldo_aux6_reg>; + reset-gpios = <&gpio4 11 GPIO_ACTIVE_LOW>; + backlight = <&gpio_bl>; + }; + }; + +... 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: 11310159 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 C3FB914B7 for ; Wed, 25 Dec 2019 11:56:29 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (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 A24B22075B for ; Wed, 25 Dec 2019 11:56:29 +0000 (UTC) Authentication-Results: mail.kernel.org; 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 A24B22075B Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 16C6A6E210; Wed, 25 Dec 2019 11:56:28 +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 C34576E210 for ; Wed, 25 Dec 2019 11:56:25 +0000 (UTC) Received: by mail-lj1-x242.google.com with SMTP id y4so8362627ljj.9 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=Hn+c7HB0YSBZ+0FYHj0kAx2NQRyzx02bxeLSnJu72+m52OQ/iI6qsWLjTb50UJZQsN /9I/MTnTItiCVXR+KyrIJyS8F07DV+o57Ml8lsZyn87o5nmSUvJFV7X+pyLr2JZ7aYq6 u9RagRY/8+4aKxKKRBF4Gb5JNwQNhNZ3PJQhovCECqldn2Sjtyo9jzJGdRJjQP3gdRdu /K4W5tbMs0APCNgHNpxCG8mWj9uVve+TZdRFernkNQFSfM+IUkDXkkLtyE5LxsSRpgJp 52ojJFUFh56M47/LEFHTlwRzFOQZZQerSsHW3TlyjXA+j4dHlh0W9/b0jqRSqzU0h6Y4 LD8g== X-Gm-Message-State: APjAAAXFDHD95DP417cL0rrrawSkxPQTzYsSjOohxY/WCGpEChhqhZuu 1xt3G2jJX/VA7dP8+GT7KE45gqtiR2Y= 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-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Stephan Gerhold , linux-arm-kernel@lists.infradead.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" 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