i2c_dw_xfer_msg(struct dw_i2c_dev *dev)
{
struct i2c_msg *msgs = dev->msgs;
- int num = dev->msgs_num;
u32 ic_con, intr_mask;
int tx_limit = dev->tx_fifo_depth - readl(dev->base + DW_IC_TXFLR);
int rx_limit = dev->rx_fifo_depth - readl(dev->base + DW_IC_RXFLR);
writel(1, dev->base + DW_IC_ENABLE);
}
- for (; dev->msg_write_idx < num; dev->msg_write_idx++) {
+ for (; dev->msg_write_idx < dev->msgs_num; dev->msg_write_idx++) {
/* if target address has changed, we need to
* reprogram the target address in the i2c
* adapter when we are done with this transfer
i2c_dw_read(struct dw_i2c_dev *dev)
{
struct i2c_msg *msgs = dev->msgs;
- int num = dev->msgs_num;
u32 addr = msgs[dev->msg_read_idx].addr;
int rx_valid = readl(dev->base + DW_IC_RXFLR);
- for (; dev->msg_read_idx < num; dev->msg_read_idx++) {
+ for (; dev->msg_read_idx < dev->msgs_num; dev->msg_read_idx++) {
u32 len;
u8 *buf;