From patchwork Sun Oct 27 23:42:04 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jakob Hauser X-Patchwork-Id: 13852766 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 EBF88D1358F for ; Sun, 27 Oct 2024 23:42:32 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 5EFBF10E225; Sun, 27 Oct 2024 23:42:28 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=rocketmail.com header.i=@rocketmail.com header.b="G8gq/3Ue"; dkim-atps=neutral Received: from sonic306-21.consmr.mail.ir2.yahoo.com (sonic306-21.consmr.mail.ir2.yahoo.com [77.238.176.207]) by gabe.freedesktop.org (Postfix) with ESMTPS id 66A9F10E07E for ; Sun, 27 Oct 2024 23:42:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rocketmail.com; s=s2048; t=1730072542; bh=8XIBMPPJ42gdb5Y/4rMuxdsvD17E+KR1v4HtmxfGLTY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From:Subject:Reply-To; b=G8gq/3UeSpd062yZ2kCFaa8ODQ0C0+WOjhJbvcgU46aueIomifbBQBsc96joFEe6IeuS2ZUOZ8sqTXa17ikj9cFtnEFab/wXuAsn/TWeHMEKRjTyZ/l9ux4xce0VrW2F/xo5GOkfzP/2HElZUHslov69+T7xT2mEGXY/9lkG5WEIEmQOae0ebFHP5jNcEVEtVoBPIBzchLdG6IkpEqM5f9DSpJtD4Umz9RVPNs0yldY4+9Om9/t07/JKfygGTAg240YBo9KmVn51t0Wo74c8mKyqogduD3WzkvW80KeKHhZbEp1eEK72bXQhXqH7R5wEF+3eBoLgo1OFkvJUyFLoTw== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1730072542; bh=pUEGDzGQKxESuaOBAiC5fkjpdcuIXVxHR7QxIBzeSI6=; h=X-Sonic-MF:From:To:Subject:Date:From:Subject; b=MyUpYEH5S/xMu2mB+YoFzWrITjb/4+vbgFu/c/VsUqm7WjmriWoVGafAXzBPkQxxQO0l2Gor2uP0yf7ZNAXDAm6t8HjwVbEALDXy1rvdOacnJjwbru8gTgUT57MXDfFJ2nZrkQFok3HZNc5Z+P0BsLBiEoKqD4/WI7CN2WewjkIRqUrkQObx8E39cNK0SdMcG0dKn9ELvbuKIA7GHtmwm3TViwtbTRAIYe2B9LtAXQonJd7tLcb2y8hFPOaCtGyX7VdhJEjHaLvlsUJoOe9X8KB2IIeQ7aSJrhFLnTELtKf4SehO7Df4p3K7vUMUpFPss9mVu71ZLMiFIVLT7+ClaQ== X-YMail-OSG: 5ITGqTcVM1m51TwlXbrgnZq8zDBs2eGzzI3MH19.va07sDiyi0t_Fv0A2KOWRLK T5CK743FX3pRBLpR6NTfapOBZos86713q_V_vh_yE7y7NJ.4SYzYf7t3KQmgTMa69qnjK3e4NqLc pUiAn9H0r.KXJ557JVx.sRl6fmi_zImMnkseDkFRDaFN2iPksUMudhvWh9RtCcIulU87VVX_evzc cSgv.LsEdxrDhzrLQBAG14rxul2g8QYCjaHLwFA.8PpSeeW_LzOr_PqSascTE6QqHZ8OWqDuMGkt IA_FMECR8qGX4SazwrvcMAP6KH7nWDEq0qOXRiTSxdHVD4BZMj500lFkvwj9LxnF1QaWhTIYMVX7 I1.7u_Ua2RHhrDgcXI7KBA1t.XMLuhiJYZSBMRZlm1Zij2JCSR.j85rwxM4_miUYTJ8d8PhwvNlv Ccte3ipjN0mrj2jLgxy3KLJVSCEdn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WSFsjL6PdiJzLj4fOKV.nEZCwgvwwMUBg0SJgnGtO 3c1.PKAbv0IDXl5MGJ4A299gND5Qwmg0TjMU9cQPXfGcEZAG5Fn_2ve_xZZUbGp1pCYarfjOsLMc L535_QhmmGSK3ECNfsaAo5JGZRKBFdg7sJ5rOFyJsieNovpKnehhEcz9MagMqLiNAi3sf3wjRvjn TXZRpe9swjUZUPZ92HuhF_nWfKo6tNvabc795kv9q3K1sWJM3IXUsnVYkD3TXvcjWqP2CFyqRHcX uyCOAmTahrTVrx09s8JQoKjGRiCxTFz3fuY.T8Aal8hFgnWfE6PruZbW6GQVNj_vsuQDfDoJGmLf RLdYEFhmJT5p2qffHEDqDIN63vTk79az4a3FP2rHwcAHVd14npSJQSCAoiDlvpt1eJg4rPsVswVs Zouex65.PdyCSzI.1avwd7v07JpU_inRfkWtGExjftyP4TfUTMMmvBj7zV7cMAPaf3P8uSrGCN9q f4L472al3u6L.vnfBT_wmdm_CiCNPzsqf4nbqS6GG0k2pM0L2CJ4zHyOuPyHCE.4PNCJejfyqswr GFtjKZ.ZFZ6nEeuZQS3DIHQqWpG9qVeuR7D6pqtopcNSWjYuFedkjgRd.1sUnV991fGZ.UXMEL5D xjW9nw6VN99OT5U91Mb9DbgxCDKdEKIXrLe4UIeECFQWyKt7gGpvco8tUe5kW9H1Q5.2yXPiADrn dT2aYtvlk4iWtBfkL18mitmn_UElrFrAI9NU.5OIq4xMq5kU2_9CNPzAsTuIS.WJ4NkpmVsf97PD qcJWBkAMZ8TcnREqSC83GlxtP0LKQTyhTgiLVyRYih6iRzZFovQ-- X-Sonic-MF: X-Sonic-ID: 8aed8bf0-e626-496f-9a83-4ac2794e898c Received: from sonic.gate.mail.ne1.yahoo.com by sonic306.consmr.mail.ir2.yahoo.com with HTTP; Sun, 27 Oct 2024 23:42:22 +0000 Received: by hermes--production-ir2-c694d79d9-qzm27 (Yahoo Inc. Hermes SMTP Server) with ESMTPA ID fc681596c483b48011d8a98a0d7203e6; Sun, 27 Oct 2024 23:42:20 +0000 (UTC) From: Jakob Hauser To: Neil Armstrong , Jessica Zhang , Rob Herring , Krzysztof Kozlowski , Conor Dooley Cc: Thierry Reding , Laurent Pinchart , Andrzej Hajda , Linus Walleij , dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, ~postmarketos/upstreaming@lists.sr.ht, Jakob Hauser Subject: [PATCH v4 3/5] drm/panel: samsung-s6e88a0-ams427ap24: Add initial driver Date: Mon, 28 Oct 2024 00:42:04 +0100 Message-Id: X-Mailer: git-send-email 2.39.5 In-Reply-To: References: MIME-Version: 1.0 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" This initial part of the panel driver was mostly generated by the "linux-mdss-dsi-panel-driver-generator" tool [1], reading downstream Android kernel file "dsi_panel_S6E88A0_AMS427AP24_qhd_octa_video.dtsi" [2]. On top of the generic output of the tool, there were a couple of changes applied: - Added mipi_dsi_dcs_set_display_on() to function s6e88a0_ams427ap24_on(), otherwise the display does not show up. - In functions s6e88a0_ams427ap24_on() and s6e88a0_ams427ap24_off() changed DSI commands to multi context and used "accum_err" returns. - In functions s6e88a0_ams427ap24_on() and s6e88a0_ams427ap24_off() replaced msleep() by mipi_dsi_msleep(). - The function s6e88a0_ams427ap24_get_modes() was changed to make use of drm_connector_helper_get_modes_fixed(). This also required to include drm/drm_probe_helper.h. - In function s6e88a0_ams427ap24_probe() registring the regulators was changed to devm_regulator_bulk_get_const(). This required to change supplies in struct s6e88a0_ams427ap24 to a pointer. - Removed bool "prepared" from struct s6e88a0_ams427ap24 and according parts in functions s6e88a0_ams427ap24_prepare() and s6e88a0_ams427ap24_unprepare(). - Removed include , it's not needed. - Added comments to the mipi_dsi_dcs_write_seq_multi() lines in function s6e88a0_ams427ap24_on(). [1] https://github.com/msm8916-mainline/linux-mdss-dsi-panel-driver-generator [2] https://github.com/msm8916-mainline/linux-downstream/blob/GT-I9195I/drivers/video/msm/mdss/samsung/S6E88A0_AMS427AP24/dsi_panel_S6E88A0_AMS427AP24_qhd_octa_video.dtsi Signed-off-by: Jakob Hauser Reviewed-by: Linus Walleij --- Changes in v4: - Removed include , it's not needed. - Added comments to the mipi_dsi_dcs_write_seq_multi() lines in function s6e88a0_ams427ap24_on(). --- drivers/gpu/drm/panel/Kconfig | 9 + drivers/gpu/drm/panel/Makefile | 1 + .../panel/panel-samsung-s6e88a0-ams427ap24.c | 251 ++++++++++++++++++ 3 files changed, 261 insertions(+) create mode 100644 drivers/gpu/drm/panel/panel-samsung-s6e88a0-ams427ap24.c diff --git a/drivers/gpu/drm/panel/Kconfig b/drivers/gpu/drm/panel/Kconfig index bce4cb64184a..f8adc38447fb 100644 --- a/drivers/gpu/drm/panel/Kconfig +++ b/drivers/gpu/drm/panel/Kconfig @@ -632,6 +632,15 @@ config DRM_PANEL_SAMSUNG_AMS639RQ08 Say Y or M here if you want to enable support for the Samsung AMS639RQ08 FHD Plus (2340x1080@60Hz) CMD mode panel. +config DRM_PANEL_SAMSUNG_S6E88A0_AMS427AP24 + tristate "Samsung AMS427AP24 panel with S6E88A0 controller" + depends on GPIOLIB && OF && REGULATOR + depends on DRM_MIPI_DSI + help + Say Y here if you want to enable support for Samsung AMS427AP24 panel + with S6E88A0 controller (found in Samsung Galaxy S4 Mini Value Edition + GT-I9195I). To compile this driver as a module, choose M here. + config DRM_PANEL_SAMSUNG_S6E88A0_AMS452EF01 tristate "Samsung AMS452EF01 panel with S6E88A0 DSI video mode controller" depends on OF diff --git a/drivers/gpu/drm/panel/Makefile b/drivers/gpu/drm/panel/Makefile index 4db02c2411ae..7dcf72646cac 100644 --- a/drivers/gpu/drm/panel/Makefile +++ b/drivers/gpu/drm/panel/Makefile @@ -77,6 +77,7 @@ obj-$(CONFIG_DRM_PANEL_SAMSUNG_S6E63J0X03) += panel-samsung-s6e63j0x03.o obj-$(CONFIG_DRM_PANEL_SAMSUNG_S6E63M0) += panel-samsung-s6e63m0.o obj-$(CONFIG_DRM_PANEL_SAMSUNG_S6E63M0_SPI) += panel-samsung-s6e63m0-spi.o obj-$(CONFIG_DRM_PANEL_SAMSUNG_S6E63M0_DSI) += panel-samsung-s6e63m0-dsi.o +obj-$(CONFIG_DRM_PANEL_SAMSUNG_S6E88A0_AMS427AP24) += panel-samsung-s6e88a0-ams427ap24.o obj-$(CONFIG_DRM_PANEL_SAMSUNG_S6E88A0_AMS452EF01) += panel-samsung-s6e88a0-ams452ef01.o obj-$(CONFIG_DRM_PANEL_SAMSUNG_S6E8AA0) += panel-samsung-s6e8aa0.o obj-$(CONFIG_DRM_PANEL_SAMSUNG_SOFEF00) += panel-samsung-sofef00.o diff --git a/drivers/gpu/drm/panel/panel-samsung-s6e88a0-ams427ap24.c b/drivers/gpu/drm/panel/panel-samsung-s6e88a0-ams427ap24.c new file mode 100644 index 000000000000..8e4d012667d7 --- /dev/null +++ b/drivers/gpu/drm/panel/panel-samsung-s6e88a0-ams427ap24.c @@ -0,0 +1,251 @@ +// SPDX-License-Identifier: GPL-2.0-only +/* + * Samsung AMS427AP24 panel with S6E88A0 controller + * Copyright (c) 2024 Jakob Hauser + */ + +#include +#include +#include +#include + +#include