From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.128.51 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1794936808; b=ZU0WX+wZ5bHVnUfYGdXMsuexdTqREURfxdt4mMSiwYn8tkkkAWyyOImiU65c94qQ089A CFYtw0114dqwCVaJu9gzFMw0zdxt2bmXlJ1En0AeEbeFMV8LYhpLGOjnRtwMOWdA/IPrz ev+5gb1RWWnIpdQZRFDP0wuSzQ52MwcWe7MVY8OEYH7AB1qEKfoK2xNIvAWr2OxFhtpA1 huYrRqEkDVG8E5XoNFwuz+9xbj0dova+fxZGvHiGyFibKTuAabkDDsFK6gu4ArxlSPuKB OF4s7HdThkzj5jdTsMN6U7f0k+V5jG1URQl/qP5mL72WDNdIKos0FSaJW9607sAN1QA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1794936808; h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature: X-Forwarded-Encrypted:X-Gm-Message-State:X-Gm-Gg:X-Received:Received: From:To:Cc:Subject:Date:Message-ID:X-Mailer:In-Reply-To:References: MIME-Version:Content-Type:Content-Transfer-Encoding; bh=KF3SMmLlEuJKFWgWa3AUTSaSVpCCSdLC7SUtbUFPE9k=; b=1INhe/bnycdNER+PKmiCzwumKRiKL8Kma6vRPdGPox8/Q2lxAh0s1zdmCbZUxuGVe2uk gaapEu6yqStIZlYWOYk9fjGWEcDgLy+8JFlARBjcJr5qpZQTkigJTuETb3NN9zWpSAe6B GpmtaGZpWvKvWTs0ZEXBO536Bt53ocsVxrUpvQrAWurOgqAmf6GuhNzF8IsMk+/H+7xe/ lylcq4qSkh8WUFrn732hLluOmz5Nep+pAsii4vUxw3PAqXWfklB1UJ4FU08f1nPtFN0oA CRXfXzFfm7wQHwy+UXpXc6G148GFQ7PLPF7qdRGKXaUHHVBeoir4WZBVmxV49WQwSaQ== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=RhiZBaDR; arc=none smtp.remote-ip=209.85.128.51 Received: from mail-wm1-f51.google.com (mail-wm1-f51.google.com [209.85.128.51]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 496A6606A887 for ; Tue, 17 Nov 2026 17:33:27 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 496A6606A887 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=RhiZBaDR Received: by mail-wm1-f51.google.com with SMTP id 5b1f17b1804b1-4ba013938d7so1109035e9.2 for ; Tue, 17 Nov 2026 09:33:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20260707; t=1794936805; x=1795541605; darn=vger.kernel.org; h=content-transfer-encoding:content-type:mime-version:references :in-reply-to:message-id:date:subject:cc:to:from:from:to:cc:subject :date:message-id:reply-to:content-type; bh=KF3SMmLlEuJKFWgWa3AUTSaSVpCCSdLC7SUtbUFPE9k=; b=RhiZBaDRVHiVfqFm5YqEpDsLn0xJLXI1B/6G0/G5CrqY5uQB9y0pfZd4jQEZ6DsLba pv+RjXqiTYrEqv9pUzOgI9maKgTOP+KXQEKCeoVB/BAxXf9UoDcwjSbEyZzLZK9/45NX Bcdsqhg5jm3biO+hybTXaLc5AQSf/OxJLLWD/16tbSrwfJbqYlHgRJfLrsCdNys6ZGuf mOIZjkrvpNAWT6RpayHNRiJWnSfUNwU7L7EitS88opr8WSUjCwfNhA59ZGO26BaRnuFh wYBTuo3Z97tSVRZgw+dxk5DDv/yIP/p4OnavIC0TMz5WkxleKfYhoABmCWfC0tOHjYm5 pt0A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1794936805; x=1795541605; h=content-transfer-encoding:content-type:mime-version:references :in-reply-to:message-id:date:subject:cc:to:from:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=KF3SMmLlEuJKFWgWa3AUTSaSVpCCSdLC7SUtbUFPE9k=; b=ePUFezXG4ARECJ56KWCBgKYc7uA/lLtQ0+z9GcVbjqUaM2M35btAP6SkkJHLBulg6Q eZvbwO4+MB0h9sFqvMvf3z8Oajn4zGUiFJaAQSkBdle2bOS2SckLKkf1EdzLIIPvvV9v y0Q9Q2EhldWJMYIyUhtQvAiyTbwDT5tI/HWxOeTLsNBIa38lZcxlX0gOuMNd+nJ0cwTy LdvX9Ou1wN/mFUtht88eJ8I49h6GMM4uQ4ZVcoArQYbLpLnPCcy1o1UGkQTCBWu1oXhE OkDmHRzBGu7bZU41T4jfOE1V0qr77ZrWcQq0SGxawvH/APrDslvPT2CJYr4AWOvAKDLt BT4g== X-Forwarded-Encrypted: i=1; AL+hErFFXAEHvDfhybzRE57IxVO+Se6P5/lSAOFTMnTsqb0MkIlInbbsDILZ59+CX3PlJEwnyvnPKizp2EJD@vger.kernel.org X-Gm-Message-State: APuU4Z9+vel7/fgMVzL0LrarUuNt1XgkCyvv7x+DTqLU0dba+mo3C2K+ NUc/LCWEfgul3liNZ2uFDZqZtFhGEEux4jLIlat09ADLV7tjpf9XA+XZNlghH0VAYWXQ0Q== X-Gm-Gg: AYBFou1wLtc+BWW7VawuLgwPfsDPQTFQTkpHc+XI+Ap+ajCK5KYNx3V4tM0XFXltORs qPtyqW7N6Ja6ulhf5x7eniIIdcuxLS62Jf+qvZWX22e/6eh4Hb1USnGT6lS9C65Wz5rKMRabjsr SapM/XdtwTtyT9CqFZRYuzX1iece1U1a/tHC4DDY8iUxSlc+dgGgdAoydOwAdQTxlTC60Q7Ms4v WNS7GUEt+zP3XnOs7QxpF4Xx/8er06u52C55SagdyJsIfV66wVsSGMrTbe+VkSx1OljmLRWGjsv UKOnHQbSXwjd9vm3trmzUuw6w0R4vU6PHEphPNL7iqBIaR5VKeOV96LqZFe/6IN5NHOyNZwg0Bv URzWd30CQYEPXiFSmeMeNlMyPSggIAt2VVuRlcVG7n9w0iNX9rjpjcuOKl2dW3CmCHvQg96g0m7 fKUQv+qLvN5P8o/bTUWoyhUtdB0UfM/2zxCctTLoaUeKJaeXt58LQwEHhXPAAayfIvRy79oznIb Ur8MR1hru9kfQ7ru4e2sEaNB9QigVE3mYAa9HqH9gHmupYQei5UWW2mVSnINz3BqoeYFfaHbhZN Z05/s6tYHQ== X-Received: by 2002:a05:600c:c4a2:b0:4bb:7581:2bb9 with SMTP id 5b1f17b1804b1-4bb75812c05mr124144785e9.22.1794936805415; Tue, 17 Nov 2026 09:33:25 -0800 (PST) Received: from dl360p ([130.61.107.245]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4bb783f8220sm79269585e9.5.2026.11.17.09.33.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Nov 2026 09:33:25 -0800 (PST) From: =?UTF-8?q?Adil=20H=C3=BCsrev=20Tepe?= To: neil.armstrong@linaro.org, jesszhan0024@gmail.com, robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org Cc: maarten.lankhorst@linux.intel.com, mripard@kernel.org, tzimmermann@suse.de, airlied@gmail.com, simona@ffwll.ch, dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, =?UTF-8?q?Adil=20H=C3=BCsrev=20Tepe?= Subject: [PATCH v3 2/2] drm/panel: add Novatek NT36525 panel driver Date: Tue, 17 Nov 2026 20:33:19 +0300 Message-ID: <20261117173319.1852638-3-tadilhusrev@gmail.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20261117173319.1852638-1-tadilhusrev@gmail.com> References: <20261116070212.314228-1-tadilhusrev@gmail.com> <20261117173319.1852638-1-tadilhusrev@gmail.com> X-Mailing-List: devicetree@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add a DRM panel driver for MIPI-DSI video-mode panels based on the Novatek NT36525 controller, as fitted on the Samsung Galaxy XCover5 (SM-G525F): 720x1480, active-low reset (RESX), and a DCS init sequence that mirrors the stock Samsung bring-up. Backlight is handled through the common drm_panel_of_backlight() path. Tested on a Samsung Galaxy XCover5 running 7.4-rc1 plus this driver and the matching DTS/binding: debugfs reports the reset gpio as ACTIVE LOW, and the DSI panel connector probes and reports "connected", with /sys/class/backlight/ present (re-confirmed 2026-11-17, kernel 7.4.0-rc1-00023-gdcb8b91fb779+ #30). Signed-off-by: Adil Hüsrev Tepe --- v2 -> v3: no functional change. v2 was mistakenly sent as a diff on top of v1's own (unmerged) patch instead of a complete, standalone patch against mainline, which Krzysztof Kozlowski correctly flagged as a git-management mistake on my part (see the cover letter). This resends the full driver as a single patch, folding in every v1 -> v2 fix below, and fixes a Kconfig help-text typo ("active-high" -> "active-low") left over from v1 that v2 never corrected. v1 -> v2 (addressing Sashiko AI's review of v1, https://sashiko.dev/#/patchset/20261116070212.314228-1-tadilhusrev@gmail.com?part=2): - Set prepare_prev_first = true before drm_panel_add(). Without it, drm_atomic_bridge_chain_pre_enable()/post_disable() call this panel's prepare()/unprepare() on the wrong side of the DSI host bridge's own enable/disable, which host_transfer() rejects on bridge-based hosts (e.g. samsung-dsim). - Fix the reset_gpio polarity: the driver drove the physical level directly instead of using gpiod logical values, which inverts under the GPIO_ACTIVE_LOW DT flag added in the matching binding patch. RESX is active-low (the 1-0-1 physical pulse the vendor sequence describes); switch the DT flag and all gpiod_set_value_cansleep()/ devm_gpiod_get() calls to logical values with the same physical outcome. - Request the "vpos" and "vneg" regulators the driver already needed (matching the binding fix) so dtbs_check and probe agree. - Use drm_connector_helper_get_modes_fixed() in nt36525_get_modes() instead of open-coding drm_mode_duplicate() + drm_mode_set_name() + manual display_info updates and returning -ENOMEM on failure (which drm_helper_probe_get_modes() logs as an error; the helper returns 0 instead). - Rename the compatible string to novatek,nt36525-xcover5, matching the fixed binding; the old samsung,xcover5-nt36525 never matched this driver's of_match_table. --- drivers/gpu/drm/panel/Kconfig | 13 + drivers/gpu/drm/panel/Makefile | 1 + drivers/gpu/drm/panel/panel-novatek-nt36525.c | 491 +++++++++++++++++++++++++ 3 files changed, 505 insertions(+) create mode 100644 drivers/gpu/drm/panel/panel-novatek-nt36525.c diff --git a/drivers/gpu/drm/panel/Kconfig b/drivers/gpu/drm/panel/Kconfig index 7a520b4d6..b76b9521f 100644 --- a/drivers/gpu/drm/panel/Kconfig +++ b/drivers/gpu/drm/panel/Kconfig @@ -676,6 +676,19 @@ config DRM_PANEL_NOVATEK_NT36523 around the Novatek NT36523 display controller, such as some Boe panels used in Xiaomi Mi Pad 5 and 5 Pro tablets. +config DRM_PANEL_NOVATEK_NT36525 + tristate "Novatek NT36525 DSI panel for Samsung Galaxy XCover5" + depends on GPIOLIB + depends on OF + depends on DRM_MIPI_DSI + depends on BACKLIGHT_CLASS_DEVICE + help + Say Y here if you want to enable support for the Novatek NT36525 + 720x1480 MIPI-DSI video-mode panel, such as the one fitted on the + Samsung Galaxy XCover5 (SM-G525F). The panel uses an active-low + reset (RESX) and a DCS initialisation sequence that mirrors the stock + Samsung bring-up. + config DRM_PANEL_NOVATEK_NT36532 tristate "Novatek NT36532-based MIPI-DSI panels" depends on OF diff --git a/drivers/gpu/drm/panel/Makefile b/drivers/gpu/drm/panel/Makefile index da5175909..46de72db7 100644 --- a/drivers/gpu/drm/panel/Makefile +++ b/drivers/gpu/drm/panel/Makefile @@ -65,6 +65,7 @@ obj-$(CONFIG_DRM_PANEL_NOVATEK_NT35532) += panel-novatek-nt35532.o obj-$(CONFIG_DRM_PANEL_NOVATEK_NT35560) += panel-novatek-nt35560.o obj-$(CONFIG_DRM_PANEL_NOVATEK_NT35950) += panel-novatek-nt35950.o obj-$(CONFIG_DRM_PANEL_NOVATEK_NT36523) += panel-novatek-nt36523.o +obj-$(CONFIG_DRM_PANEL_NOVATEK_NT36525) += panel-novatek-nt36525.o obj-$(CONFIG_DRM_PANEL_NOVATEK_NT36532) += panel-novatek-nt36532.o obj-$(CONFIG_DRM_PANEL_NOVATEK_NT36536) += panel-novatek-nt36536.o obj-$(CONFIG_DRM_PANEL_NOVATEK_NT36672A) += panel-novatek-nt36672a.o diff --git a/drivers/gpu/drm/panel/panel-novatek-nt36525.c b/drivers/gpu/drm/panel/panel-novatek-nt36525.c new file mode 100644 index 000000000..ba3e003e6 --- /dev/null +++ b/drivers/gpu/drm/panel/panel-novatek-nt36525.c @@ -0,0 +1,491 @@ +// SPDX-License-Identifier: GPL-2.0-only +/* + * Novatek NT36525 MIPI DSI panel driver for the Samsung Galaxy XCover5 + * + * Panel timing and the DCS initialisation sequence are taken from the + * Samsung GPL kernel release for the SM-G525F + * (drivers/video/fbdev/exynos/panel/nt36525/nt36525_xcover5_panel.h). + */ + +#include +#include +#include +#include +#include + +#include