diff options
author | Shawn Nematbakhsh <shawnn@chromium.org> | 2016-05-03 14:47:20 -0700 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2016-05-05 01:12:25 -0700 |
commit | b803590c27796573f8e889796d15c16427225028 (patch) | |
tree | ece28d9c4da17acf73879dff94ffd4303be183c7 /chip | |
parent | d6546857dab57079c50ae9f1140941fd8fb37229 (diff) | |
download | chrome-ec-b803590c27796573f8e889796d15c16427225028.tar.gz |
hooks: Add relative HOOK_INIT priority for peripherals
Using HOOK_PRIO_DEFAULT for peripheral initialization necessitates using
HOOK_PRIO_DEFAULT+1 for board-level code. Instead, use a
higher-than-default relative priority for peripheral initialization
outside of board.
BUG=None
TEST=Verify PWM and ADC are functional on kevin.
BRANCH=None
Signed-off-by: Shawn Nematbakhsh <shawnn@chromium.org>
Change-Id: Ia8e90a7a866bdb0a661099dd458e3dfcaaa3f6bb
Reviewed-on: https://chromium-review.googlesource.com/342171
Commit-Ready: Shawn N <shawnn@chromium.org>
Tested-by: Shawn N <shawnn@chromium.org>
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
Reviewed-by: Shawn N <shawnn@chromium.org>
Diffstat (limited to 'chip')
-rw-r--r-- | chip/it83xx/fan.c | 2 | ||||
-rw-r--r-- | chip/it83xx/pwm.c | 2 | ||||
-rw-r--r-- | chip/it83xx/spi.c | 2 | ||||
-rw-r--r-- | chip/lm4/fan.c | 3 | ||||
-rw-r--r-- | chip/lm4/pwm.c | 2 | ||||
-rw-r--r-- | chip/lm4/spi.c | 2 | ||||
-rw-r--r-- | chip/mec1322/pwm.c | 2 | ||||
-rw-r--r-- | chip/npcx/fan.c | 2 | ||||
-rw-r--r-- | chip/npcx/pwm.c | 2 | ||||
-rw-r--r-- | chip/npcx/spi.c | 2 | ||||
-rw-r--r-- | chip/stm32/spi.c | 2 |
11 files changed, 12 insertions, 11 deletions
diff --git a/chip/it83xx/fan.c b/chip/it83xx/fan.c index f61fbaa6f7..d412e14123 100644 --- a/chip/it83xx/fan.c +++ b/chip/it83xx/fan.c @@ -475,4 +475,4 @@ static void fan_init(void) ext_timer_ms(FAN_CTRL_EXT_TIMER, EXT_PSR_32P768K_HZ, 0, 0, FAN_CTRL_BASED_MS, 1, 0); } -DECLARE_HOOK(HOOK_INIT, fan_init, HOOK_PRIO_INIT_PWM); +DECLARE_HOOK(HOOK_INIT, fan_init, HOOK_PRIO_INIT_FAN); diff --git a/chip/it83xx/pwm.c b/chip/it83xx/pwm.c index 89f71f9a1d..db9f180455 100644 --- a/chip/it83xx/pwm.c +++ b/chip/it83xx/pwm.c @@ -257,4 +257,4 @@ static void pwm_init(void) } /* The chip PWM module initialization. */ -DECLARE_HOOK(HOOK_INIT, pwm_init, HOOK_PRIO_DEFAULT); +DECLARE_HOOK(HOOK_INIT, pwm_init, HOOK_PRIO_INIT_PWM); diff --git a/chip/it83xx/spi.c b/chip/it83xx/spi.c index e02c3d590d..6e876b3aee 100644 --- a/chip/it83xx/spi.c +++ b/chip/it83xx/spi.c @@ -168,4 +168,4 @@ static void sspi_init(void) /* Disabling spi module */ spi_enable(spi_devices[i].port, 0); } -DECLARE_HOOK(HOOK_INIT, sspi_init, HOOK_PRIO_DEFAULT); +DECLARE_HOOK(HOOK_INIT, sspi_init, HOOK_PRIO_INIT_SPI); diff --git a/chip/lm4/fan.c b/chip/lm4/fan.c index 0153b275fc..39baa0a03e 100644 --- a/chip/lm4/fan.c +++ b/chip/lm4/fan.c @@ -188,4 +188,5 @@ static void fan_init(void) /* Disable all fans */ LM4_FAN_FANCTL = 0; } -DECLARE_HOOK(HOOK_INIT, fan_init, HOOK_PRIO_INIT_PWM); +/* Init before PWM */ +DECLARE_HOOK(HOOK_INIT, fan_init, HOOK_PRIO_INIT_FAN); diff --git a/chip/lm4/pwm.c b/chip/lm4/pwm.c index c60a6be296..b7284c2bee 100644 --- a/chip/lm4/pwm.c +++ b/chip/lm4/pwm.c @@ -67,4 +67,4 @@ static void pwm_init(void) } /* The chip-specific fan module initializes before this. */ -DECLARE_HOOK(HOOK_INIT, pwm_init, HOOK_PRIO_DEFAULT); +DECLARE_HOOK(HOOK_INIT, pwm_init, HOOK_PRIO_INIT_PWM); diff --git a/chip/lm4/spi.c b/chip/lm4/spi.c index b0b92d86e6..60394bb936 100644 --- a/chip/lm4/spi.c +++ b/chip/lm4/spi.c @@ -138,7 +138,7 @@ static int spi_init(void) return EC_SUCCESS; } -DECLARE_HOOK(HOOK_INIT, spi_init, HOOK_PRIO_DEFAULT); +DECLARE_HOOK(HOOK_INIT, spi_init, HOOK_PRIO_INIT_SPI); /*****************************************************************************/ /* Console commands */ diff --git a/chip/mec1322/pwm.c b/chip/mec1322/pwm.c index 0c3f97baa3..3708300f71 100644 --- a/chip/mec1322/pwm.c +++ b/chip/mec1322/pwm.c @@ -82,4 +82,4 @@ static void pwm_init(void) pwm_set_duty(i, 0); } } -DECLARE_HOOK(HOOK_INIT, pwm_init, HOOK_PRIO_DEFAULT); +DECLARE_HOOK(HOOK_INIT, pwm_init, HOOK_PRIO_INIT_PWM); diff --git a/chip/npcx/fan.c b/chip/npcx/fan.c index 9836ff60bd..84cbd0e6f3 100644 --- a/chip/npcx/fan.c +++ b/chip/npcx/fan.c @@ -504,4 +504,4 @@ static void fan_init(void) /* Enable the fan module and delay a few clocks */ clock_enable_peripheral(CGC_OFFSET_FAN, CGC_FAN_MASK, CGC_MODE_ALL); } -DECLARE_HOOK(HOOK_INIT, fan_init, HOOK_PRIO_INIT_PWM); +DECLARE_HOOK(HOOK_INIT, fan_init, HOOK_PRIO_INIT_FAN); diff --git a/chip/npcx/pwm.c b/chip/npcx/pwm.c index e99ed039c2..32f676aa27 100644 --- a/chip/npcx/pwm.c +++ b/chip/npcx/pwm.c @@ -237,4 +237,4 @@ static void pwm_init(void) } /* The chip-specific fan module initializes before this. */ -DECLARE_HOOK(HOOK_INIT, pwm_init, HOOK_PRIO_DEFAULT); +DECLARE_HOOK(HOOK_INIT, pwm_init, HOOK_PRIO_INIT_PWM); diff --git a/chip/npcx/spi.c b/chip/npcx/spi.c index b3d6ec07d7..a41dcf89eb 100644 --- a/chip/npcx/spi.c +++ b/chip/npcx/spi.c @@ -213,7 +213,7 @@ static void spi_init(void) /* Cleaning junk data in the buffer */ clear_databuf(); } -DECLARE_HOOK(HOOK_INIT, spi_init, HOOK_PRIO_DEFAULT); +DECLARE_HOOK(HOOK_INIT, spi_init, HOOK_PRIO_INIT_SPI); /*****************************************************************************/ /* Console commands */ diff --git a/chip/stm32/spi.c b/chip/stm32/spi.c index 8f905d3855..032dd590a9 100644 --- a/chip/stm32/spi.c +++ b/chip/stm32/spi.c @@ -663,7 +663,7 @@ static void spi_init(void) if (was_enabled || chipset_in_state(CHIPSET_STATE_ON)) spi_chipset_startup(); } -DECLARE_HOOK(HOOK_INIT, spi_init, HOOK_PRIO_DEFAULT); +DECLARE_HOOK(HOOK_INIT, spi_init, HOOK_PRIO_INIT_SPI); /** * Get protocol information |