コード例 #1
0
static void transmit_chars(struct uart_omap_port *up)
{
	struct circ_buf *xmit = &up->port.state->xmit;
	int count;

	if (up->port.x_char) {
		serial_out(up, UART_TX, up->port.x_char);
		up->port.icount.tx++;
		up->port.x_char = 0;
		return;
	}
	if (uart_circ_empty(xmit) || uart_tx_stopped(&up->port)) {
		serial_omap_stop_tx(&up->port);
		return;
	}
	count = up->port.fifosize / 4;
	do {
		serial_out(up, UART_TX, xmit->buf[xmit->tail]);
		xmit->tail = (xmit->tail + 1) & (UART_XMIT_SIZE - 1);
		up->port.icount.tx++;
		if (uart_circ_empty(xmit))
			break;
	} while (--count > 0);

	if (uart_circ_chars_pending(xmit) < WAKEUP_CHARS)
		uart_write_wakeup(&up->port);

	if (uart_circ_empty(xmit))
		serial_omap_stop_tx(&up->port);
}
コード例 #2
0
ファイル: uart-omap_rtdm.c プロジェクト: JayKothari/uart_rtdm
static void transmit_chars(struct uart_omap_port *up, unsigned int lsr)
{	
	u16             w;
	
//trasmit holding register empty
	printk("trasmit_char.....start\n");

	if(!(lsr & UART_LSR_THRE))
	{	printk("Holding register is empty\n");
		return;
	}
	
//(void) serial_in(up, UART_LSR);
	
        while (up->buf_len_tx)
        {
//                w = *up->buf_tx++;
		w = read_buffer(up);
		printk("up->buf_len_tx--=%d\n",up->buf_len_tx);
                up->buf_len_tx--;
		
       //         rtdm_printk("BUFFER ADDRESS IN TRASMIT MODE=%x\n",up->buf);
                rtdm_printk("buffer value in trasmit_char=%x\n",w);
		serial_out(up, UART_TX, w);
        }
	

	if(up->buf_len_tx == 0)
	{
	serial_omap_stop_tx(up);
	}

	printk("trasmit_char......end\n");
}
コード例 #3
0
static void uart_tx_dma_callback(int lch, u16 ch_status, void *data)
{
	struct uart_omap_port *up = (struct uart_omap_port *)data;
	struct circ_buf *xmit = &up->port.info->xmit;
	xmit->tail = (xmit->tail + up->uart_dma.tx_buf_size) & (UART_XMIT_SIZE - 1);
	up->port.icount.tx += up->uart_dma.tx_buf_size;

	/* Revisit: Not sure about the below two steps. Seen some instabilities
	* with them. might not be needed in the DMA path
	*/
	if (uart_circ_chars_pending(xmit) < WAKEUP_CHARS)
		uart_write_wakeup(&up->port);

	if (uart_circ_empty(xmit)) {

		spin_lock(&(up->uart_dma.tx_lock));
		serial_omap_stop_tx(&up->port);
		up->uart_dma.tx_dma_state = 0;
		spin_unlock(&(up->uart_dma.tx_lock));
	} else {
		omap_stop_dma(up->uart_dma.tx_dma_channel);
		serial_omap_continue_tx(up);
	}
	isr8250_activity = jiffies;

	return;
}
コード例 #4
0
ファイル: omap-serial.c プロジェクト: AdiPat/i9003_Kernel
static void transmit_chars(struct uart_omap_port *up)
{
	struct circ_buf *xmit = &up->port.state->xmit;
	int count;

	if (up->port.x_char) {
		serial_out(up, UART_TX, up->port.x_char);
		up->port.icount.tx++;
		up->port.x_char = 0;
		return;
	}
	if (uart_circ_empty(xmit) || uart_tx_stopped(&up->port)) {
		serial_omap_stop_tx(&up->port);
		return;
	}
	count = up->port.fifosize / 4;
	do {
#if defined(CONFIG_KEYBOARD_P1)
		if(!((up->port.line == 2)&&g_keyboard))
#endif
		{
		serial_out(up, UART_TX, xmit->buf[xmit->tail]);
		}
		xmit->tail = (xmit->tail + 1) & (UART_XMIT_SIZE - 1);
		up->port.icount.tx++;
		if (uart_circ_empty(xmit)) {
			/* This wake lock has to moved out to use case drivers
			 * which require these.
			 */
			if (up->plat_hold_wakelock)
				(up->plat_hold_wakelock(up, WAKELK_TX));
			break;
		}
	} while (--count > 0);

	if (uart_circ_chars_pending(xmit) < WAKEUP_CHARS)
		uart_write_wakeup(&up->port);

	if (uart_circ_empty(xmit))
		serial_omap_stop_tx(&up->port);
}
コード例 #5
0
ファイル: omap-serial.c プロジェクト: AdiPat/i9003_Kernel
static void uart_tx_dma_callback(int lch, u16 ch_status, void *data)
{
	struct uart_omap_port *up = (struct uart_omap_port *)data;
	struct circ_buf *xmit = &up->port.state->xmit;

	xmit->tail = (xmit->tail + up->uart_dma.tx_buf_size) & \
			(UART_XMIT_SIZE - 1);
	up->port.icount.tx += up->uart_dma.tx_buf_size;

	if (uart_circ_chars_pending(xmit) < WAKEUP_CHARS)
		uart_write_wakeup(&up->port);

	if (uart_circ_empty(xmit)) {
		spin_lock(&(up->uart_dma.tx_lock));
		serial_omap_stop_tx(&up->port);
		up->uart_dma.tx_dma_used = false;
		spin_unlock(&(up->uart_dma.tx_lock));
			if (up->plat_hold_wakelock)
				(up->plat_hold_wakelock(up, WAKELK_TX));
	} else {

#ifdef CONFIG_PM
		/*
		 * This will enable the clock for some reason if the
		 * clocks get disabled. This would enable the ICK also
		 * in case if the Idle state is set and the PRCM modul
		 * just shutdown the ICK because of inactivity.
		 */
		omap_uart_enable_clock_from_irq(up->pdev->id);
#endif

		omap_stop_dma(up->uart_dma.tx_dma_channel);
		serial_omap_continue_tx(up);
	}
	up->port_activity = jiffies;
	return;
}
コード例 #6
0
static void uart_tx_dma_callback(int lch, u16 ch_status, void *data)
{
	struct uart_omap_port *up = (struct uart_omap_port *)data;
	struct circ_buf *xmit = &up->port.state->xmit;

	xmit->tail = (xmit->tail + up->uart_dma.tx_buf_size) & \
			(UART_XMIT_SIZE - 1);
	up->port.icount.tx += up->uart_dma.tx_buf_size;

	if (uart_circ_chars_pending(xmit) < WAKEUP_CHARS)
		uart_write_wakeup(&up->port);

	if (uart_circ_empty(xmit)) {
		spin_lock(&(up->uart_dma.tx_lock));
		serial_omap_stop_tx(&up->port);
		up->uart_dma.tx_dma_used = false;
		spin_unlock(&(up->uart_dma.tx_lock));
	} else {
		omap_stop_dma(up->uart_dma.tx_dma_channel);
		serial_omap_continue_tx(up);
	}
	up->port_activity = jiffies;
	return;
}