From patchwork Thu Jul 4 12:26:42 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christian Eggers X-Patchwork-Id: 13723674 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 98BCDC30653 for ; Thu, 4 Jul 2024 12:27:07 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 2642F10EAB8; Thu, 4 Jul 2024 12:27:07 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (1024-bit key; unprotected) header.d=arri.de header.i=@arri.de header.b="JGubVhPy"; dkim-atps=neutral Received: from EUR03-DBA-obe.outbound.protection.outlook.com (mail-dbaeur03hn2233.outbound.protection.outlook.com [52.100.14.233]) by gabe.freedesktop.org (Postfix) with ESMTPS id E03A010EAB8 for ; Thu, 4 Jul 2024 12:27:04 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=eexpjCmnznbaOvL9PZkYwIN30dJIyBM35gGrJQRHcX6J5+Rwi+6RJA0U2bqao3+4pJTlY+FtWTSB6mgHQiZOGlbNBloaXlByL8bStXM1Ob03I5MHyNfEEu016kU/kQIKX6RwBWOYlwlLGPqUPRjGmI/KSrlBY6Kqc7PNnTJH8XeuD4dtX4hRMd2oxhugiouvkM6ybdO7L7RCS7STCKZ9rkzUpCzMRcmjw7rXQ9XwpAbo2QRVHQEZooQJuLNeRUYXgbgvZ+7P+kzu4D5BqkEQtXZJGoNaYFE/DjCMXLUT5usdtXkunWe0rypO6V40quXmprmRY8UigSN/ECO0kysMpw== 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=QeUGYAqAc589YKBG9jO3O+XEEZ3XCcAxJf90M/Ew8S8=; b=EEEyBCKcHPCqz+B6cAesY8OQg8qALeOaT+AJZnTGVpc5C399hAhqgXASQBMYd1SX7vbrsR+HnHXRva1RjS4HMwA9+d3GKHjdd+Ifut/aiQLVjXmUScxYvPjFEUhpt0AT6Nvkvi4Nax/Dj4biIjo/hT0wjIqyc+SF2PVLQH1A5y0QFnDxh82ZR24Gi70qU4d8saCAdHsFsQ9y0ugdh5Ds4Wu0VzjaQTmsJqNqr+mGMY7TALoEwcoxURqo/RoI0apMkvXPrz11sJYB8GEuwSACzViynM552/+9elqtrIR6Q7MaQnyIl7sKeoNImRIIJfcU7lbczRlT/Tn1s4EEfkFl0w== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=fail (sender ip is 217.111.95.7) smtp.rcpttodomain=linux.intel.com smtp.mailfrom=arri.de; dmarc=fail (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=QeUGYAqAc589YKBG9jO3O+XEEZ3XCcAxJf90M/Ew8S8=; b=JGubVhPyO62V4I7XTF54VGSwGd3dEUUjZWKJHRWEAms8EbPVF481hKVviB+dbsIVSEqXqfWW3BZD4jzQteJ7I20YhwKG/kiVefSx+qCMzrdqqXdb6dRiQCfQUZsXT0h4owtIbjud/AY482TEJhp2Clj1uI54xAjw7Nak7TgYIt0= Received: from AS4P251CA0029.EURP251.PROD.OUTLOOK.COM (2603:10a6:20b:5d3::19) by DBBPR07MB7482.eurprd07.prod.outlook.com (2603:10a6:10:1f3::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7741.25; Thu, 4 Jul 2024 12:27:01 +0000 Received: from AMS0EPF000001AB.eurprd05.prod.outlook.com (2603:10a6:20b:5d3:cafe::49) by AS4P251CA0029.outlook.office365.com (2603:10a6:20b:5d3::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7741.29 via Frontend Transport; Thu, 4 Jul 2024 12:27:01 +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 AMS0EPF000001AB.mail.protection.outlook.com (10.167.16.151) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7741.18 via Frontend Transport; Thu, 4 Jul 2024 12:27:00 +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; Thu, 4 Jul 2024 14:26:59 +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 RESEND] drm/tiny: Add support for Sitronix ST7539 Date: Thu, 4 Jul 2024 14:26:42 +0200 Message-ID: <20240704122642.22906-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: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AMS0EPF000001AB:EE_|DBBPR07MB7482:EE_ X-MS-Office365-Filtering-Correlation-Id: 75b256d6-debc-487f-65b4-08dc9c249a65 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|34020700016|376014|36860700013|7416014|1800799024|82310400026|12100799063; X-Microsoft-Antispam-Message-Info: djcgNQVRvzmlcktBTc+4Ll4fvmZ/t9Glhg+l373Ryl7MYaHEQALpd1DyYzoRvjlNS7nHS+H14ZoEqRQ3MP1kSGY483kP5KpBRdhmQ4KUSi+ChzQwaw4vd7Txl6nhQSkhP8ptw5czL90oB7mp5UEApB6NWup8163a3Ch7dfSaCXmc60/xpXWlo8Q0AnPr4fay96bWl2OXsa3zjufGSPih+1iWJWHCP+U7yda2Lqg50H+fzS4TkfPJJa4S+ZlEY8gPHn3LotXRj2SSJW8V69aXgTsCsHYyhhzQ46Hd9X5980HLy6KFO0ABoT6zQwWGNrwTgWiI1oZAvQquDxBe4IJdnPl91ephT4VTmFdcB9h8aj+eO8EMYCud0u02z2KGE2jMkhZbXpnovz3699RddR9ZjMACsPkkrEFZeDw9xuLkYBWznATZZx8dTLr4v5Q9G/YN56mh9YbRhue+2wnvuZ24j/VZzkAtDidc3q/KP40SH9EYDXKe9aCK8ABDi5KsLDS97YURyUq0M4YT/xNCw9dnsBgQeK6Eec5v0gxxgDXStEE2Ht3OwA4atDhZJ5Cd+5zz5aHlONz/UBrkfqDtP0ZIc5vhu6uqLc/8zC/uPC8m8dAEJ5Q5HFFQRc/GXC5oS82sAgvwj3eTCCAqdF0d/Ni6QSoMXwaU2QqNmvTrzPUSko/evdMKnF75gyuteehZ5ofkUA3Ih6VjxQ/lzdtzATb/DrKHlIQFM8Gt3UTknyLFrrJN0S9cvifZ9RgClRtu8hR6hmZIsdjE92MrJ4USUI+aHRjCbGjzEj9nQzIw8E7dIC38M8ZxqcO6JS507w+agWH2AbKABlHAaJd8F+BS2FsOiyyiYM0b8gKmSUxUAUKJUMoNQzYZJMsz99je1wK68cmsoBV+b4M1krZbu6jKLqarkZ/Hhbb88K7buHftteahYPdhKeF54K/rFJL/AYwIGF3uDrSuAqwwrR/Z85tMkrPyTpIVgIrfODDz5RSxcGj9MEkhkrPa+COX17hELuQ/jxpPNKViEPCAWatmzlIX5Q202EqalLpDBU9TIW0Fznax9t911vqE/EWtRY308djMMamNKztTUhNvODjukElFbM4dqJcjmSjCfjugq4342DmmbG9IeDwQ4kG/8UzVEKhe+SCYvptVXZh3bP6XBSHm6t1x1iMrlAkdMF8WiUsZf0Z7fu5wFMwQgP4K5jYWdH68U61DRcYyHC+eTXcNyPnL4bl9jXrpXwTzgZykpOunOMtZKPfTrMl2adlUL2WzaSp+ta/r51H5VIU+L+yiV5K1J3e6sPczIi0U7f0+XdW2+VY6U0OQxIWXFu+9zruP7gvz/fD0YLu1xUT3lJ5iTjJggvk/dplgBOTAPfZhZ0RfEZBlj1Dq2hqHFOleYITGPZKgVhzq X-Forefront-Antispam-Report: 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)(34020700016)(376014)(36860700013)(7416014)(1800799024)(82310400026)(12100799063); DIR:OUT; SFP:1501; X-OriginatorOrg: arri.de X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Jul 2024 12:27:00.2391 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 75b256d6-debc-487f-65b4-08dc9c249a65 X-MS-Exchange-CrossTenant-Id: e6a73a5a-614d-4c51-b3e3-53b660a9433a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=e6a73a5a-614d-4c51-b3e3-53b660a9433a; Ip=[217.111.95.7]; Helo=[mta.arri.de] X-MS-Exchange-CrossTenant-AuthSource: AMS0EPF000001AB.eurprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBBPR07MB7482 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" Resend because the 1st transmission got HTML'ed by my company's mail server. 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