Lines Matching refs:port

48 	struct uart_port	port;  member
63 return readl(up->port.membase + offset); in ar933x_uart_read()
69 writel(value, up->port.membase + offset); in ar933x_uart_write()
120 static unsigned int ar933x_uart_tx_empty(struct uart_port *port) in ar933x_uart_tx_empty() argument
123 container_of(port, struct ar933x_uart_port, port); in ar933x_uart_tx_empty()
127 spin_lock_irqsave(&up->port.lock, flags); in ar933x_uart_tx_empty()
129 spin_unlock_irqrestore(&up->port.lock, flags); in ar933x_uart_tx_empty()
134 static unsigned int ar933x_uart_get_mctrl(struct uart_port *port) in ar933x_uart_get_mctrl() argument
139 static void ar933x_uart_set_mctrl(struct uart_port *port, unsigned int mctrl) in ar933x_uart_set_mctrl() argument
143 static void ar933x_uart_start_tx(struct uart_port *port) in ar933x_uart_start_tx() argument
146 container_of(port, struct ar933x_uart_port, port); in ar933x_uart_start_tx()
151 static void ar933x_uart_stop_tx(struct uart_port *port) in ar933x_uart_stop_tx() argument
154 container_of(port, struct ar933x_uart_port, port); in ar933x_uart_stop_tx()
159 static void ar933x_uart_stop_rx(struct uart_port *port) in ar933x_uart_stop_rx() argument
162 container_of(port, struct ar933x_uart_port, port); in ar933x_uart_stop_rx()
168 static void ar933x_uart_break_ctl(struct uart_port *port, int break_state) in ar933x_uart_break_ctl() argument
171 container_of(port, struct ar933x_uart_port, port); in ar933x_uart_break_ctl()
174 spin_lock_irqsave(&up->port.lock, flags); in ar933x_uart_break_ctl()
181 spin_unlock_irqrestore(&up->port.lock, flags); in ar933x_uart_break_ctl()
235 static void ar933x_uart_set_termios(struct uart_port *port, in ar933x_uart_set_termios() argument
240 container_of(port, struct ar933x_uart_port, port); in ar933x_uart_set_termios()
265 baud = uart_get_baud_rate(port, new, old, up->min_baud, up->max_baud); in ar933x_uart_set_termios()
266 ar933x_uart_get_scale_step(port->uartclk, baud, &scale, &step); in ar933x_uart_set_termios()
272 spin_lock_irqsave(&up->port.lock, flags); in ar933x_uart_set_termios()
279 uart_update_timeout(port, new->c_cflag, baud); in ar933x_uart_set_termios()
281 up->port.ignore_status_mask = 0; in ar933x_uart_set_termios()
285 up->port.ignore_status_mask |= AR933X_DUMMY_STATUS_RD; in ar933x_uart_set_termios()
302 spin_unlock_irqrestore(&up->port.lock, flags); in ar933x_uart_set_termios()
310 struct tty_port *port = &up->port.state->port; in ar933x_uart_rx_chars() local
325 up->port.icount.rx++; in ar933x_uart_rx_chars()
328 if (uart_handle_sysrq_char(&up->port, ch)) in ar933x_uart_rx_chars()
331 if ((up->port.ignore_status_mask & AR933X_DUMMY_STATUS_RD) == 0) in ar933x_uart_rx_chars()
332 tty_insert_flip_char(port, ch, TTY_NORMAL); in ar933x_uart_rx_chars()
335 spin_unlock(&up->port.lock); in ar933x_uart_rx_chars()
336 tty_flip_buffer_push(port); in ar933x_uart_rx_chars()
337 spin_lock(&up->port.lock); in ar933x_uart_rx_chars()
342 struct circ_buf *xmit = &up->port.state->xmit; in ar933x_uart_tx_chars()
345 if (uart_tx_stopped(&up->port)) in ar933x_uart_tx_chars()
348 count = up->port.fifosize; in ar933x_uart_tx_chars()
356 if (up->port.x_char) { in ar933x_uart_tx_chars()
357 ar933x_uart_putc(up, up->port.x_char); in ar933x_uart_tx_chars()
358 up->port.icount.tx++; in ar933x_uart_tx_chars()
359 up->port.x_char = 0; in ar933x_uart_tx_chars()
369 up->port.icount.tx++; in ar933x_uart_tx_chars()
373 uart_write_wakeup(&up->port); in ar933x_uart_tx_chars()
388 spin_lock(&up->port.lock); in ar933x_uart_interrupt()
406 spin_unlock(&up->port.lock); in ar933x_uart_interrupt()
411 static int ar933x_uart_startup(struct uart_port *port) in ar933x_uart_startup() argument
414 container_of(port, struct ar933x_uart_port, port); in ar933x_uart_startup()
418 ret = request_irq(up->port.irq, ar933x_uart_interrupt, in ar933x_uart_startup()
419 up->port.irqflags, dev_name(up->port.dev), up); in ar933x_uart_startup()
423 spin_lock_irqsave(&up->port.lock, flags); in ar933x_uart_startup()
433 spin_unlock_irqrestore(&up->port.lock, flags); in ar933x_uart_startup()
438 static void ar933x_uart_shutdown(struct uart_port *port) in ar933x_uart_shutdown() argument
441 container_of(port, struct ar933x_uart_port, port); in ar933x_uart_shutdown()
451 free_irq(up->port.irq, up); in ar933x_uart_shutdown()
454 static const char *ar933x_uart_type(struct uart_port *port) in ar933x_uart_type() argument
456 return (port->type == PORT_AR933X) ? "AR933X UART" : NULL; in ar933x_uart_type()
459 static void ar933x_uart_release_port(struct uart_port *port) in ar933x_uart_release_port() argument
464 static int ar933x_uart_request_port(struct uart_port *port) in ar933x_uart_request_port() argument
470 static void ar933x_uart_config_port(struct uart_port *port, int flags) in ar933x_uart_config_port() argument
473 port->type = PORT_AR933X; in ar933x_uart_config_port()
476 static int ar933x_uart_verify_port(struct uart_port *port, in ar933x_uart_verify_port() argument
480 container_of(port, struct ar933x_uart_port, port); in ar933x_uart_verify_port()
531 static void ar933x_uart_console_putchar(struct uart_port *port, int ch) in ar933x_uart_console_putchar() argument
534 container_of(port, struct ar933x_uart_port, port); in ar933x_uart_console_putchar()
550 if (up->port.sysrq) in ar933x_uart_console_write()
553 locked = spin_trylock(&up->port.lock); in ar933x_uart_console_write()
555 spin_lock(&up->port.lock); in ar933x_uart_console_write()
563 uart_console_write(&up->port, s, count, ar933x_uart_console_putchar); in ar933x_uart_console_write()
575 spin_unlock(&up->port.lock); in ar933x_uart_console_write()
598 return uart_set_options(&up->port, co, baud, parity, bits, flow); in ar933x_uart_console_setup()
616 ar933x_console_ports[up->port.line] = up; in ar933x_uart_add_console_port()
630 struct uart_port *port; in ar933x_uart_probe() local
672 port = &up->port; in ar933x_uart_probe()
675 port->membase = devm_ioremap_resource(&pdev->dev, mem_res); in ar933x_uart_probe()
676 if (IS_ERR(port->membase)) in ar933x_uart_probe()
677 return PTR_ERR(port->membase); in ar933x_uart_probe()
683 port->uartclk = clk_get_rate(up->clk); in ar933x_uart_probe()
684 if (!port->uartclk) { in ar933x_uart_probe()
689 port->mapbase = mem_res->start; in ar933x_uart_probe()
690 port->line = id; in ar933x_uart_probe()
691 port->irq = irq_res->start; in ar933x_uart_probe()
692 port->dev = &pdev->dev; in ar933x_uart_probe()
693 port->type = PORT_AR933X; in ar933x_uart_probe()
694 port->iotype = UPIO_MEM32; in ar933x_uart_probe()
696 port->regshift = 2; in ar933x_uart_probe()
697 port->fifosize = AR933X_UART_FIFO_SIZE; in ar933x_uart_probe()
698 port->ops = &ar933x_uart_ops; in ar933x_uart_probe()
700 baud = ar933x_uart_get_baud(port->uartclk, AR933X_UART_MAX_SCALE, 1); in ar933x_uart_probe()
703 baud = ar933x_uart_get_baud(port->uartclk, 0, AR933X_UART_MAX_STEP); in ar933x_uart_probe()
708 ret = uart_add_one_port(&ar933x_uart_driver, &up->port); in ar933x_uart_probe()
727 uart_remove_one_port(&ar933x_uart_driver, &up->port); in ar933x_uart_remove()