From patchwork Sat Jul 9 14:04:22 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Molly Sophia X-Patchwork-Id: 588911 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 B1FD6CCA47F for ; Sat, 9 Jul 2022 14:05:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229693AbiGIOFV (ORCPT ); Sat, 9 Jul 2022 10:05:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39802 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229568AbiGIOFV (ORCPT ); Sat, 9 Jul 2022 10:05:21 -0400 Received: from mail-pl1-x62f.google.com (mail-pl1-x62f.google.com [IPv6:2607:f8b0:4864:20::62f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3774E11A16; Sat, 9 Jul 2022 07:05:20 -0700 (PDT) Received: by mail-pl1-x62f.google.com with SMTP id m14so1023541plg.5; Sat, 09 Jul 2022 07:05:20 -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=JsA5x/iG8WfSdh0tZ4dxUU7FBSlqz7y9N+fyrUGvUx1PBpFtSnrEp4ERs6Jaoa66S/ hUIz8pj5tFx8yO/37gDbwdggYTyQ5tFV9Do27iGNssX/cH4aTnns1acqDloV30TZmVJL 6QaeC6PvgTvfBCO4YCi0Cqt/rF0TVlUkoM9w/+dwgKMTLQrbEbI5sI85CwZbJbvFVFRn TbsnCoizLml9geh0H2VCtLar2IYNEID6BdEZTQCxb/0mMRIJfaiRxsfG480bCaN2iMBm W4HvAAR/r3yv+FsCX1IIoCqTgDUYtvHs9/4+p8GqI43OtkyEeaVDs5Bkrza/zL6Ag0VL HMrw== 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=FAWMVObRkfOso9Nf7ChFtL0YSvAr6rxpqKg8zBoiOJcfmLWtbpSf0ZdT/4tGOYXU2D geL5vf0dkqs+pqRxMFfd5Td/0r0zWgjXdPd4G/jNpXJO4Tf2lPTAuDA32ue5cfAcU/ZM HyhGjzrARgbq6km6Hjp36yxgBGsaOarDmllKCXhhAA78T7Lx1QLNESTY8Hcnf3WrIVqK MWmCbjzQG91Eyhct1fAMoojenIeQF/cCtm4MmILuea2H+vUVkzYjhlleCkLa1fNgGIz8 7FWpBk1GaSqV0UV0EvRBLfjYupeJZlsEJghLqdjOoXcjt4A9Zw9oJpwuP11N7VtFb1i7 8c+g== X-Gm-Message-State: AJIora+nwmLlhqY9SmITaLxpBELxFFYDNnC/FATil4IKzRyTJbVdpNk6 vLA4G6z4dI9SlqcfCxnZd17Hoal+NdJNWA== X-Google-Smtp-Source: AGRyM1t3NFjlPMMPhXryFmJ501+/qhG0UUibtr/WTQTP0ZMNGP5yM8uq3vKteLhBZfDmJf5cX7/JGQ== X-Received: by 2002:a17:90b:1c07:b0:1f0:2077:6a9 with SMTP id oc7-20020a17090b1c0700b001f0207706a9mr1014621pjb.90.1657375519336; Sat, 09 Jul 2022 07:05:19 -0700 (PDT) Received: from localhost.localdomain ([112.0.189.16]) by smtp.gmail.com with ESMTPSA id x16-20020aa79a50000000b00528baea5dacsm1496163pfj.201.2022.07.09.07.05.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 09 Jul 2022 07:05:18 -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 1/2] dt-bindings: display: panel: Add Novatek NT35596S panel bindings Date: Sat, 9 Jul 2022 22:04:22 +0800 Message-Id: <20220709140422.56851-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:04:23 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Molly Sophia X-Patchwork-Id: 589221 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 B52C2C433EF for ; Sat, 9 Jul 2022 14:05:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229568AbiGIOFm (ORCPT ); Sat, 9 Jul 2022 10:05:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40060 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229732AbiGIOFh (ORCPT ); Sat, 9 Jul 2022 10:05:37 -0400 Received: from mail-pf1-x431.google.com (mail-pf1-x431.google.com [IPv6:2607:f8b0:4864:20::431]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C4D6E11A16; Sat, 9 Jul 2022 07:05:35 -0700 (PDT) Received: by mail-pf1-x431.google.com with SMTP id b9so1277242pfp.10; Sat, 09 Jul 2022 07:05:35 -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=oId4vPxpw4k0YIft7TpiP83cfqSRhfWbqdlFDMvb0nVwY82SgCB3UZOfLK5hQQajzr EtEVlnnI7JImXU/BlI96bh7M32EV2pnjFBm8fMSVaMn8H6g4Ov8Wh7jJpTrHFNJd1uQo XSKaSMjdV/nl+jTQqHzytBVwbjBc79b+3vDLKxCnEOpAMjXmchPX2ywv7ggEkCaXwMOh imfAyewvaop1VmbakcIaVa6RZaFK4IeUAVqG10XRDk9D+yaCVsL0T4YFQLJ181Wkn6yg 7QCJ5YwqFHZXwKLYWGjNbxrj5ZcwzOpiZW4H3XqFqiPvI/LADY2cQjNLSa09m+AAA7H0 wB8A== 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=ltLj9c3K6IxE1+oGrICjxzO8htvF6HXRBkFnfSt7redVSjzgOD5j2I8v9DO+6JNj8X kCf5ygRXUFmzP18fyYe8jS2wbbr0ERWr3mBylacZqlxvfU4Zq75VX/IXX5HUhdvY716u 1H9WThaCGk9ePp/nKch50WPSPtb9ZU3tdgA+kSJcad+X4qwl2eZVSasMPqahpksuivlJ 2mNSsPng6O+OX4b6TZR+xVorSgqHFwVzCB2teArt1FlRR05tewYSL9EpaXt7wLrIcT3Q Qs74MXrh7I16OqnDH2Cbsd+0PbA5ukrPot5pACkJM5C7oWz6/NfI5P1wyHDvcptVBz32 kOTg== X-Gm-Message-State: AJIora8+++WejkpTA6wUDVkGpP+DEBHpRP/VhW3FhWwFRHfee/kC6OJI 2ujJDIiMK1DTth4e/NBv7snc2l5lY0XAUA== X-Google-Smtp-Source: AGRyM1tp5R8zKn2HWE1YkV4UMZP8wkjBHm6Em99pLvkmcDKT7vEZYIxlNjONUgijgA2vSyKur0SBjA== X-Received: by 2002:a05:6a00:198a:b0:525:8b3a:8965 with SMTP id d10-20020a056a00198a00b005258b3a8965mr9390353pfl.20.1657375535119; Sat, 09 Jul 2022 07:05:35 -0700 (PDT) Received: from localhost.localdomain ([112.0.189.16]) by smtp.gmail.com with ESMTPSA id x16-20020aa79a50000000b00528baea5dacsm1496163pfj.201.2022.07.09.07.05.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 09 Jul 2022 07:05:34 -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 2/2] drm: panel: Add novatek nt35596s panel driver Date: Sat, 9 Jul 2022 22:04:23 +0800 Message-Id: <20220709140422.56851-2-mollysophia379@gmail.com> X-Mailer: git-send-email 2.37.0 In-Reply-To: <20220709140422.56851-1-mollysophia379@gmail.com> References: <20220709140422.56851-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