diff options
author | Sven Schnelle <svens@stackframe.org> | 2011-03-14 08:18:17 +0000 |
---|---|---|
committer | Sven Schnelle <svens@stackframe.org> | 2011-03-14 08:18:17 +0000 |
commit | 8d94d7c4a7305712478071250bda88eba9ad30d8 (patch) | |
tree | ea4cf1efbffbf390abd3f9f43da19a2f772c5bc0 /src/ec/acpi/ec.c | |
parent | 155c379b747e14ee181794d6ee460495886bee14 (diff) | |
download | coreboot-8d94d7c4a7305712478071250bda88eba9ad30d8.tar.xz |
ACPI EC: add ec_set_bit() / ec_clr_bit()
Signed-off-by: Sven Schnelle <svens@stackframe.org>
Acked-by: Sven Schnelle <svens@stackframe.org>
git-svn-id: svn://svn.coreboot.org/coreboot/trunk@6441 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
Diffstat (limited to 'src/ec/acpi/ec.c')
-rw-r--r-- | src/ec/acpi/ec.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/ec/acpi/ec.c b/src/ec/acpi/ec.c index 7a01b7e455..e353260c30 100644 --- a/src/ec/acpi/ec.c +++ b/src/ec/acpi/ec.c @@ -113,6 +113,16 @@ int ec_write(u8 addr, u8 data) return send_ec_data(data); } +void ec_set_bit(u8 addr, u8 bit) +{ + ec_write(addr, ec_read(addr) | (1 << bit)); +} + +void ec_clr_bit(u8 addr, u8 bit) +{ + ec_write(addr, ec_read(addr) & ~(1 << bit)); +} + struct chip_operations ec_acpi_ops = { CHIP_NAME("ACPI Embedded Controller") }; |