diff options
Diffstat (limited to 'board/marasov/board.c')
-rw-r--r-- | board/marasov/board.c | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/board/marasov/board.c b/board/marasov/board.c new file mode 100644 index 0000000000..e48dfaa163 --- /dev/null +++ b/board/marasov/board.c @@ -0,0 +1,52 @@ +/* Copyright 2022 The ChromiumOS Authors + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + */ + +#include "button.h" +#include "cbi.h" +#include "charge_ramp.h" +#include "charger.h" +#include "common.h" +#include "console.h" +#include "driver/accelgyro_lsm6dso.h" +#include "driver/accel_lis2dw12.h" +#include "driver/als_tcs3400.h" +#include "fw_config.h" +#include "gpio.h" +#include "gpio_signal.h" +#include "hooks.h" +#include "lid_switch.h" +#include "power_button.h" +#include "power.h" +#include "registers.h" +#include "switch.h" +#include "tablet_mode.h" +#include "throttle_ap.h" +#include "usbc_config.h" + +#include "gpio_list.h" /* Must come after other header files. */ + +/* Console output macros */ +#define CPRINTF(format, args...) cprintf(CC_CHARGER, format, ##args) +#define CPRINTS(format, args...) cprints(CC_CHARGER, format, ##args) + +/* Called on AP S3 -> S0 transition */ +static void board_chipset_resume(void) +{ + /* Allow keyboard backlight to be enabled */ + + if (IS_ENABLED(CONFIG_PWM_KBLIGHT)) + gpio_set_level(GPIO_EC_KB_BL_EN_L, 0); +} +DECLARE_HOOK(HOOK_CHIPSET_RESUME, board_chipset_resume, HOOK_PRIO_DEFAULT); + +/* Called on AP S0 -> S3 transition */ +static void board_chipset_suspend(void) +{ + /* Turn off the keyboard backlight if it's on. */ + + if (IS_ENABLED(CONFIG_PWM_KBLIGHT)) + gpio_set_level(GPIO_EC_KB_BL_EN_L, 1); +} +DECLARE_HOOK(HOOK_CHIPSET_SUSPEND, board_chipset_suspend, HOOK_PRIO_DEFAULT); |