Lines Matching refs:buf_len
148 dev->buf_len, dma->direction); in at91_twi_dma_cleanup()
157 if (!dev->buf_len) in at91_twi_write_next_byte()
164 if (--dev->buf_len == 0) { in at91_twi_write_next_byte()
170 dev_dbg(dev->dev, "wrote 0x%x, to go %zu\n", *dev->buf, dev->buf_len); in at91_twi_write_next_byte()
180 dev->buf_len, DMA_TO_DEVICE); in at91_twi_write_data_dma_callback()
202 if (!dev->buf_len) in at91_twi_write_data_dma()
208 dma_addr = dma_map_single(dev->dev, dev->buf, dev->buf_len, in at91_twi_write_data_dma()
224 part1_len = dev->buf_len & ~0x3; in at91_twi_write_data_dma()
231 part2_len = dev->buf_len & 0x3; in at91_twi_write_data_dma()
247 sg_dma_len(&dma->sg[0]) = dev->buf_len; in at91_twi_write_data_dma()
278 if (!dev->buf_len) { in at91_twi_read_next_byte()
285 --dev->buf_len; in at91_twi_read_next_byte()
296 dev->buf_len += *dev->buf; in at91_twi_read_next_byte()
297 dev->msg->len = dev->buf_len + 1; in at91_twi_read_next_byte()
299 dev->buf_len); in at91_twi_read_next_byte()
303 dev->buf_len = 1; in at91_twi_read_next_byte()
308 if (!dev->use_alt_cmd && dev->buf_len == 1) in at91_twi_read_next_byte()
311 dev_dbg(dev->dev, "read 0x%x, to go %zu\n", *dev->buf, dev->buf_len); in at91_twi_read_next_byte()
322 dev->buf_len, DMA_FROM_DEVICE); in at91_twi_read_data_dma_callback()
326 dev->buf += dev->buf_len - 2; in at91_twi_read_data_dma_callback()
327 dev->buf_len = 2; in at91_twi_read_data_dma_callback()
339 size_t buf_len; in at91_twi_read_data_dma() local
341 buf_len = (dev->use_alt_cmd) ? dev->buf_len : dev->buf_len - 2; in at91_twi_read_data_dma()
346 dma_addr = dma_map_single(dev->dev, dev->buf, buf_len, DMA_FROM_DEVICE); in at91_twi_read_data_dma()
354 if (dev->fifo_size && IS_ALIGNED(buf_len, 4)) { in at91_twi_read_data_dma()
367 sg_dma_len(&dma->sg[0]) = buf_len; in at91_twi_read_data_dma()
527 (dev->msg->flags & I2C_M_RD) ? "read" : "write", dev->buf_len); in at91_do_twi_transfer()
550 if (!dev->buf_len) { in at91_do_twi_transfer()
557 if (!dev->use_alt_cmd && dev->buf_len <= 1 && in at91_do_twi_transfer()
570 if (dev->use_dma && (dev->buf_len > AT91_I2C_DMA_THRESHOLD)) { in at91_do_twi_transfer()
580 if (dev->use_dma && (dev->buf_len > AT91_I2C_DMA_THRESHOLD)) { in at91_do_twi_transfer()
587 (dev->buf_len ? AT91_TWI_TXRDY : 0)); in at91_do_twi_transfer()
701 dev->buf_len = m_start->len; in at91_twi_xfer()