From patchwork Thu Oct 24 03:18:25 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jakob Hauser X-Patchwork-Id: 13848273 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 D2204D0BB57 for ; Thu, 24 Oct 2024 03:18:49 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 9337310E267; Thu, 24 Oct 2024 03:18:44 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=rocketmail.com header.i=@rocketmail.com header.b="YaD+/h0H"; dkim-atps=neutral Received: from sonic305-21.consmr.mail.ir2.yahoo.com (sonic305-21.consmr.mail.ir2.yahoo.com [77.238.177.83]) by gabe.freedesktop.org (Postfix) with ESMTPS id 07F3D10E896 for ; Thu, 24 Oct 2024 03:18:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rocketmail.com; s=s2048; t=1729739921; bh=XLp036BwmbZpgXYR1m9+ojQGCSAhTh/SmX7gBH+7S0Y=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From:Subject:Reply-To; b=YaD+/h0HsolWctHi+VqUr3EcJREbG0AWHWeWSuVoDl9FwkPFPnvqIej6FDY3WqIV5aY9Jf63qcVcupPjwSQvRgtaz/3abdub/vO390yBoGJjMJZmGL6oIOfPexsXGWdskT/BBWvwsKkk6vLcjK+YCI2Tpsht3Pq5hsJifWPxEK4+nwoDSHSnL82MWQtewJwC7gwmtErEhQKdE/AhigfOaid1Wa9MfZy1QAU359haKcrOCNvf8F7fvN0Ctxchmd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_UeB0y02nIMJyLcbF5W2OxlO0T vGNao4.LeNEygfHR4JizpFs1T8hyuKHbV0Q2WBUeZDnbE2iYRa6OpIGs8AzODdVZN9wGjg9ky96q PVHLaQ1NVsngaWyHGD.r.kkv6eSnsA37NUIPyPVoGX0pJUuYRrad2EguOZY1QN8RsjKLesuMOY_F rJs.9m5A.l4RA3ZOzIb.Tl3SOFrXuETFsKfj6XD6Fr8kazwyIwRIdY_6iCYlevZ5kDiO3O3Hay9S YqFDCiSAsiyigrjKDHTD9nALkClOLhISk3zhR24q6EblSoKl.4b8y1jdZ7lPahQ6X2cXc76eBOFl aG3SLGqQQs3M0JBpFydyVCwnw7kQSX09eXSmfJ05H5uQP4uUXqXMD4sOVA7DwPBOzNvMlbIcB7JP 7V0_eIN6p0skZA88U_aFNvoOcWkZlhgoYIlmTcEKLHU9.FMmtWpOKeLaWjc5KGw1JkKHNhA96e.d Px9ZhdTyopT.NibNPyx0EW.8p3m9rrc4ti6XgdggpVom5FGMa2OUW5c31dXRJ.ZGZrAcArK47vXF QJsOAHcfsVh98SDfoQPs0PpSdzOxgg_6cL17D5jKodpHSNWiE83hfAiAuBJyPWsGAJRsbU2StsA8 .jAWLpAsPlCg5jaTxFE0dQDhh8HFKV9sjX5kbb5Ty7Izo26KGvyNt9RMqdfeJDbvwNWcvgpp_enJ LIl6.QRL1MqSKJcsyFBx8IrtzsU0aJIoMW3m0E6sKUZHh2Up_pzDefPQdaqeW8o.gxkwNWrhABV4 hjsAxz5ZtN3xyJ2VJqeCfX8j3KELLdqj_XpZ7jEhQEp6vOmZdN9rSkQM- X-Sonic-MF: X-Sonic-ID: 66342042-12ab-43bd-bf63-08845b443e26 Received: from sonic.gate.mail.ne1.yahoo.com by sonic305.consmr.mail.ir2.yahoo.com with HTTP; Thu, 24 Oct 2024 03:18:41 +0000 Received: by hermes--production-ir2-c694d79d9-2zgj2 (Yahoo Inc. Hermes SMTP Server) with ESMTPA ID 26d1652bc1703d2ade3e89c3cd33808b; Thu, 24 Oct 2024 03:18:40 +0000 (UTC) From: Jakob Hauser To: Neil Armstrong , Jessica Zhang , Rob Herring , Krzysztof Kozlowski , Conor Dooley Cc: Thierry Reding , Laurent Pinchart , Andrzej Hajda , dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, ~postmarketos/upstreaming@lists.sr.ht, Jakob Hauser Subject: [PATCH v3 3/5] drm/panel: samsung-s6e88a0-ams427ap24: Add initial driver Date: Thu, 24 Oct 2024 05:18:25 +0200 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(). [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 --- Changes in v3: - Made struct s6e88a0_ams427ap24_supplies[] "static". - Removed the "panel->prepared" parts from functions s6e88a0_ams427ap24_prepare() and s6e88a0_ams427ap24_unprepare(). --- drivers/gpu/drm/panel/Kconfig | 9 + drivers/gpu/drm/panel/Makefile | 1 + .../panel/panel-samsung-s6e88a0-ams427ap24.c | 252 ++++++++++++++++++ 3 files changed, 262 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..7435e0fcb4f5 --- /dev/null +++ b/drivers/gpu/drm/panel/panel-samsung-s6e88a0-ams427ap24.c @@ -0,0 +1,252 @@ +// SPDX-License-Identifier: GPL-2.0-only +/* + * Samsung AMS427AP24 panel with S6E88A0 controller + * Copyright (c) 2024 Jakob Hauser + */ + +#include +#include +#include +#include +#include + +#include