Skip to content

Commit a05f291

Browse files
passgatsuperna9999
authored andcommitted
drm/panel: ilitek-ili9806e: add Rocktech RK050HR345-CT106A SPI panel
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 <dario.binacchi@amarulasolutions.com> Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org> Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org> Link: https://patch.msgid.link/20260318073346.18041-5-dario.binacchi@amarulasolutions.com
1 parent 7cad20e commit a05f291

5 files changed

Lines changed: 355 additions & 13 deletions

File tree

MAINTAINERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8027,6 +8027,7 @@ F: drivers/gpu/drm/panel/panel-ilitek-ili9805.c
80278027

80288028
DRM DRIVER FOR ILITEK ILI9806E PANELS
80298029
M: Michael Walle <mwalle@kernel.org>
8030+
M: Dario Binacchi <dario.binacchi@amarulasolutions.com>
80308031
S: Maintained
80318032
F: drivers/gpu/drm/panel/panel-ilitek-ili9806e-*
80328033

drivers/gpu/drm/panel/Kconfig

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -281,6 +281,18 @@ config DRM_PANEL_ILITEK_ILI9806E_DSI
281281
Say Y if you want to enable support for panels based on the
282282
Ilitek ILI9806E controller using DSI.
283283

284+
config DRM_PANEL_ILITEK_ILI9806E_SPI
285+
tristate "Ilitek ILI9806E-based RGB SPI panel"
286+
depends on OF
287+
depends on SPI
288+
depends on BACKLIGHT_CLASS_DEVICE
289+
select DRM_MIPI_DBI
290+
select VIDEOMODE_HELPERS
291+
select DRM_PANEL_ILITEK_ILI9806E_CORE
292+
help
293+
Say Y if you want to enable support for panels based on the
294+
Ilitek ILI9806E controller using SPI.
295+
284296
config DRM_PANEL_ILITEK_ILI9881C
285297
tristate "Ilitek ILI9881C-based panels"
286298
depends on OF

drivers/gpu/drm/panel/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ obj-$(CONFIG_DRM_PANEL_ILITEK_ILI9341) += panel-ilitek-ili9341.o
2929
obj-$(CONFIG_DRM_PANEL_ILITEK_ILI9805) += panel-ilitek-ili9805.o
3030
obj-$(CONFIG_DRM_PANEL_ILITEK_ILI9806E_CORE) += panel-ilitek-ili9806e-core.o
3131
obj-$(CONFIG_DRM_PANEL_ILITEK_ILI9806E_DSI) += panel-ilitek-ili9806e-dsi.o
32+
obj-$(CONFIG_DRM_PANEL_ILITEK_ILI9806E_SPI) += panel-ilitek-ili9806e-spi.o
3233
obj-$(CONFIG_DRM_PANEL_ILITEK_ILI9881C) += panel-ilitek-ili9881c.o
3334
obj-$(CONFIG_DRM_PANEL_ILITEK_ILI9882T) += panel-ilitek-ili9882t.o
3435
obj-$(CONFIG_DRM_PANEL_INNOLUX_EJ030NA) += panel-innolux-ej030na.o

drivers/gpu/drm/panel/panel-ilitek-ili9806e-core.c

Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
#include <linux/export.h>
1212
#include <linux/gpio/consumer.h>
1313
#include <linux/module.h>
14+
#include <linux/of.h>
1415
#include <linux/property.h>
1516
#include <linux/regulator/consumer.h>
1617

@@ -20,15 +21,11 @@ struct ili9806e {
2021
void *transport;
2122
struct drm_panel panel;
2223

24+
unsigned int num_supplies;
2325
struct regulator_bulk_data supplies[2];
2426
struct gpio_desc *reset_gpio;
2527
};
2628

27-
static const char * const regulator_names[] = {
28-
"vdd",
29-
"vccio",
30-
};
31-
3229
void *ili9806e_get_transport(struct drm_panel *panel)
3330
{
3431
struct ili9806e *ctx = container_of(panel, struct ili9806e, panel);
@@ -44,7 +41,7 @@ int ili9806e_power_on(struct device *dev)
4441

4542
gpiod_set_value(ctx->reset_gpio, 1);
4643

47-
ret = regulator_bulk_enable(ARRAY_SIZE(ctx->supplies), ctx->supplies);
44+
ret = regulator_bulk_enable(ctx->num_supplies, ctx->supplies);
4845
if (ret) {
4946
dev_err(dev, "regulator bulk enable failed: %d\n", ret);
5047
return ret;
@@ -65,7 +62,7 @@ int ili9806e_power_off(struct device *dev)
6562

6663
gpiod_set_value(ctx->reset_gpio, 1);
6764

68-
ret = regulator_bulk_disable(ARRAY_SIZE(ctx->supplies), ctx->supplies);
65+
ret = regulator_bulk_disable(ctx->num_supplies, ctx->supplies);
6966
if (ret)
7067
dev_err(dev, "regulator bulk disable failed: %d\n", ret);
7168

@@ -78,7 +75,8 @@ int ili9806e_probe(struct device *dev, void *transport,
7875
int connector_type)
7976
{
8077
struct ili9806e *ctx;
81-
int i, ret;
78+
bool set_prepare_prev_first = false;
79+
int ret;
8280

8381
ctx = devm_kzalloc(dev, sizeof(struct ili9806e), GFP_KERNEL);
8482
if (!ctx)
@@ -87,11 +85,16 @@ int ili9806e_probe(struct device *dev, void *transport,
8785
dev_set_drvdata(dev, ctx);
8886
ctx->transport = transport;
8987

90-
for (i = 0; i < ARRAY_SIZE(ctx->supplies); i++)
91-
ctx->supplies[i].supply = regulator_names[i];
88+
ctx->supplies[ctx->num_supplies++].supply = "vdd";
89+
if (of_device_is_compatible(dev->of_node,
90+
"densitron,dmt028vghmcmi-1d") ||
91+
of_device_is_compatible(dev->of_node,
92+
"ortustech,com35h3p70ulc")) {
93+
ctx->supplies[ctx->num_supplies++].supply = "vccio";
94+
set_prepare_prev_first = true;
95+
}
9296

93-
ret = devm_regulator_bulk_get(dev, ARRAY_SIZE(ctx->supplies),
94-
ctx->supplies);
97+
ret = devm_regulator_bulk_get(dev, ctx->num_supplies, ctx->supplies);
9598
if (ret)
9699
return dev_err_probe(dev, ret, "failed to get regulators\n");
97100

@@ -106,7 +109,9 @@ int ili9806e_probe(struct device *dev, void *transport,
106109
if (ret)
107110
return dev_err_probe(dev, ret, "Failed to get backlight\n");
108111

109-
ctx->panel.prepare_prev_first = true;
112+
if (set_prepare_prev_first)
113+
ctx->panel.prepare_prev_first = true;
114+
110115
drm_panel_add(&ctx->panel);
111116

112117
return 0;

0 commit comments

Comments
 (0)