summaryrefslogtreecommitdiff
path: root/board/primus/board.c
diff options
context:
space:
mode:
Diffstat (limited to 'board/primus/board.c')
-rw-r--r--board/primus/board.c16
1 files changed, 6 insertions, 10 deletions
diff --git a/board/primus/board.c b/board/primus/board.c
index a6c74b643d..c63bbb2c80 100644
--- a/board/primus/board.c
+++ b/board/primus/board.c
@@ -15,6 +15,7 @@
#include "lid_switch.h"
#include "power_button.h"
#include "power.h"
+#include "pwm.h"
#include "switch.h"
#include "throttle_ap.h"
@@ -24,6 +25,9 @@
#define CPRINTF(format, args...) cprintf(CC_CHARGER, format, ## args)
#define CPRINTS(format, args...) cprints(CC_CHARGER, format, ## args)
+#define KBLIGHT_LED_ON_LVL 100
+#define KBLIGHT_LED_OFF_LVL 0
+
/******************************************************************************/
/* USB-A charging control */
@@ -43,11 +47,7 @@ __override void board_cbi_init(void)
static void board_chipset_resume(void)
{
/* Allow keyboard backlight to be enabled */
-
- if (get_board_id() == 1)
- gpio_set_level(GPIO_ID_1_EC_KB_BL_EN, 1);
- else
- gpio_set_level(GPIO_EC_KB_BL_EN_L, 0);
+ pwm_set_duty(PWM_CH_KBLIGHT, KBLIGHT_LED_ON_LVL);
}
DECLARE_HOOK(HOOK_CHIPSET_RESUME, board_chipset_resume, HOOK_PRIO_DEFAULT);
@@ -55,11 +55,7 @@ DECLARE_HOOK(HOOK_CHIPSET_RESUME, board_chipset_resume, HOOK_PRIO_DEFAULT);
static void board_chipset_suspend(void)
{
/* Turn off the keyboard backlight if it's on. */
-
- if (get_board_id() == 1)
- gpio_set_level(GPIO_ID_1_EC_KB_BL_EN, 0);
- else
- gpio_set_level(GPIO_EC_KB_BL_EN_L, 1);
+ pwm_set_duty(PWM_CH_KBLIGHT, KBLIGHT_LED_OFF_LVL);
}
DECLARE_HOOK(HOOK_CHIPSET_SUSPEND, board_chipset_suspend, HOOK_PRIO_DEFAULT);