diff options
Diffstat (limited to 'chip/npcx/i2c.c')
-rw-r--r-- | chip/npcx/i2c.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/chip/npcx/i2c.c b/chip/npcx/i2c.c index 23023abf1d..91590c80ec 100644 --- a/chip/npcx/i2c.c +++ b/chip/npcx/i2c.c @@ -84,7 +84,7 @@ struct i2c_status { uint16_t sz_txbuf; /* Size of Tx buffer in bytes */ uint16_t sz_rxbuf; /* Size of rx buffer in bytes */ uint16_t idx_buf; /* Current index of Tx/Rx buffer */ - uint8_t slave_addr__7bf;/* Target slave address */ + uint8_t slave_addr_flags;/* Target slave address */ enum smb_oper_state_t oper_state;/* Smbus operation state */ enum smb_error err_code; /* Error code */ int task_waiting; /* Task waiting on controller */ @@ -344,7 +344,7 @@ void i2c_done(int controller) static void i2c_handle_sda_irq(int controller) { volatile struct i2c_status *p_status = i2c_stsobjs + controller; - uint8_t addr__8b = I2C_GET_ADDR__7b(p_status->slave_addr__7bf) << 1; + uint8_t addr_8bit = I2C_GET_ADDR(p_status->slave_addr_flags) << 1; /* 1 Issue Start is successful ie. write address byte */ if (p_status->oper_state == SMB_MASTER_START || p_status->oper_state == SMB_REPEAT_START) { @@ -360,12 +360,12 @@ static void i2c_handle_sda_irq(int controller) I2C_STALL(controller); /* Write the address to the bus R bit*/ - I2C_WRITE_BYTE(controller, (addr__8b | 0x1)); + I2C_WRITE_BYTE(controller, (addr_8bit | 0x1)); CPRINTS("-ARR-0x%02x", addr); } else {/* Transmit mode */ p_status->oper_state = SMB_WRITE_OPER; /* Write the address to the bus W bit*/ - I2C_WRITE_BYTE(controller, addr__8b); + I2C_WRITE_BYTE(controller, addr_8bit); CPRINTS("-ARW-0x%02x", addr); } /* Completed handling START condition */ @@ -405,7 +405,7 @@ static void i2c_handle_sda_irq(int controller) } /* Write the address to the bus R bit*/ I2C_WRITE_BYTE(controller, - (addr__8b | 0x1)); + (addr_8bit | 0x1)); CPUTS("-ARR"); } } @@ -609,8 +609,8 @@ void i2c_set_timeout(int port, uint32_t timeout) timeout ? timeout : I2C_TIMEOUT_DEFAULT_US; } -int chip_i2c_xfer__7bf(const int port, - const uint16_t slave_addr__7bf, +int chip_i2c_xfer(const int port, + const uint16_t slave_addr_flags, const uint8_t *out, int out_size, uint8_t *in, int in_size, int flags) { @@ -639,7 +639,7 @@ int chip_i2c_xfer__7bf(const int port, p_status->sz_txbuf = out_size; p_status->rx_buf = in; p_status->sz_rxbuf = in_size; - p_status->slave_addr__7bf = slave_addr__7bf; + p_status->slave_addr_flags = slave_addr_flags; /* Reset index & error */ p_status->idx_buf = 0; |