From patchwork Thu Oct 10 18:31:49 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jakob Hauser X-Patchwork-Id: 13831295 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 15968D2445E for ; Thu, 10 Oct 2024 23:20:31 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 4ECB210EA06; Thu, 10 Oct 2024 23:20:29 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=rocketmail.com header.i=@rocketmail.com header.b="bgvRaJr9"; dkim-atps=neutral Received: from sonic312-26.consmr.mail.ir2.yahoo.com (sonic312-26.consmr.mail.ir2.yahoo.com [77.238.178.97]) by gabe.freedesktop.org (Postfix) with ESMTPS id 4807210E9B2 for ; Thu, 10 Oct 2024 18:32:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rocketmail.com; s=s2048; t=1728585119; bh=VQ4NzBF3TD+BrXUOBvpilZ2FzFEEeRSPx8VYOZUJm+4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From:Subject:Reply-To; b=bgvRaJr940vdJWV+FI+yDeww3ulr9vY1x0ynmSendnaqRRxVztNaxJf6UYURdsw/n6pFbCcSO8vKC+9e3eIZLwKOR8uzYSXRbi04z64oX//8SYZTG3fA5JahA6t8m3zznikdokNNK+bDWafsDBt7EGszGiQejsuA5z+5hHi7abkmC/7EC9gZNKAcf9QHsaZY0hJe6Q0cJXW1cpJNhib9PrRB9sbF93owi8DumVJS6aXnEb8qanq+efX3WX97eXCK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cgtKmOgNVL72cm1MydUlgb5uQtbBkqVvoop.GDQ7d5eIQ jXK0RROft.yaZmGJyXK8jVAoG4OAZfzayqSOojoLTpqAf7.IvZCrE97v_DwgfZsafk6TrI0rATz5 o_83oaG8Ed8PIsMoBWcB5tDWs6etrbQFerIUrks5CAlHfwHy4.vtBkhNem8GZfC.bjiM1Glpk0E6 4EjzYujz0FMB2V9Pr93Zp7le0UIv7sORRMDCaSZoL24ForBAKI3su7GneB.vI4czDQ9pfnWGI6tq 6m9Ku1DGzls5ndHSVN2W1gXkt.mCmNn7lw712SbodbSGoU_S4.OcZC2vO1cST.36Dk70vGgD6opz Gue.tkrZ3s.sK5n_VBLUB6b7L8Gg85zl17B4Q0xCqu1T.wlYkECBB32hVTzpq_xJpZxC_vGZH7KH rYlTqwljOwBfCDStx60RUS4W0IfeZk5uftfQzyV9Z7uf3g1PjVOGhZwFubP0AI07yGaadGTTVKj. cn4AWjG_bGYSh5xb4Fe1g82_m4kSxZ0frQmery1MJDkhl9mFg0JKm4FzF1QW262L96nZTymuRLsZ 9mlcoQNE.XLWrPVWzDq_cGXEgNd6mIgQ1YPOxBmy0WS50w8nNX2moZYkjAhlBrh_MVkFMGXW9FDm AoMpZ5lVDoJWmqr6m0trowEnLrxakWlKReSUde8wdYwSCvCuQFbFQIlikjR8rpLe3WphUgeldMCj CpOiQhTi.Du9RGDMcoAcGiBMMR2esWz8v955IaoF0OY2VOBD7IEdbobCd5wwRs.tndvMXK4yeits 4mj1SPDU8L67uSp3iLRZl.Y8EExK7MFIbbIUAtn7ZyHR58jz1lhhuPzle5Q-- X-Sonic-MF: X-Sonic-ID: c3365b06-8d82-45d8-b1b1-a24869898cf7 Received: from sonic.gate.mail.ne1.yahoo.com by sonic312.consmr.mail.ir2.yahoo.com with HTTP; Thu, 10 Oct 2024 18:31:59 +0000 Received: by hermes--production-ir2-6664f499fc-97g4x (Yahoo Inc. Hermes SMTP Server) with ESMTPA ID 7a7b462d09211a1a6528a42ebeb90f61; Thu, 10 Oct 2024 18:31:58 +0000 (UTC) From: Jakob Hauser To: Neil Armstrong , Jessica Zhang , Rob Herring , Krzysztof Kozlowski , Conor Dooley Cc: dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, ~postmarketos/upstreaming@lists.sr.ht, Jakob Hauser Subject: [PATCH 2/4] drm/panel: samsung-s6e88a0-ams427ap24: Add initial driver Date: Thu, 10 Oct 2024 20:31:49 +0200 Message-Id: X-Mailer: git-send-email 2.39.5 In-Reply-To: References: MIME-Version: 1.0 X-Mailman-Approved-At: Thu, 10 Oct 2024 23:20:22 +0000 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. Coulnd't read out RAW EDID, /sys/class/drm/card0-DSI-1/edid is empty. [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 --- drivers/gpu/drm/panel/Kconfig | 9 + drivers/gpu/drm/panel/Makefile | 1 + .../panel/panel-samsung-s6e88a0-ams427ap24.c | 261 ++++++++++++++++++ 3 files changed, 271 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 ddfaa99ea9dd..fa6a8c6cac5b 100644 --- a/drivers/gpu/drm/panel/Kconfig +++ b/drivers/gpu/drm/panel/Kconfig @@ -623,6 +623,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 4b5eaf111676..3002087c26d1 100644 --- a/drivers/gpu/drm/panel/Makefile +++ b/drivers/gpu/drm/panel/Makefile @@ -76,6 +76,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..182ba8c347e2 --- /dev/null +++ b/drivers/gpu/drm/panel/panel-samsung-s6e88a0-ams427ap24.c @@ -0,0 +1,261 @@ +// SPDX-License-Identifier: GPL-2.0-only +/* + * Samsung AMS427AP24 panel with S6E88A0 controller + * Copyright (c) 2024 Jakob Hauser + */ + +#include +#include +#include +#include +#include + +#include