aboutsummaryrefslogtreecommitdiff
path: root/src/mainboard/hp/pavilion_m6_1035dx/ec.c
blob: d61a2e5301b607050f629548dba5a503bde41d19 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
/*
 * Copyright (C) 2014 Alexandru Gagniuc <mr.nuke.me@gmail.com>
 * Subject to the GNU GPL v2, or (at your option) any later version.
 */

#include "ec.h"
#include <ec/compal/ene932/ec.h>

/* The keyboard matrix tells the EC how the keyboard is wired internally */
static void set_keyboard_matrix_us(void)
{
	ec_kbc_write_cmd(0x59);
	ec_kbc_write_ib(0xE5);
}

/* Tell EC to operate in ACPI mode, thus generating SCIs on events, not SMIs */
static void enter_acpi_mode(void)
{
	ec_kbc_write_cmd(0x59);
	ec_kbc_write_ib(0xE8);
}

void pavilion_m6_1035dx_ec_init(void)
{
	set_keyboard_matrix_us();
	/* This could also be done in an SMI, should we decide to use SMM */
	enter_acpi_mode();
}