Lines Matching refs:msgs

195 	struct i2c_msg msgs[2];  in acpi_gsb_i2c_read_bytes()  local
203 msgs[0].addr = client->addr; in acpi_gsb_i2c_read_bytes()
204 msgs[0].flags = client->flags; in acpi_gsb_i2c_read_bytes()
205 msgs[0].len = 1; in acpi_gsb_i2c_read_bytes()
206 msgs[0].buf = &cmd; in acpi_gsb_i2c_read_bytes()
208 msgs[1].addr = client->addr; in acpi_gsb_i2c_read_bytes()
209 msgs[1].flags = client->flags | I2C_M_RD; in acpi_gsb_i2c_read_bytes()
210 msgs[1].len = data_len; in acpi_gsb_i2c_read_bytes()
211 msgs[1].buf = buffer; in acpi_gsb_i2c_read_bytes()
213 ret = i2c_transfer(client->adapter, msgs, ARRAY_SIZE(msgs)); in acpi_gsb_i2c_read_bytes()
227 struct i2c_msg msgs[1]; in acpi_gsb_i2c_write_bytes() local
238 msgs[0].addr = client->addr; in acpi_gsb_i2c_write_bytes()
239 msgs[0].flags = client->flags; in acpi_gsb_i2c_write_bytes()
240 msgs[0].len = data_len + 1; in acpi_gsb_i2c_write_bytes()
241 msgs[0].buf = buffer; in acpi_gsb_i2c_write_bytes()
243 ret = i2c_transfer(client->adapter, msgs, ARRAY_SIZE(msgs)); in acpi_gsb_i2c_write_bytes()
1952 static int i2c_check_for_quirks(struct i2c_adapter *adap, struct i2c_msg *msgs, int num) in i2c_check_for_quirks() argument
1963 if (q->flags & I2C_AQ_COMB_WRITE_FIRST && msgs[0].flags & I2C_M_RD) in i2c_check_for_quirks()
1964 return i2c_quirk_error(adap, &msgs[0], "1st comb msg must be write"); in i2c_check_for_quirks()
1966 if (q->flags & I2C_AQ_COMB_READ_SECOND && !(msgs[1].flags & I2C_M_RD)) in i2c_check_for_quirks()
1967 return i2c_quirk_error(adap, &msgs[1], "2nd comb msg must be read"); in i2c_check_for_quirks()
1969 if (q->flags & I2C_AQ_COMB_SAME_ADDR && msgs[0].addr != msgs[1].addr) in i2c_check_for_quirks()
1970 return i2c_quirk_error(adap, &msgs[0], "comb msg only to same addr"); in i2c_check_for_quirks()
1972 if (i2c_quirk_exceeded(msgs[0].len, q->max_comb_1st_msg_len)) in i2c_check_for_quirks()
1973 return i2c_quirk_error(adap, &msgs[0], "msg too long"); in i2c_check_for_quirks()
1975 if (i2c_quirk_exceeded(msgs[1].len, q->max_comb_2nd_msg_len)) in i2c_check_for_quirks()
1976 return i2c_quirk_error(adap, &msgs[1], "msg too long"); in i2c_check_for_quirks()
1983 return i2c_quirk_error(adap, &msgs[0], "too many messages"); in i2c_check_for_quirks()
1986 u16 len = msgs[i].len; in i2c_check_for_quirks()
1988 if (msgs[i].flags & I2C_M_RD) { in i2c_check_for_quirks()
1990 return i2c_quirk_error(adap, &msgs[i], "msg too long"); in i2c_check_for_quirks()
1993 return i2c_quirk_error(adap, &msgs[i], "msg too long"); in i2c_check_for_quirks()
2012 int __i2c_transfer(struct i2c_adapter *adap, struct i2c_msg *msgs, int num) in __i2c_transfer() argument
2017 if (adap->quirks && i2c_check_for_quirks(adap, msgs, num)) in __i2c_transfer()
2027 if (msgs[i].flags & I2C_M_RD) in __i2c_transfer()
2028 trace_i2c_read(adap, &msgs[i], i); in __i2c_transfer()
2030 trace_i2c_write(adap, &msgs[i], i); in __i2c_transfer()
2036 ret = adap->algo->master_xfer(adap, msgs, num); in __i2c_transfer()
2046 if (msgs[i].flags & I2C_M_RD) in __i2c_transfer()
2047 trace_i2c_reply(adap, &msgs[i], i); in __i2c_transfer()
2067 int i2c_transfer(struct i2c_adapter *adap, struct i2c_msg *msgs, int num) in i2c_transfer() argument
2092 "len=%d%s\n", ret, (msgs[ret].flags & I2C_M_RD) in i2c_transfer()
2093 ? 'R' : 'W', msgs[ret].addr, msgs[ret].len, in i2c_transfer()
2094 (msgs[ret].flags & I2C_M_RECV_LEN) ? "+" : ""); in i2c_transfer()
2107 ret = __i2c_transfer(adap, msgs, num); in i2c_transfer()