Lines Matching refs:buf_len
147 dev->buf_len, dma->direction); in at91_twi_dma_cleanup()
156 if (!dev->buf_len) in at91_twi_write_next_byte()
163 if (--dev->buf_len == 0) { in at91_twi_write_next_byte()
169 dev_dbg(dev->dev, "wrote 0x%x, to go %zu\n", *dev->buf, dev->buf_len); in at91_twi_write_next_byte()
179 dev->buf_len, DMA_TO_DEVICE); in at91_twi_write_data_dma_callback()
201 if (!dev->buf_len) in at91_twi_write_data_dma()
207 dma_addr = dma_map_single(dev->dev, dev->buf, dev->buf_len, in at91_twi_write_data_dma()
223 part1_len = dev->buf_len & ~0x3; in at91_twi_write_data_dma()
230 part2_len = dev->buf_len & 0x3; in at91_twi_write_data_dma()
246 sg_dma_len(&dma->sg[0]) = dev->buf_len; in at91_twi_write_data_dma()
277 if (!dev->buf_len) { in at91_twi_read_next_byte()
284 --dev->buf_len; in at91_twi_read_next_byte()
295 dev->buf_len += *dev->buf; in at91_twi_read_next_byte()
296 dev->msg->len = dev->buf_len + 1; in at91_twi_read_next_byte()
298 dev->buf_len); in at91_twi_read_next_byte()
302 dev->buf_len = 1; in at91_twi_read_next_byte()
307 if (!dev->use_alt_cmd && dev->buf_len == 1) in at91_twi_read_next_byte()
310 dev_dbg(dev->dev, "read 0x%x, to go %zu\n", *dev->buf, dev->buf_len); in at91_twi_read_next_byte()
321 dev->buf_len, DMA_FROM_DEVICE); in at91_twi_read_data_dma_callback()
325 dev->buf += dev->buf_len - 2; in at91_twi_read_data_dma_callback()
326 dev->buf_len = 2; in at91_twi_read_data_dma_callback()
338 size_t buf_len; in at91_twi_read_data_dma() local
340 buf_len = (dev->use_alt_cmd) ? dev->buf_len : dev->buf_len - 2; in at91_twi_read_data_dma()
345 dma_addr = dma_map_single(dev->dev, dev->buf, buf_len, DMA_FROM_DEVICE); in at91_twi_read_data_dma()
353 if (dev->fifo_size && IS_ALIGNED(buf_len, 4)) { in at91_twi_read_data_dma()
366 sg_dma_len(&dma->sg[0]) = buf_len; in at91_twi_read_data_dma()
526 (dev->msg->flags & I2C_M_RD) ? "read" : "write", dev->buf_len); in at91_do_twi_transfer()
549 if (!dev->buf_len) { in at91_do_twi_transfer()
556 if (!dev->use_alt_cmd && dev->buf_len <= 1 && in at91_do_twi_transfer()
569 if (dev->use_dma && (dev->buf_len > AT91_I2C_DMA_THRESHOLD)) { in at91_do_twi_transfer()
579 if (dev->use_dma && (dev->buf_len > AT91_I2C_DMA_THRESHOLD)) { in at91_do_twi_transfer()
586 (dev->buf_len ? AT91_TWI_TXRDY : 0)); in at91_do_twi_transfer()
701 dev->buf_len = m_start->len; in at91_twi_xfer()