static void sci_shutdown(struct uart_port *port) { struct sci_port *s = &sci_ports[port->line]; sci_stop_rx(port); sci_stop_tx(port); sci_free_irq(s); if (s->disable) s->disable(port); }
static void sci_shutdown(struct uart_port *port) { struct sci_port *s = &sci_ports[port->line]; sci_stop_rx(port); sci_stop_tx(port); sci_free_irq(s); if (s->disable) s->disable(port); #ifdef CONFIG_HAVE_CLK clk_put(s->clk); s->clk = NULL; #endif }
static void sci_transmit_chars(struct uart_port *port) { struct circ_buf *xmit = &port->info->xmit; unsigned int stopped = uart_tx_stopped(port); unsigned short status; unsigned short ctrl; int count; status = sci_in(port, SCxSR); if (!(status & SCxSR_TDxE(port))) { ctrl = sci_in(port, SCSCR); if (uart_circ_empty(xmit)) { ctrl &= ~SCI_CTRL_FLAGS_TIE; } else { ctrl |= SCI_CTRL_FLAGS_TIE; } sci_out(port, SCSCR, ctrl); return; } if (port->type == PORT_SCIF) count = scif_txroom(port); else count = sci_txroom(port); do { unsigned char c; if (port->x_char) { c = port->x_char; port->x_char = 0; } else if (!uart_circ_empty(xmit) && !stopped) { c = xmit->buf[xmit->tail]; xmit->tail = (xmit->tail + 1) & (UART_XMIT_SIZE - 1); } else { break; } sci_out(port, SCxTDR, c); port->icount.tx++; } while (--count > 0); sci_out(port, SCxSR, SCxSR_TDxE_CLEAR(port)); if (uart_circ_chars_pending(xmit) < WAKEUP_CHARS) uart_write_wakeup(port); if (uart_circ_empty(xmit)) { sci_stop_tx(port); } else { ctrl = sci_in(port, SCSCR); if (port->type == PORT_SCIF) { sci_in(port, SCxSR); /* Dummy read */ sci_out(port, SCxSR, SCxSR_TDxE_CLEAR(port)); } ctrl |= SCI_CTRL_FLAGS_TIE; sci_out(port, SCSCR, ctrl); } }