From patchwork Sat Jul 9 14:11:35 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Molly Sophia X-Patchwork-Id: 588910 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id D0DA4C433EF for ; Sat, 9 Jul 2022 14:11:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229573AbiGIOLu (ORCPT ); Sat, 9 Jul 2022 10:11:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43408 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229491AbiGIOLt (ORCPT ); Sat, 9 Jul 2022 10:11:49 -0400 Received: from mail-pj1-x102e.google.com (mail-pj1-x102e.google.com [IPv6:2607:f8b0:4864:20::102e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C085113F57; Sat, 9 Jul 2022 07:11:48 -0700 (PDT) Received: by mail-pj1-x102e.google.com with SMTP id o31-20020a17090a0a2200b001ef7bd037bbso1110066pjo.0; Sat, 09 Jul 2022 07:11:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=KllOWvu7e5SrcZMDE7g9T24hEywTIkk+v5p3DscJSVk=; b=URNmP3umu2PBlR0Jiq2x+70Gh+/snbyMaDhjDqYXTKpUbuT+iZ7a8v0Pr87jT5ljya mqGLESW71MJTMggzoFhVtAoSqiRB9CXcSxCalKUDDBQiTZiOG+kp+HJH+30PKfIXJ4P1 rgPRmSMUxKYKgoQlLBJwEF0X0m5tDuU0J51tXReFYssdd+9DkCZPulPaaKmq9yU4fniC UVldYMoBotVX1vPCVSVySqpkaeWjybRfrdQh1m7gu/OWozZzrWH0zF6UqhVvKnljHidX FLOAT0j+rk+03varPvOLd+QWaXdGZ79R+LqA0JTY4jcYgPtLkTY6Px20CDGrSRHAoIh2 mVqA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=KllOWvu7e5SrcZMDE7g9T24hEywTIkk+v5p3DscJSVk=; b=0MMh2IRpxUB8m+hsU+YHnflJ5V5RTUUu/qc+7X8kVs42r7t7i9iGHeTQv3Ohm69yDL 9pHdh4RMmZaOTMyMRKg+JuFsffAVn95LNZmIg1Oxr3xd4Y6y8aepKpFm/zHD40EdfX1x 2EVs9bN7MFGqRR0h20s6Pi1bFKIjqvn8S48FrBHlpUnZk5YHapfGUOSOrMNGRvGKiNGN SclS6L+vhCYTl7YbUorsBN7BJLQVIfMiRTEZweEu9Y4f7AgcNwKE5DJyjv2I8jnPrs2d IKmTtBsZ6Sp0eJB26loT0rFIwEhGL89qFpqdoiBwM20FYIogzoOj57OkATMoebCGYO3j wsPA== X-Gm-Message-State: AJIora+Eg49WHKrUIM+LyyGi0VoGe0VdLtI4W66MSmFbfh95kyGA4dGK T5MbQObfh0Hh2uV5cxktqt4= X-Google-Smtp-Source: AGRyM1veZswxyk5NCV2BlLrQOLUfYkf8tbPH2lK9NsCBmTlbFuxvkQULsL+YlEPBy6MIgc1Yp8h5/g== X-Received: by 2002:a17:902:c64b:b0:16b:d51a:dc24 with SMTP id s11-20020a170902c64b00b0016bd51adc24mr8822796pls.48.1657375908291; Sat, 09 Jul 2022 07:11:48 -0700 (PDT) Received: from localhost.localdomain ([112.0.189.16]) by smtp.gmail.com with ESMTPSA id e11-20020a056a0000cb00b0052974b651b9sm1529828pfj.38.2022.07.09.07.11.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 09 Jul 2022 07:11:47 -0700 (PDT) From: MollySophia To: Thierry Reding , Sam Ravnborg , David Airlie , Daniel Vetter , Rob Herring , Krzysztof Kozlowski , Molly Sophia , dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Cc: ~postmarketos/upstreaming@lists.sr.ht, phone-devel@vger.kernel.org, linux-arm-msm@vger.kernel.org Subject: [PATCH v2 1/2] dt-bindings: display: panel: Add Novatek NT35596S panel bindings Date: Sat, 9 Jul 2022 22:11:35 +0800 Message-Id: <20220709141136.58298-1-mollysophia379@gmail.com> X-Mailer: git-send-email 2.37.0 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org Add documentation for "novatek,nt35596s" panel. Signed-off-by: MollySophia --- .../display/panel/novatek,nt35596s.yaml | 83 +++++++++++++++++++ 1 file changed, 83 insertions(+) create mode 100644 Documentation/devicetree/bindings/display/panel/novatek,nt35596s.yaml diff --git a/Documentation/devicetree/bindings/display/panel/novatek,nt35596s.yaml b/Documentation/devicetree/bindings/display/panel/novatek,nt35596s.yaml new file mode 100644 index 000000000000..f724f101a6fd --- /dev/null +++ b/Documentation/devicetree/bindings/display/panel/novatek,nt35596s.yaml @@ -0,0 +1,83 @@ +# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/display/panel/novatek,nt35596s.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Novatek NT35596S based DSI display Panels + +maintainers: + - Molly Sophia + +description: | + The nt35596s IC from Novatek is a generic DSI Panel IC used to drive dsi + panels. + Right now, support is added only for a JDI FHD+ LCD display panel with a + resolution of 1080x2160. It is a video mode DSI panel. + +allOf: + - $ref: panel-common.yaml# + +properties: + compatible: + items: + - enum: + - jdi,fhd-nt35596s + - const: novatek,nt35596s + description: This indicates the panel manufacturer of the panel that is + in turn using the NT35596S panel driver. This compatible string + determines how the NT35596S panel driver is configured for the indicated + panel. The novatek,nt35596s compatible shall always be provided as a fallback. + + vddi0-supply: + description: regulator that provides the supply voltage + Power IC supply + + vddpos-supply: + description: positive boost supply regulator + + vddneg-supply: + description: negative boost supply regulator + + reg: true + port: true + backlight: true + +required: + - compatible + - reg + - vddi0-supply + - vddpos-supply + - vddneg-supply + - reset-gpios + - port + +additionalProperties: false + +examples: + - | + #include + + dsi { + #address-cells = <1>; + #size-cells = <0>; + + panel@0 { + compatible = "jdi,fhd-nt35596s", "novatek,nt35596s"; + reg = <0>; + vddi0-supply = <&vreg_l14a_1p88>; + vddpos-supply = <&lab>; + vddneg-supply = <&ibb>; + + backlight = <&pmi8998_wled>; + reset-gpios = <&tlmm 6 GPIO_ACTIVE_HIGH>; + + port { + jdi_nt35596s_in_0: endpoint { + remote-endpoint = <&dsi0_out>; + }; + }; + }; + }; + +... From patchwork Sat Jul 9 14:11:36 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Molly Sophia X-Patchwork-Id: 589220 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 73A0BC43334 for ; Sat, 9 Jul 2022 14:12:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229738AbiGIOL7 (ORCPT ); Sat, 9 Jul 2022 10:11:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43580 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229718AbiGIOL5 (ORCPT ); Sat, 9 Jul 2022 10:11:57 -0400 Received: from mail-pl1-x62d.google.com (mail-pl1-x62d.google.com [IPv6:2607:f8b0:4864:20::62d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 46BFE13F57; Sat, 9 Jul 2022 07:11:55 -0700 (PDT) Received: by mail-pl1-x62d.google.com with SMTP id m2so1036372plx.3; Sat, 09 Jul 2022 07:11:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=pdQ2fsEjyatgQ9vvMeEQJ3bDJK3UAe677Epc4PPFv8w=; b=CV0bMPQk8ItH4pkbeCBhmTjSl0iYuAyYokvXY9LZ/5uHlX/nyFD81/fnWh+A/HaTw7 nSMm29z5h2PATRAh+oO0H/1vMfrT0Gh8/nQ5vWGzg+Jsn+nOO14Qkg5TJ4bwE3sbSu6f sVIqFL8D2NX5Jogl1krSSdY9KprULH43P4MQmp6W1xfGDjVJb74SyYq6DmQadpbVX+H5 XiCYYWDG63Pb/3/ly/T4jhYJfuZ7vFqe1Gwb41PF2RWtihff3GOyYxd/1OUNM0917e8M BSvHkeZm70LrMnXMKvYSLQc7CjsS3kfpSNk2uf48cpNdtG7bU79VJBRN6kamRErW+QiB 78AA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=pdQ2fsEjyatgQ9vvMeEQJ3bDJK3UAe677Epc4PPFv8w=; b=YsYmXlLr3dkT6J65obZrL8jElCgR/kXDdicZ2nXLKFX2kQ/lMg8FMnYMWsSOpl4cBe xhtWfsFsNPb9Tf1aCuaqYBZlSWJrT2Azq5kmT9wRjO83F7mz/qMTCXHGhEPFcD0jaZ+u HzsnZ/qRoeCN+yPdvPX4B6raGSvpkKePb1F9zp4fDf1X4iUNCYi3nwIgKhK/Opc8VKw2 B18YHVhtkb5iheWlPnxRVdI+aMaLbOoqYnemwYd3bAadvhVW1Jm6zCv24+auxSXis21T rN96Y4ciQqnGPNOoXVMDhkkYT9hdJ75k+Rlv1uVMkjiCrU3+IIKNU5ccsEdcLeQU0TTl 916Q== X-Gm-Message-State: AJIora8fxvD+8+wgyGuDh20YYNP5ZfFpOFBT/jzxYr2t2TJ8VXOrn9su ZMX/ZSJqABdg2PVnGeRPf9wvFAGhE1AmHA== X-Google-Smtp-Source: AGRyM1vCmh9u8Q/ANkSPukDU5Jbai8AHsPb3I8FAq37QmNzXcaLyoO5TWNqs+NWxGIxL2DYvz2UGIA== X-Received: by 2002:a17:902:7290:b0:16b:b6b5:7e6c with SMTP id d16-20020a170902729000b0016bb6b57e6cmr9387615pll.116.1657375914734; Sat, 09 Jul 2022 07:11:54 -0700 (PDT) Received: from localhost.localdomain ([112.0.189.16]) by smtp.gmail.com with ESMTPSA id e11-20020a056a0000cb00b0052974b651b9sm1529828pfj.38.2022.07.09.07.11.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 09 Jul 2022 07:11:54 -0700 (PDT) From: MollySophia To: Thierry Reding , Sam Ravnborg , David Airlie , Daniel Vetter , Rob Herring , Krzysztof Kozlowski , Molly Sophia , dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Cc: ~postmarketos/upstreaming@lists.sr.ht, phone-devel@vger.kernel.org, linux-arm-msm@vger.kernel.org Subject: [PATCH v2 2/2] drm: panel: Add novatek nt35596s panel driver Date: Sat, 9 Jul 2022 22:11:36 +0800 Message-Id: <20220709141136.58298-2-mollysophia379@gmail.com> X-Mailer: git-send-email 2.37.0 In-Reply-To: <20220709141136.58298-1-mollysophia379@gmail.com> References: <20220709141136.58298-1-mollysophia379@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org Novatek NT35596s is a generic DSI IC that drives command and video mode panels. Add the driver for it. Currently add support for the LCD panel from JDI connected with this IC, as found on Xiaomi Mi Mix2s phones. Signed-off-by: MollySophia --- drivers/gpu/drm/panel/Kconfig | 9 + drivers/gpu/drm/panel/Makefile | 1 + .../gpu/drm/panel/panel-jdi-fhd-nt35596s.c | 465 ++++++++++++++++++ 3 files changed, 475 insertions(+) create mode 100644 drivers/gpu/drm/panel/panel-jdi-fhd-nt35596s.c diff --git a/drivers/gpu/drm/panel/Kconfig b/drivers/gpu/drm/panel/Kconfig index d5176f75248f..54e705813f98 100644 --- a/drivers/gpu/drm/panel/Kconfig +++ b/drivers/gpu/drm/panel/Kconfig @@ -222,6 +222,15 @@ config DRM_PANEL_JDI_LT070ME05000 The panel has a 1200(RGB)×1920 (WUXGA) resolution and uses 24 bit per pixel. +config DRM_PANEL_JDI_NT35596S + tristate "JDI NT35596S Full HD DSI 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 JDI NT35596S + DSI video mode panel as found in Xiaomi Mi Mix2s Devices. + config DRM_PANEL_JDI_R63452 tristate "JDI R63452 Full HD DSI panel" depends on OF diff --git a/drivers/gpu/drm/panel/Makefile b/drivers/gpu/drm/panel/Makefile index ef89dada021d..a9f0ee7b9d41 100644 --- a/drivers/gpu/drm/panel/Makefile +++ b/drivers/gpu/drm/panel/Makefile @@ -20,6 +20,7 @@ obj-$(CONFIG_DRM_PANEL_INNOLUX_EJ030NA) += panel-innolux-ej030na.o obj-$(CONFIG_DRM_PANEL_INNOLUX_P079ZCA) += panel-innolux-p079zca.o obj-$(CONFIG_DRM_PANEL_INNOLUX_TD4328) += panel-innolux-td4328.o obj-$(CONFIG_DRM_PANEL_JDI_LT070ME05000) += panel-jdi-lt070me05000.o +obj-$(CONFIG_DRM_PANEL_JDI_NT35596S) += panel-jdi-fhd-nt35596s.o obj-$(CONFIG_DRM_PANEL_JDI_R63452) += panel-jdi-fhd-r63452.o obj-$(CONFIG_DRM_PANEL_KHADAS_TS050) += panel-khadas-ts050.o obj-$(CONFIG_DRM_PANEL_KINGDISPLAY_KD097D04) += panel-kingdisplay-kd097d04.o diff --git a/drivers/gpu/drm/panel/panel-jdi-fhd-nt35596s.c b/drivers/gpu/drm/panel/panel-jdi-fhd-nt35596s.c new file mode 100644 index 000000000000..c1bc991d4888 --- /dev/null +++ b/drivers/gpu/drm/panel/panel-jdi-fhd-nt35596s.c @@ -0,0 +1,465 @@ +// SPDX-License-Identifier: GPL-2.0-only +/* + * Copyright (c) 2022 Molly Sophia + * + */ + +#include +#include +#include +#include +#include +#include +#include +#include + +#include