From nobody Wed Dec 17 07:30:13 2025 Received: from mail-pf1-f171.google.com (mail-pf1-f171.google.com [209.85.210.171]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 270256FE16 for ; Thu, 20 Jun 2024 08:05:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.171 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718870731; cv=none; b=X6L5ZSM11vvwWzehvUyG8qxoL1HJj7CYGUyUqNDO54rTTwqvSzsCbklzu5BuHCvY3Tgf6yEk3S4bT5LUsKC7JnSfl3NtYVNszs6F1MIBiiA8Fa+NNSmfmLaKZdIJ+FWkKQt8FF6pHMbID+Figr4vRbKr/XT1IXeQbzSiFgFsHzU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718870731; c=relaxed/simple; bh=XOul/qD5sSGRcDGWiYqw0qFkSHBwCbp5w5yT0BnOEjw=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version:Content-Type; b=FL/ICFFHqf4oREc4m2JU06UxaFLgjEWpBU4yYk6uxqn/j7Vc4ZZMcD4VaKdBj+NzzUJ57gUGhNj6YB1wyV31qzMcMQzPICJXjr/qBsLX4dEM4SbTYQ59+VT1oEdVHVG5quZN7pAUu8OqrJEKymoifhYdegyg4z1ouHtYcSxFuTQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=huaqin.corp-partner.google.com; spf=pass smtp.mailfrom=huaqin.corp-partner.google.com; dkim=pass (2048-bit key) header.d=huaqin-corp-partner-google-com.20230601.gappssmtp.com header.i=@huaqin-corp-partner-google-com.20230601.gappssmtp.com header.b=Ttx9WabZ; arc=none smtp.client-ip=209.85.210.171 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=huaqin.corp-partner.google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=huaqin.corp-partner.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=huaqin-corp-partner-google-com.20230601.gappssmtp.com header.i=@huaqin-corp-partner-google-com.20230601.gappssmtp.com header.b="Ttx9WabZ" Received: by mail-pf1-f171.google.com with SMTP id d2e1a72fcca58-70623ec42c2so509169b3a.0 for ; Thu, 20 Jun 2024 01:05:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=huaqin-corp-partner-google-com.20230601.gappssmtp.com; s=20230601; t=1718870726; x=1719475526; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=dakUGhqrnLzB9mnNo0IKnWBzyZqbbKSfGuNLa4v3K1U=; b=Ttx9WabZlCxTRTHDCb9sW3oAWiOrjvxFdJDU0t2VL9x8sdozoisWxk78QBdIIHsfuX +SHRC74F1T4Tk49c3hVQ9VpTFimSl0waXNBGqJtx6wp/YHJW6jgOFaoGsIGa4NoGO8cC O3QoRVNpooxTCyXJuOZ3Id1Ey1vmJEormce/rQwbpqUGqndZH0v5vhspZ5SmvH06AuMj 6ZvOVPAFe7pBWVWGeNQ90a/6o0GhxmsoD1QretiU5sLH8c4uHJ/Y2m4VHx2P8KujeJK0 UVMwq9wpHTqMAOxmedBXnQQPEJ777IGjSqIZom1AlU4sR5C4pL1remYh051ObnqGuhHv KEnQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718870726; x=1719475526; h=content-transfer-encoding:mime-version: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=dakUGhqrnLzB9mnNo0IKnWBzyZqbbKSfGuNLa4v3K1U=; b=NtY56Eyt9KiwWW0kYiMLPKbfnRu698u7MDSQfh7Aj7yauNFsTKYzqujq0wL7BFcrmk tQNf2N3xp8YdqbIemZSTjstz4PU4niqhJVli//hot7H+fzfbuUzajuzD+IkKcSx5wD9L 3xt1Vzi0qgw+Lu5kcrjTcyNLxalAD+ooT3ZnWbDlh0V8BlMOVCQ6H6PnRgThUPbbfjaA ZxOxe+gZx6o/ov30w6FkgEINq3/nWe3+oYQRX0UQmG2AH6QzUa+6SSgMDFvnhb+Rp0VD rhe+2pOUpmRihCH7pas4gPAu7U73qucHF49vjwa93iTF8tiBrg8aQKtQad0wiR+syMRR TJcQ== X-Forwarded-Encrypted: i=1; AJvYcCU8h7bJKqX5yRer4/w96IY1lcvaGWm9HXcbJ4iJ+TGEQ5R2VmnixAdIPdZF3u0rePApdHrzfpAHV13L5InnwD+faUS4g32VOTYBNG0j X-Gm-Message-State: AOJu0YzMHcKVfzQQ76YLe+lqzvvp3+k83wjyj0xaS+xNWyGTtpN42/Bz Y7KKTchArQDvt7/ZvC/+LjPSM2ycDtXrcZJqrOKPtfXpJPpPKAxS9bPy/KgThpc= X-Google-Smtp-Source: AGHT+IGIgwZB7KgN6IuNTo5vHCsjNBlcvHNhq8+jPn9RYvIJI4rtbggqu0AMU3iWTk7RGtK7PqiiHQ== X-Received: by 2002:a05:6a00:8993:b0:6ed:825b:30c0 with SMTP id d2e1a72fcca58-7061ac2e955mr9532567b3a.15.1718870726368; Thu, 20 Jun 2024 01:05:26 -0700 (PDT) Received: from lvzhaoxiong-KLVC-WXX9.huaqin.com ([116.66.212.162]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-705cc96c8c5sm11805889b3a.58.2024.06.20.01.05.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 20 Jun 2024 01:05:25 -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 v4 1/4] drm/panel: jd9365da: Modify the method of sending commands Date: Thu, 20 Jun 2024 16:05:06 +0800 Message-Id: <20240620080509.18504-2-lvzhaoxiong@huaqin.corp-partner.google.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20240620080509.18504-1-lvzhaoxiong@huaqin.corp-partner.google.com> References: <20240620080509.18504-1-lvzhaoxiong@huaqin.corp-partner.google.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Currently, the init_code of the jd9365da driver is placed in the enable() function and sent, but this seems to take a long time. It takes 17ms to send each instruction (an init code consists of about 200 instructions), so it takes about 3.5s to send the init_code. So we moved the sending of the inti_code to the prepare() function, and each instruction seemed to take only 25=CE=BCs. We checked the DSI host and found that the difference in command sending time is caused by the different modes of the DSI host in prepare() and enable() functions. Our DSI Host only supports sending cmd in LP mode, The prepare() function can directly send init_code (LP->cmd) in LP mode, but the enable() function is in HS mode and needs to switch to LP mode before sending init code (HS->LP->cmd->HS). Therefore, it takes longer to send the command. Signed-off-by: Zhaoxiong Lv --- Changes between V4 and V3: - 1. Only move mipi_dsi_dcs_write_buffer from enable() function to prepare(= ) function, - and no longer use mipi_dsi_dcs_write_seq_multi. V3:https://lore.kernel.org/all/20240614145510.22965-2-lvzhaoxiong@huaqin.co= rp-partner.google.com/ --- .../gpu/drm/panel/panel-jadard-jd9365da-h3.c | 24 +++++++++---------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/drivers/gpu/drm/panel/panel-jadard-jd9365da-h3.c b/drivers/gpu= /drm/panel/panel-jadard-jd9365da-h3.c index 4879835fe101..a9c483a7b3fa 100644 --- a/drivers/gpu/drm/panel/panel-jadard-jd9365da-h3.c +++ b/drivers/gpu/drm/panel/panel-jadard-jd9365da-h3.c @@ -52,21 +52,9 @@ static int jadard_enable(struct drm_panel *panel) { struct device *dev =3D panel->dev; struct jadard *jadard =3D panel_to_jadard(panel); - const struct jadard_panel_desc *desc =3D jadard->desc; struct mipi_dsi_device *dsi =3D jadard->dsi; - unsigned int i; int err; =20 - msleep(10); - - for (i =3D 0; i < desc->num_init_cmds; i++) { - const struct jadard_init_cmd *cmd =3D &desc->init_cmds[i]; - - err =3D mipi_dsi_dcs_write_buffer(dsi, cmd->data, JD9365DA_INIT_CMD_LEN); - if (err < 0) - return err; - } - msleep(120); =20 err =3D mipi_dsi_dcs_exit_sleep_mode(dsi); @@ -100,6 +88,8 @@ static int jadard_disable(struct drm_panel *panel) static int jadard_prepare(struct drm_panel *panel) { struct jadard *jadard =3D panel_to_jadard(panel); + const struct jadard_panel_desc *desc =3D jadard->desc; + unsigned int i; int ret; =20 ret =3D regulator_enable(jadard->vccio); @@ -117,7 +107,15 @@ static int jadard_prepare(struct drm_panel *panel) msleep(10); =20 gpiod_set_value(jadard->reset, 1); - msleep(120); + msleep(130); + + for (i =3D 0; i < desc->num_init_cmds; i++) { + const struct jadard_init_cmd *cmd =3D &desc->init_cmds[i]; + + ret =3D mipi_dsi_dcs_write_buffer(dsi, cmd->data, JD9365DA_INIT_CMD_LEN); + if (ret < 0) + return ret; + } =20 return 0; } --=20 2.17.1 From nobody Wed Dec 17 07:30:13 2025 Received: from mail-pf1-f173.google.com (mail-pf1-f173.google.com [209.85.210.173]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 358DE15EFCF for ; Thu, 20 Jun 2024 08:05:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.173 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718870739; cv=none; b=rmLyyzrjTt9jenAvyFmyAiAjgodrrCWsJDnut1ohIdOeoB8Q+rw+FojKZbn1eiekGVefsW9L+PqRPaJaMA1JCb4v8JkyaF0hvId6+FADSakq3UUQ0VBygCua9q5FzBmfQ90eAL6jAqRnX2X8b/LlIs+lVHOrwaCvRzxFtpT/mjg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718870739; c=relaxed/simple; bh=UFGisn03v9yhYedeo/3KyA9pLmLDEAPEB+tRgkSWm+4=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References; b=lQBhKxZyH816N7gEyFdimn86gkVC69eJlnyIjUblRcXhkUxPbSgkAlEsByqWl9wNXwe+46NKAEsjJ2WQWgPHbJowIQv/viNspzlTAUc4mz8z24miuPkwsEXZcfi2U7r6nQWVa2a02Cpi2uSvFhSgBbIDnAQ+TySODyQxe/eQdxM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=huaqin.corp-partner.google.com; spf=pass smtp.mailfrom=huaqin.corp-partner.google.com; dkim=pass (2048-bit key) header.d=huaqin-corp-partner-google-com.20230601.gappssmtp.com header.i=@huaqin-corp-partner-google-com.20230601.gappssmtp.com header.b=S3qPcCle; arc=none smtp.client-ip=209.85.210.173 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=huaqin.corp-partner.google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=huaqin.corp-partner.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=huaqin-corp-partner-google-com.20230601.gappssmtp.com header.i=@huaqin-corp-partner-google-com.20230601.gappssmtp.com header.b="S3qPcCle" Received: by mail-pf1-f173.google.com with SMTP id d2e1a72fcca58-704090c11easo498459b3a.2 for ; Thu, 20 Jun 2024 01:05:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=huaqin-corp-partner-google-com.20230601.gappssmtp.com; s=20230601; t=1718870736; x=1719475536; darn=vger.kernel.org; h=references:in-reply-to:message-id:date:subject:cc:to:from:from:to :cc:subject:date:message-id:reply-to; bh=/Y8D7obmprqKPMpE+xyGcQQXo6scFeZnMh+CrPUj1ro=; b=S3qPcCleYLAfk377aD6UUw5mBflqxiNePc7Gl7RfBAR23nlqfBeafemARzbrYnpjYb L7AKVu10hd+VIYtUDrb42D2At9zMlEc4/wmIS5XOJixccp/cklKnl7MCn1TzQoXWMRFj xzKnuoRxoyDoKkMThNEqPsOJsmyFb0w4Pga3cFGZVwr6k7qtrcS86Hv5KXSMfaXDLiFa JhmLmUzgKcBBVF7OactTJgbUgt3+Xoa79Mj08/m/Zhp+9nB5aYKFCl5Q4yFqJMAV0Q30 deLDjFoKpUIeoaRNDi9LBDp8cceMwxRRGZlBW+HwS9H5rlIPLaRAfmGiIvOmXkfzHc42 hZ4A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718870736; x=1719475536; 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=/Y8D7obmprqKPMpE+xyGcQQXo6scFeZnMh+CrPUj1ro=; b=phWpsUrtv41igxu/6F88pY+53i1OBS0LF8M3jvKf2SlMtXBgEgsKlzjZkulF7/37j/ yFxF3UbMImObGLmVlmS+H5ZEQ8PLwoIIcPIaV9xyZ59T/dH/mExYMQyEPJUjfXyEa1G5 MjWWNPu0uKKJaHpGfwMwdGmzFRKT18IHlXfW8cvdVlpooltznfga0jez4scNiJzUh5vc 6BVa8N0t7p/zvRRKaIHkInvjZEj4W6aWIKhiUjsoW4nTZFPECaz8D6HM6MlEh9DN19p2 EnYGUym5sDE9G9dVGykdPW+qfTJvh65TymZ4WpJsMhShBPtsbQ+Kj37qXZFW4dCqFIMC I6rw== X-Forwarded-Encrypted: i=1; AJvYcCVTlxEZkiF4e7bQJC6VS6bno96mUacOI0/s9Suna4Fftx1sZvYJiIrNDd9Z5q4fFLOFG+xDt+uWutuaZiUfvevYgxpRBTTNyrlJ2J2n X-Gm-Message-State: AOJu0YzKaauM7AvdChh7qPiudSp/mQUh/jzJpyixEm5PRIVI5GaXrgFP 6qzwUHPmNjFw8tJf/hVrvUc9IauBYr6UezTBYXV5ua77og0JvUwk80R17wUm45E= X-Google-Smtp-Source: AGHT+IEWX7tMPhLCy+EIc3J3GNxEI9rtrbsuhv+fhFcIU85LqU78MlejcJmdCThiVyNmkHK565rXEg== X-Received: by 2002:aa7:9e8f:0:b0:706:3405:fef7 with SMTP id d2e1a72fcca58-7063406032fmr4114904b3a.24.1718870736448; Thu, 20 Jun 2024 01:05:36 -0700 (PDT) Received: from lvzhaoxiong-KLVC-WXX9.huaqin.com ([116.66.212.162]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-705cc96c8c5sm11805889b3a.58.2024.06.20.01.05.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 20 Jun 2024 01:05:36 -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 v4 2/4] dt-bindings: display: panel: Add compatible for kingdisplay-kd101ne3 Date: Thu, 20 Jun 2024 16:05:07 +0800 Message-Id: <20240620080509.18504-3-lvzhaoxiong@huaqin.corp-partner.google.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20240620080509.18504-1-lvzhaoxiong@huaqin.corp-partner.google.com> References: <20240620080509.18504-1-lvzhaoxiong@huaqin.corp-partner.google.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" The kingdisplay-kd101ne3 is a 10.1" WXGA TFT-LCD panel with jadard-jd9365da controller. Hence, we add a new compatible with panel specific config. Signed-off-by: Zhaoxiong Lv Acked-by: Conor Dooley --- Changes between V4 and V3: - 1. Move positions to keep the list sorted. V2:https://lore.kernel.org/all/20240614145510.22965-3-lvzhaoxiong@huaqin.co= rp-partner.google.com/ Changes between V3 and V2: - 1. Abandon the V2 patch and add kingdisplay kd101ne3-40ti binding to=20 - jadard,jd9365da-h3.yaml again. V2:https://lore.kernel.org/all/20240601084528.22502-2-lvzhaoxiong@huaqin.co= rp-partner.google.com/ Changes between V2 and V1: - 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.c= orp-partner.google.com/ --- .../devicetree/bindings/display/panel/jadard,jd9365da-h3.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/Documentation/devicetree/bindings/display/panel/jadard,jd9365d= a-h3.yaml b/Documentation/devicetree/bindings/display/panel/jadard,jd9365da= -h3.yaml index 41eb7fbf7715..2b977292dc48 100644 --- a/Documentation/devicetree/bindings/display/panel/jadard,jd9365da-h3.ya= ml +++ b/Documentation/devicetree/bindings/display/panel/jadard,jd9365da-h3.ya= ml @@ -17,6 +17,7 @@ properties: items: - enum: - chongzhou,cz101b4001 + - kingdisplay,kd101ne3-40ti - radxa,display-10hd-ad001 - radxa,display-8hd-ad002 - const: jadard,jd9365da-h3 --=20 2.17.1 From nobody Wed Dec 17 07:30:13 2025 Received: from mail-pf1-f170.google.com (mail-pf1-f170.google.com [209.85.210.170]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 948F715EFCF for ; Thu, 20 Jun 2024 08:05:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.170 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718870747; cv=none; b=quPfghnVYtXgwuve4kYonUT6sidTLQv7Zf17ZOIPHrdMaxdIXX5/dqMlRQEcil95pTv7NQ6ZPdlqlyd3Qbe6kWK8Pl0XAwnooL1KVLhBDJ+UoHIXZY/Mh4tfjqFtYz7exrDpgp1JqiiZBMed16ssI1tQScBPmU7aZcUWuKrfCTI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718870747; c=relaxed/simple; bh=SMy5ZQzRbzRvirozL1NBPlZTWrQNASxbahosYR4T/aI=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References; b=kL572Lf8aBaiNV2JeglXL5ws3AxoNZCn0LSzkKMI+sAbahOO7//f7ueSXU/juGwA1lhmSx2C2Empvb4O/Mj41bw5rvgokQxbKKQz5d0hqASGdgsv6lzTVJVheZampBsF8Uw3gdkn9f7AS0KQTPhPgjJ+Vtd6GQsg/hnecQBTkiw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=huaqin.corp-partner.google.com; spf=pass smtp.mailfrom=huaqin.corp-partner.google.com; dkim=pass (2048-bit key) header.d=huaqin-corp-partner-google-com.20230601.gappssmtp.com header.i=@huaqin-corp-partner-google-com.20230601.gappssmtp.com header.b=gNol0SQE; arc=none smtp.client-ip=209.85.210.170 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=huaqin.corp-partner.google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=huaqin.corp-partner.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=huaqin-corp-partner-google-com.20230601.gappssmtp.com header.i=@huaqin-corp-partner-google-com.20230601.gappssmtp.com header.b="gNol0SQE" Received: by mail-pf1-f170.google.com with SMTP id d2e1a72fcca58-70436048c25so638108b3a.0 for ; Thu, 20 Jun 2024 01:05:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=huaqin-corp-partner-google-com.20230601.gappssmtp.com; s=20230601; t=1718870744; x=1719475544; darn=vger.kernel.org; h=references:in-reply-to:message-id:date:subject:cc:to:from:from:to :cc:subject:date:message-id:reply-to; bh=dn6UDOWgnuz6zvbbDETQvZyfl1lcf55ZCdpjJoB45yY=; b=gNol0SQEKbZ2YJ7jpHmq6MTAqUjOf3RVHxzzmtZL0PjdNpUmiBPTyz86dDc6DvnVq7 /1jFCmnTzW91sCmzzcyawUSjGSXa/v+JgzwxEMQ8D/9PL6ngb9ayir2OITAOCKempnKz TBH+9iP508GEa3MsHZiRrgwZwrO8Txg8HqNwr9re4eV7G4K8uzejlq2grx5Jkn5ax2Ls NZLUqO1Flt0cPT9568b/7Rzwgqxh2sIEvFpxwMwG6xCnMc4DV8FfXWkY1zZgOLcmHNNx 9ksjzn6R383SHvJgSxPHiKuXAZZI9xZ9vTCD+nEm1NwpR+BXAfJ9vPLPY8TVvGPYLvye ojUQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718870744; x=1719475544; 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=dn6UDOWgnuz6zvbbDETQvZyfl1lcf55ZCdpjJoB45yY=; b=P5184k5Evl0dk3o23JY9nSA80hB4s8f4DtRwFHvQx+teJzFrLFk6ptUHDnP9ivdPl2 KKC7i5Pzrr4/EPut8axQ1cetrj0j2Q25AgSQZqexHENYuw456H6/jbWVl0oqXZC4KeLu tmrm2n2fVBrCxyeQp35E8bL4UlVm0qHRSI3MxNabmaXSCzawbhFKK9H+k/IqbuaLhE/1 xRdadjxLCVDps4enkOxoz/PDBneXLTnPAYvjl2gqsDWf5+ovk4Hh6uYo/tmqpge1Kloy ZgVZiSqY7YADPPtFfMiB7zdtAXmBqrMa7tSJxuRrzFT7c5YeAwoC9W+idxSf28edimhd aqRw== X-Forwarded-Encrypted: i=1; AJvYcCWuRAJ10Ei58NX8TPRsGf3OGhc++kKZRDilawkCrmI2d4rucRKK/fWk2sWjCTmvvtWXXsBjyxEQxuVimh1+QH1NUKN9kq4cyf8/5N6l X-Gm-Message-State: AOJu0YwS5fPlLIqGN8KIQz2XUW5ePfY6uj8imPH1zvaJUEPKuAhA5axl CDefUCjE5BWpNIeZX0O02AJ9THYCrsn+BOUk1nJyZSjvSACUqBineMya4sK0JKM= X-Google-Smtp-Source: AGHT+IH7aptmL+hAyUU+tYWarKvY+9M8pPlEn2+s7yno1xEevBphQAGRhy8UUiknVqGeUsA3SinrnQ== X-Received: by 2002:a05:6a20:c11a:b0:1b5:4c70:d688 with SMTP id adf61e73a8af0-1bcbb3dcb94mr4562958637.3.1718870743750; Thu, 20 Jun 2024 01:05:43 -0700 (PDT) Received: from lvzhaoxiong-KLVC-WXX9.huaqin.com ([116.66.212.162]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-705cc96c8c5sm11805889b3a.58.2024.06.20.01.05.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 20 Jun 2024 01:05:43 -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 v4 3/4] drm/panel: jd9365da: Support for kd101ne3-40ti MIPI-DSI panel. Date: Thu, 20 Jun 2024 16:05:08 +0800 Message-Id: <20240620080509.18504-4-lvzhaoxiong@huaqin.corp-partner.google.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20240620080509.18504-1-lvzhaoxiong@huaqin.corp-partner.google.com> References: <20240620080509.18504-1-lvzhaoxiong@huaqin.corp-partner.google.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" The K&d kd101ne3-40ti is a 10.1" WXGA TFT-LCD panel, use jd9365da controller,which fits in nicely with the existing panel-jadard-jd9365da-h3 driver.Hence,we add a new compatible with panel specific config. Although they have the same control IC, the two panels are different, and the timing will be slightly different, so we added some variables in struct jadard_panel_desc to control the timing Signed-off-by: Zhaoxiong Lv --- Changes between V4 and V3: - 1. Use mipi_dsi_msleep. - 2. Adjust the ".clock" assignment format. - 3. Adjust "compatible" positions to keep the list sorted. V3:https://lore.kernel.org/all/20240614145510.22965-4-lvzhaoxiong@huaqin.co= rp-partner.google.com/ Changes between V3 and V2: - 1. Give up creating a new driver and re-add K&d kd101ne3-40ti=20 - configuration to the panel-jadard-jd9365da-h3.c driver. V2:https://lore.kernel.org/all/20240601084528.22502-3-lvzhaoxiong@huaqin.co= rp-partner.google.com/ Changes between V2 and V1: - 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_sle= ep_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 =3D kingdisplay_panel_shutdown". --- .../gpu/drm/panel/panel-jadard-jd9365da-h3.c | 281 +++++++++++++++++- 1 file changed, 279 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/panel/panel-jadard-jd9365da-h3.c b/drivers/gpu= /drm/panel/panel-jadard-jd9365da-h3.c index a9c483a7b3fa..632bffa035ee 100644 --- a/drivers/gpu/drm/panel/panel-jadard-jd9365da-h3.c +++ b/drivers/gpu/drm/panel/panel-jadard-jd9365da-h3.c @@ -31,6 +31,15 @@ struct jadard_panel_desc { enum mipi_dsi_pixel_format format; const struct jadard_init_cmd *init_cmds; u32 num_init_cmds; + bool lp11_before_reset; + bool reset_before_power_off_vcioo; + unsigned int vcioo_to_lp11_delay; + unsigned int lp11_to_reset_delay; + unsigned int exit_sleep_to_display_on_delay; + unsigned int display_on_delay; + unsigned int backlight_off_to_display_off_delay; + unsigned int display_off_to_enter_sleep_delay; + unsigned int enter_sleep_to_reset_down_delay; }; =20 struct jadard { @@ -53,6 +62,7 @@ static int jadard_enable(struct drm_panel *panel) struct device *dev =3D panel->dev; struct jadard *jadard =3D panel_to_jadard(panel); struct mipi_dsi_device *dsi =3D jadard->dsi; + struct mipi_dsi_multi_context dsi_ctx =3D { .dsi =3D jadard->dsi }; int err; =20 msleep(120); @@ -61,10 +71,16 @@ static int jadard_enable(struct drm_panel *panel) if (err < 0) DRM_DEV_ERROR(dev, "failed to exit sleep mode ret =3D %d\n", err); =20 + if (jadard->desc->exit_sleep_to_display_on_delay) + mipi_dsi_msleep(dsi_ctx, jadard->desc->exit_sleep_to_display_on_delay); + err =3D mipi_dsi_dcs_set_display_on(dsi); if (err < 0) DRM_DEV_ERROR(dev, "failed to set display on ret =3D %d\n", err); =20 + if (jadard->desc->display_on_delay) + mipi_dsi_msleep(dsi_ctx, jadard->desc->display_on_delay); + return 0; } =20 @@ -72,16 +88,26 @@ static int jadard_disable(struct drm_panel *panel) { struct device *dev =3D panel->dev; struct jadard *jadard =3D panel_to_jadard(panel); + struct mipi_dsi_multi_context dsi_ctx =3D { .dsi =3D jadard->dsi }; int ret; =20 + if (jadard->desc->backlight_off_to_display_off_delay) + mipi_dsi_msleep(dsi_ctx, jadard->desc->backlight_off_to_display_off_dela= y); + ret =3D mipi_dsi_dcs_set_display_off(jadard->dsi); if (ret < 0) DRM_DEV_ERROR(dev, "failed to set display off: %d\n", ret); =20 + if (jadard->desc->display_off_to_enter_sleep_delay) + mipi_dsi_msleep(dsi_ctx, jadard->desc->display_off_to_enter_sleep_delay); + ret =3D mipi_dsi_dcs_enter_sleep_mode(jadard->dsi); if (ret < 0) DRM_DEV_ERROR(dev, "failed to enter sleep mode: %d\n", ret); =20 + if (jadard->desc->enter_sleep_to_reset_down_delay) + mipi_dsi_msleep(dsi_ctx, jadard->desc->enter_sleep_to_reset_down_delay); + return 0; } =20 @@ -89,6 +115,7 @@ static int jadard_prepare(struct drm_panel *panel) { struct jadard *jadard =3D panel_to_jadard(panel); const struct jadard_panel_desc *desc =3D jadard->desc; + struct mipi_dsi_multi_context dsi_ctx =3D { .dsi =3D jadard->dsi }; unsigned int i; int ret; =20 @@ -100,6 +127,20 @@ static int jadard_prepare(struct drm_panel *panel) if (ret) return ret; =20 + if (jadard->desc->vcioo_to_lp11_delay) + mipi_dsi_msleep(dsi_ctx, jadard->desc->vcioo_to_lp11_delay); + + if (jadard->desc->lp11_before_reset) { + ret =3D mipi_dsi_dcs_nop(jadard->dsi); + if (ret) + return ret; + + usleep_range(1000, 2000); + } + + if (jadard->desc->lp11_to_reset_delay) + mipi_dsi_msleep(dsi_ctx, jadard->desc->lp11_to_reset_delay); + gpiod_set_value(jadard->reset, 1); msleep(5); =20 @@ -111,8 +152,7 @@ static int jadard_prepare(struct drm_panel *panel) =20 for (i =3D 0; i < desc->num_init_cmds; i++) { const struct jadard_init_cmd *cmd =3D &desc->init_cmds[i]; - - ret =3D mipi_dsi_dcs_write_buffer(dsi, cmd->data, JD9365DA_INIT_CMD_LEN); + ret =3D mipi_dsi_dcs_write_buffer(jadard->dsi, cmd->data, JD9365DA_INIT_= CMD_LEN); if (ret < 0) return ret; } @@ -127,6 +167,12 @@ static int jadard_unprepare(struct drm_panel *panel) gpiod_set_value(jadard->reset, 1); msleep(120); =20 + if (jadard->desc->reset_before_power_off_vcioo) { + gpiod_set_value(jadard->reset, 0); + + usleep_range(1000, 2000); + } + regulator_disable(jadard->vdd); regulator_disable(jadard->vccio); =20 @@ -582,6 +628,233 @@ static const struct jadard_panel_desc cz101b4001_desc= =3D { .num_init_cmds =3D ARRAY_SIZE(cz101b4001_init_cmds), }; =20 +static const struct jadard_init_cmd kingdisplay_kd101ne3_init_cmds[] =3D { + { .data =3D { 0xe0, 0x00 } }, + { .data =3D { 0xe1, 0x93 } }, + { .data =3D { 0xe2, 0x65 } }, + { .data =3D { 0xe3, 0xf8 } }, + { .data =3D { 0x80, 0x03 } }, + { .data =3D { 0xe0, 0x01 } }, + { .data =3D { 0x0c, 0x74 } }, + { .data =3D { 0x17, 0x00 } }, + { .data =3D { 0x18, 0xc7 } }, + { .data =3D { 0x19, 0x01 } }, + { .data =3D { 0x1a, 0x00 } }, + { .data =3D { 0x1b, 0xc7 } }, + { .data =3D { 0x1c, 0x01 } }, + { .data =3D { 0x24, 0xfe } }, + { .data =3D { 0x37, 0x19 } }, + { .data =3D { 0x35, 0x28 } }, + { .data =3D { 0x38, 0x05 } }, + { .data =3D { 0x39, 0x08 } }, + { .data =3D { 0x3a, 0x12 } }, + { .data =3D { 0x3c, 0x7e } }, + { .data =3D { 0x3d, 0xff } }, + { .data =3D { 0x3e, 0xff } }, + { .data =3D { 0x3f, 0x7f } }, + { .data =3D { 0x40, 0x06 } }, + { .data =3D { 0x41, 0xa0 } }, + { .data =3D { 0x43, 0x1e } }, + { .data =3D { 0x44, 0x0b } }, + { .data =3D { 0x55, 0x02 } }, + { .data =3D { 0x57, 0x6a } }, + { .data =3D { 0x59, 0x0a } }, + { .data =3D { 0x5a, 0x2e } }, + { .data =3D { 0x5b, 0x1a } }, + { .data =3D { 0x5c, 0x15 } }, + { .data =3D { 0x5d, 0x7f } }, + { .data =3D { 0x5e, 0x61 } }, + { .data =3D { 0x5f, 0x50 } }, + { .data =3D { 0x60, 0x43 } }, + { .data =3D { 0x61, 0x3f } }, + { .data =3D { 0x62, 0x32 } }, + { .data =3D { 0x63, 0x35 } }, + { .data =3D { 0x64, 0x1f } }, + { .data =3D { 0x65, 0x38 } }, + { .data =3D { 0x66, 0x36 } }, + { .data =3D { 0x67, 0x36 } }, + { .data =3D { 0x68, 0x54 } }, + { .data =3D { 0x69, 0x42 } }, + { .data =3D { 0x6a, 0x48 } }, + { .data =3D { 0x6b, 0x39 } }, + { .data =3D { 0x6c, 0x34 } }, + { .data =3D { 0x6d, 0x26 } }, + { .data =3D { 0x6e, 0x14 } }, + { .data =3D { 0x6f, 0x02 } }, + { .data =3D { 0x70, 0x7f } }, + { .data =3D { 0x71, 0x61 } }, + { .data =3D { 0x72, 0x50 } }, + { .data =3D { 0x73, 0x43 } }, + { .data =3D { 0x74, 0x3f } }, + { .data =3D { 0x75, 0x32 } }, + { .data =3D { 0x76, 0x35 } }, + { .data =3D { 0x77, 0x1f } }, + { .data =3D { 0x78, 0x38 } }, + { .data =3D { 0x79, 0x36 } }, + { .data =3D { 0x7a, 0x36 } }, + { .data =3D { 0x7b, 0x54 } }, + { .data =3D { 0x7c, 0x42 } }, + { .data =3D { 0x7d, 0x48 } }, + { .data =3D { 0x7e, 0x39 } }, + { .data =3D { 0x7f, 0x34 } }, + { .data =3D { 0x80, 0x26 } }, + { .data =3D { 0x81, 0x14 } }, + { .data =3D { 0x82, 0x02 } }, + { .data =3D { 0xe0, 0x02 } }, + { .data =3D { 0x00, 0x52 } }, + { .data =3D { 0x01, 0x5f } }, + { .data =3D { 0x02, 0x5f } }, + { .data =3D { 0x03, 0x50 } }, + { .data =3D { 0x04, 0x77 } }, + { .data =3D { 0x05, 0x57 } }, + { .data =3D { 0x06, 0x5f } }, + { .data =3D { 0x07, 0x4e } }, + { .data =3D { 0x08, 0x4c } }, + { .data =3D { 0x09, 0x5f } }, + { .data =3D { 0x0a, 0x4a } }, + { .data =3D { 0x0b, 0x48 } }, + { .data =3D { 0x0c, 0x5f } }, + { .data =3D { 0x0d, 0x46 } }, + { .data =3D { 0x0e, 0x44 } }, + { .data =3D { 0x0f, 0x40 } }, + { .data =3D { 0x10, 0x5f } }, + { .data =3D { 0x11, 0x5f } }, + { .data =3D { 0x12, 0x5f } }, + { .data =3D { 0x13, 0x5f } }, + { .data =3D { 0x14, 0x5f } }, + { .data =3D { 0x15, 0x5f } }, + { .data =3D { 0x16, 0x53 } }, + { .data =3D { 0x17, 0x5f } }, + { .data =3D { 0x18, 0x5f } }, + { .data =3D { 0x19, 0x51 } }, + { .data =3D { 0x1a, 0x77 } }, + { .data =3D { 0x1b, 0x57 } }, + { .data =3D { 0x1c, 0x5f } }, + { .data =3D { 0x1d, 0x4f } }, + { .data =3D { 0x1e, 0x4d } }, + { .data =3D { 0x1f, 0x5f } }, + { .data =3D { 0x20, 0x4b } }, + { .data =3D { 0x21, 0x49 } }, + { .data =3D { 0x22, 0x5f } }, + { .data =3D { 0x23, 0x47 } }, + { .data =3D { 0x24, 0x45 } }, + { .data =3D { 0x25, 0x41 } }, + { .data =3D { 0x26, 0x5f } }, + { .data =3D { 0x27, 0x5f } }, + { .data =3D { 0x28, 0x5f } }, + { .data =3D { 0x29, 0x5f } }, + { .data =3D { 0x2a, 0x5f } }, + { .data =3D { 0x2b, 0x5f } }, + { .data =3D { 0x2c, 0x13 } }, + { .data =3D { 0x2d, 0x1f } }, + { .data =3D { 0x2e, 0x1f } }, + { .data =3D { 0x2f, 0x01 } }, + { .data =3D { 0x30, 0x17 } }, + { .data =3D { 0x31, 0x17 } }, + { .data =3D { 0x32, 0x1f } }, + { .data =3D { 0x33, 0x0d } }, + { .data =3D { 0x34, 0x0f } }, + { .data =3D { 0x35, 0x1f } }, + { .data =3D { 0x36, 0x05 } }, + { .data =3D { 0x37, 0x07 } }, + { .data =3D { 0x38, 0x1f } }, + { .data =3D { 0x39, 0x09 } }, + { .data =3D { 0x3a, 0x0b } }, + { .data =3D { 0x3b, 0x11 } }, + { .data =3D { 0x3c, 0x1f } }, + { .data =3D { 0x3d, 0x1f } }, + { .data =3D { 0x3e, 0x1f } }, + { .data =3D { 0x3f, 0x1f } }, + { .data =3D { 0x40, 0x1f } }, + { .data =3D { 0x41, 0x1f } }, + { .data =3D { 0x42, 0x12 } }, + { .data =3D { 0x43, 0x1f } }, + { .data =3D { 0x44, 0x1f } }, + { .data =3D { 0x45, 0x00 } }, + { .data =3D { 0x46, 0x17 } }, + { .data =3D { 0x47, 0x17 } }, + { .data =3D { 0x48, 0x1f } }, + { .data =3D { 0x49, 0x0c } }, + { .data =3D { 0x4a, 0x0e } }, + { .data =3D { 0x4b, 0x1f } }, + { .data =3D { 0x4c, 0x04 } }, + { .data =3D { 0x4d, 0x06 } }, + { .data =3D { 0x4e, 0x1f } }, + { .data =3D { 0x4f, 0x08 } }, + { .data =3D { 0x50, 0x0a } }, + { .data =3D { 0x51, 0x10 } }, + { .data =3D { 0x52, 0x1f } }, + { .data =3D { 0x53, 0x1f } }, + { .data =3D { 0x54, 0x1f } }, + { .data =3D { 0x55, 0x1f } }, + { .data =3D { 0x56, 0x1f } }, + { .data =3D { 0x57, 0x1f } }, + { .data =3D { 0x58, 0x40 } }, + { .data =3D { 0x5b, 0x10 } }, + { .data =3D { 0x5c, 0x06 } }, + { .data =3D { 0x5d, 0x40 } }, + { .data =3D { 0x5e, 0x00 } }, + { .data =3D { 0x5f, 0x00 } }, + { .data =3D { 0x60, 0x40 } }, + { .data =3D { 0x61, 0x03 } }, + { .data =3D { 0x62, 0x04 } }, + { .data =3D { 0x63, 0x6c } }, + { .data =3D { 0x64, 0x6c } }, + { .data =3D { 0x65, 0x75 } }, + { .data =3D { 0x66, 0x08 } }, + { .data =3D { 0x67, 0xb4 } }, + { .data =3D { 0x68, 0x08 } }, + { .data =3D { 0x69, 0x6c } }, + { .data =3D { 0x6a, 0x6c } }, + { .data =3D { 0x6b, 0x0c } }, + { .data =3D { 0x6d, 0x00 } }, + { .data =3D { 0x6e, 0x00 } }, + { .data =3D { 0x6f, 0x88 } }, + { .data =3D { 0x75, 0xbb } }, + { .data =3D { 0x76, 0x00 } }, + { .data =3D { 0x77, 0x05 } }, + { .data =3D { 0x78, 0x2a } }, + { .data =3D { 0xe0, 0x04 } }, + { .data =3D { 0x00, 0x0e } }, + { .data =3D { 0x02, 0xb3 } }, + { .data =3D { 0x09, 0x61 } }, + { .data =3D { 0x0e, 0x48 } }, + { .data =3D { 0xe0, 0x00 } }, +}; + +static const struct jadard_panel_desc kingdisplay_kd101ne3_40ti_desc =3D { + .mode =3D { + .clock =3D (800 + 24 + 24 + 24) * (1280 + 30 + 4 + 8) * 60 / 1000, + + .hdisplay =3D 800, + .hsync_start =3D 800 + 24, + .hsync_end =3D 800 + 24 + 24, + .htotal =3D 800 + 24 + 24 + 24, + + .vdisplay =3D 1280, + .vsync_start =3D 1280 + 30, + .vsync_end =3D 1280 + 30 + 4, + .vtotal =3D 1280 + 30 + 4 + 8, + + .width_mm =3D 135, + .height_mm =3D 216, + .type =3D DRM_MODE_TYPE_DRIVER | DRM_MODE_TYPE_PREFERRED, + }, + .lanes =3D 4, + .format =3D MIPI_DSI_FMT_RGB888, + .init_cmds =3D kingdisplay_kd101ne3_init_cmds, + .num_init_cmds =3D ARRAY_SIZE(kingdisplay_kd101ne3_init_cmds), + .lp11_before_reset =3D true, + .reset_before_power_off_vcioo =3D true, + .vcioo_to_lp11_delay =3D 5, + .lp11_to_reset_delay =3D 10, + .exit_sleep_to_display_on_delay =3D 120, + .display_on_delay =3D 20, + .backlight_off_to_display_off_delay =3D 100, + .display_off_to_enter_sleep_delay =3D 50, + .enter_sleep_to_reset_down_delay =3D 100, +}; + static int jadard_dsi_probe(struct mipi_dsi_device *dsi) { struct device *dev =3D &dsi->dev; @@ -650,6 +923,10 @@ static const struct of_device_id jadard_of_match[] =3D= { .compatible =3D "chongzhou,cz101b4001", .data =3D &cz101b4001_desc }, + { + .compatible =3D "kingdisplay,kd101ne3-40ti", + .data =3D &kingdisplay_kd101ne3_40ti_desc + }, { .compatible =3D "radxa,display-10hd-ad001", .data =3D &cz101b4001_desc --=20 2.17.1 From nobody Wed Dec 17 07:30:13 2025 Received: from mail-oa1-f52.google.com (mail-oa1-f52.google.com [209.85.160.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8C7E717334D for ; Thu, 20 Jun 2024 08:05:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.160.52 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718870754; cv=none; b=DY7DRF0uHsMzglZZWV8N0HB06v9Q1rQJvZMxPAJYZAbsiE4H45A1gdKh1o79BnBAwWyaU2xo5FGutSIhX9Eo6GOTg5CyqR6QiEKH9Ut55n/PU9juWkS3PhaOkDvrc7YPTXEjxJMh0VBQPirjKgyics4HdjCfWZcEnkk49n0hY4M= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718870754; c=relaxed/simple; bh=TR/p/s+7xIFTDCxFlPxAv5HhWtahQakW/X1rrhPB/Aw=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References; b=UgmiIhpFqBiYLrMh1rW+KR1bgFMLsua95m6EAtfucR/gjCydh19+s9J1MDIEFtDgkRTnbDLRAAmeyBWwGj2U8yx/prT4rVgD9rxsOyhXwQVHHqSiPVIMpYykRLlNvhMsNNKDiTRYuc2J1Zuob4zFgQZSPrFtlf9qTuSwwPho6js= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=huaqin.corp-partner.google.com; spf=pass smtp.mailfrom=huaqin.corp-partner.google.com; dkim=pass (2048-bit key) header.d=huaqin-corp-partner-google-com.20230601.gappssmtp.com header.i=@huaqin-corp-partner-google-com.20230601.gappssmtp.com header.b=vLq9zNgf; arc=none smtp.client-ip=209.85.160.52 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=huaqin.corp-partner.google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=huaqin.corp-partner.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=huaqin-corp-partner-google-com.20230601.gappssmtp.com header.i=@huaqin-corp-partner-google-com.20230601.gappssmtp.com header.b="vLq9zNgf" Received: by mail-oa1-f52.google.com with SMTP id 586e51a60fabf-2598ae41389so332142fac.3 for ; Thu, 20 Jun 2024 01:05:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=huaqin-corp-partner-google-com.20230601.gappssmtp.com; s=20230601; t=1718870749; x=1719475549; darn=vger.kernel.org; h=references:in-reply-to:message-id:date:subject:cc:to:from:from:to :cc:subject:date:message-id:reply-to; bh=AMOoGP2LakwJmw2FH71ZMogJWrdUzY8/qHEtPyyBbV4=; b=vLq9zNgf1gVmIG8qbOyL5na+FHPzzzUbLTcsNitbryKC/GKPuxnfGHsin7QkFSLaTm g7MxOjvQHcr/kzJi6mg/C8wkxkAuRU6RTCNBMNsrK5YVG8wQl3XBTPOoDjUtqaRt6w18 Rtu4pvb9KFDauXzZBRqzdHe2cU5QFh8091IK+Ykg5LoUXNikVpvVATzqyfG07KCDjyF8 U8U8LJFbVxvurfu5KGPk1nc4jw/g2trQXv9eMwKeCwOdGZb1A53q23MWhDp1841pTq+N GUwxq3ANhqZ/lrg47eGA7i0E2JYUu7Wuq7mjwggctbEvUDNevxjKBDO4GEiPDY161NvQ Q0pQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718870749; x=1719475549; 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=AMOoGP2LakwJmw2FH71ZMogJWrdUzY8/qHEtPyyBbV4=; b=GCHGEJ/N72L5isWGxDCdA/a8tzzFBFg8v6985Ff4y3hSgLLlMibucKiTxnWFotiNRZ bQ+9D1MzdDFTmTvaGjwIzqtE22mbWBEY7LR9VJHl+qRz1YSicG4U17d6ikIJyyY6Gpkh XQwVB7N6kCufEUWF/IFFa5gtBIrAXIAC9YCDFifjy/kBudx9bzC9RSUX4y+bBiRoXhOv 136MgBS/4y37zaoTuA00i2+SCimM7mKlavee1FpD2rlhogDvHugcfncHmsQBVEnZPEuX unAMWWR8RdZakfqW/e46NW9vHmFczNeS2NSLcmd1ZltByFxYvdTJhBZqxLsU+4gZGQUB 8BpA== X-Forwarded-Encrypted: i=1; AJvYcCUgpDxEAOEBNzJBAxrNpWKDYpSqZImBR4L52mj0dm39jd6dCfNasCNI7McgXmuOCe1i8DsEV1QRdBG/xdZ/YdvQS0XS67fA+2aB1e5d X-Gm-Message-State: AOJu0YwsjkPvlit9d6wKLiThuOb7k4LkabKn7VO6iPVUYR7yxYDqP2mw 48Xa+olGVIrZ5HvQFBzVOelpkVTe98ibxdS7GRuaDqr63+QAczmn6n/JcUUuWig= X-Google-Smtp-Source: AGHT+IEbQAMEJgVsRzS0P1rsWA85d/j/lSoDKbJ+GhYfS/LOyoubfsealP8TGQ73YDuxPIYvuL2izg== X-Received: by 2002:a05:6870:b50f:b0:255:1819:b458 with SMTP id 586e51a60fabf-25c948f70cfmr4660143fac.8.1718870749476; Thu, 20 Jun 2024 01:05:49 -0700 (PDT) Received: from lvzhaoxiong-KLVC-WXX9.huaqin.com ([116.66.212.162]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-705cc96c8c5sm11805889b3a.58.2024.06.20.01.05.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 20 Jun 2024 01:05:49 -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 v4 4/4] drm/panel: jd9365da: Add the function of adjusting orientation Date: Thu, 20 Jun 2024 16:05:09 +0800 Message-Id: <20240620080509.18504-5-lvzhaoxiong@huaqin.corp-partner.google.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20240620080509.18504-1-lvzhaoxiong@huaqin.corp-partner.google.com> References: <20240620080509.18504-1-lvzhaoxiong@huaqin.corp-partner.google.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" This driver does not have the function to adjust the orientation, so this function is added. Signed-off-by: Zhaoxiong Lv --- Changes between V4 and V3: - No changes. --- drivers/gpu/drm/panel/panel-jadard-jd9365da-h3.c | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/panel/panel-jadard-jd9365da-h3.c b/drivers/gpu= /drm/panel/panel-jadard-jd9365da-h3.c index 632bffa035ee..2545e22a5c85 100644 --- a/drivers/gpu/drm/panel/panel-jadard-jd9365da-h3.c +++ b/drivers/gpu/drm/panel/panel-jadard-jd9365da-h3.c @@ -46,7 +46,7 @@ struct jadard { struct drm_panel panel; struct mipi_dsi_device *dsi; const struct jadard_panel_desc *desc; - + enum drm_panel_orientation orientation; struct regulator *vdd; struct regulator *vccio; struct gpio_desc *reset; @@ -203,12 +203,20 @@ static int jadard_get_modes(struct drm_panel *panel, return 1; } =20 +static enum drm_panel_orientation jadard_panel_get_orientation(struct drm_= panel *panel) +{ + struct jadard *jadard =3D panel_to_jadard(panel); + + return jadard->orientation; +} + static const struct drm_panel_funcs jadard_funcs =3D { .disable =3D jadard_disable, .unprepare =3D jadard_unprepare, .prepare =3D jadard_prepare, .enable =3D jadard_enable, .get_modes =3D jadard_get_modes, + .get_orientation =3D jadard_panel_get_orientation, }; =20 static const struct jadard_init_cmd radxa_display_8hd_ad002_init_cmds[] = =3D { @@ -893,6 +901,12 @@ static int jadard_dsi_probe(struct mipi_dsi_device *ds= i) drm_panel_init(&jadard->panel, dev, &jadard_funcs, DRM_MODE_CONNECTOR_DSI); =20 + ret =3D of_drm_get_panel_orientation(dev->of_node, &jadard->orientation); + if (ret < 0) { + dev_err(dev, "%pOF: failed to get orientation %d\n", dev->of_node, ret); + return ret; + } + ret =3D drm_panel_of_backlight(&jadard->panel); if (ret) return ret; --=20 2.17.1