From patchwork Wed Jul 3 14:05:04 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christian Eggers X-Patchwork-Id: 13722914 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 EF530C3814E for ; Wed, 3 Jul 2024 22:14:03 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 81ED810E0F4; Wed, 3 Jul 2024 22:14:00 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (1024-bit key; unprotected) header.d=arri.de header.i=@arri.de header.b="HJZagDfq"; dkim-atps=neutral Received: from EUR05-DB8-obe.outbound.protection.outlook.com (mail-db8eur05hn2229.outbound.protection.outlook.com [52.100.20.229]) by gabe.freedesktop.org (Postfix) with ESMTPS id D7E5410E8B3 for ; Wed, 3 Jul 2024 14:05:43 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=LDAR+UV0J9wBVy+rRPWx/2qI1bZI7ZH3Uf64M2lNT7VuimNxYiAxMjUUqMroUAf36yq3HpWtWmDfriFm5FLCifIpJKx2v3zASz9h8vN+Ap8dJPGwqel66ibUyZ/WkvpqfIPZ798ZbGtRS5hXPJb1F6xhyKBy0LQI+haKmJROR17kA9WmEYRzWOaMH4xjbEI0qtcK+zWtId8t9Iiz2qN7yMIefO5w/VF9c4rLZDcjQr7zXbyd9lMoZzHh3Q/9hlmor7X4AMs2yqPu1M7M61L05cCxSceRkYybxlToLNlErrFNqDwYFSPU/pdSCvT/lNv5oG75PnfmGI+VkeKe4zXO/g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=E10gPqcL6hRgvaMs8XYn2D9znD4b6zwR4muSMuLp8o4=; b=gvDjb2L8UP1801qLGXLUAKsgB8EhF93uW0oFbDATfrXw425uzYUu5m97+uyx+FVO/bAW9XtbCuv6uDpeRA5ZjyXatZfWWVWlbIlJFd7dRa+oNRF+tc7UxXs9XmE5FQR2fSQnjprBlV4lnFXIxZ9R7U2PSE3XfdCruKj7oBkJM5284JcOVNAqqLrGi2X3+Vq0pUGyzCl/7h2BMscY4WS1Cokf/gpWGub8Cz7hRdJxoYDZL5E2CBhubeu+u/jwXPEW1nr1V3PXEXcqJziK/iCRfc6+PEnJ1AV4OSbQaAXvxb6F7xsPlavCpN45rdX++3xvsBk43jDIA5tiVoEXo7wxWw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 52.169.0.179) smtp.rcpttodomain=linux.intel.com smtp.mailfrom=arri.de; dmarc=pass (p=none sp=none pct=100) action=none header.from=arri.de; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=arri.de; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=E10gPqcL6hRgvaMs8XYn2D9znD4b6zwR4muSMuLp8o4=; b=HJZagDfqx002PhxHw7ZMJREapaKbK6OJYGb1r5XTDlhrPksYcQNUCGZ9svdO+9DOMSpElL68qboORJYatDTDk9xks2RKNnfITYUceVVsHyKJ5P/V/Wnd6219IG6T+QqEJ9OA0u66E9gy6r/3zIu2K9VluDXfANvu1BZDrOmHI9M= Received: from DB7PR05CA0049.eurprd05.prod.outlook.com (2603:10a6:10:2e::26) by VI1PR07MB6672.eurprd07.prod.outlook.com (2603:10a6:800:18f::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7741.23; Wed, 3 Jul 2024 14:05:36 +0000 Received: from DB3PEPF0000885E.eurprd02.prod.outlook.com (2603:10a6:10:2e:cafe::4a) by DB7PR05CA0049.outlook.office365.com (2603:10a6:10:2e::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7741.25 via Frontend Transport; Wed, 3 Jul 2024 14:05:36 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 52.169.0.179) smtp.mailfrom=arri.de; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=arri.de; Received-SPF: Pass (protection.outlook.com: domain of arri.de designates 52.169.0.179 as permitted sender) receiver=protection.outlook.com; client-ip=52.169.0.179; helo=eu2.smtp.exclaimer.net; pr=C Received: from eu2.smtp.exclaimer.net (52.169.0.179) by DB3PEPF0000885E.mail.protection.outlook.com (10.167.242.9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.7741.18 via Frontend Transport; Wed, 3 Jul 2024 14:05:33 +0000 Received: from EUR05-DB8-obe.outbound.protection.outlook.com (104.47.17.104) by eu2.smtp.exclaimer.net (52.169.0.179) with Exclaimer Signature Manager ESMTP Proxy eu2.smtp.exclaimer.net (tlsversion=TLS12, tlscipher=TLS_ECDHE_WITH_AES256_SHA384); Wed, 3 Jul 2024 14:05:34 +0000 X-ExclaimerHostedSignatures-MessageProcessed: true X-ExclaimerProxyLatency: 16751512 X-ExclaimerImprintLatency: 11350820 X-ExclaimerImprintAction: 829cb2d161f74764956e5a39f7feacf8 Received: from AS4P195CA0035.EURP195.PROD.OUTLOOK.COM (2603:10a6:20b:65a::19) by PAXPR07MB8339.eurprd07.prod.outlook.com (2603:10a6:102:220::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7741.23; Wed, 3 Jul 2024 14:05:31 +0000 Received: from AMS1EPF0000004E.eurprd04.prod.outlook.com (2603:10a6:20b:65a:cafe::84) by AS4P195CA0035.outlook.office365.com (2603:10a6:20b:65a::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7741.25 via Frontend Transport; Wed, 3 Jul 2024 14:05:31 +0000 X-MS-Exchange-Authentication-Results: spf=fail (sender IP is 217.111.95.7) smtp.mailfrom=arri.de; dkim=none (message not signed) header.d=none;dmarc=fail action=none header.from=arri.de; Received-SPF: Fail (protection.outlook.com: domain of arri.de does not designate 217.111.95.7 as permitted sender) receiver=protection.outlook.com; client-ip=217.111.95.7; helo=mta.arri.de; Received: from mta.arri.de (217.111.95.7) by AMS1EPF0000004E.mail.protection.outlook.com (10.167.16.139) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7741.18 via Frontend Transport; Wed, 3 Jul 2024 14:05:30 +0000 Received: from N9W6SW14.arri.de (10.30.4.245) by mta.arri.de (10.10.18.5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1258.34; Wed, 3 Jul 2024 16:05:29 +0200 From: Christian Eggers To: Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Daniel Vetter CC: David Lechner , =?utf-8?q?Noralf_Tr=C3=B8nnes?= , , , Christian Eggers Subject: [RFC PATCH] drm/tiny: Add support for Sitronix ST7539 Date: Wed, 3 Jul 2024 16:05:04 +0200 Message-ID: <20240703140504.8518-1-ceggers@arri.de> X-Mailer: git-send-email 2.43.0 MIME-Version: 1.0 X-Originating-IP: [10.30.4.245] X-EOPAttributedMessage: 1 X-MS-TrafficTypeDiagnostic: AMS1EPF0000004E:EE_|PAXPR07MB8339:EE_|DB3PEPF0000885E:EE_|VI1PR07MB6672:EE_ X-MS-Office365-Filtering-Correlation-Id: 05a03bfa-24dd-4650-8da0-08dc9b6935a0 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; ARA:13230040|376014|82310400026|1800799024|34020700016|36860700013|12100799063; X-Microsoft-Antispam-Message-Info-Original: tdoqC5B78OIiSNsP1p8MkH2ZV29s+bg3fcL8K0/fU54+U3+oFnD2ZfggOxsMxwD3OpnGU4m20SUHoTdesdLgHSmoBjel+QGTmqfKY6AA3faor2Re0FZx2OvdXmbfXVipNpmwSBrcGseZ878eh7jdgBhTXlDJaaGRCAJNgGb239KE44mvhn8szj+ikfWelUAkP+PnO+2eu9kNhurDcDn6uxM9bCL7KTah8j6iWzuW9L3xjLQVXF78NWwuTz1+WeBd6eQfkfYmDM1jZPqv1hDXzO4f7T21JuEdyWHRAofMzaGGhY9VJupLUCtsfTfQO02caIKPXztad4lfrneo8yFeqEucMeMRu165bQBFYpr7cF67IcV4c3KlJQMS32+y/UxHZKaqJx7TYZ7TL+5G4XCCOYL/haQAg4Fy1X06ah5vzPF34teNW2Sj5rBAtNLqFsY+9drfmehTjosYWkorrdTmmlKP9cHkyTW4iohrIg8VDEHhSq5f7rP9OjUXBXUF60bfVkOd3Yut788SqV0kKwG2xHyFpKEgbDLAxXXOyauHD7EjnWJjz9gm8TNQCNDi/2tRdMYPbFmhasCA1VuCW19bKmh+hrhQ1rmPHY7DptdILtcb7Jh+G1x9cI0iNZ9zbm95zCy+J3FBZFDJsEKyWMJfvOBAvvHk8Jo+OuNPISIhPyDZVsB2zhh1HWrOFZs3lKX4p9jxYw6EWpTyIWNf/F5YJTNycp2YzJ6MFg9FUQh0Xtew0wUs03+e/EqrcDYjLjiQqtxZ67cd0hZaddg5K6rv57Rh3MiegiRxU0eObaamaBJ8XNpIPekMqWJIzIvWOxuPRsCyfqYLBrg2MsluYk9YZLd0uufgaS40G5Q5ktK/KFqKN+dZ1yXzlFt6gEITMN+TaO8zJlWU79tGB2g3e1O44vULBMJao5gvXxZ+v0b6oUkGErIC1qzIcL5XCPJxDO3vqFD26/NsGb/673RiKDP5zm90yf/TSzwSjJgUujZVRSdwSCPVW57Xf+fbtZbldcCmbHXIAklor8alzBJinFhwO04nPm4pU5AotprcA+Ol1fpg2wNLSY1zymW2bJQhuFQvATwp/crsvzjO3rHCF6RRo/wsbOIVBE5GnQ+VlBkSO2MU21Pa7B5Pm+qZ1tSZLZqKX3nkki92B1h3t9qSTaT2INOE+qkkM8c55cmJqqTiQyA2j+83Tc2dBsyS+it2QqWBWtkp9MYJ0g+BZoege/TjTAGxYc8lo4Br7gzmOoRWm1rJdfmWQdll1FigLGarP1noqVhEzyp/XnNvH/sGil/RBdloHDqjlwctmUi+tFgdyt5P5yox2X6TkM1k12zKvtsauUEVUZ7AIX6TSO/BNMr0cgrM2ttuu73zqm3+b6selarA5T/td/8qKSJykaUsyoGY X-Forefront-Antispam-Report-Untrusted: CIP:217.111.95.7; CTRY:DE; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mta.arri.de; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(13230040)(376014)(82310400026)(1800799024)(34020700016)(36860700013)(12100799063); DIR:OUT; SFP:1501; X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAXPR07MB8339 X-MS-Exchange-Transport-CrossTenantHeadersStripped: DB3PEPF0000885E.eurprd02.prod.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 0cb1eaf9-cf4b-4266-88d8-08dc9b69327b X-Microsoft-Antispam: BCL:0; ARA:13230040|34020700016|35042699022|82310400026|36860700013|376014|1800799024|12100799063; X-Microsoft-Antispam-Message-Info: =?utf-8?q?NUbbP6btXxRLohVefNfGbQTXepcQm5y?= =?utf-8?q?OLtpG7vSEqOpHVFTitvBJ3KXLWohopsfknLbVPf3CmrrJ4eJVYel4uVgfBDdn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ar?= =?utf-8?q?kBQIGn1SpcYSDcdLWhzYJiqtziCNw57oJnkxjSnIgcx5qJ/pXondnkVuiPc6wGbVP?= =?utf-8?q?P2oH9HThtMNZTUiUWXMY2qWYQE8qYfIwLqM+RrMVfGt6CVJ/utTizj30A/BgymZEG?= =?utf-8?q?hewUIiDEEf0ta41T/5GRoHKH/ZHtC6acLj4avZMDcY4Eu0w2GuMIh6uIvGgMkt3KM?= =?utf-8?q?WXtnPQ1ya1fmQ9IYwYk7y82Ny8m0CuKJ1NlnJS798ihjaYMcaJ9JRItx1D4HsO/Wl?= =?utf-8?q?I4kPd+9bf9LiYLXPEy90Q+Kp468ngaTuS5u5UdB0XHMBxy/M+AhTcDl48nZFaJZZz?= =?utf-8?q?ADvix7nqhXGqViZ6okTdYvPlPgE3tY16CQmI4rBpUtP8vaE8CrdNF/1gh9Xlp7KMD?= =?utf-8?q?gG884DRkZJ2yXr76m19zpIbgNoHhHwxcFg=3D=3D?= X-Forefront-Antispam-Report: CIP:52.169.0.179; CTRY:IE; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:eu2.smtp.exclaimer.net; PTR:eu2.smtp.exclaimer.net; CAT:NONE; SFS:(13230040)(34020700016)(35042699022)(82310400026)(36860700013)(376014)(1800799024)(12100799063); DIR:OUT; SFP:1501; X-OriginatorOrg: arri.de X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Jul 2024 14:05:33.9291 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 05a03bfa-24dd-4650-8da0-08dc9b6935a0 X-MS-Exchange-CrossTenant-Id: e6a73a5a-614d-4c51-b3e3-53b660a9433a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=e6a73a5a-614d-4c51-b3e3-53b660a9433a; Ip=[52.169.0.179]; Helo=[eu2.smtp.exclaimer.net] X-MS-Exchange-CrossTenant-AuthSource: DB3PEPF0000885E.eurprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR07MB6672 X-Mailman-Approved-At: Wed, 03 Jul 2024 22:13:57 +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" Based on the existing ST7586 driver. But the ST7539 ... - is monochrome only - has 8 VERTICAL pixels per byte - doesn't support any MIPI DCS commands - has (a few) 16 bit commands - doesn't support setting a clipping rect when writing to the RAM - doesn't support rotation (only mirroring of X and/or Y axis) Questions/TODO: - should drivers for such old displays be mainlined? - shall I use mipi_dbi_ although the display doesn't implement MIPI DCS (and has some 16 bit commands)? - can the conversion to 8 vertical pixels/byte (taken from solomon/ssd130x.c) be avoided / simplified / made more efficient? - how to implement setting of the display contrast (required by my application)? - add device tree binding Signed-off-by: Christian Eggers --- MAINTAINERS | 6 + drivers/gpu/drm/tiny/Kconfig | 11 + drivers/gpu/drm/tiny/Makefile | 1 + drivers/gpu/drm/tiny/st7539.c | 424 ++++++++++++++++++++++++++++++++++ 4 files changed, 442 insertions(+) create mode 100644 drivers/gpu/drm/tiny/st7539.c diff --git a/MAINTAINERS b/MAINTAINERS index e7d543cf9f6c..7191206c1ae3 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -7116,6 +7116,12 @@ S: Maintained F: Documentation/devicetree/bindings/display/panel/samsung,s6d7aa0.yaml F: drivers/gpu/drm/panel/panel-samsung-s6d7aa0.c +DRM DRIVER FOR SITRONIX ST7539 PANELS +M: Christian Eggers +S: Maintained +T: git https://gitlab.freedesktop.org/drm/misc/kernel.git +F: drivers/gpu/drm/tiny/st7539.c + DRM DRIVER FOR SITRONIX ST7586 PANELS M: David Lechner S: Maintained diff --git a/drivers/gpu/drm/tiny/Kconfig b/drivers/gpu/drm/tiny/Kconfig index f6889f649bc1..220d2aee9354 100644 --- a/drivers/gpu/drm/tiny/Kconfig +++ b/drivers/gpu/drm/tiny/Kconfig @@ -186,6 +186,17 @@ config TINYDRM_REPAPER If M is selected the module will be called repaper. +config TINYDRM_ST7539 + tristate "DRM support for Sitronix ST7539 display panels" + depends on DRM && SPI + select DRM_KMS_HELPER + select DRM_GEM_DMA_HELPER + select DRM_MIPI_DBI + help + DRM driver for Sitronix ST7539 panels. + + If M is selected the module will be called st7539. + config TINYDRM_ST7586 tristate "DRM support for Sitronix ST7586 display panels" depends on DRM && SPI diff --git a/drivers/gpu/drm/tiny/Makefile b/drivers/gpu/drm/tiny/Makefile index 76dde89a044b..0bd217779995 100644 --- a/drivers/gpu/drm/tiny/Makefile +++ b/drivers/gpu/drm/tiny/Makefile @@ -14,5 +14,6 @@ obj-$(CONFIG_TINYDRM_ILI9341) += ili9341.o obj-$(CONFIG_TINYDRM_ILI9486) += ili9486.o obj-$(CONFIG_TINYDRM_MI0283QT) += mi0283qt.o obj-$(CONFIG_TINYDRM_REPAPER) += repaper.o +obj-$(CONFIG_TINYDRM_ST7539) += st7539.o obj-$(CONFIG_TINYDRM_ST7586) += st7586.o obj-$(CONFIG_TINYDRM_ST7735R) += st7735r.o diff --git a/drivers/gpu/drm/tiny/st7539.c b/drivers/gpu/drm/tiny/st7539.c new file mode 100644 index 000000000000..9a6aeea006ef --- /dev/null +++ b/drivers/gpu/drm/tiny/st7539.c @@ -0,0 +1,424 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +/* + * DRM driver for Sitronix ST7539 panels + * + * Copyright 2024 Christian Eggers + * + * based on st7586.c + * Copyright 2017 David Lechner + */ + +#include +#include +#include +#include +#include +#include