system76/common: Switch to pmc_swi for wake events
This commit is contained in:
committed by
Jeremy Soller
parent
3f41cd6ab3
commit
5559d4e2f6
@ -190,9 +190,7 @@ bool kbscan_press(uint16_t key, bool pressed, uint8_t * layer) {
|
|||||||
if (pressed &&
|
if (pressed &&
|
||||||
lid_state &&
|
lid_state &&
|
||||||
(power_state == POWER_STATE_S3 || power_state == POWER_STATE_DS3)) {
|
(power_state == POWER_STATE_S3 || power_state == POWER_STATE_DS3)) {
|
||||||
gpio_set(&SWI_N, false);
|
pmc_swi();
|
||||||
delay_ticks(10); //TODO: find correct delay
|
|
||||||
gpio_set(&SWI_N, true);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (key & KT_MASK) {
|
switch (key & KT_MASK) {
|
||||||
|
@ -7,7 +7,8 @@
|
|||||||
#include <board/pmc.h>
|
#include <board/pmc.h>
|
||||||
#include <common/debug.h>
|
#include <common/debug.h>
|
||||||
|
|
||||||
bool lid_state = true;
|
// Default closed to prevent spurious power on
|
||||||
|
bool lid_state = false;
|
||||||
bool lid_wake = false;
|
bool lid_wake = false;
|
||||||
|
|
||||||
void lid_event(void) {
|
void lid_event(void) {
|
||||||
@ -21,13 +22,7 @@ void lid_event(void) {
|
|||||||
DEBUG("open\n");
|
DEBUG("open\n");
|
||||||
|
|
||||||
if (lid_wake) {
|
if (lid_wake) {
|
||||||
gpio_set(&SWI_N, false);
|
pmc_swi();
|
||||||
|
|
||||||
//TODO: find correct delay
|
|
||||||
delay_ticks(10);
|
|
||||||
|
|
||||||
gpio_set(&SWI_N, true);
|
|
||||||
|
|
||||||
lid_wake = false;
|
lid_wake = false;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
Reference in New Issue
Block a user