Skip to content

Commit

Permalink
ili9341: mipi-dbi-mode setable through DT
Browse files Browse the repository at this point in the history
Currently ili9341 is only supported using SPI, but there is also
a 16-bit interface. The property mipi-mode is defined in
mipi-dbi-device.yaml, a parent to this display driver, so there's no need
to redefine it here.

Signed-off-by: Thorsten Spätling <thorsten.spaetling@vierling.de>
  • Loading branch information
ts4ling committed Sep 16, 2024
1 parent 50b07f9 commit 97f85cd
Showing 1 changed file with 30 additions and 31 deletions.
61 changes: 30 additions & 31 deletions drivers/display/display_ili9xxx.c
Original file line number Diff line number Diff line change
Expand Up @@ -513,37 +513,36 @@ static const struct ili9xxx_quirks ili9488_quirks = {

#define INST_DT_ILI9XXX(n, t) DT_INST(n, ilitek_ili##t)

#define ILI9XXX_INIT(n, t) \
ILI##t##_REGS_INIT(n); \
\
static const struct ili9xxx_config ili9xxx_config_##n = { \
.quirks = &ili##t##_quirks, \
.mipi_dev = DEVICE_DT_GET(DT_PARENT(INST_DT_ILI9XXX(n, t))), \
.dbi_config = { \
.mode = MIPI_DBI_MODE_SPI_4WIRE, \
.config = MIPI_DBI_SPI_CONFIG_DT( \
INST_DT_ILI9XXX(n, t), \
SPI_OP_MODE_MASTER | \
SPI_WORD_SET(8), \
0), \
}, \
.pixel_format = DT_PROP(INST_DT_ILI9XXX(n, t), pixel_format), \
.rotation = DT_PROP(INST_DT_ILI9XXX(n, t), rotation), \
.x_resolution = ILI##t##_X_RES, \
.y_resolution = ILI##t##_Y_RES, \
.inversion = DT_PROP(INST_DT_ILI9XXX(n, t), display_inversion),\
.regs = &ili9xxx_regs_##n, \
.regs_init_fn = ili##t##_regs_init, \
}; \
\
static struct ili9xxx_data ili9xxx_data_##n; \
\
DEVICE_DT_DEFINE(INST_DT_ILI9XXX(n, t), ili9xxx_init, \
NULL, &ili9xxx_data_##n, \
&ili9xxx_config_##n, POST_KERNEL, \
CONFIG_DISPLAY_INIT_PRIORITY, &ili9xxx_api)

#define DT_INST_FOREACH_ILI9XXX_STATUS_OKAY(t) \
#define ILI9XXX_INIT(n, t) \
ILI##t##_REGS_INIT(n); \
\
static const struct ili9xxx_config ili9xxx_config_##n = { \
.quirks = &ili##t##_quirks, \
.mipi_dev = DEVICE_DT_GET(DT_PARENT(INST_DT_ILI9XXX(n, t))), \
.dbi_config = \
{ \
.mode = DT_PROP_OR(INST_DT_ILI9XXX(n, t), mipi_mode, \
MIPI_DBI_MODE_SPI_4WIRE), \
.config = MIPI_DBI_SPI_CONFIG_DT( \
INST_DT_ILI9XXX(n, t), \
SPI_OP_MODE_MASTER | SPI_WORD_SET(8), 0), \
}, \
.pixel_format = DT_PROP(INST_DT_ILI9XXX(n, t), pixel_format), \
.rotation = DT_PROP(INST_DT_ILI9XXX(n, t), rotation), \
.x_resolution = ILI##t##_X_RES, \
.y_resolution = ILI##t##_Y_RES, \
.inversion = DT_PROP(INST_DT_ILI9XXX(n, t), display_inversion), \
.regs = &ili9xxx_regs_##n, \
.regs_init_fn = ili##t##_regs_init, \
}; \
\
static struct ili9xxx_data ili9xxx_data_##n; \
\
DEVICE_DT_DEFINE(INST_DT_ILI9XXX(n, t), ili9xxx_init, NULL, &ili9xxx_data_##n, \
&ili9xxx_config_##n, POST_KERNEL, CONFIG_DISPLAY_INIT_PRIORITY, \
&ili9xxx_api)

#define DT_INST_FOREACH_ILI9XXX_STATUS_OKAY(t) \
LISTIFY(DT_NUM_INST_STATUS_OKAY(ilitek_ili##t), ILI9XXX_INIT, (;), t)

#ifdef CONFIG_ILI9340
Expand Down

0 comments on commit 97f85cd

Please sign in to comment.