Home
last modified time | relevance | path

Searched refs:msgs (Results 1 – 25 of 166) sorted by relevance

1234567

/drivers/media/pci/pt1/
Dva1j5jf8007s.c57 struct i2c_msg msgs[2]; in va1j5jf8007s_read_snr() local
67 msgs[0].addr = addr; in va1j5jf8007s_read_snr()
68 msgs[0].flags = 0; in va1j5jf8007s_read_snr()
69 msgs[0].len = sizeof(write_buf); in va1j5jf8007s_read_snr()
70 msgs[0].buf = write_buf; in va1j5jf8007s_read_snr()
72 msgs[1].addr = addr; in va1j5jf8007s_read_snr()
73 msgs[1].flags = I2C_M_RD; in va1j5jf8007s_read_snr()
74 msgs[1].len = sizeof(read_buf); in va1j5jf8007s_read_snr()
75 msgs[1].buf = read_buf; in va1j5jf8007s_read_snr()
77 if (i2c_transfer(state->adap, msgs, 2) != 2) in va1j5jf8007s_read_snr()
[all …]
Dva1j5jf8007t.c55 struct i2c_msg msgs[2]; in va1j5jf8007t_read_snr() local
65 msgs[0].addr = addr; in va1j5jf8007t_read_snr()
66 msgs[0].flags = 0; in va1j5jf8007t_read_snr()
67 msgs[0].len = sizeof(write_buf); in va1j5jf8007t_read_snr()
68 msgs[0].buf = write_buf; in va1j5jf8007t_read_snr()
70 msgs[1].addr = addr; in va1j5jf8007t_read_snr()
71 msgs[1].flags = I2C_M_RD; in va1j5jf8007t_read_snr()
72 msgs[1].len = sizeof(read_buf); in va1j5jf8007t_read_snr()
73 msgs[1].buf = read_buf; in va1j5jf8007t_read_snr()
75 if (i2c_transfer(state->adap, msgs, 2) != 2) in va1j5jf8007t_read_snr()
[all …]
/drivers/video/fbdev/via/
Dvia_i2c.c125 struct i2c_msg msgs[2]; in viafb_i2c_readbyte() local
130 msgs[0].flags = 0; in viafb_i2c_readbyte()
131 msgs[1].flags = I2C_M_RD; in viafb_i2c_readbyte()
132 msgs[0].addr = msgs[1].addr = slave_addr / 2; in viafb_i2c_readbyte()
134 msgs[0].len = 1; msgs[1].len = 1; in viafb_i2c_readbyte()
135 msgs[0].buf = mm1; msgs[1].buf = pdata; in viafb_i2c_readbyte()
136 ret = i2c_transfer(&via_i2c_par[adap].adapter, msgs, 2); in viafb_i2c_readbyte()
149 struct i2c_msg msgs; in viafb_i2c_writebyte() local
153 msgs.flags = 0; in viafb_i2c_writebyte()
154 msgs.addr = slave_addr / 2; in viafb_i2c_writebyte()
[all …]
/drivers/media/usb/tm6000/
Dtm6000-i2c.c157 struct i2c_msg msgs[], int num) in tm6000_i2c_xfer() argument
165 addr = (msgs[i].addr << 1) & 0xff; in tm6000_i2c_xfer()
167 (msgs[i].flags & I2C_M_RD) ? "read" : "write", in tm6000_i2c_xfer()
168 i == num - 1 ? "stop" : "nonstop", addr, msgs[i].len); in tm6000_i2c_xfer()
169 if (msgs[i].flags & I2C_M_RD) { in tm6000_i2c_xfer()
180 } else if (i + 1 < num && msgs[i].len <= 2 && in tm6000_i2c_xfer()
181 (msgs[i + 1].flags & I2C_M_RD) && in tm6000_i2c_xfer()
182 msgs[i].addr == msgs[i + 1].addr) { in tm6000_i2c_xfer()
185 for (byte = 0; byte < msgs[i].len; byte++) in tm6000_i2c_xfer()
186 printk(KERN_CONT " %02x", msgs[i].buf[byte]); in tm6000_i2c_xfer()
[all …]
/drivers/media/pci/saa7164/
Dsaa7164-i2c.c30 static int i2c_xfer(struct i2c_adapter *i2c_adap, struct i2c_msg *msgs, int num) in i2c_xfer() argument
40 __func__, num, msgs[i].addr, msgs[i].len); in i2c_xfer()
41 if (msgs[i].flags & I2C_M_RD) { in i2c_xfer()
45 } else if (i + 1 < num && (msgs[i + 1].flags & I2C_M_RD) && in i2c_xfer()
46 msgs[i].addr == msgs[i + 1].addr) { in i2c_xfer()
49 retval = saa7164_api_i2c_read(bus, msgs[i].addr, in i2c_xfer()
50 msgs[i].len, msgs[i].buf, in i2c_xfer()
51 msgs[i+1].len, msgs[i+1].buf in i2c_xfer()
60 retval = saa7164_api_i2c_write(bus, msgs[i].addr, in i2c_xfer()
61 msgs[i].len, msgs[i].buf); in i2c_xfer()
/drivers/media/usb/go7007/
Dgo7007-i2c.c154 struct i2c_msg msgs[], int num) in go7007_i2c_master_xfer() argument
162 if (msgs[i].len == 2) { in go7007_i2c_master_xfer()
163 if (i + 1 == num || msgs[i].addr != msgs[i + 1].addr || in go7007_i2c_master_xfer()
164 (msgs[i].flags & I2C_M_RD) || in go7007_i2c_master_xfer()
165 !(msgs[i + 1].flags & I2C_M_RD) || in go7007_i2c_master_xfer()
166 msgs[i + 1].len != 1) in go7007_i2c_master_xfer()
168 if (go7007_i2c_xfer(go, msgs[i].addr, 1, in go7007_i2c_master_xfer()
169 (msgs[i].buf[0] << 8) | msgs[i].buf[1], in go7007_i2c_master_xfer()
170 0x01, &msgs[i + 1].buf[0]) < 0) in go7007_i2c_master_xfer()
173 } else if (msgs[i].len == 3) { in go7007_i2c_master_xfer()
[all …]
Dgo7007-usb.c956 struct i2c_msg msgs[], int num) in go7007_usb_i2c_master_xfer() argument
973 if (i + 1 < num && msgs[i].addr == msgs[i + 1].addr && in go7007_usb_i2c_master_xfer()
974 !(msgs[i].flags & I2C_M_RD) && in go7007_usb_i2c_master_xfer()
975 (msgs[i + 1].flags & I2C_M_RD)) { in go7007_usb_i2c_master_xfer()
978 msgs[i].len, msgs[i + 1].len, msgs[i].addr); in go7007_usb_i2c_master_xfer()
981 buf[1] = msgs[i].len + 1; in go7007_usb_i2c_master_xfer()
982 buf[2] = msgs[i].addr << 1; in go7007_usb_i2c_master_xfer()
983 memcpy(&buf[3], msgs[i].buf, msgs[i].len); in go7007_usb_i2c_master_xfer()
984 buf_len = msgs[i].len + 3; in go7007_usb_i2c_master_xfer()
985 buf[buf_len++] = msgs[++i].len; in go7007_usb_i2c_master_xfer()
[all …]
/drivers/media/usb/stk1160/
Dstk1160-i2c.c162 struct i2c_msg msgs[], int num) in stk1160_i2c_xfer() argument
168 addr = msgs[i].addr << 1; in stk1160_i2c_xfer()
171 if (!msgs[i].len) { in stk1160_i2c_xfer()
179 } else if (msgs[i].flags & I2C_M_RD) { in stk1160_i2c_xfer()
185 } else if (i + 1 < num && msgs[i].len <= 2 && in stk1160_i2c_xfer()
186 (msgs[i + 1].flags & I2C_M_RD) && in stk1160_i2c_xfer()
187 msgs[i].addr == msgs[i + 1].addr) { in stk1160_i2c_xfer()
189 if (msgs[i].len != 1 || msgs[i + 1].len != 1) { in stk1160_i2c_xfer()
195 dprintk_i2c(" subaddr=%x", msgs[i].buf[0]); in stk1160_i2c_xfer()
197 rc = stk1160_i2c_read_reg(dev, addr, msgs[i].buf[0], in stk1160_i2c_xfer()
[all …]
/drivers/rtc/
Drtc-pcf8523.c44 struct i2c_msg msgs[2]; in pcf8523_read() local
48 msgs[0].addr = client->addr; in pcf8523_read()
49 msgs[0].flags = 0; in pcf8523_read()
50 msgs[0].len = sizeof(reg); in pcf8523_read()
51 msgs[0].buf = &reg; in pcf8523_read()
53 msgs[1].addr = client->addr; in pcf8523_read()
54 msgs[1].flags = I2C_M_RD; in pcf8523_read()
55 msgs[1].len = sizeof(value); in pcf8523_read()
56 msgs[1].buf = &value; in pcf8523_read()
58 err = i2c_transfer(client->adapter, msgs, ARRAY_SIZE(msgs)); in pcf8523_read()
[all …]
/drivers/media/usb/hdpvr/
Dhdpvr-i2c.c126 static int hdpvr_transfer(struct i2c_adapter *i2c_adapter, struct i2c_msg *msgs, in hdpvr_transfer() argument
137 addr = msgs[0].addr << 1; in hdpvr_transfer()
140 if (msgs[0].flags & I2C_M_RD) in hdpvr_transfer()
142 msgs[0].buf, msgs[0].len); in hdpvr_transfer()
144 retval = hdpvr_i2c_write(dev, 1, addr, msgs[0].buf, in hdpvr_transfer()
145 msgs[0].len); in hdpvr_transfer()
147 if (msgs[0].addr != msgs[1].addr) { in hdpvr_transfer()
154 if ((msgs[0].flags & I2C_M_RD) || !(msgs[1].flags & I2C_M_RD)) { in hdpvr_transfer()
156 "r0=%d, r1=%d\n", msgs[0].flags & I2C_M_RD, in hdpvr_transfer()
157 msgs[1].flags & I2C_M_RD); in hdpvr_transfer()
[all …]
/drivers/media/pci/solo6x10/
Dsolo6x10-i2c.c35 struct i2c_msg msgs[2]; in solo_i2c_readbyte() local
38 msgs[0].flags = 0; in solo_i2c_readbyte()
39 msgs[0].addr = addr; in solo_i2c_readbyte()
40 msgs[0].len = 1; in solo_i2c_readbyte()
41 msgs[0].buf = &off; in solo_i2c_readbyte()
43 msgs[1].flags = I2C_M_RD; in solo_i2c_readbyte()
44 msgs[1].addr = addr; in solo_i2c_readbyte()
45 msgs[1].len = 1; in solo_i2c_readbyte()
46 msgs[1].buf = &data; in solo_i2c_readbyte()
48 i2c_transfer(&solo_dev->i2c_adap[id], msgs, 2); in solo_i2c_readbyte()
[all …]
/drivers/media/usb/cx231xx/
Dcx231xx-i2c.c363 struct i2c_msg msgs[], int num) in cx231xx_i2c_xfer() argument
374 addr = msgs[i].addr; in cx231xx_i2c_xfer()
377 (msgs[i].flags & I2C_M_RD) ? "read" : "write", in cx231xx_i2c_xfer()
378 i == num - 1 ? "stop" : "nonstop", addr, msgs[i].len); in cx231xx_i2c_xfer()
379 if (!msgs[i].len) { in cx231xx_i2c_xfer()
381 rc = cx231xx_i2c_check_for_device(i2c_adap, &msgs[i]); in cx231xx_i2c_xfer()
388 } else if (msgs[i].flags & I2C_M_RD) { in cx231xx_i2c_xfer()
390 rc = cx231xx_i2c_recv_bytes(i2c_adap, &msgs[i]); in cx231xx_i2c_xfer()
392 for (byte = 0; byte < msgs[i].len; byte++) in cx231xx_i2c_xfer()
393 printk(KERN_CONT " %02x", msgs[i].buf[byte]); in cx231xx_i2c_xfer()
[all …]
/drivers/media/usb/pvrusb2/
Dpvrusb2-i2c-core.c384 struct i2c_msg msgs[], in pvr2_i2c_xfer() argument
395 if (msgs[0].addr < PVR2_I2C_FUNC_CNT) { in pvr2_i2c_xfer()
396 funcp = hdw->i2c_func[msgs[0].addr]; in pvr2_i2c_xfer()
404 if (msgs[0].flags & I2C_M_RD) { in pvr2_i2c_xfer()
407 if (!msgs[0].len) { in pvr2_i2c_xfer()
409 if (funcp(hdw,msgs[0].addr,NULL,0,NULL,0)) { in pvr2_i2c_xfer()
419 tcnt = msgs[0].len; in pvr2_i2c_xfer()
426 if (funcp(hdw,msgs[0].addr,NULL,0, in pvr2_i2c_xfer()
427 msgs[0].buf+offs,bcnt)) { in pvr2_i2c_xfer()
439 if (funcp(hdw,msgs[0].addr, in pvr2_i2c_xfer()
[all …]
/drivers/media/pci/pt3/
Dpt3_i2c.c114 static void translate(struct pt3_i2cbuf *cbuf, struct i2c_msg *msgs, int num) in translate() argument
121 rd = !!(msgs[i].flags & I2C_M_RD); in translate()
123 put_byte_write(cbuf, msgs[i].addr << 1 | rd); in translate()
125 put_byte_read(cbuf, msgs[i].len); in translate()
127 for (j = 0; j < msgs[i].len; j++) in translate()
128 put_byte_write(cbuf, msgs[i].buf[j]); in translate()
202 pt3_i2c_master_xfer(struct i2c_adapter *adap, struct i2c_msg *msgs, int num) in pt3_i2c_master_xfer() argument
213 if (msgs[i].flags & I2C_M_RECV_LEN) { in pt3_i2c_master_xfer()
220 translate(cbuf, msgs, num); in pt3_i2c_master_xfer()
229 if ((msgs[i].flags & I2C_M_RD) && msgs[i].len > 0) { in pt3_i2c_master_xfer()
[all …]
/drivers/media/pci/cx25821/
Dcx25821-i2c.c238 static int i2c_xfer(struct i2c_adapter *i2c_adap, struct i2c_msg *msgs, int num) in i2c_xfer() argument
248 __func__, num, msgs[i].addr, msgs[i].len); in i2c_xfer()
250 if (msgs[i].flags & I2C_M_RD) { in i2c_xfer()
252 retval = i2c_readbytes(i2c_adap, &msgs[i], 0); in i2c_xfer()
253 } else if (i + 1 < num && (msgs[i + 1].flags & I2C_M_RD) && in i2c_xfer()
254 msgs[i].addr == msgs[i + 1].addr) { in i2c_xfer()
256 retval = i2c_sendbytes(i2c_adap, &msgs[i], in i2c_xfer()
257 msgs[i + 1].len); in i2c_xfer()
262 retval = i2c_readbytes(i2c_adap, &msgs[i], 1); in i2c_xfer()
265 retval = i2c_sendbytes(i2c_adap, &msgs[i], 0); in i2c_xfer()
[all …]
/drivers/gpu/drm/i915/
Dintel_i2c.c394 gmbus_is_index_read(struct i2c_msg *msgs, int i, int num) in gmbus_is_index_read() argument
397 msgs[i].addr == msgs[i + 1].addr && in gmbus_is_index_read()
398 !(msgs[i].flags & I2C_M_RD) && in gmbus_is_index_read()
399 (msgs[i].len == 1 || msgs[i].len == 2) && in gmbus_is_index_read()
400 (msgs[i + 1].flags & I2C_M_RD)); in gmbus_is_index_read()
404 gmbus_xfer_index_read(struct drm_i915_private *dev_priv, struct i2c_msg *msgs) in gmbus_xfer_index_read() argument
411 if (msgs[0].len == 2) in gmbus_xfer_index_read()
413 msgs[0].buf[1] | (msgs[0].buf[0] << 8); in gmbus_xfer_index_read()
414 if (msgs[0].len == 1) in gmbus_xfer_index_read()
416 (msgs[0].buf[0] << GMBUS_SLAVE_INDEX_SHIFT); in gmbus_xfer_index_read()
[all …]
/drivers/input/touchscreen/
Dcyttsp_i2c_common.c42 struct i2c_msg msgs[] = { in cyttsp_i2c_read_block_data() local
58 retval = i2c_transfer(client->adapter, msgs, ARRAY_SIZE(msgs)); in cyttsp_i2c_read_block_data()
62 return retval != ARRAY_SIZE(msgs) ? -EIO : 0; in cyttsp_i2c_read_block_data()
72 struct i2c_msg msgs[] = { in cyttsp_i2c_write_block_data() local
85 retval = i2c_transfer(client->adapter, msgs, ARRAY_SIZE(msgs)); in cyttsp_i2c_write_block_data()
89 return retval != ARRAY_SIZE(msgs) ? -EIO : 0; in cyttsp_i2c_write_block_data()
/drivers/media/pci/mantis/
Dmantis_i2c.c128 static int mantis_i2c_xfer(struct i2c_adapter *adapter, struct i2c_msg *msgs, int num) in mantis_i2c_xfer() argument
147 (msgs[i].len < 2) && in mantis_i2c_xfer()
148 (msgs[i + 1].len < 2) && in mantis_i2c_xfer()
149 (msgs[i + 1].flags & I2C_M_RD)) { in mantis_i2c_xfer()
154 txd = msgs[i].addr << 25 | (0x1 << 24) in mantis_i2c_xfer()
155 | (msgs[i].buf[0] << 16) in mantis_i2c_xfer()
171 msgs[i + 1].buf[0] = (data >> 8) & 0xff; in mantis_i2c_xfer()
172 … dprintk(MANTIS_DEBUG, 0, " Byte <%d> RXD=0x%02x [%02x]\n", 0x0, data, msgs[i + 1].buf[0]); in mantis_i2c_xfer()
189 if (msgs[i].flags & I2C_M_RD) in mantis_i2c_xfer()
190 ret = mantis_i2c_read(mantis, &msgs[i]); in mantis_i2c_xfer()
[all …]
/drivers/i2c/busses/
Di2c-imx.c438 static int i2c_imx_write(struct imx_i2c_struct *i2c_imx, struct i2c_msg *msgs) in i2c_imx_write() argument
443 __func__, msgs->addr << 1); in i2c_imx_write()
446 imx_i2c_write_reg(msgs->addr << 1, i2c_imx, IMX_I2C_I2DR); in i2c_imx_write()
456 for (i = 0; i < msgs->len; i++) { in i2c_imx_write()
459 __func__, i, msgs->buf[i]); in i2c_imx_write()
460 imx_i2c_write_reg(msgs->buf[i], i2c_imx, IMX_I2C_I2DR); in i2c_imx_write()
471 static int i2c_imx_read(struct imx_i2c_struct *i2c_imx, struct i2c_msg *msgs, bool is_lastmsg) in i2c_imx_read() argument
475 int block_data = msgs->flags & I2C_M_RECV_LEN; in i2c_imx_read()
479 __func__, (msgs->addr << 1) | 0x01); in i2c_imx_read()
482 imx_i2c_write_reg((msgs->addr << 1) | 0x01, i2c_imx, IMX_I2C_I2DR); in i2c_imx_read()
[all …]
Di2c-designware-core.c392 struct i2c_msg *msgs = dev->msgs; in i2c_dw_xfer_init() local
400 if (msgs[dev->msg_write_idx].flags & I2C_M_TEN) { in i2c_dw_xfer_init()
419 dw_writel(dev, msgs[dev->msg_write_idx].addr | ic_tar, DW_IC_TAR); in i2c_dw_xfer_init()
441 struct i2c_msg *msgs = dev->msgs; in i2c_dw_xfer_msg() local
444 u32 addr = msgs[dev->msg_write_idx].addr; in i2c_dw_xfer_msg()
457 if (msgs[dev->msg_write_idx].addr != addr) { in i2c_dw_xfer_msg()
464 if (msgs[dev->msg_write_idx].len == 0) { in i2c_dw_xfer_msg()
473 buf = msgs[dev->msg_write_idx].buf; in i2c_dw_xfer_msg()
474 buf_len = msgs[dev->msg_write_idx].len; in i2c_dw_xfer_msg()
506 if (msgs[dev->msg_write_idx].flags & I2C_M_RD) { in i2c_dw_xfer_msg()
[all …]
/drivers/media/pci/saa7134/
Dsaa7134-i2c.c236 struct i2c_msg *msgs, int num) in saa7134_i2c_xfer() argument
251 if (!(msgs[i].flags & I2C_M_NOSTART) || 0 == i) { in saa7134_i2c_xfer()
254 addr = msgs[i].addr << 1; in saa7134_i2c_xfer()
255 if (msgs[i].flags & I2C_M_RD) in saa7134_i2c_xfer()
257 if (i > 0 && msgs[i].flags & in saa7134_i2c_xfer()
258 I2C_M_RD && msgs[i].addr != 0x40 && in saa7134_i2c_xfer()
259 msgs[i].addr != 0x41 && in saa7134_i2c_xfer()
260 msgs[i].addr != 0x19) { in saa7134_i2c_xfer()
274 if (msgs[i].flags & I2C_M_RD) { in saa7134_i2c_xfer()
277 for (byte = 0; byte < msgs[i].len; byte++) { in saa7134_i2c_xfer()
[all …]
/drivers/media/usb/au0828/
Dau0828-i2c.c297 struct i2c_msg *msgs, int num) in i2c_xfer() argument
305 __func__, num, msgs[i].addr, msgs[i].len); in i2c_xfer()
306 if (msgs[i].flags & I2C_M_RD) { in i2c_xfer()
308 retval = i2c_readbytes(i2c_adap, &msgs[i], 0); in i2c_xfer()
309 } else if (i + 1 < num && (msgs[i + 1].flags & I2C_M_RD) && in i2c_xfer()
310 msgs[i].addr == msgs[i + 1].addr) { in i2c_xfer()
312 retval = i2c_sendbytes(i2c_adap, &msgs[i], in i2c_xfer()
313 msgs[i + 1].len); in i2c_xfer()
317 retval = i2c_readbytes(i2c_adap, &msgs[i], 1); in i2c_xfer()
320 retval = i2c_sendbytes(i2c_adap, &msgs[i], 0); in i2c_xfer()
/drivers/media/i2c/
Dsony-btf-mpx.c241 struct i2c_msg msgs[2]; in mpx_setup() local
256 msgs[0].addr = client->addr; in mpx_setup()
257 msgs[0].flags = 0; in mpx_setup()
258 msgs[0].len = 3; in mpx_setup()
259 msgs[0].buf = buf1; in mpx_setup()
260 msgs[1].addr = client->addr; in mpx_setup()
261 msgs[1].flags = I2C_M_RD; in mpx_setup()
262 msgs[1].len = 2; in mpx_setup()
263 msgs[1].buf = buf2; in mpx_setup()
264 i2c_transfer(client->adapter, msgs, 2); in mpx_setup()
[all …]
/drivers/media/pci/cx23885/
Dcx23885-i2c.c220 struct i2c_msg *msgs, int num) in i2c_xfer() argument
230 __func__, num, msgs[i].addr, msgs[i].len); in i2c_xfer()
231 if (msgs[i].flags & I2C_M_RD) { in i2c_xfer()
233 retval = i2c_readbytes(i2c_adap, &msgs[i], 0); in i2c_xfer()
234 } else if (i + 1 < num && (msgs[i + 1].flags & I2C_M_RD) && in i2c_xfer()
235 msgs[i].addr == msgs[i + 1].addr) { in i2c_xfer()
237 retval = i2c_sendbytes(i2c_adap, &msgs[i], in i2c_xfer()
238 msgs[i + 1].len); in i2c_xfer()
242 retval = i2c_readbytes(i2c_adap, &msgs[i], 1); in i2c_xfer()
245 retval = i2c_sendbytes(i2c_adap, &msgs[i], 0); in i2c_xfer()
/drivers/media/common/b2c2/
Dflexcop-i2c.c176 struct i2c_msg msgs[], int num) in flexcop_master_xfer() argument
185 if (num == 1 && msgs[0].flags == I2C_M_RD && msgs[0].len <= 1) in flexcop_master_xfer()
193 if (i+1 < num && (msgs[i+1].flags == I2C_M_RD)) { in flexcop_master_xfer()
194 ret = i2c->fc->i2c_request(i2c, FC_READ, msgs[i].addr, in flexcop_master_xfer()
195 msgs[i].buf[0], msgs[i+1].buf, in flexcop_master_xfer()
196 msgs[i+1].len); in flexcop_master_xfer()
199 ret = i2c->fc->i2c_request(i2c, FC_WRITE, msgs[i].addr, in flexcop_master_xfer()
200 msgs[i].buf[0], &msgs[i].buf[1], in flexcop_master_xfer()
201 msgs[i].len - 1); in flexcop_master_xfer()

1234567