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