From patchwork Thu Feb 26 08:47:03 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dario Binacchi X-Patchwork-Id: 4495 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-wm1-f72.google.com (mail-wm1-f72.google.com [209.85.128.72]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id 5EA083F10C for ; Thu, 26 Feb 2026 09:47:26 +0100 (CET) Received: by mail-wm1-f72.google.com with SMTP id 5b1f17b1804b1-4806cfffca6sf5521845e9.2 for ; Thu, 26 Feb 2026 00:47:26 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1772095646; cv=pass; d=google.com; s=arc-20240605; b=PyvWsc6GI8+CBFrTE9eIYjy6OoTtJkta+juMKQ79xTrceJbqGSVnAPMMFsvsTQiMxn 1L/8jHTVOt7BxfQnaDTC5hAq9hJQLYOtW+kk5K2fGmWkWbP2ePP0TblzYa5YpvKxL34D VZz1xBQP0wIYP4O3zjg3SPoD3Isy83rxTYkKHikeRABnH9WrxVQubMWbGqRDtXUefMFh i5P6jJQy8tTHrSPQq81rVuj0hjeqJQtXucsFiGZvUpc5yLXyUuq0Q2vG3Y8ztUBH/VLg yoXSYsskYLJG744SOYJ1XwHZhCVctQU6i/5qtQt+CUaObkspYnMwuUthyGLrgsWPkbkU X36w== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=SD4jk+IrLh7T27fQxDJqste8+8R4v3TCHmBJIoBGYNc=; fh=s+hyl11wWHbGHcRJ21LgoWRp/YlLq7M2harqr+M8Jpk=; b=RjlFdf3GWd6SrdysOlZgaaAhB/94y3wu/KeYBgHtt0OLH01qQmQMlK352p3PSLTjcO FpWeB0tOWrGHw+gNp5nZjQwVh7AXwCT0Ub9m1tuFjVKrEoscNidIXl9GoApLNKvgzl6P mwMMf1HKYWq7I8AruwH/CIhWd5Vou3kM89NfVeIlap3ZqDeDLhlaG7pH+HcSjtfG0O5r cTu9GH8SvbsUVb3ULbXwrUfGepo93kd4jN4DVq/vpA/zpoGLpyjWBkw+K5TDW0+eucYU LTtelGuutUhdMIXooUvKKVhDIAmZy2Dp7bMVcBSMfSdnVcHANPzWL6qyCKjUjbHVm8i4 t+IQ==; darn=patchwork.amarulasolutions.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b="KGuLU/69"; spf=pass (google.com: domain of dario.binacchi@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=dario.binacchi@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com; dara=neutral header.i=@amarulasolutions.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; t=1772095646; x=1772700446; darn=patchwork.amarulasolutions.com; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:x-original-authentication-results :x-original-sender:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to; bh=SD4jk+IrLh7T27fQxDJqste8+8R4v3TCHmBJIoBGYNc=; b=L9IAmjeIZcSHE6d0aimqOtrQifMPz7T5zDWeH9wYhl6UrT94kAezvRABRGmfjobvIA rKpJtDjFNhtLvaLrIpWF60SFCmbvPh21nzXT83Tcko/xHkeVRh0nhQO9STi2+ExD1ABX 5q/efWWforJG4GMYIJKxamrA5X2AHFzUSQxXs= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1772095646; x=1772700446; h=list-unsubscribe:list-archive:list-help:list-post :x-spam-checked-in-group:list-id:mailing-list:precedence :x-original-authentication-results:x-original-sender:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from:x-gm-gg :x-beenthere:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=SD4jk+IrLh7T27fQxDJqste8+8R4v3TCHmBJIoBGYNc=; b=lX14yuCQy8S4axb4nTN1/q5W2+OQ9WvlL+vA8WfvgsaNqS5WpFsvxFfKegxwpvV2OB 0S5WeeOF3/k89E6sm8VPL58fJpdASzWoAYQTRyIJhMYs/FJWIX9f4guEG/nNbXvhQuUF hV50fZD4jSJQBtx0zg8AmOeH1j2xiQG7keODhppp7pFC//eJI/6+LR+/MLbHoPUHNI8d M7S9eLNxCMOBev8+Q2gAgYkcZwQN8t3cD/nF07+o9rTE5CVK1rSj8dY+dodPzQbYVRsW zPG+Le0fPUVxTkvC+WA3eO416dassOzx3LIL44ve0tyWwBrjg5B5JxcVNYiP78A5qHnn rIJQ== X-Forwarded-Encrypted: i=2; AJvYcCXILAS467ynH5lIGYsqtCkGDXrOOxqjF9NJI6h7p0KYDxbmVn2I++zWtZk7XohSR6VBIOhn6eD/NxBNFTRh@patchwork.amarulasolutions.com X-Gm-Message-State: AOJu0YwxXF0XfvPiFXU0C2xyZhGznAvaZpfJIvmttu/+6osAwhzPVpJR MJcS0yo+65ZVEvUQdE+8sz5MsFI+3aI8uR5+PvGfEs0VVlclAFFQtgTqksqY8Fix6f9fHtZFAuW w0Q== X-Received: by 2002:a05:600c:1e28:b0:477:5af7:6fa with SMTP id 5b1f17b1804b1-483a95fe96bmr282367415e9.32.1772095645940; Thu, 26 Feb 2026 00:47:25 -0800 (PST) X-BeenThere: linux-amarula@amarulasolutions.com; h="AV1CL+FxRJwxXM2dEm6RgBfot93fhVJ20qf2S254n/TXRjDDaw==" Received: by 2002:a05:600c:1c03:b0:477:a036:8e60 with SMTP id 5b1f17b1804b1-483bf270883ls12910475e9.0.-pod-prod-02-eu; Thu, 26 Feb 2026 00:47:24 -0800 (PST) X-Received: by 2002:a05:600c:3105:b0:477:7bca:8b2b with SMTP id 5b1f17b1804b1-483c12c7d04mr82628195e9.15.1772095643896; Thu, 26 Feb 2026 00:47:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1772095643; cv=none; d=google.com; s=arc-20240605; b=lhN0lkXkr1j9ILp3BUMpyCmNKeleBJwkEOlsDgs30vrdJRheOng+SMTLvZGN49g1R8 H4h4vOhYUAFdoJ862/HQEK1gMYeqfiV4oUj076Yt1Q/+IwFiG62iTICxHPFjVHFuDWNZ mrsphPcwp9Ju2INmR8YqvDF7jr4xEpYWDMY5K08Za7WS3OwHRmIxk0Cgx3zZZOVWhEg3 PdtiHZWjidS+ZoBlQfg+oB/m8LV9BLciikTwf7KgAAjnF2m/petwaCNUI4eBrrAQ/6mx SGUAxx18ofI9i6hQmQw+EiSIXXfWlYG23Vi2NDoABwIr8AQkJZKH1qER9Gv5G6wZlztq +YrQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=gtsQMjhiq506Xq8FXI7rtm/QcNWCTlABZTBMqgdKP/4=; fh=AdINyqa0RrhYjILkNDREXbEInCFvYIP+gW50d4EJsQ0=; b=hVsWhbES31YahWvfzzZtgNnFerOoILy/tFj5XXfLVW6HNAZ6TqzAbr/L+EpljEuNAh jgv1I1KfOEjSRpoJGd/rc9JPCXsWHH2yA4RBWngyxc4F5MfMSZHYXQpmyg/NOaR595xt jvYB6gSGJcjAuaxgSLEig8NeFT0kiu8hjJCONEQXvPk+eda0vHN5nTNlb4Mtofq0TgiE dN4iRsMJMfyAmGMAie97xq6H4Luo85bmLAOdWI67SpRZZwX0D8eFLnEkf6QsEnequksr 3oiLZpM5IMsi1j1fQG2LCZQ0rxsHvmFokVp6F2qOeOJZ7wab7kYK75mIbBSBFZECihqc i/7A==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b="KGuLU/69"; spf=pass (google.com: domain of dario.binacchi@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=dario.binacchi@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com; dara=neutral header.i=@amarulasolutions.com Received: from mail-sor-f41.google.com (mail-sor-f41.google.com. [209.85.220.41]) by mx.google.com with SMTPS id 5b1f17b1804b1-483c3b68e47sor1612135e9.12.2026.02.26.00.47.23 for (Google Transport Security); Thu, 26 Feb 2026 00:47:23 -0800 (PST) Received-SPF: pass (google.com: domain of dario.binacchi@amarulasolutions.com designates 209.85.220.41 as permitted sender) client-ip=209.85.220.41; X-Gm-Gg: ATEYQzywyh871u91VnpSWHPNkHJ13RHSX4smHHYrHXVe/yMj9JI8FNnqUAo5884o0Dx /mAxOKkabjd/HAVR47mUZl8Lz4mn18FsXqa2bYBfJ/n/oMvRSz/2MraTX6dhEq9wgWLJmw1EVmK wjzarinlKyuU8Klz+TpHe8Kk3jEKBMcnuWntuB2ErL+GJnOCa7ijh83xULWGGuLPRQNod7V+PU/ yqycTYkDFS6PxveBXY9P6uAMjxkzIpU1y9flLPhz3EH3duO+nX1OdUWxG3WTVSUwpJZppnyw1Rz ehgd81TnUIm5lKy61i+If8KteI2KxPNJ1LUcVxsj8uxlW6q1cJpO++kU9eRQ2T6OB/6herFa9gy dz9fojR4efb25sFIBRElLdn26rFRTR6bCPNRrZLW+tsWzpw9CEEt206mBPz9Q6ukyNkkMytyFvz 62QTCBdiFXJq2rhf2UxyIdSHXOYkBrTaL6A9Z9KFAo1TLLY4c+RCPISD/+NfkKGfIdPqNLsWHyH ckR4IF7d3cKXZI/lxbli8AhLQYBP/y1A0MeSJHiI4/xU7USVLHhniXtJWQR5Ci48uhoyYQCmfk8 gD2qDC07VuT9id0SffKhsn5I X-Received: by 2002:a05:600c:4f4b:b0:477:a54a:acba with SMTP id 5b1f17b1804b1-483a95e1f34mr335619665e9.17.1772095643354; Thu, 26 Feb 2026 00:47:23 -0800 (PST) Received: from dario-ThinkPad-P14s-Gen-5.homenet.telecomitalia.it (host-95-248-31-95.retail.telecomitalia.it. [95.248.31.95]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-483bfb85c58sm31581075e9.9.2026.02.26.00.47.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Feb 2026 00:47:22 -0800 (PST) From: Dario Binacchi To: linux-kernel@vger.kernel.org Cc: linux-amarula@amarulasolutions.com, Dario Binacchi , David Airlie , Jessica Zhang , Maarten Lankhorst , Maxime Ripard , Michael Walle , Neil Armstrong , Simona Vetter , Thomas Zimmermann , dri-devel@lists.freedesktop.org Subject: [RESEND PATCH v4 4/4] drm/panel: ilitek-ili9806e: add Rocktech RK050HR345-CT106A SPI panel Date: Thu, 26 Feb 2026 09:47:03 +0100 Message-ID: <20260226084713.2566672-5-dario.binacchi@amarulasolutions.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260226084713.2566672-1-dario.binacchi@amarulasolutions.com> References: <20260226084713.2566672-1-dario.binacchi@amarulasolutions.com> MIME-Version: 1.0 X-Original-Sender: dario.binacchi@amarulasolutions.com X-Original-Authentication-Results: mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b="KGuLU/69"; spf=pass (google.com: domain of dario.binacchi@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=dario.binacchi@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com; dara=neutral header.i=@amarulasolutions.com Content-Type: text/plain; charset="UTF-8" Precedence: list Mailing-list: list linux-amarula@amarulasolutions.com; contact linux-amarula+owners@amarulasolutions.com List-ID: X-Spam-Checked-In-Group: linux-amarula@amarulasolutions.com X-Google-Group-Id: 476853432473 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , Add support for the Rocktech RK050HR345-CT106A panel based on the Ilitek ILI9806E controller using the SPI bus. The driver is designed to be easily extensible to support other panels with different initialization sequences and display timings by providing a specific descriptor structure for each model. Signed-off-by: Dario Binacchi --- Changes in v4: - Fix "WARNING: unmet direct dependencies detected for DRM_PANEL_ILITEK_ILI9806E_CORE" reported by kernel test robot Changes in v3: - Add Reviewed-by tag of Rob Herring Changes in v2: - Introduce DRM_PANEL_ILITEK_ILI9806E_CORE hidden kconfig option. - Split core and DSI logic. - Restore vdd-supply as required for both DSI and SPI types in the dt-bindings. - Dop useless settings in case of rocktech,rk050hr345-ct106a in the dt-bindings. MAINTAINERS | 1 + drivers/gpu/drm/panel/Kconfig | 12 + drivers/gpu/drm/panel/Makefile | 1 + .../drm/panel/panel-ilitek-ili9806e-core.c | 31 +- .../gpu/drm/panel/panel-ilitek-ili9806e-spi.c | 323 ++++++++++++++++++ 5 files changed, 355 insertions(+), 13 deletions(-) create mode 100644 drivers/gpu/drm/panel/panel-ilitek-ili9806e-spi.c diff --git a/MAINTAINERS b/MAINTAINERS index 46bd910ba2c4..6c5ad37513f7 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -8031,6 +8031,7 @@ F: drivers/gpu/drm/panel/panel-ilitek-ili9805.c DRM DRIVER FOR ILITEK ILI9806E PANELS M: Michael Walle +M: Dario Binacchi S: Maintained F: drivers/gpu/drm/panel/panel-ilitek-ili9806e-* diff --git a/drivers/gpu/drm/panel/Kconfig b/drivers/gpu/drm/panel/Kconfig index 7fc20421cba5..ec12850fc231 100644 --- a/drivers/gpu/drm/panel/Kconfig +++ b/drivers/gpu/drm/panel/Kconfig @@ -270,6 +270,18 @@ config DRM_PANEL_ILITEK_ILI9806E_DSI Say Y if you want to enable support for panels based on the Ilitek ILI9806E controller using DSI. +config DRM_PANEL_ILITEK_ILI9806E_SPI + tristate "Ilitek ILI9806E-based RGB SPI panel" + depends on OF + depends on SPI + depends on BACKLIGHT_CLASS_DEVICE + select DRM_MIPI_DBI + select VIDEOMODE_HELPERS + select DRM_PANEL_ILITEK_ILI9806E_CORE + help + Say Y if you want to enable support for panels based on the + Ilitek ILI9806E controller using SPI. + config DRM_PANEL_ILITEK_ILI9881C tristate "Ilitek ILI9881C-based panels" depends on OF diff --git a/drivers/gpu/drm/panel/Makefile b/drivers/gpu/drm/panel/Makefile index f56dafb36499..948c4a2d58ff 100644 --- a/drivers/gpu/drm/panel/Makefile +++ b/drivers/gpu/drm/panel/Makefile @@ -28,6 +28,7 @@ obj-$(CONFIG_DRM_PANEL_ILITEK_ILI9341) += panel-ilitek-ili9341.o obj-$(CONFIG_DRM_PANEL_ILITEK_ILI9805) += panel-ilitek-ili9805.o obj-$(CONFIG_DRM_PANEL_ILITEK_ILI9806E_CORE) += panel-ilitek-ili9806e-core.o obj-$(CONFIG_DRM_PANEL_ILITEK_ILI9806E_DSI) += panel-ilitek-ili9806e-dsi.o +obj-$(CONFIG_DRM_PANEL_ILITEK_ILI9806E_SPI) += panel-ilitek-ili9806e-spi.o obj-$(CONFIG_DRM_PANEL_ILITEK_ILI9881C) += panel-ilitek-ili9881c.o obj-$(CONFIG_DRM_PANEL_ILITEK_ILI9882T) += panel-ilitek-ili9882t.o obj-$(CONFIG_DRM_PANEL_INNOLUX_EJ030NA) += panel-innolux-ej030na.o diff --git a/drivers/gpu/drm/panel/panel-ilitek-ili9806e-core.c b/drivers/gpu/drm/panel/panel-ilitek-ili9806e-core.c index c088685d9d85..be2cf1440155 100644 --- a/drivers/gpu/drm/panel/panel-ilitek-ili9806e-core.c +++ b/drivers/gpu/drm/panel/panel-ilitek-ili9806e-core.c @@ -11,6 +11,7 @@ #include #include #include +#include #include #include @@ -20,15 +21,11 @@ struct ili9806e { void *transport; struct drm_panel panel; + unsigned int num_supplies; struct regulator_bulk_data supplies[2]; struct gpio_desc *reset_gpio; }; -static const char * const regulator_names[] = { - "vdd", - "vccio", -}; - void *ili9806e_get_transport(struct drm_panel *panel) { struct ili9806e *ctx = container_of(panel, struct ili9806e, panel); @@ -44,7 +41,7 @@ int ili9806e_power_on(struct device *dev) gpiod_set_value(ctx->reset_gpio, 1); - ret = regulator_bulk_enable(ARRAY_SIZE(ctx->supplies), ctx->supplies); + ret = regulator_bulk_enable(ctx->num_supplies, ctx->supplies); if (ret) { dev_err(dev, "regulator bulk enable failed: %d\n", ret); return ret; @@ -65,7 +62,7 @@ int ili9806e_power_off(struct device *dev) gpiod_set_value(ctx->reset_gpio, 1); - ret = regulator_bulk_disable(ARRAY_SIZE(ctx->supplies), ctx->supplies); + ret = regulator_bulk_disable(ctx->num_supplies, ctx->supplies); if (ret) dev_err(dev, "regulator bulk disable failed: %d\n", ret); @@ -78,7 +75,8 @@ int ili9806e_probe(struct device *dev, void *transport, int connector_type) { struct ili9806e *ctx; - int i, ret; + bool set_prepare_prev_first = false; + int ret; ctx = devm_kzalloc(dev, sizeof(struct ili9806e), GFP_KERNEL); if (!ctx) @@ -87,11 +85,16 @@ int ili9806e_probe(struct device *dev, void *transport, dev_set_drvdata(dev, ctx); ctx->transport = transport; - for (i = 0; i < ARRAY_SIZE(ctx->supplies); i++) - ctx->supplies[i].supply = regulator_names[i]; + ctx->supplies[ctx->num_supplies++].supply = "vdd"; + if (of_device_is_compatible(dev->of_node, + "densitron,dmt028vghmcmi-1d") || + of_device_is_compatible(dev->of_node, + "ortustech,com35h3p70ulc")) { + ctx->supplies[ctx->num_supplies++].supply = "vccio"; + set_prepare_prev_first = true; + } - ret = devm_regulator_bulk_get(dev, ARRAY_SIZE(ctx->supplies), - ctx->supplies); + ret = devm_regulator_bulk_get(dev, ctx->num_supplies, ctx->supplies); if (ret) return dev_err_probe(dev, ret, "failed to get regulators\n"); @@ -106,7 +109,9 @@ int ili9806e_probe(struct device *dev, void *transport, if (ret) return dev_err_probe(dev, ret, "Failed to get backlight\n"); - ctx->panel.prepare_prev_first = true; + if (set_prepare_prev_first) + ctx->panel.prepare_prev_first = true; + drm_panel_add(&ctx->panel); return 0; diff --git a/drivers/gpu/drm/panel/panel-ilitek-ili9806e-spi.c b/drivers/gpu/drm/panel/panel-ilitek-ili9806e-spi.c new file mode 100644 index 000000000000..9d10b0d28f52 --- /dev/null +++ b/drivers/gpu/drm/panel/panel-ilitek-ili9806e-spi.c @@ -0,0 +1,323 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * SPI interface to the Ilitek ILI9806E panel. + * + * Copyright (c) 2026 Amarula Solutions, Dario Binacchi + */ + +#include +#include +#include +#include +#include + +#include +#include +#include + +#include