coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
sense.c File Reference
#include <ec/acpi/ec.h>
#include "h8.h"
Include dependency graph for sense.c:

Go to the source code of this file.

Functions

int h8_get_sense_ready (void)
 Return the EC sense status register state. More...
 
int h8_get_fn_key (void)
 Return the state of Fn key. More...
 

Function Documentation

◆ h8_get_fn_key()

int h8_get_fn_key ( void  )

Return the state of Fn key.

Only valid if h8_get_sense_ready (see above) returns true.

Returns
1 if the key is pressed.

Definition at line 38 of file sense.c.

References ec_read(), H8_STATUS0, and H8_STATUS0_FN_KEY_DOWN.

Referenced by get_recovery_mode_switch().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ h8_get_sense_ready()

int h8_get_sense_ready ( void  )

Return the EC sense status register state.

Observations showed the sense registers are all zero until the EC populates them after some time. Likely the EC sets all bits to it's valid state at once, but there's no prove as the firmware isn't available.

Wait for any register having at least one bit set. Unlikely that all register will be zero after booting has finished.

Returns
1 if the EC provides valid data in sense status registers

Definition at line 19 of file sense.c.

References ARRAY_SIZE, ec_read(), H8_STATUS0, H8_STATUS1, H8_STATUS2, and H8_STATUS3.

Referenced by get_recovery_mode_switch().

Here is the call graph for this function:
Here is the caller graph for this function: