coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
ec.c
Go to the documentation of this file.
1
/* SPDX-License-Identifier: GPL-2.0-or-later */
2
3
#include "
ec.h
"
4
#include <
ec/compal/ene932/ec.h
>
5
6
/* The keyboard matrix tells the EC how the keyboard is wired internally */
7
static
void
set_keyboard_matrix_us
(
void
)
8
{
9
ec_kbc_write_cmd
(0x59);
10
ec_kbc_write_ib
(0xE5);
11
}
12
13
/* Tell EC to operate in APM mode. Events generate SMIs instead of SCIs */
14
static
void
enter_apm_mode
(
void
)
15
{
16
ec_kbc_write_cmd
(0x59);
17
ec_kbc_write_ib
(0xE9);
18
}
19
20
void
lenovo_g505s_ec_init
(
void
)
21
{
22
set_keyboard_matrix_us
();
23
24
/*
25
* The EC has a special "blinking Caps Lock LED" mode which it normally
26
* enters when it believes the OS is not responding. It occasionally
27
* disables battery charging when in this mode, although other
28
* functionality is unaffected. Although the EC starts in APM mode by
29
* default, it only leaves the "blinking Caps Lock LED" mode after
30
* receiving the following command.
31
*/
32
enter_apm_mode
();
33
}
ec_kbc_write_ib
void ec_kbc_write_ib(u8 data)
Definition:
ec.c:83
ec_kbc_write_cmd
void ec_kbc_write_cmd(u8 cmd)
Definition:
ec.c:77
ec.h
lenovo_g505s_ec_init
void lenovo_g505s_ec_init(void)
Definition:
ec.c:20
enter_apm_mode
static void enter_apm_mode(void)
Definition:
ec.c:14
set_keyboard_matrix_us
static void set_keyboard_matrix_us(void)
Definition:
ec.c:7
ec.h
src
mainboard
lenovo
g505s
ec.c
Generated by
1.9.1