Lines Matching refs:msg
249 struct I2cMsg *msg = &td->msgs[td->index];
250 unsigned int addr = msg->addr;
252 if (msg->flags & I2C_FLAG_ADDR_10BIT) {
254 addr = ((msg->addr & 0x300) << 1) | 0xf000;
255 if (msg->flags & I2C_FLAG_READ) {
259 addr |= msg->addr & 0xff;
261 addr = (msg->addr & 0x7f) << 1;
262 if (msg->flags & I2C_FLAG_READ) {
280 struct I2cMsg *msg = &td->msgs[td->index];
284 if (msg->flags & I2C_FLAG_ADDR_10BIT) {
293 Hi35xxI2cCmdregSet(hi35xx, (msg->flags & I2C_FLAG_IGNORE_NO_ACK) ? CMD_IGN_ACK : CMD_RX_ACK, &offset);
294 if (msg->flags & I2C_FLAG_READ) {
295 if (msg->len > 1) {
297 OSAL_WRITEL(msg->len - HI35XX_I2C_R_LOOP_ADJ, hi35xx->regBase + HI35XX_I2C_LOOP1);
306 OSAL_WRITEL(msg->len - 1, hi35xx->regBase + HI35XX_I2C_LOOP1);
310 Hi35xxI2cCmdregSet(hi35xx, (msg->flags & I2C_FLAG_IGNORE_NO_ACK) ? CMD_IGN_ACK : CMD_RX_ACK, &offset);
314 if ((td->index == (td->count - 1)) || (msg->flags & I2C_FLAG_STOP)) {
316 td->index, td->count, msg->flags);
479 struct I2cMsg *msg = &td->msgs[td->index];
481 PLAT_LOGV("%s: addr:%x, flags:0x%x, len=%hu", __func__, msg->addr, msg->flags, msg->len);
490 if (msg->flags & I2C_FLAG_READ) {
491 while (bufIdx < msg->len) {
497 status = HdfCopyToUser((void *)&msg->buf[bufIdx], (void *)(uintptr_t)&val, sizeof(val));
505 while (bufIdx < msg->len) {
510 status = HdfCopyFromUser((void *)&val, (void *)(uintptr_t)&msg->buf[bufIdx], sizeof(val));