Keyboard backlight control should hook lid switch itself

It previously relied on the switch module to enable/disable the
keyboard backlight when the lid changed position.  It can do that itself now.

BUG=chrome-os-partner:20743
BRANCH=none
TEST=Boot link in a dark room where the keyboard backlight is on.  Briefly run
     a magnet over the lid switch and see the keyboard backlight blink off and
     then back on.

Change-Id: Iadf02b780a4990db25b6f0b3e1e0692f49c5488d
Signed-off-by: Randall Spangler <rspangler@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/61194
Reviewed-by: Bill Richardson <wfrichar@chromium.org>
This commit is contained in:
Randall Spangler
2013-07-08 14:34:05 -07:00
committed by ChromeBot
parent 958e43840e
commit 3e7d7090aa
2 changed files with 7 additions and 5 deletions

View File

@@ -11,6 +11,7 @@
#include "gpio.h"
#include "hooks.h"
#include "host_command.h"
#include "lid_switch.h"
#include "pwm.h"
#include "registers.h"
#include "system.h"
@@ -188,3 +189,9 @@ static void pwm_kblight_shutdown(void)
pwm_set_keyboard_backlight(0);
}
DECLARE_HOOK(HOOK_CHIPSET_SHUTDOWN, pwm_kblight_shutdown, HOOK_PRIO_DEFAULT);
static void pwm_kblight_lid_change(void)
{
pwm_enable_keyboard_backlight(lid_is_open());
}
DECLARE_HOOK(HOOK_LID_CHANGE, pwm_kblight_lid_change, HOOK_PRIO_DEFAULT);

View File

@@ -153,11 +153,6 @@ static void update_backlight(void)
gpio_set_level(GPIO_ENABLE_BACKLIGHT, 1);
else
gpio_set_level(GPIO_ENABLE_BACKLIGHT, 0);
#ifdef CONFIG_PWM_KBLIGHT
/* Same with keyboard backlight */
pwm_enable_keyboard_backlight(lid_is_open());
#endif
}
/**