Lines Matching refs:port
3 * Driver for the serial port on the 21285 StrongArm-110 core logic chip.
46 * this, use bits of the private_data pointer of the uart port structure.
51 static bool is_enabled(struct uart_port *port, int bit)
53 unsigned long *private_data = (unsigned long *)&port->private_data;
60 static void enable(struct uart_port *port, int bit)
62 unsigned long *private_data = (unsigned long *)&port->private_data;
67 static void disable(struct uart_port *port, int bit)
69 unsigned long *private_data = (unsigned long *)&port->private_data;
74 #define is_tx_enabled(port) is_enabled(port, tx_enabled_bit)
75 #define tx_enable(port) enable(port, tx_enabled_bit)
76 #define tx_disable(port) disable(port, tx_enabled_bit)
78 #define is_rx_enabled(port) is_enabled(port, rx_enabled_bit)
79 #define rx_enable(port) enable(port, rx_enabled_bit)
80 #define rx_disable(port) disable(port, rx_enabled_bit)
93 static void serial21285_stop_tx(struct uart_port *port)
95 if (is_tx_enabled(port)) {
97 tx_disable(port);
101 static void serial21285_start_tx(struct uart_port *port)
103 if (!is_tx_enabled(port)) {
105 tx_enable(port);
109 static void serial21285_stop_rx(struct uart_port *port)
111 if (is_rx_enabled(port)) {
113 rx_disable(port);
119 struct uart_port *port = dev_id;
127 port->icount.rx++;
132 port->icount.parity++;
134 port->icount.frame++;
136 port->icount.overrun++;
138 rxs &= port->read_status_mask;
146 uart_insert_char(port, rxs, RXSTAT_OVERRUN, ch, flag);
150 tty_flip_buffer_push(&port->state->port);
157 struct uart_port *port = dev_id;
160 uart_port_tx_limited(port, ch, 256,
168 static unsigned int serial21285_tx_empty(struct uart_port *port)
174 static unsigned int serial21285_get_mctrl(struct uart_port *port)
179 static void serial21285_set_mctrl(struct uart_port *port, unsigned int mctrl)
183 static void serial21285_break_ctl(struct uart_port *port, int break_state)
188 spin_lock_irqsave(&port->lock, flags);
195 spin_unlock_irqrestore(&port->lock, flags);
198 static int serial21285_startup(struct uart_port *port)
202 tx_enable(port);
203 rx_enable(port);
206 serial21285_name, port);
209 serial21285_name, port);
211 free_irq(IRQ_CONRX, port);
217 static void serial21285_shutdown(struct uart_port *port)
219 free_irq(IRQ_CONTX, port);
220 free_irq(IRQ_CONRX, port);
224 serial21285_set_termios(struct uart_port *port, struct ktermios *termios,
244 baud = uart_get_baud_rate(port, termios, old, 0, port->uartclk/16);
245 quot = uart_get_divisor(port, baud);
246 b = port->uartclk / (16 * quot);
272 if (port->fifosize)
275 spin_lock_irqsave(&port->lock, flags);
278 * Update the per-port timeout.
280 uart_update_timeout(port, termios->c_cflag, baud);
285 port->read_status_mask = RXSTAT_OVERRUN;
287 port->read_status_mask |= RXSTAT_FRAME | RXSTAT_PARITY;
292 port->ignore_status_mask = 0;
294 port->ignore_status_mask |= RXSTAT_FRAME | RXSTAT_PARITY;
296 port->ignore_status_mask |= RXSTAT_OVERRUN;
302 port->ignore_status_mask |= RXSTAT_DUMMY_READ;
312 spin_unlock_irqrestore(&port->lock, flags);
315 static const char *serial21285_type(struct uart_port *port)
317 return port->type == PORT_21285 ? "DC21285" : NULL;
320 static void serial21285_release_port(struct uart_port *port)
322 release_mem_region(port->mapbase, 32);
325 static int serial21285_request_port(struct uart_port *port)
327 return request_mem_region(port->mapbase, 32, serial21285_name)
331 static void serial21285_config_port(struct uart_port *port, int flags)
333 if (flags & UART_CONFIG_TYPE && serial21285_request_port(port) == 0)
334 port->type = PORT_21285;
340 static int serial21285_verify_port(struct uart_port *port, struct serial_struct *ser)
347 if (ser->baud_base != port->uartclk / 16)
385 static void serial21285_console_putchar(struct uart_port *port, unsigned char ch)
400 serial21285_get_options(struct uart_port *port, int *baud,
431 *baud = port->uartclk / (16 * (tmp + 1));
437 struct uart_port *port = &serial21285_port;
445 * if so, search for the first available port that does have
451 serial21285_get_options(port, &baud, &parity, &bits);
453 return uart_set_options(port, co, baud, parity, bits, flow);