Lines Matching refs:msg

127 static int i2c_transfer(struct mv_i2c *base, struct mv_i2c_msg *msg)  in i2c_transfer()  argument
131 if (!msg) in i2c_transfer()
134 switch (msg->direction) { in i2c_transfer()
143 writel(msg->data, &base->idbr); in i2c_transfer()
144 if (msg->condition == I2C_COND_START) in i2c_transfer()
146 if (msg->condition == I2C_COND_STOP) in i2c_transfer()
148 if (msg->acknack == I2C_ACKNAK_SENDNAK) in i2c_transfer()
150 if (msg->acknack == I2C_ACKNAK_SENDACK) in i2c_transfer()
163 if (msg->acknack == I2C_ACKNAK_WAITACK) in i2c_transfer()
177 if (msg->condition == I2C_COND_START) in i2c_transfer()
179 if (msg->condition == I2C_COND_STOP) in i2c_transfer()
181 if (msg->acknack == I2C_ACKNAK_SENDNAK) in i2c_transfer()
183 if (msg->acknack == I2C_ACKNAK_SENDACK) in i2c_transfer()
192 msg->data = readl(&base->idbr); in i2c_transfer()
242 struct mv_i2c_msg msg; in __i2c_read() local
256 msg.condition = I2C_COND_START; in __i2c_read()
257 msg.acknack = I2C_ACKNAK_WAITACK; in __i2c_read()
258 msg.direction = I2C_WRITE; in __i2c_read()
259 msg.data = (chip << 1); in __i2c_read()
260 msg.data &= 0xFE; in __i2c_read()
261 if (i2c_transfer(base, &msg)) in __i2c_read()
271 msg.condition = I2C_COND_NORMAL; in __i2c_read()
272 msg.acknack = I2C_ACKNAK_WAITACK; in __i2c_read()
273 msg.direction = I2C_WRITE; in __i2c_read()
274 msg.data = addr[alen]; in __i2c_read()
275 if (i2c_transfer(base, &msg)) in __i2c_read()
281 msg.condition = I2C_COND_START; in __i2c_read()
282 msg.acknack = I2C_ACKNAK_WAITACK; in __i2c_read()
283 msg.direction = I2C_WRITE; in __i2c_read()
284 msg.data = (chip << 1); in __i2c_read()
285 msg.data |= 0x01; in __i2c_read()
286 if (i2c_transfer(base, &msg)) in __i2c_read()
292 msg.condition = I2C_COND_STOP; in __i2c_read()
293 msg.acknack = I2C_ACKNAK_SENDNAK; in __i2c_read()
295 msg.condition = I2C_COND_NORMAL; in __i2c_read()
296 msg.acknack = I2C_ACKNAK_SENDACK; in __i2c_read()
299 msg.direction = I2C_READ; in __i2c_read()
300 msg.data = 0x00; in __i2c_read()
301 if (i2c_transfer(base, &msg)) in __i2c_read()
304 *buffer = msg.data; in __i2c_read()
318 struct mv_i2c_msg msg; in __i2c_write() local
327 msg.condition = I2C_COND_START; in __i2c_write()
328 msg.acknack = I2C_ACKNAK_WAITACK; in __i2c_write()
329 msg.direction = I2C_WRITE; in __i2c_write()
330 msg.data = (chip << 1); in __i2c_write()
331 msg.data &= 0xFE; in __i2c_write()
332 if (i2c_transfer(base, &msg)) in __i2c_write()
342 msg.condition = I2C_COND_NORMAL; in __i2c_write()
343 msg.acknack = I2C_ACKNAK_WAITACK; in __i2c_write()
344 msg.direction = I2C_WRITE; in __i2c_write()
345 msg.data = addr[alen]; in __i2c_write()
346 if (i2c_transfer(base, &msg)) in __i2c_write()
356 msg.condition = I2C_COND_STOP; in __i2c_write()
358 msg.condition = I2C_COND_NORMAL; in __i2c_write()
360 msg.acknack = I2C_ACKNAK_WAITACK; in __i2c_write()
361 msg.direction = I2C_WRITE; in __i2c_write()
362 msg.data = *(buffer++); in __i2c_write()
364 if (i2c_transfer(base, &msg)) in __i2c_write()
450 struct mv_i2c_msg msg; in __i2c_probe_chip() local
454 msg.condition = I2C_COND_START; in __i2c_probe_chip()
455 msg.acknack = I2C_ACKNAK_WAITACK; in __i2c_probe_chip()
456 msg.direction = I2C_WRITE; in __i2c_probe_chip()
457 msg.data = (chip << 1) + 1; in __i2c_probe_chip()
458 if (i2c_transfer(base, &msg)) in __i2c_probe_chip()
461 msg.condition = I2C_COND_STOP; in __i2c_probe_chip()
462 msg.acknack = I2C_ACKNAK_SENDNAK; in __i2c_probe_chip()
463 msg.direction = I2C_READ; in __i2c_probe_chip()
464 msg.data = 0x00; in __i2c_probe_chip()
465 if (i2c_transfer(base, &msg)) in __i2c_probe_chip()
538 static int mv_i2c_xfer(struct udevice *bus, struct i2c_msg *msg, int nmsgs) in mv_i2c_xfer() argument
554 omsg = nmsgs == 1 ? &dummy : msg; in mv_i2c_xfer()
555 dmsg = nmsgs == 1 ? msg : msg + 1; in mv_i2c_xfer()