drivers: counter: Refactor drivers to use shared init priority

Refactors all of the counter drivers to use a shared driver class
initialization priority configuration, CONFIG_COUNTER_INIT_PRIORITY, to
allow configuring counter drivers separately from other devices. This is
similar to other driver classes like I2C and SPI.

The default is set to CONFIG_KERNEL_INIT_PRIORITY_DEVICE to preserve the
existing default initialization priority for most drivers. The
exceptions are the maxim_ds3231 and mcp7940n drivers which have a
dependency on a SPI driver and must therefore initialize later than the
default device priority.

Signed-off-by: Maureen Helm <maureen.helm@intel.com>
This commit is contained in:
Maureen Helm 2021-10-20 15:15:14 -05:00 committed by Anas Nashif
commit 165963c115
28 changed files with 33 additions and 38 deletions

View file

@ -1313,13 +1313,13 @@ static const struct ds3231_config ds3231_0_config = {
static struct ds3231_data ds3231_0_data;
#if CONFIG_COUNTER_MAXIM_DS3231_INIT_PRIORITY <= CONFIG_I2C_INIT_PRIORITY
#error COUNTER_MAXIM_DS3231_INIT_PRIORITY must be greater than I2C_INIT_PRIORITY
#if CONFIG_COUNTER_INIT_PRIORITY <= CONFIG_I2C_INIT_PRIORITY
#error CONFIG_COUNTER_INIT_PRIORITY must be greater than I2C_INIT_PRIORITY
#endif
DEVICE_DT_INST_DEFINE(0, ds3231_init, NULL, &ds3231_0_data,
&ds3231_0_config,
POST_KERNEL, CONFIG_COUNTER_MAXIM_DS3231_INIT_PRIORITY,
POST_KERNEL, CONFIG_COUNTER_INIT_PRIORITY,
&ds3231_api);
#ifdef CONFIG_USERSPACE