From patchwork Sat Jun 1 08:45:26 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zhaoxiong Lv X-Patchwork-Id: 13682348 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 gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 6BF61C25B76 for ; Sat, 1 Jun 2024 08:46:47 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 6103610E0A9; Sat, 1 Jun 2024 08:46:46 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=huaqin-corp-partner-google-com.20230601.gappssmtp.com header.i=@huaqin-corp-partner-google-com.20230601.gappssmtp.com header.b="dy468gvT"; dkim-atps=neutral Received: from mail-pf1-f182.google.com (mail-pf1-f182.google.com [209.85.210.182]) by gabe.freedesktop.org (Postfix) with ESMTPS id F276710E09B for ; Sat, 1 Jun 2024 08:46:43 +0000 (UTC) Received: by mail-pf1-f182.google.com with SMTP id d2e1a72fcca58-70244776719so1301424b3a.2 for ; Sat, 01 Jun 2024 01:46:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=huaqin-corp-partner-google-com.20230601.gappssmtp.com; s=20230601; t=1717231603; x=1717836403; darn=lists.freedesktop.org; h=references:in-reply-to:message-id:date:subject:cc:to:from:from:to :cc:subject:date:message-id:reply-to; bh=F/VhRzJvFlw4cgaCE7sGFk/fAzW07UQtz5Yy9K56bvo=; b=dy468gvTwe0MgN5XgXwnM5ahSLIdG0Rvt2A5sttJCHb3tzM6ATGZ16YQ0BK8w6DggB mzoLsuayxD6RoVJbccDYXyzEfMpy6DXV/UPxoJUFffJeHuvX8TIUNzjdEFkvGyTxLFpN XeNB8zQ6wn/BxqACVS0BsuSsIEbvybeJniyrRGY5Ud0ABLnzun/KBbZQCUm1DlWrWmho 7MRhi27mVgMkIfDXyV7zEJgKoNuN9ehJv3eeDV9ls0LhnigZoBwGchrPSCTsSdgHwJQU Xtim0s9sQHwAKGGewMtqNarc2TaKYVdp/yCevcoHJskcrGRaM8qO9dwxPYCAmWDewi7o jo7g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717231603; x=1717836403; h=references:in-reply-to:message-id:date:subject:cc:to:from :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=F/VhRzJvFlw4cgaCE7sGFk/fAzW07UQtz5Yy9K56bvo=; b=bOFtolTBhGKopLI1kCmXi6oODlphvgUy13/lv8j0R59PadA95sMwlSr6vdKG324/qA bgqf0nlYQg6fGMIEtEovs29PHoW8XLKv7zXGIivaNHwEd9BbIB71Ve9ck3S7OWUha93A 3e5yDqRwbNLPrhbq7C4sN2uuTCm+sNrOZTExAAoItpGfK4NZ1YpmeHWJInyizT1vMCPG zeUH61n08LHrG4fc17wMRurDx0ROC7Bqv2JbN447V+43+uhQKt+bQ7F6+2tZKPf6RVTg zUx/W/DxB87ByxynecUu0uG5QEkqyE41QEFqTObcCQlpGQlDNuUtq82qr/yH6UO/QQIA E+QA== X-Gm-Message-State: AOJu0Yx8yHwaDgbzhdlqDQ7BpfR/oVvr36qUAwN8QycWngb+PbnsHLnn 00VgyddU6kOIwe859pUG6TjisuLCf4dcEfcEWfCtO7zfSBXx+ewqVr4h7lpckn0= X-Google-Smtp-Source: AGHT+IFWt1E88fxINk/YBxjzIfj8xsDi2coQpetmeM7CVRx0T7/j+rW5O2QbTMQT1BKH2hEUibAtTA== X-Received: by 2002:a05:6a21:185:b0:1b1:ce04:e80a with SMTP id adf61e73a8af0-1b26f0e6127mr4974707637.13.1717231603039; Sat, 01 Jun 2024 01:46:43 -0700 (PDT) Received: from lvzhaoxiong-KLVC-WXX9.huaqin.com ([116.66.212.162]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-702423c7b49sm2512044b3a.37.2024.06.01.01.46.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 01 Jun 2024 01:46:42 -0700 (PDT) From: Zhaoxiong Lv To: dmitry.torokhov@gmail.com, robh@kernel.org, krzysztof.kozlowski+dt@linaro.org, conor+dt@kernel.org, jikos@kernel.org, benjamin.tissoires@redhat.co, dianders@google.com, hsinyi@google.com Cc: dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Zhaoxiong Lv Subject: [PATCH v2 2/4] drm/panel: kd101ne3: add new panel driver Date: Sat, 1 Jun 2024 16:45:26 +0800 Message-Id: <20240601084528.22502-3-lvzhaoxiong@huaqin.corp-partner.google.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20240601084528.22502-1-lvzhaoxiong@huaqin.corp-partner.google.com> References: <20240601084528.22502-1-lvzhaoxiong@huaqin.corp-partner.google.com> X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" The bias IC of this kindisplay-kd101ne3 panel is placed on the panel side, so when the panel is powered on, there is no need to control AVDD and AVEE in the driver, only 3.3v and reset are needed. Signed-off-by: Zhaoxiong Lv --- Chage since V2: - 1. Use the new mipi_dsi_dcs_write_seq_multi() function. - 2. Modify Move mipi_dsi_dcs_set_display_off() and mipi_dsi_dcs_enter_sleep_mode() to disable(), - and drop kingdisplay_panel_enter_sleep_mode(). - 3. If prepare fails, disable GPIO before regulators. - 4. This function drm_connector_set_panel_orientation() is no longer used. Delete it. - 5. Drop ".shutdown = kingdisplay_panel_shutdown". --- drivers/gpu/drm/panel/Kconfig | 9 + drivers/gpu/drm/panel/Makefile | 1 + .../drm/panel/panel-kingdisplay-kd101ne3.c | 533 ++++++++++++++++++ 3 files changed, 543 insertions(+) create mode 100644 drivers/gpu/drm/panel/panel-kingdisplay-kd101ne3.c diff --git a/drivers/gpu/drm/panel/Kconfig b/drivers/gpu/drm/panel/Kconfig index e54f6f5604ed..71669e990e8e 100644 --- a/drivers/gpu/drm/panel/Kconfig +++ b/drivers/gpu/drm/panel/Kconfig @@ -297,6 +297,15 @@ config DRM_PANEL_KINGDISPLAY_KD097D04 24 bit RGB per pixel. It provides a MIPI DSI interface to the host and has a built-in LED backlight. +config DRM_PANEL_KINGDISPLAY_KD101NE3 + tristate "Kingdisplay kd101ne3 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 kingdisplay kd101ne3 + 4-lane 800x1280 MIPI DSI panel. + config DRM_PANEL_LEADTEK_LTK050H3146W tristate "Leadtek LTK050H3146W panel" depends on OF diff --git a/drivers/gpu/drm/panel/Makefile b/drivers/gpu/drm/panel/Makefile index f0203f6e02f4..4576c9fe33d9 100644 --- a/drivers/gpu/drm/panel/Makefile +++ b/drivers/gpu/drm/panel/Makefile @@ -30,6 +30,7 @@ obj-$(CONFIG_DRM_PANEL_JDI_LPM102A188A) += panel-jdi-lpm102a188a.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 +obj-$(CONFIG_DRM_PANEL_KINGDISPLAY_KD101NE3) += panel-kingdisplay-kd101ne3.o obj-$(CONFIG_DRM_PANEL_LEADTEK_LTK050H3146W) += panel-leadtek-ltk050h3146w.o obj-$(CONFIG_DRM_PANEL_LEADTEK_LTK500HD1829) += panel-leadtek-ltk500hd1829.o obj-$(CONFIG_DRM_PANEL_LG_LB035Q02) += panel-lg-lb035q02.o diff --git a/drivers/gpu/drm/panel/panel-kingdisplay-kd101ne3.c b/drivers/gpu/drm/panel/panel-kingdisplay-kd101ne3.c new file mode 100644 index 000000000000..8994a1c9afb5 --- /dev/null +++ b/drivers/gpu/drm/panel/panel-kingdisplay-kd101ne3.c @@ -0,0 +1,533 @@ +// SPDX-License-Identifier: GPL-2.0 +/* Panels based on the JD9365DA display controller. + * Author: Zhaoxiong Lv + */ + +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +#include