Commit 8b8e8f99 authored by Daniel Leung's avatar Daniel Leung Committed by Carles Cufi
Browse files

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: default avatarDaniel Leung <daniel.leung@intel.com>
parent 7d1f1331
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -10,6 +10,12 @@ menuconfig DISPLAY

if DISPLAY

config DISPLAY_INIT_PRIORITY
	int "Display devices init priority"
	default 90
	help
	  Display devices initialization priority.

module = DISPLAY
module-str = display
source "subsys/logging/Kconfig.template.log_config"
+1 −1
Original line number Diff line number Diff line
@@ -126,5 +126,5 @@ static const struct display_driver_api dummy_display_api = {
DEVICE_DEFINE(dummy_display, CONFIG_DUMMY_DISPLAY_DEV_NAME,
		    &dummy_display_init, NULL,
		    &dummy_display_data, NULL,
		    APPLICATION, CONFIG_APPLICATION_INIT_PRIORITY,
		    APPLICATION, CONFIG_DISPLAY_INIT_PRIORITY,
		    &dummy_display_api);
+1 −1
Original line number Diff line number Diff line
@@ -447,7 +447,7 @@ static const struct display_driver_api ili9xxx_api = {
	DEVICE_DT_DEFINE(INST_DT_ILI9XXX(n, t), ili9xxx_init,                  \
			    NULL, &ili9xxx_data_##n,                           \
			    &ili9xxx_config_##n, POST_KERNEL,                  \
			    CONFIG_APPLICATION_INIT_PRIORITY, &ili9xxx_api);
			    CONFIG_DISPLAY_INIT_PRIORITY, &ili9xxx_api);

#define DT_INST_FOREACH_ILI9XXX_STATUS_OKAY(t)                                 \
	UTIL_LISTIFY(DT_NUM_INST_STATUS_OKAY(ilitek_ili##t), ILI9XXX_INIT, t)
+1 −1
Original line number Diff line number Diff line
@@ -417,7 +417,7 @@ static const struct display_driver_api sdl_display_api = {

DEVICE_DEFINE(sdl_display, CONFIG_SDL_DISPLAY_DEV_NAME, &sdl_display_init,
		NULL, &sdl_display_data, NULL, APPLICATION,
		CONFIG_APPLICATION_INIT_PRIORITY, &sdl_display_api);
		CONFIG_DISPLAY_INIT_PRIORITY, &sdl_display_api);


NATIVE_TASK(sdl_display_cleanup, ON_EXIT, 1);
+1 −1
Original line number Diff line number Diff line
@@ -575,7 +575,7 @@ static const struct display_driver_api st7735r_api = {
	};									\
	DEVICE_DT_INST_DEFINE(inst, st7735r_init, st7735r_pm_control,		\
			      &st7735r_data_ ## inst, &st7735r_config_ ## inst,	\
			      APPLICATION, CONFIG_APPLICATION_INIT_PRIORITY,	\
			      APPLICATION, CONFIG_DISPLAY_INIT_PRIORITY,	\
			      &st7735r_api);

DT_INST_FOREACH_STATUS_OKAY(ST7735R_INIT)
Loading