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