From patchwork Sat Mar 30 15:00:48 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Baryshkov X-Patchwork-Id: 13611596 Received: from mail-lf1-f45.google.com (mail-lf1-f45.google.com [209.85.167.45]) (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 80C2638F96 for ; Sat, 30 Mar 2024 15:00:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.45 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711810854; cv=none; b=MbzMUxKz81wIB1z2wU//YK/ef+RiJMFnK8faV5RbhgXV8hjgeh0ufzJ+l5W7ooRj9U+l5mOHiAc+YESthUADCvGt53UpRmHJmKWul+ak48RbUPBUI56J4DMHTBo1t+7nnUkxf2CPheqFYmExvH4uMkvVcm0ipuIY5290zv9vwTE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711810854; c=relaxed/simple; bh=6eyOWDzw9LhAdwHF11NxUmKTnAcKVzQqt7phGeeb+OU=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=k2Qeieo6hxJaEu0pGlcsl1qnY4GP9BP9xdmojaBZ1PXw9d0Jo+QotRXToV6AIPAqoiV3dkRWuhjjC7QOw1LNd4Zvixjx4ijhxWa0loDm/o7KfpXg73WmUGR1m6r0LkhHoWLrpu+AYXiYPea9NJOywvIU79Weiz2UI1rGKte0k+E= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=D3+Otqc5; arc=none smtp.client-ip=209.85.167.45 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="D3+Otqc5" Received: by mail-lf1-f45.google.com with SMTP id 2adb3069b0e04-513dc9d6938so3419572e87.2 for ; Sat, 30 Mar 2024 08:00:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1711810850; x=1712415650; darn=vger.kernel.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=OoeceOXD90b/faMyNELCuqZCbGS4AC8UJzwAJuXctxQ=; b=D3+Otqc5SEgS+zlRd6eB+WjDGnExgq/6uSCckpzFmdPWLzOgqwA5YWFBUYWTRQP4Gb Iy7Ud9Za+AdZEOUl8ieFwd7q7urV0Q0fSpVnvOWYu04ZInW7fYyNF2qXjqOcES3sqTu6 d/VciChFa+bOtjP2LcR9IJQCIIsLDr8qGoO8xCz5gDKZKUAq3Tnhg9YgogLDydEJ1/oL WiXqCYxoJIlMFlznSJ077xqGHhuNVUGwiWckJzx/PrhX+YRj+x2EKukGgyIJw+M4IELW 9WI/Ex6pynVHuGAu1wHmQPX8as/HeMNOIf/6ZdSzhoTDJUW8cw/JjdwVBSsCdCClskwY LlVg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711810850; x=1712415650; 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=OoeceOXD90b/faMyNELCuqZCbGS4AC8UJzwAJuXctxQ=; b=DCOi39n17fKM524fZPpgVuhZrQGPNzKl+ShpAatZziRJa/w+bYQ+DL3Pv9pud7Y1xZ PZHbYeILmoljAjsKtU6geXwj5mlNE3YcoDX1RGjZThwePXrcp27GSU2/vu6t6nb4aVDm QjVTHVyvaFD8qAAgtD//5kTb5m7ZLJRZbmKhdTbyFKD1mfFtdRIF3Y/f4ahVSBeUvBa1 KlSfpcTptsjL3YbIANk/JssyTGj88M3ZC0X/F830mrZnLsi1WDy4XWE7Xsb5Q9zgUk6g KPpJa9c6sqRgw74o60xTwRdJCNk6Lb3GWL2iskclD9zuVDy9/yW+/XcVjpvkkISLowAl 7eGQ== X-Forwarded-Encrypted: i=1; AJvYcCVWqjwzwGEpubVns1hh+FOFE4Csh5PAmP/Mbs7uYjwIv68Wy2+/1klJ8PIxET6jKTp5O66gjx/ahh2zg6T+Y7qt1IuzXaeWUmGeb71HWw== X-Gm-Message-State: AOJu0YwBtF7wzt31Rg9+ydDOrHEJyrYVlyxVPFNJvBpPo1HrDQsiZvAK WhNaaL6RnvTz7ZPY9nimfOCzfmuBW5ehPn4LBcOY4BbLKw9w3EKI57zs/mHxOhA= X-Google-Smtp-Source: AGHT+IHec1Q0uwQWE8BAAkS24eikCNlNUYUBM6/OoSwgMUeKpOolLXm7mOQbRk6KyKGxs9Tu1tx8AQ== X-Received: by 2002:a19:645d:0:b0:513:5951:61a4 with SMTP id b29-20020a19645d000000b00513595161a4mr3014559lfj.6.1711810850608; Sat, 30 Mar 2024 08:00:50 -0700 (PDT) Received: from umbar.lan ([192.130.178.91]) by smtp.gmail.com with ESMTPSA id j5-20020a056512344500b00515d205a6f0sm496199lfr.29.2024.03.30.08.00.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 30 Mar 2024 08:00:49 -0700 (PDT) From: Dmitry Baryshkov Date: Sat, 30 Mar 2024 17:00:48 +0200 Subject: [PATCH v2 3/3] drm: panel: Add LG sw43408 panel driver Precedence: bulk X-Mailing-List: linux-arm-msm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240330-lg-sw43408-panel-v2-3-293a58717b38@linaro.org> References: <20240330-lg-sw43408-panel-v2-0-293a58717b38@linaro.org> In-Reply-To: <20240330-lg-sw43408-panel-v2-0-293a58717b38@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=12229; i=dmitry.baryshkov@linaro.org; h=from:subject:message-id; bh=D6vJJI+0cd9TezSGqlz9pC0jmFumI9Fyojywzyt3GeA=; b=owEBbQGS/pANAwAKAYs8ij4CKSjVAcsmYgBmCCkffNwBqAropCyO2l9Jyg07Kxpr10x4DXZIo z9bQSoOw56JATMEAAEKAB0WIQRMcISVXLJjVvC4lX+LPIo+Aiko1QUCZggpHwAKCRCLPIo+Aiko 1SZ5B/9Cv+ba2KyMkgNicBHJyvACx8mdXa5zay9s9JfnrmHcgAMkkTyvPWJn3cA7lBke+Zj7LwX zz6JpF0DZij96RrVVs3h8HqkOrkHe3F/oVRCPA/jhy7weDjRCr8LZzbyff/cqqLbkFwu8hcsjSS +W0/jxzrtS78N6nd4YQ7G+GOLYd0VN/5BafXu9i6Hqv/FxwsynObGSnk/zzQ9ydQ/9RbKYnWwbg ayQ+dEXOTThpxdIbVZkughUOUtEAnqh94MenrmDUqFR988DJTrNs6M7UF6AjIPymiJPYYpe19rs bbeDlR50Es5A2/QRQ/PqZ79YtGSzKyikuMmyeiylkXpURNXO X-Developer-Key: i=dmitry.baryshkov@linaro.org; a=openpgp; fpr=8F88381DD5C873E4AE487DA5199BF1243632046A 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] 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 | 321 +++++++++++++++++++++++++++++++ 4 files changed, 341 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..6c244b9642f1 --- /dev/null +++ b/drivers/gpu/drm/panel/panel-lg-sw43408.c @@ -0,0 +1,321 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* + * Copyright (C) 2019-2024 Linaro Ltd + * Author: Sumit Semwal + * Dmitry Baryshkov + */ + +#include +#include +#include +#include +#include +#include + +#include