diff options
author | Randall Spangler <rspangler@chromium.org> | 2012-05-24 09:24:29 -0700 |
---|---|---|
committer | Randall Spangler <rspangler@chromium.org> | 2012-05-24 09:28:03 -0700 |
commit | 0d6203adbf66182480c2b95269ab72df495c9669 (patch) | |
tree | 6923b7c05ae5ba9da00fabbecdfbbb201978ebd4 | |
parent | 0a77eea2e45f84bd009fe467ffaa3f268a29e21b (diff) | |
download | chrome-ec-0d6203adbf66182480c2b95269ab72df495c9669.tar.gz |
Update backlight in lid open/close funcs
...so lidopen/lidclose debug command also update the backlight
Signed-off-by: Randall Spangler <rspangler@chromium.org>
BUG=chrome-os-partner:9188
TEST=manual:
powerbtn -> boot system, display backlight on
kblight 100 -> keyboard backlight on
lidclose -> backlights off
lidopen -> backlights on
Change-Id: I0d092d3061ba8a00c8790b3d1b8380eecd2d1628
-rw-r--r-- | chip/lm4/power_button.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/chip/lm4/power_button.c b/chip/lm4/power_button.c index 66fc7b7589..685902c508 100644 --- a/chip/lm4/power_button.c +++ b/chip/lm4/power_button.c @@ -25,7 +25,8 @@ #define CPUTS(outstr) cputs(CC_POWERBTN, outstr) #define CPRINTF(format, args...) cprintf(CC_POWERBTN, format, ## args) -/* Power button state machine. +/* When chipset is on, we stretch the power button signal to it so chipset + * hard-reset is triggered at ~8 sec, not ~4 sec: * * PWRBTN# --- ---- * to EC |______________________| @@ -39,6 +40,7 @@ * to host v v * @S0 make code break code */ +/* TODO: link to full power button / lid switch state machine description. */ #define PWRBTN_DEBOUNCE_US 30000 /* Debounce time for power button */ #define PWRBTN_DELAY_T0 32000 /* 32ms (PCH requires >16ms) */ #define PWRBTN_DELAY_T1 (4000000 - PWRBTN_DELAY_T0) /* 4 secs - t0 */ @@ -215,8 +217,9 @@ static void lid_switch_open(uint64_t tnow) CPRINTF("[%T PB lid open]\n"); debounced_lid_open = 1; *memmap_switches |= EC_SWITCH_LID_OPEN; - lpc_set_host_events(EC_HOST_EVENT_MASK(EC_HOST_EVENT_LID_OPEN)); hook_notify(HOOK_LID_CHANGE, 0); + update_backlight(); + lpc_set_host_events(EC_HOST_EVENT_MASK(EC_HOST_EVENT_LID_OPEN)); /* If the chipset is off, send a power button pulse to wake up the * chipset. */ @@ -242,6 +245,7 @@ static void lid_switch_close(uint64_t tnow) debounced_lid_open = 0; *memmap_switches &= ~EC_SWITCH_LID_OPEN; hook_notify(HOOK_LID_CHANGE, 0); + update_backlight(); lpc_set_host_events(EC_HOST_EVENT_MASK(EC_HOST_EVENT_LID_CLOSED)); } @@ -282,8 +286,6 @@ static void lid_switch_changed(uint64_t tnow) lid_switch_open(tnow); else lid_switch_close(tnow); - - update_backlight(); } |