Signed-off-by: Sven Schnelle svens@stackframe.org --- src/ec/acpi/ec.c | 6 ++++++ src/ec/acpi/ec.h | 1 + 2 files changed, 7 insertions(+), 0 deletions(-)
diff --git a/src/ec/acpi/ec.c b/src/ec/acpi/ec.c index 1d4ffb8..2680aa3 100644 --- a/src/ec/acpi/ec.c +++ b/src/ec/acpi/ec.c @@ -116,6 +116,12 @@ int ec_write(u8 addr, u8 data) return send_ec_data(data); }
+u8 ec_query(void) +{ + send_ec_command(0x84); + return recv_ec_data(); +} + void ec_set_bit(u8 addr, u8 bit) { ec_write(addr, ec_read(addr) | (1 << bit)); diff --git a/src/ec/acpi/ec.h b/src/ec/acpi/ec.h index b5a1197..8fc88d2 100644 --- a/src/ec/acpi/ec.h +++ b/src/ec/acpi/ec.h @@ -42,6 +42,7 @@ int send_ec_command(u8 command); int send_ec_data(u8 data); int send_ec_data_nowait(u8 data); u8 recv_ec_data(void); +u8 ec_query(void); u8 ec_read(u8 addr); int ec_write(u8 addr, u8 data); void ec_set_bit(u8 addr, u8 bit);
Signed-off-by: Sven Schnelle svens@stackframe.org --- src/mainboard/lenovo/x60/acpi/ec.asl | 2 ++ src/mainboard/lenovo/x60/acpi/gpe.asl | 8 ++++++++ 2 files changed, 10 insertions(+), 0 deletions(-)
diff --git a/src/mainboard/lenovo/x60/acpi/ec.asl b/src/mainboard/lenovo/x60/acpi/ec.asl index ec5c6ab..7e2b94d 100644 --- a/src/mainboard/lenovo/x60/acpi/ec.asl +++ b/src/mainboard/lenovo/x60/acpi/ec.asl @@ -37,6 +37,8 @@ Device(EC) Offset (0x3B), , 1, KBLT, 1, /* Keyboard Light */ + Offset (0x4e), + WAKE, 16, Offset (0x78), TMP0, 8, /* Thermal Zone 0 temperature */ TMP1, 8, /* Thermal Zone 1 temperature */ diff --git a/src/mainboard/lenovo/x60/acpi/gpe.asl b/src/mainboard/lenovo/x60/acpi/gpe.asl index e69de29..1c5d1bd 100644 --- a/src/mainboard/lenovo/x60/acpi/gpe.asl +++ b/src/mainboard/lenovo/x60/acpi/gpe.asl @@ -0,0 +1,8 @@ +Scope (_GPE) +{ + Method(_L18, 0, NotSerialized) + { + /* Read EC register to clear wake status */ + Store(_SB.PCI0.LPCB.EC.WAKE, Local0) + } +}
Sven Schnelle wrote:
Signed-off-by: Sven Schnelle svens@stackframe.org
Acked-by: Peter Stuge peter@stuge.se
Sven Schnelle wrote:
Signed-off-by: Sven Schnelle svens@stackframe.org
Acked-by: Peter Stuge peter@stuge.se