From patchwork Wed Apr 3 03:43:58 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Baryshkov X-Patchwork-Id: 13614920 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 81BE3C6FD1F for ; Wed, 3 Apr 2024 03:44:08 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id A688510F8ED; Wed, 3 Apr 2024 03:44:03 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="RO6Nb7p3"; dkim-atps=neutral Received: from mail-lf1-f42.google.com (mail-lf1-f42.google.com [209.85.167.42]) by gabe.freedesktop.org (Postfix) with ESMTPS id BB64110F8ED for ; Wed, 3 Apr 2024 03:44:02 +0000 (UTC) Received: by mail-lf1-f42.google.com with SMTP id 2adb3069b0e04-515a81928faso7274355e87.1 for ; Tue, 02 Apr 2024 20:44:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1712115840; x=1712720640; darn=lists.freedesktop.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=VEllE0JxY/kWG3UyhjYtfiI+8grBVB/qzOVHLfoOelc=; b=RO6Nb7p3fkf70T6QX4CmVOF7LFEwvWFMCU6bzaTQqQsdy43V9wge04heHVFF3Embox F1rLo/W+ndK2/L7Yc8ssE1sTMYztYpo8txn+j4vsbEEy6K4FH1HxkvK4U51VNeC0KbbY oqncGp7SOFIPh7ViJksLNSIv2HQm8vWJgLnRdAs/KWYQAUZLnJWkm9evM96l4C+Rya3M YSkImgDlxbP1/Ukni8M0ixrplkGxzlbcYlXFVCrM3+MTG4M0egPXfGGzOyjUXVZeqmRo GNN95+mmPI0K6oRqDQW5H75AfEpmaIHGVj0LkdBSUZoo274ZdZtXeeHRuAJhxwCeOeol aBig== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712115840; x=1712720640; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=VEllE0JxY/kWG3UyhjYtfiI+8grBVB/qzOVHLfoOelc=; b=SzRHB6fXeSx1r/STchZAq0zSQpoeGY7rhwFZxVNgbtJnEnomX3OkMNljAXM/ZilG/Z 3oMt8ZtHCR3ChYXL5z7OvFO3SSIM7ugog0pEcZeTZCb11oLnlbI7rcdMOq0mP81m1v6h yHtmxNJ+8OFxa55kmkmW27DUfn8xwvhKuIMOH00ML5jRhE108ryS6MqrSh2UI6Y75PLp FjuHYhc1mtkuUW3utXNWTBK3/4TNO3yQ1nxKzXsJcs6TH/V+XSbVR8Bb0kc036h+SXeC vXM+Y91bgmV2EcwKUDrzQ8NsTiSCJfKl7G3xMKS8RvsiUjpAPUJFAyj31LcrlUmg8BZN 6BYw== X-Gm-Message-State: AOJu0YxGYvYrubULmpyz6MGJK5VP31ug8qxb6TBpcSJEPTejmo45GIVR tj+LmBfd5dRQ2u8RdcI6aP5II4mQ1qZPpt2HA44rjs+79JTkegYeBgbTFcw2Obf2C1W2VyoebyL B X-Google-Smtp-Source: AGHT+IEfIPCrrPgC5ZFLX497AE4CvsNKnGXOrqFIYnp2nyQ7u1ZNPXjK9PFY8RWN3ASmBmVsJXV55w== X-Received: by 2002:ac2:4e94:0:b0:515:bee6:5e8c with SMTP id o20-20020ac24e94000000b00515bee65e8cmr746256lfr.40.1712115840618; Tue, 02 Apr 2024 20:44:00 -0700 (PDT) Received: from umbar.lan ([192.130.178.91]) by smtp.gmail.com with ESMTPSA id br31-20020a056512401f00b00516a69b1dcbsm940985lfb.78.2024.04.02.20.43.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Apr 2024 20:44:00 -0700 (PDT) From: Dmitry Baryshkov Date: Wed, 03 Apr 2024 06:43:58 +0300 Subject: [PATCH v4 4/4] drm: panel: Add LG sw43408 panel driver MIME-Version: 1.0 Message-Id: <20240403-lg-sw43408-panel-v4-4-a386d5d3b0c6@linaro.org> References: <20240403-lg-sw43408-panel-v4-0-a386d5d3b0c6@linaro.org> In-Reply-To: <20240403-lg-sw43408-panel-v4-0-a386d5d3b0c6@linaro.org> To: Sumit Semwal , Caleb Connolly , Neil Armstrong , Jessica Zhang , Sam Ravnborg , David Airlie , Daniel Vetter , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , Rob Herring , Krzysztof Kozlowski , Conor Dooley Cc: dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, Vinod Koul , Caleb Connolly , Marijn Suijten X-Mailer: b4 0.13.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=12287; i=dmitry.baryshkov@linaro.org; h=from:subject:message-id; bh=RUV+Dk+/80GpPXHjLxLRCSIqIHDkECObEjPjG6mQQz4=; b=owEBbQGS/pANAwAKAYs8ij4CKSjVAcsmYgBmDNB7FbyKMbLG3zClJcH1OsnRrXOOu27dNGear jOwqW3U3UqJATMEAAEKAB0WIQRMcISVXLJjVvC4lX+LPIo+Aiko1QUCZgzQewAKCRCLPIo+Aiko 1dDVCACL69rdnEE8PIJX88qc7+xTy7DBdvssN2vwlwAf48Txyr0m7LHMEPos6c24etB+iKBm1JH xDeNaX86zlqi1KtahuW49W1y9104vvQUNNPcRYHje4N8PX96hPxws9rUH1uHWbkM5ujt+YbC/2U Qm40mRlR2M82r4nV8WVNWMIC0VbBjiFYx8xLrgeY9wVF68XtMMml9YMxNRUoqUWAf9K2mls98+y hmCJh2nkY3t6e2f8gmPO7rETqf4/WRSU821tUbzQmM/GirNrA1zjZmyXbK82SR2dXNUwvZ2JKql 77LtF6qBcuEyN6PXXW7yZE9HWtuZIWfXsDfcixtUM+b8ycF4 X-Developer-Key: i=dmitry.baryshkov@linaro.org; a=openpgp; fpr=8F88381DD5C873E4AE487DA5199BF1243632046A 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" From: Sumit Semwal LG SW43408 is 1080x2160, 4-lane MIPI-DSI panel, used in some Pixel3 phones. Signed-off-by: Sumit Semwal [vinod: Add DSC support] Signed-off-by: Vinod Koul [caleb: cleanup and support turning off the panel] Signed-off-by: Caleb Connolly [DB: partially rewrote the driver and fixed DSC programming] Reviewed-by: Marijn Suijten Signed-off-by: Dmitry Baryshkov --- MAINTAINERS | 8 + drivers/gpu/drm/panel/Kconfig | 11 ++ drivers/gpu/drm/panel/Makefile | 1 + drivers/gpu/drm/panel/panel-lg-sw43408.c | 323 +++++++++++++++++++++++++++++++ 4 files changed, 343 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index d36c19c1bf81..4cc43c16e07e 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -6789,6 +6789,14 @@ S: Maintained F: Documentation/devicetree/bindings/display/panel/jadard,jd9365da-h3.yaml F: drivers/gpu/drm/panel/panel-jadard-jd9365da-h3.c +DRM DRIVER FOR LG SW43408 PANELS +M: Sumit Semwal +M: Caleb Connolly +S: Maintained +T: git git://anongit.freedesktop.org/drm/drm-misc +F: Documentation/devicetree/bindings/display/panel/lg,sw43408.yaml +F: drivers/gpu/drm/panel/panel-lg-sw43408.c + DRM DRIVER FOR LOGICVC DISPLAY CONTROLLER M: Paul Kocialkowski S: Supported diff --git a/drivers/gpu/drm/panel/Kconfig b/drivers/gpu/drm/panel/Kconfig index 6dc451f58a3e..a55e9437c8cf 100644 --- a/drivers/gpu/drm/panel/Kconfig +++ b/drivers/gpu/drm/panel/Kconfig @@ -335,6 +335,17 @@ config DRM_PANEL_LG_LG4573 Say Y here if you want to enable support for LG4573 RGB panel. To compile this driver as a module, choose M here. +config DRM_PANEL_LG_SW43408 + tristate "LG SW43408 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 LG sw43408 panel. + The panel has a 1080x2160 resolution and uses + 24 bit RGB per pixel. It provides a MIPI DSI interface to + the host and has a built-in LED backlight. + config DRM_PANEL_MAGNACHIP_D53E6EA8966 tristate "Magnachip D53E6EA8966 DSI panel" depends on OF && SPI diff --git a/drivers/gpu/drm/panel/Makefile b/drivers/gpu/drm/panel/Makefile index 24a02655d726..0b40b010e8e7 100644 --- a/drivers/gpu/drm/panel/Makefile +++ b/drivers/gpu/drm/panel/Makefile @@ -34,6 +34,7 @@ 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 obj-$(CONFIG_DRM_PANEL_LG_LG4573) += panel-lg-lg4573.o +obj-$(CONFIG_DRM_PANEL_LG_SW43408) += panel-lg-sw43408.o obj-$(CONFIG_DRM_PANEL_MAGNACHIP_D53E6EA8966) += panel-magnachip-d53e6ea8966.o obj-$(CONFIG_DRM_PANEL_NEC_NL8048HL11) += panel-nec-nl8048hl11.o obj-$(CONFIG_DRM_PANEL_NEWVISION_NV3051D) += panel-newvision-nv3051d.o diff --git a/drivers/gpu/drm/panel/panel-lg-sw43408.c b/drivers/gpu/drm/panel/panel-lg-sw43408.c new file mode 100644 index 000000000000..6fcdaa5cf6c5 --- /dev/null +++ b/drivers/gpu/drm/panel/panel-lg-sw43408.c @@ -0,0 +1,323 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* + * Copyright (C) 2019-2024 Linaro Ltd + * Author: Sumit Semwal + * Dmitry Baryshkov + */ + +#include +#include +#include +#include +#include +#include + +#include