Author: svens Date: Mon Mar 14 09:18:17 2011 New Revision: 6441 URL: https://tracker.coreboot.org/trac/coreboot/changeset/6441
Log: ACPI EC: add ec_set_bit() / ec_clr_bit()
Signed-off-by: Sven Schnelle svens@stackframe.org Acked-by: Sven Schnelle svens@stackframe.org
Modified: trunk/src/ec/acpi/ec.c trunk/src/ec/acpi/ec.h
Modified: trunk/src/ec/acpi/ec.c ============================================================================== --- trunk/src/ec/acpi/ec.c Thu Mar 10 08:52:02 2011 (r6440) +++ trunk/src/ec/acpi/ec.c Mon Mar 14 09:18:17 2011 (r6441) @@ -113,6 +113,16 @@ 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") };
Modified: trunk/src/ec/acpi/ec.h ============================================================================== --- trunk/src/ec/acpi/ec.h Thu Mar 10 08:52:02 2011 (r6440) +++ trunk/src/ec/acpi/ec.h Mon Mar 14 09:18:17 2011 (r6441) @@ -44,6 +44,8 @@ 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