From patchwork Sat Jun 1 08:45:25 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zhaoxiong Lv X-Patchwork-Id: 13682347 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 D969AC27C44 for ; Sat, 1 Jun 2024 08:46:39 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id CA84410E082; Sat, 1 Jun 2024 08:46:38 +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="Ulm+rEtQ"; dkim-atps=neutral Received: from mail-pf1-f194.google.com (mail-pf1-f194.google.com [209.85.210.194]) by gabe.freedesktop.org (Postfix) with ESMTPS id A717810E082 for ; Sat, 1 Jun 2024 08:46:34 +0000 (UTC) Received: by mail-pf1-f194.google.com with SMTP id d2e1a72fcca58-702555eb23bso396815b3a.1 for ; Sat, 01 Jun 2024 01:46:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=huaqin-corp-partner-google-com.20230601.gappssmtp.com; s=20230601; t=1717231594; x=1717836394; 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=BWMKP5LFlkDOSxfrnz5yHlOyMbunRcU9qIKa5/oOPUc=; b=Ulm+rEtQfxkVQJPYE/1A7/SbS+AxLrwna2rAUgrgyquFdxVCgxLIgndkrUAycOx0x6 X8NHmZeYmoPlb5dBioWJvXrWRiBLBEqMo8KkPsg6JG8cDtaPxamWNr+SzCXCTO/j7Vgz NVqzwYFFGkwVZRh6mes9TmbsNVF8JIM0/bANlndlv5Q2hNhDFrj8sZAQ7aO85Lx7wycJ 889njxroLBIaqDMJf93yRMiNILSUHxxlud/t4B1vww57jHZzlpcApx+53xwHNVMSBEOS EGlPeHGADBRoFcdpu8MburRcueHZR7FYZqDfQL0i/GTGE1UbpNUE1/kIDPgvEpwA8LTs 8tCQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717231594; x=1717836394; 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=BWMKP5LFlkDOSxfrnz5yHlOyMbunRcU9qIKa5/oOPUc=; b=NFGDV3TqJg0q9bh1aAhqyqHBrb4Ajex/zjf0OIvIyLiwii4fyWc1peUOYFXVE8HCNJ edllIvXU/soxV3DmQ1gYQcjeZRjR9kPwh9VKw14niJwB3Q+MZ2FWGjhS3mVVlCs00cm7 IfLM3VgclL6m/3vov0/35QdJPVuJ1uQkaahMOTJEaRMs6wtQSRkgsA8xZB1dWHtyoISF SDrEqz/ku7JQypcSLshteCvVrSWIuPFFZU3HvMOfErOPiyt2MjS+M8R/jbO0ZgmqL6ej nfzlmusP4rpL+b54Al5vCoKTd8KnLcfkhjW+LXZ7jXNlQNbxQicGdXn7RidVwydqv61a X03g== X-Gm-Message-State: AOJu0YzawCh/l73RKHw3/4TWzVj46gyhaf086xLb7IGTq5t8cxPSI+UT Ss/fvuEM2J+xPX+oITvmyktiyWhH1X7dI2hC+zj8j2t0yXHPPoY/t39Cg5JC6yY= X-Google-Smtp-Source: AGHT+IGXPuE8dbUUxqNOYjw6L1iImTMU+Bb7Ncc2SHFeKOzPZbY2wYMNuci4TbwP5eGNNmY//5z8yg== X-Received: by 2002:a05:6a00:2e90:b0:702:56c0:299 with SMTP id d2e1a72fcca58-70256c00467mr1173669b3a.20.1717231593905; Sat, 01 Jun 2024 01:46:33 -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.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 01 Jun 2024 01:46:33 -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 1/4] dt-bindings: display: panel: Add KD101NE3-40TI support Date: Sat, 1 Jun 2024 16:45:25 +0800 Message-Id: <20240601084528.22502-2-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" Create a new dt-scheam for the kd101ne3-40ti. 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. Signed-off-by: Zhaoxiong Lv --- Chage since V2: - Drop some properties that have already been defined in panel-common. - The header file 'dt-bindings/gpio/gpio.h' is not used, delete it V1: https://lore.kernel.org/all/20240418081548.12160-2-lvzhaoxiong@huaqin.corp-partner.google.com/ --- .../panel/kingdisplay,kd101ne3-40ti.yaml | 59 +++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 Documentation/devicetree/bindings/display/panel/kingdisplay,kd101ne3-40ti.yaml diff --git a/Documentation/devicetree/bindings/display/panel/kingdisplay,kd101ne3-40ti.yaml b/Documentation/devicetree/bindings/display/panel/kingdisplay,kd101ne3-40ti.yaml new file mode 100644 index 000000000000..b0cf12bb727d --- /dev/null +++ b/Documentation/devicetree/bindings/display/panel/kingdisplay,kd101ne3-40ti.yaml @@ -0,0 +1,59 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/display/panel/kingdisplay,kd101ne3-40ti.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Kingdisplay KD101NE3-40TI based MIPI-DSI panels + +maintainers: + - Zhaoxiong Lv + +allOf: + - $ref: panel-common.yaml# + +properties: + compatible: + items: + - enum: + - kingdisplay,kd101ne3-40ti + + reg: + description: the virtual channel number of a DSI peripheral + + pp3300-supply: + description: core voltage supply + +required: + - compatible + - reg + - pp3300-supply + - enable-gpios + - backlight + - port + +unevaluatedProperties: false + +examples: + - | + dsi { + #address-cells = <1>; + #size-cells = <0>; + panel: panel@0 { + compatible = "kingdisplay,kd101ne3-40ti"; + reg = <0>; + enable-gpios = <&pio 98 0>; + pinctrl-names = "default"; + pinctrl-0 = <&panel_pins_default>; + pp3300-supply = <&en_pp6000_mipi_disp>; + backlight = <&backlight_lcd0>; + rotation = <90>; + port { + panel_in: endpoint { + remote-endpoint = <&dsi_out>; + }; + }; + }; + }; + +... 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