summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--common/keyboard_backlight.c4
-rw-r--r--include/keyboard_backlight.h7
2 files changed, 11 insertions, 0 deletions
diff --git a/common/keyboard_backlight.c b/common/keyboard_backlight.c
index 694ac77446..0091f38ba6 100644
--- a/common/keyboard_backlight.c
+++ b/common/keyboard_backlight.c
@@ -5,6 +5,7 @@
#include "console.h"
#include "ec_commands.h"
+#include "gpio.h"
#include "hooks.h"
#include "host_command.h"
#include "keyboard_backlight.h"
@@ -56,6 +57,9 @@ int kblight_get(void)
int kblight_enable(int enable)
{
+#ifdef GPIO_EN_KEYBOARD_BACKLIGHT
+ gpio_set_level(GPIO_EN_KEYBOARD_BACKLIGHT, enable);
+#endif
if (!kblight.drv || !kblight.drv->enable)
return -1;
return kblight.drv->enable(enable);
diff --git a/include/keyboard_backlight.h b/include/keyboard_backlight.h
index 2389b3dfe0..e0a1f4d30e 100644
--- a/include/keyboard_backlight.h
+++ b/include/keyboard_backlight.h
@@ -6,6 +6,13 @@
#ifndef __CROS_EC_KEYBOARD_BACKLIGHT_H
#define __CROS_EC_KEYBOARD_BACKLIGHT_H
+/**
+ * If GPIO_EN_KEYBOARD_BACKLIGHT is defined, this GPIO will be set when
+ * the the keyboard backlight is enabled or disabled. This GPIO is used
+ * to enable or disable the power to the keyboard backlight circuitry.
+ * GPIO_EN_KEYBOARD_BACKLIGHT must be active high.
+ */
+
struct kblight_conf {
const struct kblight_drv *drv;
};