This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
測試項目.. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Copyright 2004-2011 Freescale Semiconductor, Inc. All Rights Reserved. | |
*/ | |
/* | |
* The code contained herein is licensed under the GNU General Public | |
* License. You may obtain a copy of the GNU General Public License | |
* Version 2 or later at the following locations: | |
* | |
* http://www.opensource.org/licenses/gpl-license.html | |
* http://www.gnu.org/copyleft/gpl.html | |
*/ | |
/*! | |
* @file drivers/serial/mxc_uart.c | |
* | |
* @brief Driver for the Freescale Semiconductor MXC serial ports based on | |
* drivers/char/serial.c, by Linus Torvalds, Theodore Ts'o. | |
* | |
* @ingroup UART | |
*/ | |
static void mxcuart_dma_writecallback(void *arg, int error, unsigned int count) | |
{ | |
uart_mxc_port *umxc = arg; | |
struct circ_buf *xmit = &umxc->port.state->xmit; | |
int tx_num; | |
if (error != MXC_DMA_TRANSFER_ERROR) { | |
tx_num = count; | |
umxc->port.icount.tx += tx_num; | |
xmit->tail = (xmit->tail + tx_num) & (UART_XMIT_SIZE - 1); | |
} | |
dma_unmap_single(umxc->port.dev, umxc->tx_handle, TXDMA_BUFF_SIZE, | |
DMA_TO_DEVICE); | |
tx_num = uart_circ_chars_pending(xmit); | |
if (tx_num > 0) | |
mxcuart_dma_tx(umxc); | |
else | |
dma_list[umxc->port.line].dma_txchnl_inuse = 0; | |
if (tx_num < WAKEUP_CHARS) | |
uart_write_wakeup(&umxc->port); | |
} |
沒有留言:
張貼留言