Lines Matching defs:msgs
1952 static int i2c_check_for_quirks(struct i2c_adapter *adap, struct i2c_msg *msgs, int num)
1963 if (q->flags & I2C_AQ_COMB_WRITE_FIRST && msgs[0].flags & I2C_M_RD)
1964 return i2c_quirk_error(adap, &msgs[0], "1st comb msg must be write");
1966 if (q->flags & I2C_AQ_COMB_READ_SECOND && !(msgs[1].flags & I2C_M_RD))
1967 return i2c_quirk_error(adap, &msgs[1], "2nd comb msg must be read");
1969 if (q->flags & I2C_AQ_COMB_SAME_ADDR && msgs[0].addr != msgs[1].addr)
1970 return i2c_quirk_error(adap, &msgs[0], "comb msg only to same addr");
1972 if (i2c_quirk_exceeded(msgs[0].len, q->max_comb_1st_msg_len))
1973 return i2c_quirk_error(adap, &msgs[0], "msg too long");
1975 if (i2c_quirk_exceeded(msgs[1].len, q->max_comb_2nd_msg_len))
1976 return i2c_quirk_error(adap, &msgs[1], "msg too long");
1983 return i2c_quirk_error(adap, &msgs[0], "too many messages");
1986 u16 len = msgs[i].len;
1988 if (msgs[i].flags & I2C_M_RD) {
1990 return i2c_quirk_error(adap, &msgs[i], "msg too long");
1993 return i2c_quirk_error(adap, &msgs[i], "no zero length");
1996 return i2c_quirk_error(adap, &msgs[i], "msg too long");
1999 return i2c_quirk_error(adap, &msgs[i], "no zero length");
2009 * @msgs: One or more messages to execute before STOP is issued to
2018 int __i2c_transfer(struct i2c_adapter *adap, struct i2c_msg *msgs, int num)
2028 if (WARN_ON(!msgs || num < 1))
2035 if (adap->quirks && i2c_check_for_quirks(adap, msgs, num))
2046 if (msgs[i].flags & I2C_M_RD)
2047 trace_i2c_read(adap, &msgs[i], i);
2049 trace_i2c_write(adap, &msgs[i], i);
2056 ret = adap->algo->master_xfer_atomic(adap, msgs, num);
2058 ret = adap->algo->master_xfer(adap, msgs, num);
2069 if (msgs[i].flags & I2C_M_RD)
2070 trace_i2c_reply(adap, &msgs[i], i);
2081 * @msgs: One or more messages to execute before STOP is issued to
2090 int i2c_transfer(struct i2c_adapter *adap, struct i2c_msg *msgs, int num)
2114 ret = __i2c_transfer(adap, msgs, num);
2428 /* also skip 0-length msgs for bogus thresholds of 0 */