Attention is currently required from: Michał Żygowski.
5 comments:
Commit Message:
What part of the code is about ACPI? Sure, the EC data/control I/O register pair is described in ACPI, but the interface per se has nothing to do with ACPI, as far as I know.
typo: c
File acpi_ec.h:
bool ec_wait_for_ibuf(uint8_t control_port);
bool ec_wait_for_obuf(uint8_t control_port, unsigned int max_checks);
Any reason why only one of these has the `max_checks` parameter?
File acpi_ec.c:
Patch Set #1, Line 84: ec_wait_for_ibuf
obuf?
bool ec_read_reg(uint8_t address, uint8_t *data)
{
if (!ec_wait_for_ibuf(EC_CONTROL))
return false;
OUTB(EC_CMD_READ_REG, EC_CONTROL);
if (!ec_wait_for_ibuf(EC_CONTROL))
return false;
OUTB(address, EC_DATA);
if (!ec_wait_for_ibuf(EC_CONTROL))
return false;
*data = INB(EC_DATA);
return true;
}
bool ec_write_reg(uint8_t address, uint8_t data)
{
if (!ec_wait_for_ibuf(EC_CONTROL))
return false;
OUTB(EC_CMD_WRITE_REG, EC_CONTROL);
if (!ec_wait_for_ibuf(EC_CONTROL))
return false;
OUTB(address, EC_DATA);
if (!ec_wait_for_ibuf(EC_CONTROL))
return false;
OUTB(data, EC_DATA);
return true;
}
Why not use the functions you defined above?
bool ec_read_reg(uint8_t address, uint8_t *data)
{
if (!ec_write_cmd(EC_CONTROL, EC_CMD_READ_REG))
return false;
if (!ec_write_byte(EC_CONTROL, EC_DATA, address))
return false;
return ec_read_byte(EC_CONTROL, EC_DATA, data);
}
bool ec_write_reg(uint8_t address, uint8_t data)
{
if (!ec_write_cmd(EC_CONTROL, EC_CMD_READ_REG))
return false;
if (!ec_write_byte(EC_CONTROL, EC_DATA, address))
return false;
return ec_write_byte(EC_CONTROL, EC_DATA, data);
}
To view, visit change 55714. To unsubscribe, or for help writing mail filters, visit settings.