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; }
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; }
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; }