summaryrefslogtreecommitdiff
path: root/baseboard/hatch/baseboard.c
diff options
context:
space:
mode:
Diffstat (limited to 'baseboard/hatch/baseboard.c')
-rw-r--r--baseboard/hatch/baseboard.c19
1 files changed, 12 insertions, 7 deletions
diff --git a/baseboard/hatch/baseboard.c b/baseboard/hatch/baseboard.c
index 58f795ed9f..040c2f2659 100644
--- a/baseboard/hatch/baseboard.c
+++ b/baseboard/hatch/baseboard.c
@@ -22,6 +22,7 @@
#include "i2c.h"
#include "keyboard_scan.h"
#include "power.h"
+#include "stdbool.h"
#include "tcpci.h"
#include "timer.h"
#include "usbc_ppc.h"
@@ -80,6 +81,12 @@ const unsigned int i2c_ports_used = ARRAY_SIZE(i2c_ports);
/******************************************************************************/
/* Chipset callbacks/hooks */
+__attribute__((weak)) bool board_has_kb_backlight(void)
+{
+ /* Default enable keyboard backlight */
+ return true;
+}
+
/* Called on AP S5 -> S3 transition */
static void baseboard_chipset_startup(void)
{
@@ -91,18 +98,16 @@ DECLARE_HOOK(HOOK_CHIPSET_STARTUP, baseboard_chipset_startup,
/* Called on AP S0iX -> S0 transition */
static void baseboard_chipset_resume(void)
{
- /* TODD(b/122266850): Need to fill out this hook */
- /* Enable keyboard backlight */
- gpio_set_level(GPIO_EC_KB_BL_EN, 1);
+ if (board_has_kb_backlight())
+ gpio_set_level(GPIO_EC_KB_BL_EN, 1);
}
DECLARE_HOOK(HOOK_CHIPSET_RESUME, baseboard_chipset_resume, HOOK_PRIO_DEFAULT);
/* Called on AP S0 -> S0iX transition */
static void baseboard_chipset_suspend(void)
{
- /* TODD(b/122266850): Need to fill out this hook */
- /* Disable keyboard backlight */
- gpio_set_level(GPIO_EC_KB_BL_EN, 0);
+ if (board_has_kb_backlight())
+ gpio_set_level(GPIO_EC_KB_BL_EN, 0);
}
DECLARE_HOOK(HOOK_CHIPSET_SUSPEND, baseboard_chipset_suspend,
HOOK_PRIO_DEFAULT);
@@ -110,7 +115,7 @@ DECLARE_HOOK(HOOK_CHIPSET_SUSPEND, baseboard_chipset_suspend,
/* Called on AP S3 -> S5 transition */
static void baseboard_chipset_shutdown(void)
{
- /* TODD(b/122266850): Need to fill out this hook */
+
}
DECLARE_HOOK(HOOK_CHIPSET_SHUTDOWN, baseboard_chipset_shutdown,
HOOK_PRIO_DEFAULT);