Lines Matching defs:msgs
2126 static int i2c_check_for_quirks(struct i2c_adapter *adap, struct i2c_msg *msgs, int num)
2137 if (q->flags & I2C_AQ_COMB_WRITE_FIRST && msgs[0].flags & I2C_M_RD)
2138 return i2c_quirk_error(adap, &msgs[0], "1st comb msg must be write");
2140 if (q->flags & I2C_AQ_COMB_READ_SECOND && !(msgs[1].flags & I2C_M_RD))
2141 return i2c_quirk_error(adap, &msgs[1], "2nd comb msg must be read");
2143 if (q->flags & I2C_AQ_COMB_SAME_ADDR && msgs[0].addr != msgs[1].addr)
2144 return i2c_quirk_error(adap, &msgs[0], "comb msg only to same addr");
2146 if (i2c_quirk_exceeded(msgs[0].len, q->max_comb_1st_msg_len))
2147 return i2c_quirk_error(adap, &msgs[0], "msg too long");
2149 if (i2c_quirk_exceeded(msgs[1].len, q->max_comb_2nd_msg_len))
2150 return i2c_quirk_error(adap, &msgs[1], "msg too long");
2157 return i2c_quirk_error(adap, &msgs[0], "too many messages");
2160 u16 len = msgs[i].len;
2162 if (msgs[i].flags & I2C_M_RD) {
2164 return i2c_quirk_error(adap, &msgs[i], "msg too long");
2167 return i2c_quirk_error(adap, &msgs[i], "no zero length");
2170 return i2c_quirk_error(adap, &msgs[i], "msg too long");
2173 return i2c_quirk_error(adap, &msgs[i], "no zero length");
2183 * @msgs: One or more messages to execute before STOP is issued to
2192 int __i2c_transfer(struct i2c_adapter *adap, struct i2c_msg *msgs, int num)
2197 if (WARN_ON(!msgs || num < 1))
2204 if (adap->quirks && i2c_check_for_quirks(adap, msgs, num))
2215 if (msgs[i].flags & I2C_M_RD)
2216 trace_i2c_read(adap, &msgs[i], i);
2218 trace_i2c_write(adap, &msgs[i], i);
2225 ret = adap->algo->master_xfer_atomic(adap, msgs, num);
2227 ret = adap->algo->master_xfer(adap, msgs, num);
2238 if (msgs[i].flags & I2C_M_RD)
2239 trace_i2c_reply(adap, &msgs[i], i);
2250 * @msgs: One or more messages to execute before STOP is issued to
2259 int i2c_transfer(struct i2c_adapter *adap, struct i2c_msg *msgs, int num)
2288 ret = __i2c_transfer(adap, msgs, num);
2616 /* also skip 0-length msgs for bogus thresholds of 0 */