From nobody Mon Feb 9 06:24:33 2026 Received: from mail-wm1-f47.google.com (mail-wm1-f47.google.com [209.85.128.47]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4D92E32D7F7 for ; Wed, 4 Feb 2026 17:32:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.47 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770226325; cv=none; b=iV7uDL+M2f9p1Vq3kl8bwL4nMFlcBzb4J4CpWM980kwqQVkgTWLkUVCGoMtY2yXNJPplsth5rcOqW1yE6yH1pqBxzpphOeMw59f5YlfK59qnDjh+5ZGfIwiW5oBkJgPEmizQkwMu/3Nj7Th9P6aFaKP4s4NqvpAeDRepn+FDSGM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770226325; c=relaxed/simple; bh=TXwhX1K6yWMpQ/mJh6SEb2YxY5esqympgYbD5w4DQ1s=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=ZkLAHj6mZYL0osuOqhZY5aCnPJai8Hr0N+eSHG5kQpMu1MMd0cTIyJ/suboE2k8cTnrrsM8PxlFQRucYiEhVwz0p2JcidTSbcqO7mBEzNuepZzpEOgVCwqAT78iyUfFWPFNwvEY7WHZ2yQGUh8FuhzVQRQoJVxYEVmtPqeY4lAo= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=amarulasolutions.com; spf=pass smtp.mailfrom=amarulasolutions.com; dkim=pass (1024-bit key) header.d=amarulasolutions.com header.i=@amarulasolutions.com header.b=FaLpDwQg; arc=none smtp.client-ip=209.85.128.47 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=amarulasolutions.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=amarulasolutions.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=amarulasolutions.com header.i=@amarulasolutions.com header.b="FaLpDwQg" Received: by mail-wm1-f47.google.com with SMTP id 5b1f17b1804b1-47ee07570deso452615e9.1 for ; Wed, 04 Feb 2026 09:32:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; t=1770226323; x=1770831123; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=KEmenxrmDwzNeXpzlEfB0IxhIpMig5qGpRyQpXt0OQM=; b=FaLpDwQgG3X37UwSNu6ChgfI9swNcoaTaE3HclaEc5xxUTFoH5ti8uEI07fVZShzjs 4Qi/x1MqwEHxrmlZCZ3ZVARJBFB0qOAFMePTuzR6dh9ZmaEwdN8BiXhko/KI3Ew1n7Wa k9t1wM4QJuH4lKNTO1SSj/pGZk1feS292mvFQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1770226323; x=1770831123; h=content-transfer-encoding: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; bh=KEmenxrmDwzNeXpzlEfB0IxhIpMig5qGpRyQpXt0OQM=; b=k7JIER2DzqXLqhU4LuQfWH8XEzL1xz5O5p2xvJELnVVjyVdiLHmYw7yQXqs3NwXk+P URyrNyHaYENroSUjl8dhLE80IU1VCALYKm6r1it3eA6OcosHTXdlorrRoOXr0G2tCa6N huVy5GmD0GKgYiK1xDGz7lZZUaQ8LsMPtugScnZCa/GX6DwhpUPNUIhXn++5QFAbaPF5 Rm3a28e/VxaEB5u66oKdzhp0z3uj42dAlNrUyhr0sU7HFtDLegANOy+xoND9nI8zCs6m oMqwm/rTuZPl/KL2dO6liv/l8ONtBYHD/Mc8ZZvHmboO+lrMZFnKrxgwhXCn0S0eiY03 eDRA== X-Gm-Message-State: AOJu0YykrwQjcy6p55x4ZKpAoldYAm60adt7fUuQGIbLJ+HeRwqn5/nq ejLQu6fddbjsCZ6fq75Hl/YXUGrSm+cxLe2L7I0WxIUcWeghFNa7O845j5uDhNjnhilT6MFYWmj JOifu X-Gm-Gg: AZuq6aKvtL3Oqs888lenEYEd+wC6Gyvco4JY+AEywfsuWfgbj9pSkSYsfNLPfWkiin7 hi5R2pMV39IyVpoX62CU7Axn74snOsudyAWfe3XcvLGcyQCj3Uq5So85SqkZkQHZ+Du4SFio+OA TZbddxKWkPu286Qj2DZg9Mbgkl37L+XQ5zhvyxjHoF832DWnvumz33XYvlxM1cg4tw6NppihBYI 29Rd/ahVyZIFVuHZDukuKgOtGMZNrtOBmVSIpGPGVLRDgrg7rUN1V8+yQSWfz8D+REJlMv0jL85 5MgND6D5BsMvStps1twL23BbGXtXRx20J4fZUTCuhVQRlteSVEj7C4i0HzKD67a3oD5wUimACOH NgPfhrlkwObH6uAj3vTPzeVsDM2xOowRXH+2Z6Y2hqLAy8irDOa/bDnP8aeZnm3TpoIo07h/yaS 7qswAm7lFLIC1frJ+tbO/JeODP9D0lTWtznb1/V/0LEMg5d2w+iDjhma+xQdm5loj+0hiFd0OLx SvNY4KNv2qIJDVXMkzu4RKLZzg+gZWtny8t3alXfHz/ X-Received: by 2002:a05:600c:19cd:b0:477:2f7c:314f with SMTP id 5b1f17b1804b1-4830e94c659mr50283265e9.10.1770226323299; Wed, 04 Feb 2026 09:32:03 -0800 (PST) Received: from dario-ThinkPad-P14s-Gen-5.amarulasolutions.com ([2.196.42.58]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-436180640f2sm7241565f8f.39.2026.02.04.09.32.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Feb 2026 09:32:02 -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: [PATCH v4 2/4] drm/panel: ilitek-ili9806e: split core and DSI logic Date: Wed, 4 Feb 2026 18:31:18 +0100 Message-ID: <20260204173154.337674-3-dario.binacchi@amarulasolutions.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260204173154.337674-1-dario.binacchi@amarulasolutions.com> References: <20260204173154.337674-1-dario.binacchi@amarulasolutions.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Split the driver to support multiple transport buses. The core logic (power, GPIO, backlight) is moved to a dedicated core module, while DSI-specific code is restricted to the DSI module. Introduce DRM_PANEL_ILITEK_ILI9806E_CORE as a hidden Kconfig symbol selected by the bus-specific configuration. 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 MAINTAINERS | 2 +- drivers/gpu/drm/panel/Kconfig | 4 + drivers/gpu/drm/panel/Makefile | 1 + .../drm/panel/panel-ilitek-ili9806e-core.c | 129 +++++++++++++++ .../drm/panel/panel-ilitek-ili9806e-core.h | 15 ++ .../gpu/drm/panel/panel-ilitek-ili9806e-dsi.c | 151 +++++------------- 6 files changed, 193 insertions(+), 109 deletions(-) create mode 100644 drivers/gpu/drm/panel/panel-ilitek-ili9806e-core.c create mode 100644 drivers/gpu/drm/panel/panel-ilitek-ili9806e-core.h diff --git a/MAINTAINERS b/MAINTAINERS index 58cd78fb9731..1daf45133c39 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -7917,7 +7917,7 @@ F: drivers/gpu/drm/panel/panel-ilitek-ili9805.c DRM DRIVER FOR ILITEK ILI9806E PANELS M: Michael Walle S: Maintained -F: drivers/gpu/drm/panel/panel-ilitek-ili9806e-dsi.c +F: drivers/gpu/drm/panel/panel-ilitek-ili9806e-* =20 DRM DRIVER FOR JADARD JD9365DA-H3 MIPI-DSI LCD PANELS M: Jagan Teki diff --git a/drivers/gpu/drm/panel/Kconfig b/drivers/gpu/drm/panel/Kconfig index 692cd474910d..cbfee8abba0c 100644 --- a/drivers/gpu/drm/panel/Kconfig +++ b/drivers/gpu/drm/panel/Kconfig @@ -257,11 +257,15 @@ config DRM_PANEL_ILITEK_ILI9805 Say Y if you want to enable support for panels based on the Ilitek ILI9805 controller. =20 +config DRM_PANEL_ILITEK_ILI9806E_CORE + tristate + config DRM_PANEL_ILITEK_ILI9806E_DSI tristate "Ilitek ILI9806E-based DSI panels" depends on OF depends on DRM_MIPI_DSI depends on BACKLIGHT_CLASS_DEVICE + select DRM_PANEL_ILITEK_ILI9806E_CORE help Say Y if you want to enable support for panels based on the Ilitek ILI9806E controller using DSI. diff --git a/drivers/gpu/drm/panel/Makefile b/drivers/gpu/drm/panel/Makefile index 00071a983242..13034cadb8d8 100644 --- a/drivers/gpu/drm/panel/Makefile +++ b/drivers/gpu/drm/panel/Makefile @@ -26,6 +26,7 @@ obj-$(CONFIG_DRM_PANEL_HYDIS_HV101HD1) +=3D panel-hydis-h= v101hd1.o obj-$(CONFIG_DRM_PANEL_ILITEK_IL9322) +=3D panel-ilitek-ili9322.o obj-$(CONFIG_DRM_PANEL_ILITEK_ILI9341) +=3D panel-ilitek-ili9341.o obj-$(CONFIG_DRM_PANEL_ILITEK_ILI9805) +=3D panel-ilitek-ili9805.o +obj-$(CONFIG_DRM_PANEL_ILITEK_ILI9806E_CORE) +=3D panel-ilitek-ili9806e-co= re.o obj-$(CONFIG_DRM_PANEL_ILITEK_ILI9806E_DSI) +=3D panel-ilitek-ili9806e-dsi= .o obj-$(CONFIG_DRM_PANEL_ILITEK_ILI9881C) +=3D panel-ilitek-ili9881c.o obj-$(CONFIG_DRM_PANEL_ILITEK_ILI9882T) +=3D panel-ilitek-ili9882t.o diff --git a/drivers/gpu/drm/panel/panel-ilitek-ili9806e-core.c b/drivers/g= pu/drm/panel/panel-ilitek-ili9806e-core.c new file mode 100644 index 000000000000..c088685d9d85 --- /dev/null +++ b/drivers/gpu/drm/panel/panel-ilitek-ili9806e-core.c @@ -0,0 +1,129 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * Ilitek ILI9806E core driver. + * + * Copyright (c) 2026 Amarula Solutions, Dario Binacchi + */ + +#include + +#include +#include +#include +#include +#include +#include + +#include "panel-ilitek-ili9806e-core.h" + +struct ili9806e { + void *transport; + struct drm_panel panel; + + struct regulator_bulk_data supplies[2]; + struct gpio_desc *reset_gpio; +}; + +static const char * const regulator_names[] =3D { + "vdd", + "vccio", +}; + +void *ili9806e_get_transport(struct drm_panel *panel) +{ + struct ili9806e *ctx =3D container_of(panel, struct ili9806e, panel); + + return ctx->transport; +} +EXPORT_SYMBOL_GPL(ili9806e_get_transport); + +int ili9806e_power_on(struct device *dev) +{ + struct ili9806e *ctx =3D dev_get_drvdata(dev); + int ret; + + gpiod_set_value(ctx->reset_gpio, 1); + + ret =3D regulator_bulk_enable(ARRAY_SIZE(ctx->supplies), ctx->supplies); + if (ret) { + dev_err(dev, "regulator bulk enable failed: %d\n", ret); + return ret; + } + + usleep_range(10000, 20000); + gpiod_set_value(ctx->reset_gpio, 0); + usleep_range(10000, 20000); + + return 0; +} +EXPORT_SYMBOL_GPL(ili9806e_power_on); + +int ili9806e_power_off(struct device *dev) +{ + struct ili9806e *ctx =3D dev_get_drvdata(dev); + int ret; + + gpiod_set_value(ctx->reset_gpio, 1); + + ret =3D regulator_bulk_disable(ARRAY_SIZE(ctx->supplies), ctx->supplies); + if (ret) + dev_err(dev, "regulator bulk disable failed: %d\n", ret); + + return ret; +} +EXPORT_SYMBOL_GPL(ili9806e_power_off); + +int ili9806e_probe(struct device *dev, void *transport, + const struct drm_panel_funcs *funcs, + int connector_type) +{ + struct ili9806e *ctx; + int i, ret; + + ctx =3D devm_kzalloc(dev, sizeof(struct ili9806e), GFP_KERNEL); + if (!ctx) + return -ENOMEM; + + dev_set_drvdata(dev, ctx); + ctx->transport =3D transport; + + for (i =3D 0; i < ARRAY_SIZE(ctx->supplies); i++) + ctx->supplies[i].supply =3D regulator_names[i]; + + ret =3D devm_regulator_bulk_get(dev, ARRAY_SIZE(ctx->supplies), + ctx->supplies); + if (ret) + return dev_err_probe(dev, ret, "failed to get regulators\n"); + + ctx->reset_gpio =3D devm_gpiod_get(dev, "reset", GPIOD_OUT_LOW); + if (IS_ERR(ctx->reset_gpio)) + return dev_err_probe(dev, PTR_ERR(ctx->reset_gpio), + "Failed to get reset-gpios\n"); + + drm_panel_init(&ctx->panel, dev, funcs, connector_type); + + ret =3D drm_panel_of_backlight(&ctx->panel); + if (ret) + return dev_err_probe(dev, ret, "Failed to get backlight\n"); + + ctx->panel.prepare_prev_first =3D true; + drm_panel_add(&ctx->panel); + + return 0; + +} +EXPORT_SYMBOL_GPL(ili9806e_probe); + +void ili9806e_remove(struct device *dev) +{ + struct ili9806e *ctx =3D dev_get_drvdata(dev); + + drm_panel_remove(&ctx->panel); +} +EXPORT_SYMBOL_GPL(ili9806e_remove); + +MODULE_AUTHOR("Dario Binacchi "); +MODULE_AUTHOR("Gunnar Dibbern "); +MODULE_AUTHOR("Michael Walle "); +MODULE_DESCRIPTION("Ilitek ILI9806E Controller Driver"); +MODULE_LICENSE("GPL"); diff --git a/drivers/gpu/drm/panel/panel-ilitek-ili9806e-core.h b/drivers/g= pu/drm/panel/panel-ilitek-ili9806e-core.h new file mode 100644 index 000000000000..dddece62cf42 --- /dev/null +++ b/drivers/gpu/drm/panel/panel-ilitek-ili9806e-core.h @@ -0,0 +1,15 @@ +/* SPDX-License-Identifier: GPL-2.0 */ + +#ifndef _PANEL_ILITEK_ILI9806E_CORE_H +#define _PANEL_ILITEK_ILI9806E_CORE_H + +void *ili9806e_get_transport(struct drm_panel *panel); +int ili9806e_power_off(struct device *dev); +int ili9806e_power_on(struct device *dev); + +int ili9806e_probe(struct device *dev, void *transport, + const struct drm_panel_funcs *funcs, + int connector_type); +void ili9806e_remove(struct device *dev); + +#endif /* _PANEL_ILITEK_ILI9806E_CORE_H */ diff --git a/drivers/gpu/drm/panel/panel-ilitek-ili9806e-dsi.c b/drivers/gp= u/drm/panel/panel-ilitek-ili9806e-dsi.c index c337c4f1a1c7..ecdbed8d4a3a 100644 --- a/drivers/gpu/drm/panel/panel-ilitek-ili9806e-dsi.c +++ b/drivers/gpu/drm/panel/panel-ilitek-ili9806e-dsi.c @@ -1,15 +1,12 @@ // SPDX-License-Identifier: GPL-2.0 =20 -#include #include #include #include -#include #include #include #include #include -#include =20 #include #include @@ -18,7 +15,9 @@ =20 #include