Skip to content

Commit b2826ae

Browse files
pdgendtkartben
authored andcommitted
drivers: display: display_ili9xxx: Allow multiple instances
The ili9xxx driver is used for multiple variants, but did not support different ones at the same time. Use unique variable names for each variant. Signed-off-by: Pieter De Gendt <[email protected]>
1 parent 5518bb4 commit b2826ae

File tree

5 files changed

+9
-9
lines changed

5 files changed

+9
-9
lines changed

drivers/display/display_ili9340.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ struct ili9340_regs {
5050

5151
/* Initializer macro for ILI9340 registers. */
5252
#define ILI9340_REGS_INIT(n) \
53-
static const struct ili9340_regs ili9xxx_regs_##n = { \
53+
static const struct ili9340_regs ili9340_regs_##n = { \
5454
.gamset = DT_PROP(DT_INST(n, ilitek_ili9340), gamset), \
5555
.frmctr1 = DT_PROP(DT_INST(n, ilitek_ili9340), frmctr1), \
5656
.disctrl = DT_PROP(DT_INST(n, ilitek_ili9340), disctrl), \

drivers/display/display_ili9341.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ struct ili9341_regs {
121121
"ili9341: Error length frame rate control (IFCTL) register"); \
122122
BUILD_ASSERT(DT_PROP_LEN(DT_INST(n, ilitek_ili9341), etmod) == ILI9341_ETMOD_LEN, \
123123
"ili9341: Error length entry Mode Set (ETMOD) register"); \
124-
static const struct ili9341_regs ili9xxx_regs_##n = { \
124+
static const struct ili9341_regs ili9341_regs_##n = { \
125125
.gamset = DT_PROP(DT_INST(n, ilitek_ili9341), gamset), \
126126
.ifmode = DT_PROP(DT_INST(n, ilitek_ili9341), ifmode), \
127127
.frmctr1 = DT_PROP(DT_INST(n, ilitek_ili9341), frmctr1), \

drivers/display/display_ili9342c.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ struct ili9342c_regs {
6767

6868
/* Initializer macro for ILI9342C registers. */
6969
#define ILI9342c_REGS_INIT(n) \
70-
static const struct ili9342c_regs ili9xxx_regs_##n = { \
70+
static const struct ili9342c_regs ili9342c_regs_##n = { \
7171
.gamset = DT_PROP(DT_INST(n, ilitek_ili9342c), gamset), \
7272
.ifmode = DT_PROP(DT_INST(n, ilitek_ili9342c), ifmode), \
7373
.frmctr1 = DT_PROP(DT_INST(n, ilitek_ili9342c), frmctr1), \

drivers/display/display_ili9488.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ struct ili9488_regs {
4444

4545
/* Initializer macro for ILI9488 registers. */
4646
#define ILI9488_REGS_INIT(n) \
47-
static const struct ili9488_regs ili9xxx_regs_##n = { \
47+
static const struct ili9488_regs ili9488_regs_##n = { \
4848
.frmctr1 = DT_PROP(DT_INST(n, ilitek_ili9488), frmctr1), \
4949
.disctrl = DT_PROP(DT_INST(n, ilitek_ili9488), disctrl), \
5050
.pwctrl1 = DT_PROP(DT_INST(n, ilitek_ili9488), pwctrl1), \

drivers/display/display_ili9xxx.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -517,7 +517,7 @@ static const struct ili9xxx_quirks ili9488_quirks = {
517517
#define ILI9XXX_INIT(n, t) \
518518
ILI##t##_REGS_INIT(n); \
519519
\
520-
static const struct ili9xxx_config ili9xxx_config_##n = { \
520+
static const struct ili9xxx_config ili9##t##_config_##n = { \
521521
.quirks = &ili##t##_quirks, \
522522
.mipi_dev = DEVICE_DT_GET(DT_PARENT(INST_DT_ILI9XXX(n, t))), \
523523
.dbi_config = { \
@@ -535,15 +535,15 @@ static const struct ili9xxx_quirks ili9488_quirks = {
535535
.x_resolution = ILI##t##_X_RES, \
536536
.y_resolution = ILI##t##_Y_RES, \
537537
.inversion = DT_PROP(INST_DT_ILI9XXX(n, t), display_inversion),\
538-
.regs = &ili9xxx_regs_##n, \
538+
.regs = &ili##t##_regs_##n, \
539539
.regs_init_fn = ili##t##_regs_init, \
540540
}; \
541541
\
542-
static struct ili9xxx_data ili9xxx_data_##n; \
542+
static struct ili9xxx_data ili9##t##_data_##n; \
543543
\
544544
DEVICE_DT_DEFINE(INST_DT_ILI9XXX(n, t), ili9xxx_init, \
545-
NULL, &ili9xxx_data_##n, \
546-
&ili9xxx_config_##n, POST_KERNEL, \
545+
NULL, &ili9##t##_data_##n, \
546+
&ili9##t##_config_##n, POST_KERNEL, \
547547
CONFIG_DISPLAY_INIT_PRIORITY, &ili9xxx_api)
548548

549549
#define DT_INST_FOREACH_ILI9XXX_STATUS_OKAY(t) \

0 commit comments

Comments
 (0)