From patchwork Sat Mar 30 03:59:30 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Baryshkov X-Patchwork-Id: 13611437 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 7A25FC47DD9 for ; Sat, 30 Mar 2024 03:59:49 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 41F8010E416; Sat, 30 Mar 2024 03:59:47 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="qdhb5B/Z"; dkim-atps=neutral Received: from mail-lf1-f52.google.com (mail-lf1-f52.google.com [209.85.167.52]) by gabe.freedesktop.org (Postfix) with ESMTPS id 57A0210E392 for ; Sat, 30 Mar 2024 03:59:34 +0000 (UTC) Received: by mail-lf1-f52.google.com with SMTP id 2adb3069b0e04-515c3eeea5dso2680332e87.1 for ; Fri, 29 Mar 2024 20:59:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1711771172; x=1712375972; 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=WjzjJkPLaf/5sU8SH37VcIsolFjmu0UrsFouDXMFkec=; b=qdhb5B/ZKxBrHhc+hNwVVxou4DFLE6wgM7biHUZnGNjrAaO+Igk/7WtZc/u30fx4GP 6GG02XtI1v+hbmGLnqjRUE+55E9bt/lRCLI55vNnfJaLO+NYiLcSZwUaExLf3RWHzOvX PxA9KSUOxJ16koAWZpIafZCeXvbNr6C/T/xBZ9m3I7hIFjhJEEEj2zpEgYHdJJCXOOBa pL1LDFNwbwpYQLvrcL5uh5qG2qFE24/7xrwt47blPSc3eSPiRslGQK0YuOWrg8wCIOV3 zWXGRRCCkKS8Apq6fZDHGO2z7kwtFSvUnHkNx7CfAFuASHQTrpaS+U0r/BbxSpfQEMTk Qa5g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711771172; x=1712375972; 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=WjzjJkPLaf/5sU8SH37VcIsolFjmu0UrsFouDXMFkec=; b=sGfUN4xvD12x6dD7djNwobtIFLQRRGjeMCA+qutcbX5DmJOOPlinnkXPqheNjlM9G0 yGbUptrWQd3Se3mtTSQOGg2kBGZaCJU0HrMG4W2sIvqqejpaHVCNoOH0UTUahfr7MVrJ FkpD9EsDcRyfUT4E3yMsCKG6izt09uTE9OjhbVUth6vWjlXt+NU34XGkXEc9HAsloswg YboiJqK+s0tPXktp8koMW0MJAZ8UyGxoE9fPwtWNQjK6R+cO1w2n63iOqeEgQ3YhxH0T cbwr304KBukoCeiJKZ9kvAlS3dOTbhps375oeI8epf/fm7v1opT7t69xs2KuaFTlN1CJ yX8g== X-Gm-Message-State: AOJu0Yy+yv8Gccy/f4lGKvPG2JiNkxgkyyQ013PHRR7oJ5OxXW81J3E5 6Ccuoa/IuyDhW3A9xgTed8AmLZGyHbKEHDO7t9vDdko63PmGtCOQs76+PGVTTb0= X-Google-Smtp-Source: AGHT+IGqVPCCB3/eyVQg9oHRpBYxv5wUfYVbFTb1Te1jY1NNi0uT35uP6k6LWlpa/PFZlqz6q6RHXA== X-Received: by 2002:a05:6512:5c9:b0:513:b30c:53c7 with SMTP id o9-20020a05651205c900b00513b30c53c7mr2646887lfo.10.1711771172614; Fri, 29 Mar 2024 20:59:32 -0700 (PDT) Received: from umbar.lan ([192.130.178.91]) by smtp.gmail.com with ESMTPSA id br2-20020a056512400200b00515d1393f3csm423957lfb.104.2024.03.29.20.59.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Mar 2024 20:59:31 -0700 (PDT) From: Dmitry Baryshkov Date: Sat, 30 Mar 2024 05:59:30 +0200 Subject: [PATCH 3/3] drm: panel: Add LG sw43408 panel driver MIME-Version: 1.0 Message-Id: <20240330-lg-sw43408-panel-v1-3-f5580fc9f2da@linaro.org> References: <20240330-lg-sw43408-panel-v1-0-f5580fc9f2da@linaro.org> In-Reply-To: <20240330-lg-sw43408-panel-v1-0-f5580fc9f2da@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 X-Mailer: b4 0.13.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=12464; i=dmitry.baryshkov@linaro.org; h=from:subject:message-id; bh=YF+FNs4wpu9U2rfxEq/PVlcJ4tLwN+tWipMzmBnmhFI=; b=owGbwMvMwMXYbdNlx6SpcZXxtFoSQxp7n+K+iexlj0y5mdXnTGmYIqmQobNV6/IT+8wTu7kDz 818cW1WJ6MxCwMjF4OsmCKLT0HL1JhNyWEfdkythxnEygQyhYGLUwAmkjKd/Z+ho+12o/rVeQ/8 dDICi017bv+ZFLjO0f62olecq9L+3WuL3SbkeHQ+La0K7S851b7r2MJt4s/8A/Wbkg/0b7lTo+e x5dx3mWtViml+x547JRsoyR/qeOusbHtlSaNH3hoRFo49LvxXLnUH9mRs3suvPavp1nuJfb/Vs7 dbXDBp+Dz/29yiKnPjB1n7v+s4vs9Oy+II8jwU/fyqSdG/VzVutTlO6wK2Tgt80NP9vchw/m27N 4lJ03v4f8jteB7ifr7AhfXRTANJ76qXmX8YdKssjBRjr2eluUTZ+8Up9iWEbdRXOZbAL1xq7XDr 7rOfSRLsd7b9epqYYcfD/2bBpoqbvRWNxw/PUzBiqa0GAA== 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. Whatever init sequence we have for this panel isn't capable of initialising it completely, toggling the reset gpio ever causes the panel to die. Until this is resolved we avoid resetting the panel. The disable/unprepare functions only put the panel to sleep mode and disable the backlight. 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] 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 | 322 +++++++++++++++++++++++++++++++ 4 files changed, 342 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index 4b511a55101c..f4cf7ee97376 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -6755,6 +6755,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 d037b3b8b999..f94c702735cb 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 f156d7fa0bcc..a75687d13caf 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..365d25e14d54 --- /dev/null +++ b/drivers/gpu/drm/panel/panel-lg-sw43408.c @@ -0,0 +1,322 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* + * Copyright (C) 2019-2024 Linaro Ltd + * Author: Sumit Semwal + * Dmitry Baryshkov + */ + +#include +#include +#include +#include +#include +#include + +#include