From 958e53d9cb2e0531eb33a5901e43efa237ffb835 Mon Sep 17 00:00:00 2001 From: Rob Barnes Date: Tue, 11 May 2021 08:17:43 -0600 Subject: guybrush: Alias kb backlight gpio When keyboard backlight is 0%, the backlight led driver should be disabled to save power. By aliasing this GPIO, the common keyboard_backlight handler will toggle this GPIO on kblight_enable. 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 Change-Id: I22b0bb31720e9e17e9d896759be6b2ccf8c69d42 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2887551 Commit-Queue: Diana Z Reviewed-by: Diana Z --- baseboard/guybrush/baseboard.c | 2 -- baseboard/guybrush/baseboard.h | 3 ++- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/baseboard/guybrush/baseboard.c b/baseboard/guybrush/baseboard.c index 51f8e44f35..564133c55f 100644 --- a/baseboard/guybrush/baseboard.c +++ b/baseboard/guybrush/baseboard.c @@ -908,7 +908,6 @@ static void baseboard_chipset_suspend(void) { /* Disable display and keyboard backlights. */ gpio_set_level(GPIO_EC_DISABLE_DISP_BL, 1); - gpio_set_level(GPIO_EN_KB_BL, 0); ioex_set_level(IOEX_USB_A1_RETIMER_EN, 0); } DECLARE_HOOK(HOOK_CHIPSET_SUSPEND, baseboard_chipset_suspend, @@ -918,7 +917,6 @@ static void baseboard_chipset_resume(void) { /* Enable display and keyboard backlights. */ gpio_set_level(GPIO_EC_DISABLE_DISP_BL, 0); - gpio_set_level(GPIO_EN_KB_BL, 1); ioex_set_level(IOEX_USB_A1_RETIMER_EN, 1); /* Some retimers take several ms to be ready, so defer setup call */ hook_call_deferred(&baseboard_a1_retimer_setup_data, 20 * MSEC); diff --git a/baseboard/guybrush/baseboard.h b/baseboard/guybrush/baseboard.h index 455c5bd971..5f3ec9fd5b 100644 --- a/baseboard/guybrush/baseboard.h +++ b/baseboard/guybrush/baseboard.h @@ -105,7 +105,8 @@ #define CONFIG_KEYBOARD_COL2_INVERTED #define CONFIG_KEYBOARD_PROTOCOL_8042 #define CONFIG_KEYBOARD_VIVALDI -#define GPIO_KBD_KSO2 GPIO_EC_KSO_02_INV +#define GPIO_EN_KEYBOARD_BACKLIGHT GPIO_EN_KB_BL +#define GPIO_KBD_KSO2 GPIO_EC_KSO_02_INV /* Sensors */ #define CONFIG_TABLET_MODE -- cgit v1.2.1