init: Implement fine-grained initialization policy

Put initialization priorities as device driver Kconfig
parameter.

Initialization priority value for each platform is defined
in the platform Kconfig file.

Drivers and platform code use SYS_DEFINE_DEVICE to add
and initialization function.

Change-Id: I2f4f3c7370dac02408a1b50a0a1bade8b427a282
Signed-off-by: Dmitriy Korovkin <dmitriy.korovkin@windriver.com>
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
This commit is contained in:
Dmitriy Korovkin 2015-10-26 15:56:02 -04:00 committed by Anas Nashif
commit 57f2741e4f
66 changed files with 447 additions and 115 deletions

View file

@ -38,3 +38,12 @@ config GROVE_LCD_RGB
help
Setting this value will enable driver support for the Groove-LCD RGB
Backlight.
config GROVE_LCD_RGB_INIT_PRIORITY
int
prompt "Init priority"
depends on GROVE_LCD_RGB
help
Device driver initialization priority.
As the device is connected to I2C bus, its driver has
to be initialized after the I2C one.

View file

@ -358,4 +358,5 @@ DECLARE_DEVICE_INIT_CONFIG(grove_lcd,
glcd_initialize,
&grove_lcd_config);
app_early_init(grove_lcd, &grove_lcd_driver);
SYS_DEFINE_DEVICE(grove_lcd, &grove_lcd_driver, SECONDARY,
CONFIG_GROVE_LCD_RGB_INIT_PRIORITY);