diff options
author | Rob Barnes <robbarnes@google.com> | 2021-05-11 07:49:43 -0600 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2021-05-14 23:47:49 +0000 |
commit | 844cb221cc3bb7002c902d11189f9d39e9615fb6 (patch) | |
tree | 38e59cb04a8a4cca6866d4872fa15f36b491e49a | |
parent | 15c38c9a9b5588a566e5ff7fa639ff07d10426af (diff) | |
download | chrome-ec-844cb221cc3bb7002c902d11189f9d39e9615fb6.tar.gz |
kblight: Set kb backlight enable gpiostabilize-13974.B-main
Set the keyboard backlight enable gpio on enable/disable. This will
improve power usage on some boards.
BUG=b:187757151
TEST=Set backlight to 0, 50, 0 and observe the enable gpio is 0, 1, 0
BRANCH=None
Signed-off-by: Rob Barnes <robbarnes@google.com>
Change-Id: Ie03e98d939d05aea861c7b885a45b7e0c476db59
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2887550
Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
-rw-r--r-- | common/keyboard_backlight.c | 4 | ||||
-rw-r--r-- | include/keyboard_backlight.h | 7 |
2 files changed, 11 insertions, 0 deletions
diff --git a/common/keyboard_backlight.c b/common/keyboard_backlight.c index 694ac77446..0091f38ba6 100644 --- a/common/keyboard_backlight.c +++ b/common/keyboard_backlight.c @@ -5,6 +5,7 @@ #include "console.h" #include "ec_commands.h" +#include "gpio.h" #include "hooks.h" #include "host_command.h" #include "keyboard_backlight.h" @@ -56,6 +57,9 @@ int kblight_get(void) int kblight_enable(int enable) { +#ifdef GPIO_EN_KEYBOARD_BACKLIGHT + gpio_set_level(GPIO_EN_KEYBOARD_BACKLIGHT, enable); +#endif if (!kblight.drv || !kblight.drv->enable) return -1; return kblight.drv->enable(enable); diff --git a/include/keyboard_backlight.h b/include/keyboard_backlight.h index 2389b3dfe0..e0a1f4d30e 100644 --- a/include/keyboard_backlight.h +++ b/include/keyboard_backlight.h @@ -6,6 +6,13 @@ #ifndef __CROS_EC_KEYBOARD_BACKLIGHT_H #define __CROS_EC_KEYBOARD_BACKLIGHT_H +/** + * If GPIO_EN_KEYBOARD_BACKLIGHT is defined, this GPIO will be set when + * the the keyboard backlight is enabled or disabled. This GPIO is used + * to enable or disable the power to the keyboard backlight circuitry. + * GPIO_EN_KEYBOARD_BACKLIGHT must be active high. + */ + struct kblight_conf { const struct kblight_drv *drv; }; |