diff options
author | Rajesh Kumar <rajesh3.kumar@intel.com> | 2022-03-07 15:06:21 -0800 |
---|---|---|
committer | Chromeos LUCI <chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com> | 2022-04-01 23:47:51 +0000 |
commit | 0728ca37596203dbc9def3a4d442bd3d7aaac6ba (patch) | |
tree | 1180af2899cc800d674567b70f4f4a525b8eaf7a /baseboard | |
parent | 627bbf99a4f21274e1531ba0ead456fc98269756 (diff) | |
download | chrome-ec-0728ca37596203dbc9def3a4d442bd3d7aaac6ba.tar.gz |
zephyr: adlrvp: Enable LED configuration
This CL adds support for LED on ADP RVP NPCX platform.
BUG=b:218684235
BRANCH=none
TEST=zmake -l DEBUG configure -B ~/tmp/adlrvp_npcx/ adlrvp_npcx -b
LEDs are working
Signed-off-by: Rajesh Kumar <rajesh3.kumar@intel.com>
Change-Id: Ic52f35d2ab43a868b829fd349bbc325dd541a3c3
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3508584
Reviewed-by: Vijay P Hiremath <vijay.p.hiremath@intel.com>
Reviewed-by: Al Semjonovs <asemjonovs@google.com>
Diffstat (limited to 'baseboard')
-rw-r--r-- | baseboard/intelrvp/led.c | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/baseboard/intelrvp/led.c b/baseboard/intelrvp/led.c index 47dad8994f..add2ebbe43 100644 --- a/baseboard/intelrvp/led.c +++ b/baseboard/intelrvp/led.c @@ -49,26 +49,56 @@ const int supported_led_ids_count = ARRAY_SIZE(supported_led_ids); void led_set_color_power(enum ec_led_colors color) { if (color == EC_LED_COLOR_WHITE) +#ifdef CONFIG_ZEPHYR + gpio_pin_set_dt(GPIO_DT_FROM_NODELABEL(led_white_l), + LED_ON_LVL); +#else gpio_set_level(GPIO_PWR_LED_WHITE_L, LED_ON_LVL); +#endif /* CONFIG_ZEPHYR */ else /* LED_OFF and unsupported colors */ +#ifdef CONFIG_ZEPHYR + gpio_pin_set_dt(GPIO_DT_FROM_NODELABEL(led_white_l), + LED_OFF_LVL); +#else gpio_set_level(GPIO_PWR_LED_WHITE_L, LED_OFF_LVL); +#endif /* CONFIG_ZEPHYR */ } void led_set_color_battery(enum ec_led_colors color) { switch (color) { case EC_LED_COLOR_RED: +#ifdef CONFIG_ZEPHYR + gpio_pin_set_dt(GPIO_DT_FROM_NODELABEL(led_red_l), + LED_ON_LVL); +#else gpio_set_level(GPIO_BAT_LED_RED_L, LED_ON_LVL); +#endif /* CONFIG_ZEPHYR */ break; case EC_LED_COLOR_AMBER: +#ifdef CONFIG_ZEPHYR + gpio_pin_set_dt(GPIO_DT_FROM_NODELABEL(led_red_l), + LED_ON_LVL); +#else gpio_set_level(GPIO_BAT_LED_RED_L, LED_ON_LVL); +#endif /* CONFIG_ZEPHYR */ break; case EC_LED_COLOR_GREEN: +#ifdef CONFIG_ZEPHYR + gpio_pin_set_dt(GPIO_DT_FROM_NODELABEL(led_red_l), + LED_OFF_LVL); +#else gpio_set_level(GPIO_BAT_LED_RED_L, LED_OFF_LVL); +#endif /* CONFIG_ZEPHYR */ break; default: /* LED_OFF and other unsupported colors */ +#ifdef CONFIG_ZEPHYR + gpio_pin_set_dt(GPIO_DT_FROM_NODELABEL(led_red_l), + LED_OFF_LVL); +#else gpio_set_level(GPIO_BAT_LED_RED_L, LED_OFF_LVL); +#endif /* CONFIG_ZEPHYR */ break; } } |