Skip to content

Commit 8b8e8f9

Browse files
dcpleungcarlescufi
authored andcommitted
display: introduce CONFIG_DISPLAY_INIT_PRIORITY
This introduces a new kconfig CONFIG_DISPLAY_INIT_PRIORITY to specify the initialization priority for display devices. Most of the display devices are using APPLICATION and CONFIG_APPLICATION_INIT_PRIORITY which is not entirely appropriate for devices. Due to linking order, the display device may be initialized after application code at same init level and priority. This results in the display device not ready to be used for application code. So this kconfig option allows the display devices to be initialized earlier if needed. For the drivers using CONFIG_APPLICATION_INIT_PRIORITY, they have been changed to use CONFIG_DISPLAY_INIT_PRIORITY instead. Note that the default value for CONFIG_DISPLAY_INIT_PRIORITY is the same as CONFIG_APPLICATION_INIT_PRIORITY at 90 to avoid any functional changes. Signed-off-by: Daniel Leung <[email protected]>
1 parent 7d1f133 commit 8b8e8f9

11 files changed

+16
-10
lines changed

drivers/display/Kconfig

+6
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,12 @@ menuconfig DISPLAY
1010

1111
if DISPLAY
1212

13+
config DISPLAY_INIT_PRIORITY
14+
int "Display devices init priority"
15+
default 90
16+
help
17+
Display devices initialization priority.
18+
1319
module = DISPLAY
1420
module-str = display
1521
source "subsys/logging/Kconfig.template.log_config"

drivers/display/display_dummy.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -126,5 +126,5 @@ static const struct display_driver_api dummy_display_api = {
126126
DEVICE_DEFINE(dummy_display, CONFIG_DUMMY_DISPLAY_DEV_NAME,
127127
&dummy_display_init, NULL,
128128
&dummy_display_data, NULL,
129-
APPLICATION, CONFIG_APPLICATION_INIT_PRIORITY,
129+
APPLICATION, CONFIG_DISPLAY_INIT_PRIORITY,
130130
&dummy_display_api);

drivers/display/display_ili9xxx.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -447,7 +447,7 @@ static const struct display_driver_api ili9xxx_api = {
447447
DEVICE_DT_DEFINE(INST_DT_ILI9XXX(n, t), ili9xxx_init, \
448448
NULL, &ili9xxx_data_##n, \
449449
&ili9xxx_config_##n, POST_KERNEL, \
450-
CONFIG_APPLICATION_INIT_PRIORITY, &ili9xxx_api);
450+
CONFIG_DISPLAY_INIT_PRIORITY, &ili9xxx_api);
451451

452452
#define DT_INST_FOREACH_ILI9XXX_STATUS_OKAY(t) \
453453
UTIL_LISTIFY(DT_NUM_INST_STATUS_OKAY(ilitek_ili##t), ILI9XXX_INIT, t)

drivers/display/display_sdl.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -417,7 +417,7 @@ static const struct display_driver_api sdl_display_api = {
417417

418418
DEVICE_DEFINE(sdl_display, CONFIG_SDL_DISPLAY_DEV_NAME, &sdl_display_init,
419419
NULL, &sdl_display_data, NULL, APPLICATION,
420-
CONFIG_APPLICATION_INIT_PRIORITY, &sdl_display_api);
420+
CONFIG_DISPLAY_INIT_PRIORITY, &sdl_display_api);
421421

422422

423423
NATIVE_TASK(sdl_display_cleanup, ON_EXIT, 1);

drivers/display/display_st7735r.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -575,7 +575,7 @@ static const struct display_driver_api st7735r_api = {
575575
}; \
576576
DEVICE_DT_INST_DEFINE(inst, st7735r_init, st7735r_pm_control, \
577577
&st7735r_data_ ## inst, &st7735r_config_ ## inst, \
578-
APPLICATION, CONFIG_APPLICATION_INIT_PRIORITY, \
578+
APPLICATION, CONFIG_DISPLAY_INIT_PRIORITY, \
579579
&st7735r_api);
580580

581581
DT_INST_FOREACH_STATUS_OKAY(ST7735R_INIT)

drivers/display/display_st7789v.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -440,4 +440,4 @@ static struct st7789v_data st7789v_data = {
440440

441441
DEVICE_DT_INST_DEFINE(0, &st7789v_init,
442442
st7789v_pm_control, &st7789v_data, NULL, APPLICATION,
443-
CONFIG_APPLICATION_INIT_PRIORITY, &st7789v_api);
443+
CONFIG_DISPLAY_INIT_PRIORITY, &st7789v_api);

drivers/display/gd7965.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -450,5 +450,5 @@ static struct display_driver_api gd7965_driver_api = {
450450

451451
DEVICE_DT_INST_DEFINE(0, gd7965_init, NULL,
452452
&gd7965_driver, &gd7965_config,
453-
POST_KERNEL, CONFIG_APPLICATION_INIT_PRIORITY,
453+
POST_KERNEL, CONFIG_DISPLAY_INIT_PRIORITY,
454454
&gd7965_driver_api);

drivers/display/grove_lcd_rgb.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -344,5 +344,5 @@ static struct glcd_data grove_lcd_driver = {
344344
*/
345345
DEVICE_DEFINE(grove_lcd, GROVE_LCD_NAME, glcd_initialize,
346346
NULL, &grove_lcd_driver, &grove_lcd_config,
347-
POST_KERNEL, CONFIG_APPLICATION_INIT_PRIORITY,
347+
POST_KERNEL, CONFIG_DISPLAY_INIT_PRIORITY,
348348
(void *)&grove_lcd_driver);

drivers/display/ls0xx.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -340,5 +340,5 @@ static struct display_driver_api ls0xx_driver_api = {
340340

341341
DEVICE_DT_INST_DEFINE(0, ls0xx_init, NULL,
342342
&ls0xx_driver, &ls0xx_config,
343-
POST_KERNEL, CONFIG_APPLICATION_INIT_PRIORITY,
343+
POST_KERNEL, CONFIG_DISPLAY_INIT_PRIORITY,
344344
&ls0xx_driver_api);

drivers/display/ssd1306.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -448,5 +448,5 @@ static struct display_driver_api ssd1306_driver_api = {
448448

449449
DEVICE_DT_INST_DEFINE(0, ssd1306_init, NULL,
450450
&ssd1306_driver, &ssd1306_config,
451-
POST_KERNEL, CONFIG_APPLICATION_INIT_PRIORITY,
451+
POST_KERNEL, CONFIG_DISPLAY_INIT_PRIORITY,
452452
&ssd1306_driver_api);

drivers/display/ssd16xx.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -701,5 +701,5 @@ static struct display_driver_api ssd16xx_driver_api = {
701701

702702
DEVICE_DT_INST_DEFINE(0, ssd16xx_init, NULL,
703703
&ssd16xx_driver, NULL,
704-
POST_KERNEL, CONFIG_APPLICATION_INIT_PRIORITY,
704+
POST_KERNEL, CONFIG_DISPLAY_INIT_PRIORITY,
705705
&ssd16xx_driver_api);

0 commit comments

Comments
 (0)