diff options
author | Fabio Baltieri <fabiobaltieri@google.com> | 2021-09-10 14:39:16 +0000 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2021-09-10 22:35:05 +0000 |
commit | 2c0c44bed1d4b866cd33abc6ed29ac6241b32476 (patch) | |
tree | d0fc27a7bc01156f959a5f24e6906d153cddf912 /zephyr/shim/include | |
parent | 8b37b17df0b8946763b1da984c64c51418a6b381 (diff) | |
download | chrome-ec-2c0c44bed1d4b866cd33abc6ed29ac6241b32476.tar.gz |
zephyr: shim: set pwm_led data from device tree
Set up the pwm_leds data from the device tree, gets rid of most static
map defines and sets CONFIG_LED_PWM_COUNT automatically.
BRANCH=none
BUG=b:177452529
TEST=build and run on volteer
TEST=compared the built up pwm_leds structure with gdb
Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
Change-Id: Ib41faf86ae018f5a1ed8a1c96c4b6ec081e175d9
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3154256
Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
Reviewed-by: Yuval Peress <peress@google.com>
Diffstat (limited to 'zephyr/shim/include')
-rw-r--r-- | zephyr/shim/include/config_chip.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/zephyr/shim/include/config_chip.h b/zephyr/shim/include/config_chip.h index eff014a781..0ab812a5b8 100644 --- a/zephyr/shim/include/config_chip.h +++ b/zephyr/shim/include/config_chip.h @@ -549,8 +549,8 @@ #endif #undef CONFIG_LED_PWM_COUNT -#ifdef CONFIG_PLATFORM_EC_LED_PWM_COUNT -#define CONFIG_LED_PWM_COUNT CONFIG_PLATFORM_EC_LED_PWM_COUNT +#if DT_HAS_COMPAT_STATUS_OKAY(cros_ec_pwm_leds) +#define CONFIG_LED_PWM_COUNT DT_PROP_LEN(DT_INST(0, cros_ec_pwm_leds), leds) #endif #undef CONFIG_CMD_LEDTEST |