Lines Matching full:rx_dma
126 struct sprd_uart_dma rx_dma; member
180 if (sp->rx_dma.enable) in sprd_stop_rx()
181 dmaengine_terminate_all(sp->rx_dma.chn); in sprd_stop_rx()
354 sp->rx_dma.virt = dma_alloc_coherent(sp->port.dev, SPRD_UART_RX_SIZE, in sprd_rx_alloc_buf()
355 &sp->rx_dma.phys_addr, GFP_KERNEL); in sprd_rx_alloc_buf()
356 if (!sp->rx_dma.virt) in sprd_rx_alloc_buf()
364 if (sp->rx_dma.virt) in sprd_rx_free_buf()
366 sp->rx_dma.virt, sp->rx_dma.phys_addr); in sprd_rx_free_buf()
367 sp->rx_dma.virt = NULL; in sprd_rx_free_buf()
381 return dmaengine_slave_config(sp->rx_dma.chn, &cfg); in sprd_rx_dma_config()
390 port->icount.rx += sp->rx_dma.trans_len; in sprd_uart_dma_rx()
391 tty_insert_flip_string(tty, sp->rx_buf_tail, sp->rx_dma.trans_len); in sprd_uart_dma_rx()
402 status = dmaengine_tx_status(sp->rx_dma.chn, in sprd_uart_dma_irq()
403 sp->rx_dma.cookie, &state); in sprd_uart_dma_irq()
407 if (!state.residue && sp->pos == sp->rx_dma.phys_addr) in sprd_uart_dma_irq()
411 sp->rx_dma.trans_len = SPRD_UART_RX_SIZE + in sprd_uart_dma_irq()
412 sp->rx_dma.phys_addr - sp->pos; in sprd_uart_dma_irq()
413 sp->pos = sp->rx_dma.phys_addr; in sprd_uart_dma_irq()
415 sp->rx_dma.trans_len = state.residue - sp->pos; in sprd_uart_dma_irq()
420 sp->rx_buf_tail += sp->rx_dma.trans_len; in sprd_uart_dma_irq()
434 status = dmaengine_tx_status(sp->rx_dma.chn, in sprd_complete_rx_dma()
435 sp->rx_dma.cookie, &state); in sprd_complete_rx_dma()
442 if (sp->pos != sp->rx_dma.phys_addr) { in sprd_complete_rx_dma()
443 sp->rx_dma.trans_len = SPRD_UART_RX_SIZE + in sprd_complete_rx_dma()
444 sp->rx_dma.phys_addr - sp->pos; in sprd_complete_rx_dma()
446 sp->rx_buf_tail += sp->rx_dma.trans_len; in sprd_complete_rx_dma()
461 if (!sp->rx_dma.enable) in sprd_start_dma_rx()
464 sp->pos = sp->rx_dma.phys_addr; in sprd_start_dma_rx()
465 sp->rx_buf_tail = sp->rx_dma.virt; in sprd_start_dma_rx()
471 return sprd_uart_dma_submit(port, &sp->rx_dma, SPRD_UART_RX_SIZE, in sprd_start_dma_rx()
482 if (sp->rx_dma.enable) in sprd_release_dma()
483 dma_release_channel(sp->rx_dma.chn); in sprd_release_dma()
489 sp->rx_dma.enable = false; in sprd_release_dma()
498 sp->rx_dma.enable = true; in sprd_request_dma()
507 sp->rx_dma.chn = dma_request_chan(port->dev, "rx"); in sprd_request_dma()
508 if (IS_ERR(sp->rx_dma.chn)) { in sprd_request_dma()
510 PTR_ERR(sp->rx_dma.chn)); in sprd_request_dma()
511 sp->rx_dma.enable = false; in sprd_request_dma()
600 if (sp->rx_dma.enable) { in sprd_rx()
674 if (!(sp->rx_dma.enable || sp->tx_dma.enable)) in sprd_uart_dma_startup()
679 sp->rx_dma.enable = false; in sprd_uart_dma_startup()
680 dma_release_channel(sp->rx_dma.chn); in sprd_uart_dma_startup()
733 if (!sp->rx_dma.enable) in sprd_startup()