Lines Matching refs:port

43 #define tx_enabled(port)	((port)->unused[0])  argument
44 #define rx_enabled(port) ((port)->unused[1]) argument
57 static void serial21285_stop_tx(struct uart_port *port) in serial21285_stop_tx() argument
59 if (tx_enabled(port)) { in serial21285_stop_tx()
61 tx_enabled(port) = 0; in serial21285_stop_tx()
65 static void serial21285_start_tx(struct uart_port *port) in serial21285_start_tx() argument
67 if (!tx_enabled(port)) { in serial21285_start_tx()
69 tx_enabled(port) = 1; in serial21285_start_tx()
73 static void serial21285_stop_rx(struct uart_port *port) in serial21285_stop_rx() argument
75 if (rx_enabled(port)) { in serial21285_stop_rx()
77 rx_enabled(port) = 0; in serial21285_stop_rx()
83 struct uart_port *port = dev_id; in serial21285_rx_chars() local
90 port->icount.rx++; in serial21285_rx_chars()
95 port->icount.parity++; in serial21285_rx_chars()
97 port->icount.frame++; in serial21285_rx_chars()
99 port->icount.overrun++; in serial21285_rx_chars()
101 rxs &= port->read_status_mask; in serial21285_rx_chars()
109 uart_insert_char(port, rxs, RXSTAT_OVERRUN, ch, flag); in serial21285_rx_chars()
113 tty_flip_buffer_push(&port->state->port); in serial21285_rx_chars()
120 struct uart_port *port = dev_id; in serial21285_tx_chars() local
121 struct circ_buf *xmit = &port->state->xmit; in serial21285_tx_chars()
124 if (port->x_char) { in serial21285_tx_chars()
125 *CSR_UARTDR = port->x_char; in serial21285_tx_chars()
126 port->icount.tx++; in serial21285_tx_chars()
127 port->x_char = 0; in serial21285_tx_chars()
130 if (uart_circ_empty(xmit) || uart_tx_stopped(port)) { in serial21285_tx_chars()
131 serial21285_stop_tx(port); in serial21285_tx_chars()
138 port->icount.tx++; in serial21285_tx_chars()
144 uart_write_wakeup(port); in serial21285_tx_chars()
147 serial21285_stop_tx(port); in serial21285_tx_chars()
153 static unsigned int serial21285_tx_empty(struct uart_port *port) in serial21285_tx_empty() argument
159 static unsigned int serial21285_get_mctrl(struct uart_port *port) in serial21285_get_mctrl() argument
164 static void serial21285_set_mctrl(struct uart_port *port, unsigned int mctrl) in serial21285_set_mctrl() argument
168 static void serial21285_break_ctl(struct uart_port *port, int break_state) in serial21285_break_ctl() argument
173 spin_lock_irqsave(&port->lock, flags); in serial21285_break_ctl()
180 spin_unlock_irqrestore(&port->lock, flags); in serial21285_break_ctl()
183 static int serial21285_startup(struct uart_port *port) in serial21285_startup() argument
187 tx_enabled(port) = 1; in serial21285_startup()
188 rx_enabled(port) = 1; in serial21285_startup()
191 serial21285_name, port); in serial21285_startup()
194 serial21285_name, port); in serial21285_startup()
196 free_irq(IRQ_CONRX, port); in serial21285_startup()
202 static void serial21285_shutdown(struct uart_port *port) in serial21285_shutdown() argument
204 free_irq(IRQ_CONTX, port); in serial21285_shutdown()
205 free_irq(IRQ_CONRX, port); in serial21285_shutdown()
209 serial21285_set_termios(struct uart_port *port, struct ktermios *termios, in serial21285_set_termios() argument
229 baud = uart_get_baud_rate(port, termios, old, 0, port->uartclk/16); in serial21285_set_termios()
230 quot = uart_get_divisor(port, baud); in serial21285_set_termios()
231 b = port->uartclk / (16 * quot); in serial21285_set_termios()
257 if (port->fifosize) in serial21285_set_termios()
260 spin_lock_irqsave(&port->lock, flags); in serial21285_set_termios()
265 uart_update_timeout(port, termios->c_cflag, baud); in serial21285_set_termios()
270 port->read_status_mask = RXSTAT_OVERRUN; in serial21285_set_termios()
272 port->read_status_mask |= RXSTAT_FRAME | RXSTAT_PARITY; in serial21285_set_termios()
277 port->ignore_status_mask = 0; in serial21285_set_termios()
279 port->ignore_status_mask |= RXSTAT_FRAME | RXSTAT_PARITY; in serial21285_set_termios()
281 port->ignore_status_mask |= RXSTAT_OVERRUN; in serial21285_set_termios()
287 port->ignore_status_mask |= RXSTAT_DUMMY_READ; in serial21285_set_termios()
297 spin_unlock_irqrestore(&port->lock, flags); in serial21285_set_termios()
300 static const char *serial21285_type(struct uart_port *port) in serial21285_type() argument
302 return port->type == PORT_21285 ? "DC21285" : NULL; in serial21285_type()
305 static void serial21285_release_port(struct uart_port *port) in serial21285_release_port() argument
307 release_mem_region(port->mapbase, 32); in serial21285_release_port()
310 static int serial21285_request_port(struct uart_port *port) in serial21285_request_port() argument
312 return request_mem_region(port->mapbase, 32, serial21285_name) in serial21285_request_port()
316 static void serial21285_config_port(struct uart_port *port, int flags) in serial21285_config_port() argument
318 if (flags & UART_CONFIG_TYPE && serial21285_request_port(port) == 0) in serial21285_config_port()
319 port->type = PORT_21285; in serial21285_config_port()
325 static int serial21285_verify_port(struct uart_port *port, struct serial_struct *ser) in serial21285_verify_port() argument
332 if (ser->baud_base != port->uartclk / 16) in serial21285_verify_port()
370 static void serial21285_console_putchar(struct uart_port *port, int ch) in serial21285_console_putchar() argument
385 serial21285_get_options(struct uart_port *port, int *baud, in serial21285_get_options() argument
416 *baud = port->uartclk / (16 * (tmp + 1)); in serial21285_get_options()
422 struct uart_port *port = &serial21285_port; in serial21285_console_setup() local
439 serial21285_get_options(port, &baud, &parity, &bits); in serial21285_console_setup()
441 return uart_set_options(port, co, baud, parity, bits, flow); in serial21285_console_setup()