Skip to content

Instantly share code, notes, and snippets.

@checko
Created May 29, 2012 01:35
Show Gist options
  • Save checko/2822067 to your computer and use it in GitHub Desktop.
Save checko/2822067 to your computer and use it in GitHub Desktop.
TEST sourcecode format,
/*
* 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);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment