From patchwork Tue Oct 22 21:33:37 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jakob Hauser X-Patchwork-Id: 13846199 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 22902CDD0FB for ; Tue, 22 Oct 2024 21:33:58 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id A5CD410E225; Tue, 22 Oct 2024 21:33:57 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=rocketmail.com header.i=@rocketmail.com header.b="U10E7peQ"; 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 59FFF10E6DE for ; Tue, 22 Oct 2024 21:33:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rocketmail.com; s=s2048; t=1729632831; bh=70QVeRtyDiMg9KxW5Djk0oZQv4ngnf+PlKtHAYt3mCU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From:Subject:Reply-To; b=U10E7peQ1sG0nDCQwHqanS5scnk/0khfL9xFVrBeI9EO/t9F7Fu5hXOoj7lD4iM/nrxe+LALhE66uvIssh5ZjSB+ikDOhjUNoSTWf7zRo72+Mh44IlV5+NlII7wT8JeWk21BJ86sk3dgzHuL7fNX7VoMXQ51fi39INcXjgXBeveBw7sn3diDJtGfNb3YX3brhfvkTeCHpUoyu4F9IrhVOcrIRV+Oa4qClH7gsmo2/kKJBKd5/vLSkOBKWBXCFWNxiOEe5zqJuypfumBqzYCwBs8Fr90FzTPr5J8aPO74pGymHlC8vm5r/ryxbBbxBYzSa9FCu9iuTcpGDEcjDgPwEw== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1729632831; bh=N+Y8fbwXRY/dpy15/Is41TB5/5vs5e6EQmG4PmjqMXl=; h=X-Sonic-MF:From:To:Subject:Date:From:Subject; b=faETbkP32kEvtwHyUQR0mgNCc3t8IQBpfIVHDt+9kV2amKmFd6g9HdqmWDZZiQWzIXR6flHtLbj35PjYY8Dt8cO+5GKyYyKjYsg0+U5mXivW3Mz5Q83Ldvojap/d6znKytTf3DXZxggjw4K2xdSNq/JnmFIgaUtHWM7fYowz7p3M9KdTJBk38WUaejAFZLbumqQesX8mqOnGkpaHk6CKv6m+MsCx27YVD8hiQOwQOOKu+Vxep42qP+5RVqIZZjrIhFs0oMRD7xPW8GvNEwr4Q+ArJ23/g046/dNIAUDRtq3WG2ghXK/5CPkazON+vyn7YLC1+7GWOPHJv2qUMLwfcw== X-YMail-OSG: AyD3kEwVM1kZlugt63NC1r5xzUJaJQ89y3TOsrfo9DzTEQNhQZ7qFf75qksr7H2 sjgwJp88tt708JmYdtTeqGiyXhIAnBtojIO5xEK_PvZ9zEermbW3PmHrqqgeANR1tar_z54.jT3A 8TliZJeM.KyvpBqAKOFRX7BwYWyr5aaEGyklggVybKe7AlAA_LlONS5DD7kljD.lARDzdOEkmHor YFuOcVTCGnaBXtVmjMW15E9O5P48i3UDey5M9.ot60jSCVoWGGuyauHnLAOb_YJ7JZ1mZdvt1Xks SpEZwum1KGpUGk9WiVo2QG7BGriQHf7F7n9CC1ecmxWrO6i.c1n4BUhOwY_D5A_FIDXkBcGhIOpO ukhrpeFytvImDwIntWflYNtjYyWfAbsYl1wa.nWC.JR_wYNervOkrr7cEz6TwbQn7VIPKGAv6t35 5U6IsZIa9s2lHzpYk2tm826uZaMXyRre82cYrdkpWDADB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2AizHqz6IWUFNN2NUCyoxywPC ghfLfLDzj25aMX2jZ2PmUiWago_HZkqalPkVnhLTqJRlNU_dZXptdTCwGXDrOrpPUrD1Q_6e9CbJ 16pPOeZI4DwUiKwTJg2sEpCu_tf.H0dC4tc.PAhnwmZ_P3Gc9qFYBCBzJ4oF1GOCbBV2NsEh0kwq 4_qnKtKGaGO2yJUe47JrpJVD0WmK2RJ9lqLv7IQhiL2qeV7d5ZjIwuXGhOili8GCRSiqkvvccTZH 3XXAqPUE3zt18zKotbbQ94ONiCHU5y5uf4lZ_ZB_q1anbMLahMZhFSCgPMKB.wxmka4r12pZcRtC Ecb44JeBapoWqM.Thz4mpDluoEJXbq4U9NALuYexWCdQ5arcUX9p47vE.8gx6OJezzs7na5qgHc0 jxj_Cw0lB.b9Du4voT2Dy6E29mTC.k2e02lp4caYn0ZsdQV2DdUCy71vflrrd1DxXmrpLtBAxCok VHj1Pe8o6NjNeCe0V3DieLJgEv8o.OHeCyX.UHqJdNZ6FXnsqY7XlrV2_UzE5l0JFiZkqEOWq.gO wj9UuOmOSo9slv2RznGMbjTaFNvDvAZVqy1hEsgxJ1HOuVFIHgoVaWZ1lO7vau20JjosgZHQFSjp E4eA0FnWsDlgLKrAd40rL8Qb1DH3dSrUXP_OkE9XU4gjuYNTJ3kFbpjbzKSKfLIDZ_gteivwvfie yTis_nnbaV_jZvNd1PQFG_4dbvgxGj1udm5MgKZuaNdFqUjuC2SqEz0RScImWN1guop9qwYjCCHq 9ayF84bDUzPcMaEWUyObH2UHPLOjoQ_bJDs4Ty7u.4TAMNymGJA-- X-Sonic-MF: X-Sonic-ID: 35b9d1d3-400a-4fc6-b194-8a75753c9daf Received: from sonic.gate.mail.ne1.yahoo.com by sonic305.consmr.mail.ir2.yahoo.com with HTTP; Tue, 22 Oct 2024 21:33:51 +0000 Received: by hermes--production-ir2-c694d79d9-qjs6q (Yahoo Inc. Hermes SMTP Server) with ESMTPA ID 00a5d0a4af66107c7c1614b6d685cac8; Tue, 22 Oct 2024 21:33:46 +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 v2 3/5] drm/panel: samsung-s6e88a0-ams427ap24: Add initial driver Date: Tue, 22 Oct 2024 23:33:37 +0200 Message-Id: <3a7d3e17e37819fa0a198a37d0c2f54de7b93971.1729630039.git.jahau@rocketmail.com> 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 instead used framework-provided "panel->prepared" 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 --- Coulnd't read out RAW EDID, /sys/class/drm/card0-DSI-1/edid is empty. Changes in v2: - Removed bool "prepared" from struct s6e88a0_ams427ap24 and instead used framework-provided "panel->prepared" in functions s6e88a0_ams427ap24_prepare() and s6e88a0_ams427ap24_unprepare(). Mentioned this in the commit message. --- drivers/gpu/drm/panel/Kconfig | 9 + drivers/gpu/drm/panel/Makefile | 1 + .../panel/panel-samsung-s6e88a0-ams427ap24.c | 260 ++++++++++++++++++ 3 files changed, 270 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..0ab2768e0e2b --- /dev/null +++ b/drivers/gpu/drm/panel/panel-samsung-s6e88a0-ams427ap24.c @@ -0,0 +1,260 @@ +// SPDX-License-Identifier: GPL-2.0-only +/* + * Samsung AMS427AP24 panel with S6E88A0 controller + * Copyright (c) 2024 Jakob Hauser + */ + +#include +#include +#include +#include +#include + +#include