| 1 |
|
| 2 |
|
| 3 |
#include <ec/acpi/ec.h> |
| 4 |
#include <bootmode.h> |
| 5 |
#include <timer.h> |
| 6 |
#include <delay.h> |
| 7 |
|
| 8 |
#include "h8.h" |
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
int get_recovery_mode_switch(void) |
| 15 |
{ |
| 16 |
struct stopwatch sw; |
| 17 |
|
| 18 |
if (!CONFIG(H8_FN_KEY_AS_VBOOT_RECOVERY_SW)) |
| 19 |
return 0; |
| 20 |
|
| 21 |
|
| 22 |
|
| 23 |
|
| 24 |
|
| 25 |
stopwatch_init_msecs_expire(&sw, 1000); |
| 26 |
while (!stopwatch_expired(&sw) && !h8_get_sense_ready()) |
| 27 |
mdelay(1); |
| 28 |
|
| 29 |
if (!h8_get_sense_ready()) |
| 30 |
return 0; |
| 31 |
|
| 32 |
return h8_get_fn_key(); |
| 33 |
} |
| 34 |
|
| 35 |
|
| 36 |
|
| 37 |
|
| 38 |
|
| 39 |
int get_write_protect_state(void) |
| 40 |
{ |
| 41 |
return 0; |
| 42 |
} |