summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSue Chen <sue.chen@quanta.corp-partner.google.com>2022-01-20 13:19:36 +0800
committerCommit Bot <commit-bot@chromium.org>2022-01-21 07:23:02 +0000
commita80fe5654d6869c1f08f691e1618cd02794f98cb (patch)
tree5b087e15638bdbdbc479b79cf632adbc46902db4
parente73be91d98d81599a687841586a910615b4d22db (diff)
downloadchrome-ec-a80fe5654d6869c1f08f691e1618cd02794f98cb.tar.gz
Tomato: Set EN_KB_BL on/off while chipset resume/suspend
For GPIO_EN_KEYBOARD_BACKLIGHT is only enable when the current_percent is not 0 in common/keyboard_backlight.c, enable EN_KB_BL while chipset resume to S0 in board.c. BUG=b:214165183 BRANCH=cherry TEST=pressing hot key can adjust keyboard backlight. Signed-off-by: Sue Chen <sue.chen@quanta.corp-partner.google.com> Change-Id: I0f94f68398fa31bb8435e985e990d2d5ba2cbcd3 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3403363 Reviewed-by: Chen-Tsung Hsieh <chentsung@chromium.org> Reviewed-by: Ting Shen <phoenixshen@chromium.org> Commit-Queue: Chen-Tsung Hsieh <chentsung@chromium.org>
-rw-r--r--board/cherry/board.c12
-rw-r--r--board/cherry/board.h1
2 files changed, 12 insertions, 1 deletions
diff --git a/board/cherry/board.c b/board/cherry/board.c
index 35dae9ed36..565c68e976 100644
--- a/board/cherry/board.c
+++ b/board/cherry/board.c
@@ -177,3 +177,15 @@ static void board_init(void)
}
}
DECLARE_HOOK(HOOK_INIT, board_init, HOOK_PRIO_DEFAULT);
+
+static void board_do_chipset_resume(void)
+{
+ gpio_set_level(GPIO_EN_KB_BL, 1);
+}
+DECLARE_HOOK(HOOK_CHIPSET_RESUME, board_do_chipset_resume, HOOK_PRIO_DEFAULT);
+
+static void board_do_chipset_suspend(void)
+{
+ gpio_set_level(GPIO_EN_KB_BL, 0);
+}
+DECLARE_HOOK(HOOK_CHIPSET_SUSPEND, board_do_chipset_suspend, HOOK_PRIO_DEFAULT);
diff --git a/board/cherry/board.h b/board/cherry/board.h
index 4f617c49eb..be09f45637 100644
--- a/board/cherry/board.h
+++ b/board/cherry/board.h
@@ -36,7 +36,6 @@
#define CONFIG_BATT_FULL_CHIPSET_OFF_INPUT_LIMIT_MV 9000
/* Keyboard */
-#define GPIO_EN_KEYBOARD_BACKLIGHT GPIO_EN_KB_BL
#define CONFIG_KEYBOARD_REFRESH_ROW3
/* Sensor */