Lines Matching refs:port
71 return (__raw_readl(sport->port.membase + offset)); in serial_in()
76 __raw_writel(value, sport->port.membase + offset); in serial_out()
86 status = sport->port.ops->get_mctrl(&sport->port); in pnx8xxx_mctrl_check()
95 sport->port.icount.rng++; in pnx8xxx_mctrl_check()
97 sport->port.icount.dsr++; in pnx8xxx_mctrl_check()
99 uart_handle_dcd_change(&sport->port, status & TIOCM_CAR); in pnx8xxx_mctrl_check()
101 uart_handle_cts_change(&sport->port, status & TIOCM_CTS); in pnx8xxx_mctrl_check()
103 wake_up_interruptible(&sport->port.state->port.delta_msr_wait); in pnx8xxx_mctrl_check()
115 if (sport->port.state) { in pnx8xxx_timeout()
116 spin_lock_irqsave(&sport->port.lock, flags); in pnx8xxx_timeout()
118 spin_unlock_irqrestore(&sport->port.lock, flags); in pnx8xxx_timeout()
127 static void pnx8xxx_stop_tx(struct uart_port *port) in pnx8xxx_stop_tx() argument
130 container_of(port, struct pnx8xxx_port, port); in pnx8xxx_stop_tx()
144 static void pnx8xxx_start_tx(struct uart_port *port) in pnx8xxx_start_tx() argument
147 container_of(port, struct pnx8xxx_port, port); in pnx8xxx_start_tx()
161 static void pnx8xxx_stop_rx(struct uart_port *port) in pnx8xxx_stop_rx() argument
164 container_of(port, struct pnx8xxx_port, port); in pnx8xxx_stop_rx()
178 static void pnx8xxx_enable_ms(struct uart_port *port) in pnx8xxx_enable_ms() argument
181 container_of(port, struct pnx8xxx_port, port); in pnx8xxx_enable_ms()
195 sport->port.icount.rx++; in pnx8xxx_rx_chars()
210 sport->port.icount.brk++; in pnx8xxx_rx_chars()
211 if (uart_handle_break(&sport->port)) in pnx8xxx_rx_chars()
214 sport->port.icount.parity++; in pnx8xxx_rx_chars()
216 sport->port.icount.frame++; in pnx8xxx_rx_chars()
218 sport->port.icount.overrun++; in pnx8xxx_rx_chars()
220 status &= sport->port.read_status_mask; in pnx8xxx_rx_chars()
228 sport->port.sysrq = 0; in pnx8xxx_rx_chars()
232 if (uart_handle_sysrq_char(&sport->port, ch)) in pnx8xxx_rx_chars()
235 uart_insert_char(&sport->port, status, in pnx8xxx_rx_chars()
245 spin_unlock(&sport->port.lock); in pnx8xxx_rx_chars()
246 tty_flip_buffer_push(&sport->port.state->port); in pnx8xxx_rx_chars()
247 spin_lock(&sport->port.lock); in pnx8xxx_rx_chars()
252 struct circ_buf *xmit = &sport->port.state->xmit; in pnx8xxx_tx_chars()
254 if (sport->port.x_char) { in pnx8xxx_tx_chars()
255 serial_out(sport, PNX8XXX_FIFO, sport->port.x_char); in pnx8xxx_tx_chars()
256 sport->port.icount.tx++; in pnx8xxx_tx_chars()
257 sport->port.x_char = 0; in pnx8xxx_tx_chars()
267 if (uart_circ_empty(xmit) || uart_tx_stopped(&sport->port)) { in pnx8xxx_tx_chars()
268 pnx8xxx_stop_tx(&sport->port); in pnx8xxx_tx_chars()
279 sport->port.icount.tx++; in pnx8xxx_tx_chars()
285 uart_write_wakeup(&sport->port); in pnx8xxx_tx_chars()
288 pnx8xxx_stop_tx(&sport->port); in pnx8xxx_tx_chars()
296 spin_lock(&sport->port.lock); in pnx8xxx_int()
311 spin_unlock(&sport->port.lock); in pnx8xxx_int()
318 static unsigned int pnx8xxx_tx_empty(struct uart_port *port) in pnx8xxx_tx_empty() argument
321 container_of(port, struct pnx8xxx_port, port); in pnx8xxx_tx_empty()
326 static unsigned int pnx8xxx_get_mctrl(struct uart_port *port) in pnx8xxx_get_mctrl() argument
329 container_of(port, struct pnx8xxx_port, port); in pnx8xxx_get_mctrl()
343 static void pnx8xxx_set_mctrl(struct uart_port *port, unsigned int mctrl) in pnx8xxx_set_mctrl() argument
346 struct pnx8xxx_port *sport = (struct pnx8xxx_port *)port; in pnx8xxx_set_mctrl()
354 static void pnx8xxx_break_ctl(struct uart_port *port, int break_state) in pnx8xxx_break_ctl() argument
357 container_of(port, struct pnx8xxx_port, port); in pnx8xxx_break_ctl()
361 spin_lock_irqsave(&sport->port.lock, flags); in pnx8xxx_break_ctl()
368 spin_unlock_irqrestore(&sport->port.lock, flags); in pnx8xxx_break_ctl()
371 static int pnx8xxx_startup(struct uart_port *port) in pnx8xxx_startup() argument
374 container_of(port, struct pnx8xxx_port, port); in pnx8xxx_startup()
380 retval = request_irq(sport->port.irq, pnx8xxx_int, 0, in pnx8xxx_startup()
399 spin_lock_irq(&sport->port.lock); in pnx8xxx_startup()
400 pnx8xxx_enable_ms(&sport->port); in pnx8xxx_startup()
401 spin_unlock_irq(&sport->port.lock); in pnx8xxx_startup()
406 static void pnx8xxx_shutdown(struct uart_port *port) in pnx8xxx_shutdown() argument
409 container_of(port, struct pnx8xxx_port, port); in pnx8xxx_shutdown()
439 free_irq(sport->port.irq, sport); in pnx8xxx_shutdown()
443 pnx8xxx_set_termios(struct uart_port *port, struct ktermios *termios, in pnx8xxx_set_termios() argument
447 container_of(port, struct pnx8xxx_port, port); in pnx8xxx_set_termios()
478 baud = uart_get_baud_rate(port, termios, old, 0, port->uartclk/16); in pnx8xxx_set_termios()
479 quot = uart_get_divisor(port, baud); in pnx8xxx_set_termios()
481 spin_lock_irqsave(&sport->port.lock, flags); in pnx8xxx_set_termios()
483 sport->port.read_status_mask = ISTAT_TO_SM(PNX8XXX_UART_INT_RXOVRN) | in pnx8xxx_set_termios()
487 sport->port.read_status_mask |= in pnx8xxx_set_termios()
491 sport->port.read_status_mask |= in pnx8xxx_set_termios()
497 sport->port.ignore_status_mask = 0; in pnx8xxx_set_termios()
499 sport->port.ignore_status_mask |= in pnx8xxx_set_termios()
503 sport->port.ignore_status_mask |= in pnx8xxx_set_termios()
510 sport->port.ignore_status_mask |= in pnx8xxx_set_termios()
518 sport->port.ignore_status_mask |= in pnx8xxx_set_termios()
526 uart_update_timeout(port, termios->c_cflag, baud); in pnx8xxx_set_termios()
556 if (UART_ENABLE_MS(&sport->port, termios->c_cflag)) in pnx8xxx_set_termios()
557 pnx8xxx_enable_ms(&sport->port); in pnx8xxx_set_termios()
559 spin_unlock_irqrestore(&sport->port.lock, flags); in pnx8xxx_set_termios()
562 static const char *pnx8xxx_type(struct uart_port *port) in pnx8xxx_type() argument
565 container_of(port, struct pnx8xxx_port, port); in pnx8xxx_type()
567 return sport->port.type == PORT_PNX8XXX ? "PNX8XXX" : NULL; in pnx8xxx_type()
573 static void pnx8xxx_release_port(struct uart_port *port) in pnx8xxx_release_port() argument
576 container_of(port, struct pnx8xxx_port, port); in pnx8xxx_release_port()
578 release_mem_region(sport->port.mapbase, UART_PORT_SIZE); in pnx8xxx_release_port()
584 static int pnx8xxx_request_port(struct uart_port *port) in pnx8xxx_request_port() argument
587 container_of(port, struct pnx8xxx_port, port); in pnx8xxx_request_port()
588 return request_mem_region(sport->port.mapbase, UART_PORT_SIZE, in pnx8xxx_request_port()
595 static void pnx8xxx_config_port(struct uart_port *port, int flags) in pnx8xxx_config_port() argument
598 container_of(port, struct pnx8xxx_port, port); in pnx8xxx_config_port()
601 pnx8xxx_request_port(&sport->port) == 0) in pnx8xxx_config_port()
602 sport->port.type = PORT_PNX8XXX; in pnx8xxx_config_port()
611 pnx8xxx_verify_port(struct uart_port *port, struct serial_struct *ser) in pnx8xxx_verify_port() argument
614 container_of(port, struct pnx8xxx_port, port); in pnx8xxx_verify_port()
619 if (sport->port.irq != ser->irq) in pnx8xxx_verify_port()
623 if (sport->port.uartclk / 16 != ser->baud_base) in pnx8xxx_verify_port()
625 if ((void *)sport->port.mapbase != ser->iomem_base) in pnx8xxx_verify_port()
627 if (sport->port.iobase != ser->port) in pnx8xxx_verify_port()
672 pnx8xxx_ports[i].port.ops = &pnx8xxx_pops; in pnx8xxx_init_ports()
678 static void pnx8xxx_console_putchar(struct uart_port *port, int ch) in pnx8xxx_console_putchar() argument
681 container_of(port, struct pnx8xxx_port, port); in pnx8xxx_console_putchar()
706 uart_console_write(&sport->port, s, count, pnx8xxx_console_putchar); in pnx8xxx_console_write()
745 return uart_set_options(&sport->port, co, baud, parity, bits, flow); in pnx8xxx_console_setup()
786 return uart_suspend_port(&pnx8xxx_reg, &sport->port); in pnx8xxx_serial_suspend()
793 return uart_resume_port(&pnx8xxx_reg, &sport->port); in pnx8xxx_serial_resume()
806 if (pnx8xxx_ports[i].port.mapbase != res->start) in pnx8xxx_serial_probe()
809 pnx8xxx_ports[i].port.dev = &pdev->dev; in pnx8xxx_serial_probe()
810 uart_add_one_port(&pnx8xxx_reg, &pnx8xxx_ports[i].port); in pnx8xxx_serial_probe()
824 uart_remove_one_port(&pnx8xxx_reg, &sport->port); in pnx8xxx_serial_remove()