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
This commit is contained in:
Sven Schnelle 2011-03-14 08:18:17 +00:00
parent 155c379b74
commit 8d94d7c4a7
2 changed files with 12 additions and 0 deletions

View File

@ -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")
};

View File

@ -44,6 +44,8 @@ int send_ec_data_nowait(u8 data);
u8 recv_ec_data(void);
u8 ec_read(u8 addr);
int ec_write(u8 addr, u8 data);
void ec_set_bit(u8 addr, u8 bit);
void ec_clr_bit(u8 addr, u8 bit);
#endif