From patchwork Mon Jul 27 07:43:47 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sumit Semwal X-Patchwork-Id: 11686497 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 B31E7138C for ; Mon, 27 Jul 2020 07:44:06 +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 9044620738 for ; Mon, 27 Jul 2020 07:44:06 +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="qur/Atmd" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9044620738 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 E5C4189C28; Mon, 27 Jul 2020 07:44:04 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-pg1-x544.google.com (mail-pg1-x544.google.com [IPv6:2607:f8b0:4864:20::544]) by gabe.freedesktop.org (Postfix) with ESMTPS id 4ABEC89C28 for ; Mon, 27 Jul 2020 07:44:03 +0000 (UTC) Received: by mail-pg1-x544.google.com with SMTP id o13so8989914pgf.0 for ; Mon, 27 Jul 2020 00:44:03 -0700 (PDT) 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=5US/XCWACBZUG+u/wcd8ufH/ZA+g/IaYFSks30i6g9k=; b=qur/AtmdKo9Z1/6syLwN1Bs4Sm/0w7BycwiIZCY7HuB+hYitWI7TQ8VkabtUNI47M/ 29JN1tJWNYx+YxEysZUSk7IW1ZJlGbD9Y+yD1pR4biouLN2Rgnw9LfDEja2iMYVkyCgT yZ/d/pZGG8Mcqy6Ki+qZBMYfcZc0+vmoTzIRvAG7jJs9FZk7wUpEIh5fU+gIpDRoqJNl y8F1anTTNJ6r6hyPdW5JNd6JfWtEle2hAkZLUteWrM+AN2Vd/94lXUquyxFVmQxLl+cE L4xu9F/uvyrIwP131jddQKfXgyD9Ix8VNsH3b6wUbBNMmzxO0zIxXBJ6+GTo0B3/ydWD Y2tw== 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=5US/XCWACBZUG+u/wcd8ufH/ZA+g/IaYFSks30i6g9k=; b=jv1gn+cDdK1zStWT1TwypMpab7GGgJDaXSKe5kVS0LQzfg45CXhL116HE/F2v1JtVP PfqJcIdQKG8Q7bsN2NLipTk8zKL5nRds02uLizpTL2QZajIKTq34y9h+a2ah3cSemz0l k4NzCrW7GRFuaVrf0wmh16KrBXnvnrM/3cZKLHA0R5ZcEHAbdmVyKIW2sBktmWZNiDUa RJaep6nHIjsghDWDXcK3awATaENCpiTQDq2P685StOM9cTYp3L6rJ42iAJOoH3Dw2Ljv lCbi6ODIzgh1pbDDT0c9Ei8KsqoNZn0ogvqy+YWjCO5xNeaZYIbDT6Flj0GsEzr3gx9J 7cvw== X-Gm-Message-State: AOAM5318Rh8FjdKrZ6alJSsH1+E0ZF/UGJGOoNyEhVa8WRl0Qq5HwDRB 8VERZNlGZ8d2/y5EobQVm4s/YTUIbg4= X-Google-Smtp-Source: ABdhPJzMXwH+bJlvAoqfT0h/bFkfqXsia+jQnXAdIqrualZwu256Gdg7aSGAbhqMTbYCq6zWUmBiug== X-Received: by 2002:a62:7991:: with SMTP id u139mr18349947pfc.87.1595835842812; Mon, 27 Jul 2020 00:44:02 -0700 (PDT) Received: from nagraj.local ([49.206.21.239]) by smtp.gmail.com with ESMTPSA id n22sm13062152pjq.25.2020.07.27.00.43.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Jul 2020 00:44:01 -0700 (PDT) From: Sumit Semwal To: Thierry Reding , Sam Ravnborg , Rob Herring Subject: [PATCH v3 1/2] dt-bindings: display: panel: Add bindings for Tianma nt36672a panel Date: Mon, 27 Jul 2020 13:13:47 +0530 Message-Id: <20200727074348.26116-2-sumit.semwal@linaro.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200727074348.26116-1-sumit.semwal@linaro.org> References: <20200727074348.26116-1-sumit.semwal@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: devicetree@vger.kernel.org, David Airlie , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, Bjorn Andersson , Mauro Carvalho Chehab , "David S . Miller" Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" The nt36672a panel from Tianma is a FHD+ panel with a resolution of 1080x2246 and 6.18 inches size. It is found in some of the Poco F1 phones. Signed-off-by: Sumit Semwal Reviewed-by: Rob Herring --- v2: remove ports node, making port@0 directly under panel@0 node. v3: updated to replace port@0 to just 'port'. --- .../display/panel/tianma,nt36672a.yaml | 95 +++++++++++++++++++ 1 file changed, 95 insertions(+) create mode 100644 Documentation/devicetree/bindings/display/panel/tianma,nt36672a.yaml diff --git a/Documentation/devicetree/bindings/display/panel/tianma,nt36672a.yaml b/Documentation/devicetree/bindings/display/panel/tianma,nt36672a.yaml new file mode 100644 index 000000000000..03dc323332a5 --- /dev/null +++ b/Documentation/devicetree/bindings/display/panel/tianma,nt36672a.yaml @@ -0,0 +1,95 @@ +# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/display/panel/tianma,nt36672a.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Tianma model NT36672A DSI Panel display driver + +maintainers: + - Sumit Semwal + +description: | + The nt36672a panel from Tianma is a FHD+ LCD display panel with a resolution + of 1080x2246. It is a video mode DSI panel. + +allOf: + - $ref: panel-common.yaml# + +properties: + compatible: + const: tianma,nt36672a + + reg: + description: DSI virtual channel of the peripheral + + reset-gpios: + description: phandle of gpio for reset line - This should be 8mA, gpio + can be configured using mux, pinctrl, pinctrl-names (active high) + + vddio-supply: + description: phandle of the regulator that provides the supply voltage + Power IC supply + + vddpos-supply: + description: phandle of the positive boost supply regulator + + vddneg-supply: + description: phandle of the negative boost supply regulator + + pinctrl-names: + description: Pinctrl for panel active and suspend + + pinctrl-0: + description: Active pinctrls + + pinctrl-1: + description: Suspend pinctrls + + port: true + +required: + - compatible + - reg + - vddi0-supply + - vddpos-supply + - vddneg-supply + - reset-gpios + - pinctrl-names + - pinctrl-0 + - pinctrl-1 + - port + +unevaluatedProperties: false + +examples: + - |+ + #include + dsi0 { + #address-cells = <1>; + #size-cells = <0>; + + panel@0 { + compatible = "tianma,nt36672a"; + reg = <0>; + vddi0-supply = <&vreg_l14a_1p88>; + vddpos-supply = <&lab>; + vddneg-supply = <&ibb>; + + reset-gpios = <&tlmm 6 GPIO_ACTIVE_HIGH>; + + pinctrl-names = "panel_active", "panel_suspend"; + pinctrl-0 = <&sde_dsi_active>; + pinctrl-1 = <&sde_dsi_suspend>; + + #address-cells = <1>; + #size-cells = <0>; + port { + tianma_nt36672a_in_0: endpoint { + remote-endpoint = <&dsi0_out>; + }; + }; + }; + }; + +... From patchwork Mon Jul 27 07:43:48 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sumit Semwal X-Patchwork-Id: 11686499 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 AEEFF722 for ; Mon, 27 Jul 2020 07:44:11 +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 8BDE02072E for ; Mon, 27 Jul 2020 07:44:11 +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="V3iN6l/h" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8BDE02072E 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 2E15989D00; Mon, 27 Jul 2020 07:44:10 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-pg1-x543.google.com (mail-pg1-x543.google.com [IPv6:2607:f8b0:4864:20::543]) by gabe.freedesktop.org (Postfix) with ESMTPS id E662A89CFA for ; Mon, 27 Jul 2020 07:44:07 +0000 (UTC) Received: by mail-pg1-x543.google.com with SMTP id k27so8976882pgm.2 for ; Mon, 27 Jul 2020 00:44:07 -0700 (PDT) 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=P0AUpy2ZdCxQk1OnnLHB9v9HjjMoSPNb/b3Tq/gh12k=; b=V3iN6l/harTN4h3DbAFsSaO+REmiLVeUw6BjAnWTdFO7CBkiNZ1TGrJ3p26vUN/+YN RVGJreFZ55oKdG7zS5b6IMeVc/Mhm+sLxgx8VKyNGz2HrmDsBtBcrfw24RqFON71yelU X+UG4LZpc8hZuhj+a9Tc2iCqIlTBZVdAG+QDSbyTzUw2Uv042Y1aqxNyryo6OeAUhE5/ IqAQq6ST91CVPAnYmoYrHaTFNLuQJWb1NHLhQSEiuLI9mhWWK2u7DQ2j/Hh70iPGuMBy YJDBuesSzQIL8HNTaouH1L5lkByNmXB/grQH0gjl6Qmv+Al/tjPwsvHKZ10I6mz9gnwF NjLQ== 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=P0AUpy2ZdCxQk1OnnLHB9v9HjjMoSPNb/b3Tq/gh12k=; b=YLvCVfQyYlT1nesW38CA8QdeAy9UfjJFmFbaWxbdbTt6JeIVx5p9sxVDUwTzOL79mQ xiwzILhkzevAn0krHM0rV0j/5vAM41ms5kCnwR1gXx8mYqnksKgmprwvoo+mzwet6ugh q3iupdl8D9ST3arCx1aNGob1P2ObLtSS/X8Kp2iSU5XP60He4X5TssogaQbTWONi2pX6 7dMGj9XJDSL/Nd2qdsD85y7vLFNARPTVmw34z7/0HyCtzLVSs9q/6hB4tbordz3HG1TD 1PPkTNF7RfP95kOP0yf2YEXOTjPyCctWKcxGctkgxze5xPUora0Z70PfarTUexM9DMT4 Urpw== X-Gm-Message-State: AOAM531/r3c8lqxDNIw0zoxtsUqSUWE/KN+Zf/ZTlWDx+0Icw1YPOiYm 1SVFRmNYndUn+cObsfYOO69GQg== X-Google-Smtp-Source: ABdhPJz9h3OWeZxKW4SUcZGkE5dbrohJHJwM6actqYk6qZW4TjBCPyE6tn54KG/27E+L16kdh579yw== X-Received: by 2002:aa7:8f2a:: with SMTP id y10mr18523587pfr.182.1595835847260; Mon, 27 Jul 2020 00:44:07 -0700 (PDT) Received: from nagraj.local ([49.206.21.239]) by smtp.gmail.com with ESMTPSA id n22sm13062152pjq.25.2020.07.27.00.44.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Jul 2020 00:44:06 -0700 (PDT) From: Sumit Semwal To: Thierry Reding , Sam Ravnborg , Rob Herring Subject: [PATCH v3 2/2] drm: panel: Add tianma nt36672a panel driver Date: Mon, 27 Jul 2020 13:13:48 +0530 Message-Id: <20200727074348.26116-3-sumit.semwal@linaro.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200727074348.26116-1-sumit.semwal@linaro.org> References: <20200727074348.26116-1-sumit.semwal@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: devicetree@vger.kernel.org, David Airlie , Benni Steini , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, Bjorn Andersson , Mauro Carvalho Chehab , "David S . Miller" Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Some Poco F1 phones have an LCD panel from Tianma, model nt36672a, with a resolution of 1080x2246 that operates in DSI video mode. Add the drm panel driver for it. During testing, Benni Steini helped us fix the reset sequence timing (from 10ms to 20ms), to get the bootanimation to work on Android. With current AOSP, we need to increase it to 200ms - this seems to be a safe high value to avoid a white screen occasionally. Signed-off-by: Sumit Semwal Cc: Benni Steini --- v2: increase reset sequence timing to a safe 200ms --- MAINTAINERS | 7 + drivers/gpu/drm/panel/Kconfig | 11 + drivers/gpu/drm/panel/Makefile | 1 + drivers/gpu/drm/panel/panel-tianma-nt36672a.c | 859 ++++++++++++++++++ 4 files changed, 878 insertions(+) create mode 100644 drivers/gpu/drm/panel/panel-tianma-nt36672a.c diff --git a/MAINTAINERS b/MAINTAINERS index b4a43a9e7fbc..2d384e51353b 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -5544,6 +5544,13 @@ T: git git://anongit.freedesktop.org/drm/drm-misc F: Documentation/devicetree/bindings/display/ste,mcde.txt F: drivers/gpu/drm/mcde/ +DRM DRIVER FOR TIANMA NT36672A PANELS +M: Sumit Semwal +S: Maintained +T: git git://anongit.freedesktop.org/drm/drm-misc +F: Documentation/devicetree/bindings/display/panel/tianma,nt36672a-panel.yaml +F: drivers/gpu/drm/panel/panel-tianma-nt36672a.c + DRM DRIVER FOR TDFX VIDEO CARDS S: Orphan / Obsolete F: drivers/gpu/drm/tdfx/ diff --git a/drivers/gpu/drm/panel/Kconfig b/drivers/gpu/drm/panel/Kconfig index 39055c1f0e2f..da9d74c1ec91 100644 --- a/drivers/gpu/drm/panel/Kconfig +++ b/drivers/gpu/drm/panel/Kconfig @@ -437,6 +437,17 @@ config DRM_PANEL_TPO_TD043MTEA1 Say Y here if you want to enable support for TPO TD043MTEA1 800x480 4.3" panel (found on the OMAP3 Pandora board). +config DRM_PANEL_TIANMA_FHD_NT36672A + tristate "TIANMA NT36672A 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 Tianma NT36672A + panel. It is seen mostly in Xiaomi Poco F1 mobile phone. + The panel has a 1080x2246 resolution and uses 24 bit RGB per pixel. + It provides a MIPI DSI interface to the host. + config DRM_PANEL_TPO_TPG110 tristate "TPO TPG 800x400 panel" depends on OF && SPI && GPIOLIB diff --git a/drivers/gpu/drm/panel/Makefile b/drivers/gpu/drm/panel/Makefile index de74f282c433..303e44eb50fa 100644 --- a/drivers/gpu/drm/panel/Makefile +++ b/drivers/gpu/drm/panel/Makefile @@ -44,6 +44,7 @@ obj-$(CONFIG_DRM_PANEL_SITRONIX_ST7701) += panel-sitronix-st7701.o obj-$(CONFIG_DRM_PANEL_SITRONIX_ST7789V) += panel-sitronix-st7789v.o obj-$(CONFIG_DRM_PANEL_SONY_ACX424AKP) += panel-sony-acx424akp.o obj-$(CONFIG_DRM_PANEL_SONY_ACX565AKM) += panel-sony-acx565akm.o +obj-$(CONFIG_DRM_PANEL_TIANMA_FHD_NT36672A) += panel-tianma-nt36672a.o obj-$(CONFIG_DRM_PANEL_TPO_TD028TTEC1) += panel-tpo-td028ttec1.o obj-$(CONFIG_DRM_PANEL_TPO_TD043MTEA1) += panel-tpo-td043mtea1.o obj-$(CONFIG_DRM_PANEL_TPO_TPG110) += panel-tpo-tpg110.o diff --git a/drivers/gpu/drm/panel/panel-tianma-nt36672a.c b/drivers/gpu/drm/panel/panel-tianma-nt36672a.c new file mode 100644 index 000000000000..07e8461b8893 --- /dev/null +++ b/drivers/gpu/drm/panel/panel-tianma-nt36672a.c @@ -0,0 +1,859 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* + * Copyright (C) 2020 Linaro Ltd + * Author: Sumit Semwal + */ + +#include +#include +#include +#include +#include + +#include +#include +#include + +#include +#include +#include +#include +#include + +#include