Lines Matching refs:pmsg
122 static int wmt_i2c_write(struct i2c_adapter *adap, struct i2c_msg *pmsg, in wmt_i2c_write() argument
131 if (!(pmsg->flags & I2C_M_NOSTART)) { in wmt_i2c_write()
137 if (pmsg->len == 0) { in wmt_i2c_write()
145 writew(pmsg->buf[0] & 0xFF, i2c_dev->base + REG_CDR); in wmt_i2c_write()
148 if (!(pmsg->flags & I2C_M_NOSTART)) { in wmt_i2c_write()
165 tcr_val |= (TCR_MASTER_WRITE | (pmsg->addr & TCR_SLAVE_ADDR_MASK)); in wmt_i2c_write()
169 if (pmsg->flags & I2C_M_NOSTART) { in wmt_i2c_write()
175 while (xfer_len < pmsg->len) { in wmt_i2c_write()
194 if (pmsg->len == 0) { in wmt_i2c_write()
200 if (xfer_len == pmsg->len) { in wmt_i2c_write()
204 writew(pmsg->buf[xfer_len] & 0xFF, i2c_dev->base + in wmt_i2c_write()
213 static int wmt_i2c_read(struct i2c_adapter *adap, struct i2c_msg *pmsg, in wmt_i2c_read() argument
222 if (!(pmsg->flags & I2C_M_NOSTART)) { in wmt_i2c_read()
236 if (!(pmsg->flags & I2C_M_NOSTART)) { in wmt_i2c_read()
242 if (pmsg->len == 1) { in wmt_i2c_read()
255 tcr_val |= TCR_MASTER_READ | (pmsg->addr & TCR_SLAVE_ADDR_MASK); in wmt_i2c_read()
259 if (pmsg->flags & I2C_M_NOSTART) { in wmt_i2c_read()
265 while (xfer_len < pmsg->len) { in wmt_i2c_read()
276 pmsg->buf[xfer_len] = readw(i2c_dev->base + REG_CDR) >> 8; in wmt_i2c_read()
279 if (xfer_len == pmsg->len - 1) { in wmt_i2c_read()
297 struct i2c_msg *pmsg; in wmt_i2c_xfer() local
304 pmsg = &msgs[i]; in wmt_i2c_xfer()
305 if (pmsg->flags & I2C_M_RD) in wmt_i2c_xfer()
306 ret = wmt_i2c_read(adap, pmsg, is_last); in wmt_i2c_xfer()
308 ret = wmt_i2c_write(adap, pmsg, is_last); in wmt_i2c_xfer()