Lines Matching refs:msgs
235 struct i2c_msg msgs[2]; in acpi_gsb_i2c_read_bytes() local
243 msgs[0].addr = client->addr; in acpi_gsb_i2c_read_bytes()
244 msgs[0].flags = client->flags; in acpi_gsb_i2c_read_bytes()
245 msgs[0].len = 1; in acpi_gsb_i2c_read_bytes()
246 msgs[0].buf = &cmd; in acpi_gsb_i2c_read_bytes()
248 msgs[1].addr = client->addr; in acpi_gsb_i2c_read_bytes()
249 msgs[1].flags = client->flags | I2C_M_RD; in acpi_gsb_i2c_read_bytes()
250 msgs[1].len = data_len; in acpi_gsb_i2c_read_bytes()
251 msgs[1].buf = buffer; in acpi_gsb_i2c_read_bytes()
253 ret = i2c_transfer(client->adapter, msgs, ARRAY_SIZE(msgs)); in acpi_gsb_i2c_read_bytes()
267 struct i2c_msg msgs[1]; in acpi_gsb_i2c_write_bytes() local
278 msgs[0].addr = client->addr; in acpi_gsb_i2c_write_bytes()
279 msgs[0].flags = client->flags; in acpi_gsb_i2c_write_bytes()
280 msgs[0].len = data_len + 1; in acpi_gsb_i2c_write_bytes()
281 msgs[0].buf = buffer; in acpi_gsb_i2c_write_bytes()
283 ret = i2c_transfer(client->adapter, msgs, ARRAY_SIZE(msgs)); in acpi_gsb_i2c_write_bytes()
2110 static int i2c_check_for_quirks(struct i2c_adapter *adap, struct i2c_msg *msgs, int num) in i2c_check_for_quirks() argument
2121 if (q->flags & I2C_AQ_COMB_WRITE_FIRST && msgs[0].flags & I2C_M_RD) in i2c_check_for_quirks()
2122 return i2c_quirk_error(adap, &msgs[0], "1st comb msg must be write"); in i2c_check_for_quirks()
2124 if (q->flags & I2C_AQ_COMB_READ_SECOND && !(msgs[1].flags & I2C_M_RD)) in i2c_check_for_quirks()
2125 return i2c_quirk_error(adap, &msgs[1], "2nd comb msg must be read"); in i2c_check_for_quirks()
2127 if (q->flags & I2C_AQ_COMB_SAME_ADDR && msgs[0].addr != msgs[1].addr) in i2c_check_for_quirks()
2128 return i2c_quirk_error(adap, &msgs[0], "comb msg only to same addr"); in i2c_check_for_quirks()
2130 if (i2c_quirk_exceeded(msgs[0].len, q->max_comb_1st_msg_len)) in i2c_check_for_quirks()
2131 return i2c_quirk_error(adap, &msgs[0], "msg too long"); in i2c_check_for_quirks()
2133 if (i2c_quirk_exceeded(msgs[1].len, q->max_comb_2nd_msg_len)) in i2c_check_for_quirks()
2134 return i2c_quirk_error(adap, &msgs[1], "msg too long"); in i2c_check_for_quirks()
2141 return i2c_quirk_error(adap, &msgs[0], "too many messages"); in i2c_check_for_quirks()
2144 u16 len = msgs[i].len; in i2c_check_for_quirks()
2146 if (msgs[i].flags & I2C_M_RD) { in i2c_check_for_quirks()
2148 return i2c_quirk_error(adap, &msgs[i], "msg too long"); in i2c_check_for_quirks()
2151 return i2c_quirk_error(adap, &msgs[i], "msg too long"); in i2c_check_for_quirks()
2170 int __i2c_transfer(struct i2c_adapter *adap, struct i2c_msg *msgs, int num) in __i2c_transfer() argument
2175 if (adap->quirks && i2c_check_for_quirks(adap, msgs, num)) in __i2c_transfer()
2185 if (msgs[i].flags & I2C_M_RD) in __i2c_transfer()
2186 trace_i2c_read(adap, &msgs[i], i); in __i2c_transfer()
2188 trace_i2c_write(adap, &msgs[i], i); in __i2c_transfer()
2194 ret = adap->algo->master_xfer(adap, msgs, num); in __i2c_transfer()
2204 if (msgs[i].flags & I2C_M_RD) in __i2c_transfer()
2205 trace_i2c_reply(adap, &msgs[i], i); in __i2c_transfer()
2225 int i2c_transfer(struct i2c_adapter *adap, struct i2c_msg *msgs, int num) in i2c_transfer() argument
2250 "len=%d%s\n", ret, (msgs[ret].flags & I2C_M_RD) in i2c_transfer()
2251 ? 'R' : 'W', msgs[ret].addr, msgs[ret].len, in i2c_transfer()
2252 (msgs[ret].flags & I2C_M_RECV_LEN) ? "+" : ""); in i2c_transfer()
2265 ret = __i2c_transfer(adap, msgs, num); in i2c_transfer()