diff options
author | Yuval Peress <peress@chromium.org> | 2021-04-27 23:33:05 -0600 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2021-05-02 05:57:30 +0000 |
commit | b58e2cba26f06702838f2965003927b678e1859a (patch) | |
tree | 6aaea10a6bc7c17405a3309bf63feb0ed017e205 /zephyr/shim | |
parent | 8c438c712b7d4113874addc52a88ab9508e3ee44 (diff) | |
download | chrome-ec-b58e2cba26f06702838f2965003927b678e1859a.tar.gz |
zephyr: pwm: fix init priority
Currently, the Zephyr pwm drivers were initialized at
<PRE_KERNEL_1, KERNEL_INIT_PRIORITY_DEVICE (50)> which is the same
priority as the shimmed pwm module. Zephyr does not guarantee any
ordering if there's a tie in the priority. I believe that this may
be the cause for the black screen after software sync (or at the
very least error prone).
BRANCH=none
BUG=b:186458444
TEST=zmake testall
Signed-off-by: Yuval Peress <peress@chromium.org>
Change-Id: I63758c6e11bc7b158fa27dd637f88dddd5d162cb
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2855993
Reviewed-by: Keith Short <keithshort@chromium.org>
Diffstat (limited to 'zephyr/shim')
-rw-r--r-- | zephyr/shim/src/pwm.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/zephyr/shim/src/pwm.c b/zephyr/shim/src/pwm.c index a9466684d6..0446fd47ce 100644 --- a/zephyr/shim/src/pwm.c +++ b/zephyr/shim/src/pwm.c @@ -85,7 +85,10 @@ static int init_pwms(const struct device *unused) return rv; } -SYS_INIT(init_pwms, PRE_KERNEL_1, 50); +#if CONFIG_PLATFORM_EC_PWM_INIT_PRIORITY <= CONFIG_KERNEL_INIT_PRIORITY_DEVICE +#error "PWM init priority must be > KERNEL_INIT_PRIORITY_DEVICE" +#endif +SYS_INIT(init_pwms, PRE_KERNEL_1, CONFIG_PLATFORM_EC_PWM_INIT_PRIORITY); static struct pwm_config* pwm_lookup(enum pwm_channel ch) { |