From patchwork Fri Jul 8 02:18:23 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Molly Sophia X-Patchwork-Id: 588936 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 D4EDECCA480 for ; Fri, 8 Jul 2022 02:19:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237046AbiGHCTV (ORCPT ); Thu, 7 Jul 2022 22:19:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51098 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236929AbiGHCTN (ORCPT ); Thu, 7 Jul 2022 22:19:13 -0400 Received: from mail-pg1-x52c.google.com (mail-pg1-x52c.google.com [IPv6:2607:f8b0:4864:20::52c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B91B374359; Thu, 7 Jul 2022 19:19:10 -0700 (PDT) Received: by mail-pg1-x52c.google.com with SMTP id r22so14295244pgr.2; Thu, 07 Jul 2022 19:19:10 -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=iz8bT7YPyUHTObGNpxtkrlymFcuBRN0N5+wdic9C3L4=; b=ErDmXgWeDdEjMB2VNmjqOaa4/jUh3dGZ5HXosNEIxuhRK0oU1H3Ro90xbw7VtmUNyo Bw3qJ3WIWKDz4yET0Pt3QA9OqDhEFixUwvEALg/zYwrifGUxclXQm6xPqoyRlF8dWbpV JwvC78kTkatErLKsBb4tcCA8ncEpZNKuduZ8nVlA5au7tDOOSXFmtRMpqnnZ78jf0vJ4 2drLOy5lguEP3FshINoAxYIW/QcKoxIgHwe2Z+XxyjYYtchdtcDZT+bgNJZJ5hkTpdD4 1mHFHvuWU6akdPTt6fhFZsX+hrcTSWRURkB1wVKa3BBv0TIwBqHYIiyzCdngTSsCB7bB vQiA== 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=iz8bT7YPyUHTObGNpxtkrlymFcuBRN0N5+wdic9C3L4=; b=RCkw2YM5OZDg4xhRai0h+jeBWwjoIM7boBDvHXle5KD2X6d1AswKNlhJ42wEUAJTU6 m9TSKCNQwOtkjt6STeMtCpOYydwYP6w/B50yJwW4KRlYkrm5PIshXBwACJUQGTUK2uGc xvKImxPsSmANcDmZxsemCmL7FWwkxKRsz4jmSwvPv96ZAu35WAwdIspKd39OxOAJv0sd 3BVN0ihxSphhuzjz+7jYwz3w0ghqooEG5qfdbZQmJVzjSTNDoefzxFQ6122ZKbiEfPY/ 5Jyvipz8pVuAFBdWJme2E3T/n3L3kSXwGfnDfz3VeBVoV9V7Ivy7oqMWcd/gPHKzitc2 JW/A== X-Gm-Message-State: AJIora9I/b+U4N6YxC80EptuDWY6RHxabJg6YS1/bVJ5i6E3jxTaZJNn ov2l/srTSjOZP4ihYn71YJc= X-Google-Smtp-Source: AGRyM1ubhSI5/BHz9dGe77c+348d794iAywC6TQWQo9x+N7/BgNKuoYXwi2eurd2NY73KDIwXYnvTg== X-Received: by 2002:a63:69c3:0:b0:411:9d19:ff13 with SMTP id e186-20020a6369c3000000b004119d19ff13mr1137416pgc.34.1657246750285; Thu, 07 Jul 2022 19:19:10 -0700 (PDT) Received: from localhost.localdomain ([112.0.189.16]) by smtp.gmail.com with ESMTPSA id c17-20020a170902d49100b0015e8d4eb1dbsm12678820plg.37.2022.07.07.19.19.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Jul 2022 19:19:09 -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] drm: panel: Add novatek nt35596s panel driver Date: Fri, 8 Jul 2022 10:18:23 +0800 Message-Id: <20220708021824.9167-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 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 | 464 ++++++++++++++++++ 3 files changed, 474 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..a54389c107bc 100644 --- a/drivers/gpu/drm/panel/Kconfig +++ b/drivers/gpu/drm/panel/Kconfig @@ -231,6 +231,15 @@ config DRM_PANEL_JDI_R63452 Say Y here if you want to enable support for the JDI R63452 DSI command mode panel as found in Xiaomi Mi 5 Devices. +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_KHADAS_TS050 tristate "Khadas TS050 panel" depends on OF diff --git a/drivers/gpu/drm/panel/Makefile b/drivers/gpu/drm/panel/Makefile index ef89dada021d..40db5e6dcbf5 100644 --- a/drivers/gpu/drm/panel/Makefile +++ b/drivers/gpu/drm/panel/Makefile @@ -21,6 +21,7 @@ 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_R63452) += panel-jdi-fhd-r63452.o +obj-$(CONFIG_DRM_PANEL_JDI_NT35596S) += panel-jdi-fhd-nt35596s.o obj-$(CONFIG_DRM_PANEL_KHADAS_TS050) += panel-khadas-ts050.o obj-$(CONFIG_DRM_PANEL_KINGDISPLAY_KD097D04) += panel-kingdisplay-kd097d04.o obj-$(CONFIG_DRM_PANEL_LEADTEK_LTK050H3146W) += panel-leadtek-ltk050h3146w.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..0793bcd872e2 --- /dev/null +++ b/drivers/gpu/drm/panel/panel-jdi-fhd-nt35596s.c @@ -0,0 +1,464 @@ +// SPDX-License-Identifier: GPL-2.0-only +/* + * Copyright (c) 2022 Molly Sophia + * + */ + +#include +#include +#include +#include +#include +#include +#include +#include + +#include