system76/common: Switch to pmc_swi for wake events

This commit is contained in:
Jeremy Soller
2020-12-29 10:11:52 -07:00
committed by Jeremy Soller
parent 3f41cd6ab3
commit 5559d4e2f6
2 changed files with 4 additions and 11 deletions

View File

@ -190,9 +190,7 @@ bool kbscan_press(uint16_t key, bool pressed, uint8_t * layer) {
if (pressed &&
lid_state &&
(power_state == POWER_STATE_S3 || power_state == POWER_STATE_DS3)) {
gpio_set(&SWI_N, false);
delay_ticks(10); //TODO: find correct delay
gpio_set(&SWI_N, true);
pmc_swi();
}
switch (key & KT_MASK) {

View File

@ -7,7 +7,8 @@
#include <board/pmc.h>
#include <common/debug.h>
bool lid_state = true;
// Default closed to prevent spurious power on
bool lid_state = false;
bool lid_wake = false;
void lid_event(void) {
@ -21,13 +22,7 @@ void lid_event(void) {
DEBUG("open\n");
if (lid_wake) {
gpio_set(&SWI_N, false);
//TODO: find correct delay
delay_ticks(10);
gpio_set(&SWI_N, true);
pmc_swi();
lid_wake = false;
}
} else {