diff options
Diffstat (limited to 'src/ec/lenovo')
-rw-r--r-- | src/ec/lenovo/pmh7/pmh7.c | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/src/ec/lenovo/pmh7/pmh7.c b/src/ec/lenovo/pmh7/pmh7.c index c9756795a0..b160fd0bc1 100644 --- a/src/ec/lenovo/pmh7/pmh7.c +++ b/src/ec/lenovo/pmh7/pmh7.c @@ -68,20 +68,16 @@ void pmh7_register_set_bit(int reg, int bit) { char val; - outb(reg, EC_LENOVO_PMH7_ADDR); - val = inb(EC_LENOVO_PMH7_DATA); - outb(reg, EC_LENOVO_PMH7_ADDR); - outb(val | (1 << bit), EC_LENOVO_PMH7_DATA); + val = pmh7_register_read(reg); + pmh7_register_write(reg, val | (1 << bit)); } void pmh7_register_clear_bit(int reg, int bit) { char val; - outb(reg, EC_LENOVO_PMH7_ADDR); - val = inb(EC_LENOVO_PMH7_DATA); - outb(reg, EC_LENOVO_PMH7_ADDR); - outb(val &= ~(1 << bit), EC_LENOVO_PMH7_DATA); + val = pmh7_register_read(reg); + pmh7_register_write(reg, val & ~(1 << bit)); } char pmh7_register_read(int reg) |