diff options
Diffstat (limited to 'baseboard/hatch')
-rw-r--r-- | baseboard/hatch/baseboard.c | 19 | ||||
-rw-r--r-- | baseboard/hatch/baseboard.h | 4 |
2 files changed, 16 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); diff --git a/baseboard/hatch/baseboard.h b/baseboard/hatch/baseboard.h index b9832b1c06..dac40e9293 100644 --- a/baseboard/hatch/baseboard.h +++ b/baseboard/hatch/baseboard.h @@ -8,6 +8,8 @@ #ifndef __CROS_EC_BASEBOARD_H #define __CROS_EC_BASEBOARD_H +#include "stdbool.h" + /* * By default, enable all console messages excepted HC, ACPI and event: * The sensor stack is generating a lot of activity. @@ -185,6 +187,8 @@ enum mst_source { }; /* Forward declare common (within Hatch) board-specific functions */ +bool board_has_kb_backlight(void); +unsigned char get_board_sku(void); void board_reset_pd_mcu(void); void baseboard_mst_enable_control(enum mst_source, int level); |