Lines Matching refs:port

51 	struct uart_port        port;  member
63 return readl(up->port.membase + offset); in serial_in()
69 writel(value, up->port.membase + offset); in serial_out()
72 static void serial_pxa_enable_ms(struct uart_port *port) in serial_pxa_enable_ms() argument
74 struct uart_pxa_port *up = (struct uart_pxa_port *)port; in serial_pxa_enable_ms()
80 static void serial_pxa_stop_tx(struct uart_port *port) in serial_pxa_stop_tx() argument
82 struct uart_pxa_port *up = (struct uart_pxa_port *)port; in serial_pxa_stop_tx()
90 static void serial_pxa_stop_rx(struct uart_port *port) in serial_pxa_stop_rx() argument
92 struct uart_pxa_port *up = (struct uart_pxa_port *)port; in serial_pxa_stop_rx()
95 up->port.read_status_mask &= ~UART_LSR_DR; in serial_pxa_stop_rx()
117 up->port.icount.rx++; in receive_chars()
126 up->port.icount.brk++; in receive_chars()
133 if (uart_handle_break(&up->port)) in receive_chars()
136 up->port.icount.parity++; in receive_chars()
138 up->port.icount.frame++; in receive_chars()
140 up->port.icount.overrun++; in receive_chars()
145 *status &= up->port.read_status_mask; in receive_chars()
148 if (up->port.line == up->port.cons->index) { in receive_chars()
162 if (uart_handle_sysrq_char(&up->port, ch)) in receive_chars()
165 uart_insert_char(&up->port, *status, UART_LSR_OE, ch, flag); in receive_chars()
170 tty_flip_buffer_push(&up->port.state->port); in receive_chars()
185 struct circ_buf *xmit = &up->port.state->xmit; in transmit_chars()
188 if (up->port.x_char) { in transmit_chars()
189 serial_out(up, UART_TX, up->port.x_char); in transmit_chars()
190 up->port.icount.tx++; in transmit_chars()
191 up->port.x_char = 0; in transmit_chars()
194 if (uart_circ_empty(xmit) || uart_tx_stopped(&up->port)) { in transmit_chars()
195 serial_pxa_stop_tx(&up->port); in transmit_chars()
199 count = up->port.fifosize / 2; in transmit_chars()
203 up->port.icount.tx++; in transmit_chars()
209 uart_write_wakeup(&up->port); in transmit_chars()
213 serial_pxa_stop_tx(&up->port); in transmit_chars()
216 static void serial_pxa_start_tx(struct uart_port *port) in serial_pxa_start_tx() argument
218 struct uart_pxa_port *up = (struct uart_pxa_port *)port; in serial_pxa_start_tx()
237 up->port.icount.rng++; in check_modem_status()
239 up->port.icount.dsr++; in check_modem_status()
241 uart_handle_dcd_change(&up->port, status & UART_MSR_DCD); in check_modem_status()
243 uart_handle_cts_change(&up->port, status & UART_MSR_CTS); in check_modem_status()
245 wake_up_interruptible(&up->port.state->port.delta_msr_wait); in check_modem_status()
259 spin_lock(&up->port.lock); in serial_pxa_irq()
266 spin_unlock(&up->port.lock); in serial_pxa_irq()
270 static unsigned int serial_pxa_tx_empty(struct uart_port *port) in serial_pxa_tx_empty() argument
272 struct uart_pxa_port *up = (struct uart_pxa_port *)port; in serial_pxa_tx_empty()
276 spin_lock_irqsave(&up->port.lock, flags); in serial_pxa_tx_empty()
278 spin_unlock_irqrestore(&up->port.lock, flags); in serial_pxa_tx_empty()
283 static unsigned int serial_pxa_get_mctrl(struct uart_port *port) in serial_pxa_get_mctrl() argument
285 struct uart_pxa_port *up = (struct uart_pxa_port *)port; in serial_pxa_get_mctrl()
303 static void serial_pxa_set_mctrl(struct uart_port *port, unsigned int mctrl) in serial_pxa_set_mctrl() argument
305 struct uart_pxa_port *up = (struct uart_pxa_port *)port; in serial_pxa_set_mctrl()
324 static void serial_pxa_break_ctl(struct uart_port *port, int break_state) in serial_pxa_break_ctl() argument
326 struct uart_pxa_port *up = (struct uart_pxa_port *)port; in serial_pxa_break_ctl()
329 spin_lock_irqsave(&up->port.lock, flags); in serial_pxa_break_ctl()
335 spin_unlock_irqrestore(&up->port.lock, flags); in serial_pxa_break_ctl()
338 static int serial_pxa_startup(struct uart_port *port) in serial_pxa_startup() argument
340 struct uart_pxa_port *up = (struct uart_pxa_port *)port; in serial_pxa_startup()
344 if (port->line == 3) /* HWUART */ in serial_pxa_startup()
349 up->port.uartclk = clk_get_rate(up->clk); in serial_pxa_startup()
354 retval = request_irq(up->port.irq, serial_pxa_irq, 0, up->name, up); in serial_pxa_startup()
380 spin_lock_irqsave(&up->port.lock, flags); in serial_pxa_startup()
381 up->port.mctrl |= TIOCM_OUT2; in serial_pxa_startup()
382 serial_pxa_set_mctrl(&up->port, up->port.mctrl); in serial_pxa_startup()
383 spin_unlock_irqrestore(&up->port.lock, flags); in serial_pxa_startup()
404 static void serial_pxa_shutdown(struct uart_port *port) in serial_pxa_shutdown() argument
406 struct uart_pxa_port *up = (struct uart_pxa_port *)port; in serial_pxa_shutdown()
409 free_irq(up->port.irq, up); in serial_pxa_shutdown()
417 spin_lock_irqsave(&up->port.lock, flags); in serial_pxa_shutdown()
418 up->port.mctrl &= ~TIOCM_OUT2; in serial_pxa_shutdown()
419 serial_pxa_set_mctrl(&up->port, up->port.mctrl); in serial_pxa_shutdown()
420 spin_unlock_irqrestore(&up->port.lock, flags); in serial_pxa_shutdown()
433 serial_pxa_set_termios(struct uart_port *port, struct ktermios *termios, in serial_pxa_set_termios() argument
436 struct uart_pxa_port *up = (struct uart_pxa_port *)port; in serial_pxa_set_termios()
468 baud = uart_get_baud_rate(port, termios, old, 0, port->uartclk/16); in serial_pxa_set_termios()
469 quot = uart_get_divisor(port, baud); in serial_pxa_set_termios()
471 if ((up->port.uartclk / quot) < (2400 * 16)) in serial_pxa_set_termios()
473 else if ((up->port.uartclk / quot) < (230400 * 16)) in serial_pxa_set_termios()
482 spin_lock_irqsave(&up->port.lock, flags); in serial_pxa_set_termios()
493 uart_update_timeout(port, termios->c_cflag, baud); in serial_pxa_set_termios()
495 up->port.read_status_mask = UART_LSR_OE | UART_LSR_THRE | UART_LSR_DR; in serial_pxa_set_termios()
497 up->port.read_status_mask |= UART_LSR_FE | UART_LSR_PE; in serial_pxa_set_termios()
499 up->port.read_status_mask |= UART_LSR_BI; in serial_pxa_set_termios()
504 up->port.ignore_status_mask = 0; in serial_pxa_set_termios()
506 up->port.ignore_status_mask |= UART_LSR_PE | UART_LSR_FE; in serial_pxa_set_termios()
508 up->port.ignore_status_mask |= UART_LSR_BI; in serial_pxa_set_termios()
514 up->port.ignore_status_mask |= UART_LSR_OE; in serial_pxa_set_termios()
521 up->port.ignore_status_mask |= UART_LSR_DR; in serial_pxa_set_termios()
527 if (UART_ENABLE_MS(&up->port, termios->c_cflag)) in serial_pxa_set_termios()
550 serial_pxa_set_mctrl(&up->port, up->port.mctrl); in serial_pxa_set_termios()
552 spin_unlock_irqrestore(&up->port.lock, flags); in serial_pxa_set_termios()
556 serial_pxa_pm(struct uart_port *port, unsigned int state, in serial_pxa_pm() argument
559 struct uart_pxa_port *up = (struct uart_pxa_port *)port; in serial_pxa_pm()
567 static void serial_pxa_release_port(struct uart_port *port) in serial_pxa_release_port() argument
571 static int serial_pxa_request_port(struct uart_port *port) in serial_pxa_request_port() argument
576 static void serial_pxa_config_port(struct uart_port *port, int flags) in serial_pxa_config_port() argument
578 struct uart_pxa_port *up = (struct uart_pxa_port *)port; in serial_pxa_config_port()
579 up->port.type = PORT_PXA; in serial_pxa_config_port()
583 serial_pxa_verify_port(struct uart_port *port, struct serial_struct *ser) in serial_pxa_verify_port() argument
590 serial_pxa_type(struct uart_port *port) in serial_pxa_type() argument
592 struct uart_pxa_port *up = (struct uart_pxa_port *)port; in serial_pxa_type()
623 if (up->port.flags & UPF_CONS_FLOW) { in wait_for_xmitr()
631 static void serial_pxa_console_putchar(struct uart_port *port, int ch) in serial_pxa_console_putchar() argument
633 struct uart_pxa_port *up = (struct uart_pxa_port *)port; in serial_pxa_console_putchar()
655 if (up->port.sysrq) in serial_pxa_console_write()
658 locked = spin_trylock(&up->port.lock); in serial_pxa_console_write()
660 spin_lock(&up->port.lock); in serial_pxa_console_write()
668 uart_console_write(&up->port, s, count, serial_pxa_console_putchar); in serial_pxa_console_write()
678 spin_unlock(&up->port.lock); in serial_pxa_console_write()
690 static int serial_pxa_get_poll_char(struct uart_port *port) in serial_pxa_get_poll_char() argument
692 struct uart_pxa_port *up = (struct uart_pxa_port *)port; in serial_pxa_get_poll_char()
702 static void serial_pxa_put_poll_char(struct uart_port *port, in serial_pxa_put_poll_char() argument
706 struct uart_pxa_port *up = (struct uart_pxa_port *)port; in serial_pxa_put_poll_char()
748 return uart_set_options(&up->port, co, baud, parity, bits, flow); in serial_pxa_console_setup()
806 uart_suspend_port(&serial_pxa_reg, &sport->port); in serial_pxa_suspend()
816 uart_resume_port(&serial_pxa_reg, &sport->port); in serial_pxa_resume()
848 sport->port.line = ret; in serial_pxa_probe_dt()
879 sport->port.type = PORT_PXA; in serial_pxa_probe()
880 sport->port.iotype = UPIO_MEM; in serial_pxa_probe()
881 sport->port.mapbase = mmres->start; in serial_pxa_probe()
882 sport->port.irq = irqres->start; in serial_pxa_probe()
883 sport->port.fifosize = 64; in serial_pxa_probe()
884 sport->port.ops = &serial_pxa_pops; in serial_pxa_probe()
885 sport->port.dev = &dev->dev; in serial_pxa_probe()
886 sport->port.flags = UPF_IOREMAP | UPF_BOOT_AUTOCONF; in serial_pxa_probe()
887 sport->port.uartclk = clk_get_rate(sport->clk); in serial_pxa_probe()
891 sport->port.line = dev->id; in serial_pxa_probe()
894 snprintf(sport->name, PXA_NAME_LEN - 1, "UART%d", sport->port.line + 1); in serial_pxa_probe()
896 sport->port.membase = ioremap(mmres->start, resource_size(mmres)); in serial_pxa_probe()
897 if (!sport->port.membase) { in serial_pxa_probe()
902 serial_pxa_ports[sport->port.line] = sport; in serial_pxa_probe()
904 uart_add_one_port(&serial_pxa_reg, &sport->port); in serial_pxa_probe()
921 uart_remove_one_port(&serial_pxa_reg, &sport->port); in serial_pxa_remove()