Lines Matching refs:port
81 struct uart_port *port; in serial8250_interrupt() local
84 port = &up->port; in serial8250_interrupt()
86 if (port->handle_irq(port)) { in serial8250_interrupt()
140 h = &irq_lists[up->port.irq % NR_IRQ_HASH]; in serial_link_irq_chain()
143 if (i->irq == up->port.irq) in serial_link_irq_chain()
153 i->irq = up->port.irq; in serial_link_irq_chain()
169 ret = request_irq(up->port.irq, serial8250_interrupt, in serial_link_irq_chain()
170 up->port.irqflags, up->port.name, i); in serial_link_irq_chain()
185 h = &irq_lists[up->port.irq % NR_IRQ_HASH]; in serial_unlink_irq_chain()
188 if (i->irq == up->port.irq) in serial_unlink_irq_chain()
195 free_irq(up->port.irq, i); in serial_unlink_irq_chain()
211 up->port.handle_irq(&up->port); in serial8250_timeout()
212 mod_timer(&up->timer, jiffies + uart_poll_timeout(&up->port)); in serial8250_timeout()
221 uart_port_lock_irqsave(&up->port, &flags); in serial8250_backup_timeout()
227 if (up->port.irq) { in serial8250_backup_timeout()
242 (!kfifo_is_empty(&up->port.state->port.xmit_fifo) || in serial8250_backup_timeout()
243 up->port.x_char) && in serial8250_backup_timeout()
252 if (up->port.irq) in serial8250_backup_timeout()
255 uart_port_unlock_irqrestore(&up->port, flags); in serial8250_backup_timeout()
259 jiffies + uart_poll_timeout(&up->port) + HZ / 5); in serial8250_backup_timeout()
264 struct uart_port *port = &up->port; in univ8250_setup_timer() local
271 pr_debug("%s - using backup timer\n", port->name); in univ8250_setup_timer()
275 uart_poll_timeout(port) + HZ / 5); in univ8250_setup_timer()
283 if (!port->irq) in univ8250_setup_timer()
284 mod_timer(&up->timer, jiffies + uart_poll_timeout(port)); in univ8250_setup_timer()
289 struct uart_port *port = &up->port; in univ8250_setup_irq() local
291 if (port->irq) in univ8250_setup_irq()
299 struct uart_port *port = &up->port; in univ8250_release_irq() local
303 if (port->irq) in univ8250_release_irq()
338 up->port.quirks |= skip_txen_test ? UPQ_NO_TXEN_TEST : 0; in serial8250_apply_quirks()
349 up->port.line = index; in serial8250_setup_port()
350 up->port.port_id = index; in serial8250_setup_port()
354 univ8250_port_base_ops = up->port.ops; in serial8250_setup_port()
355 up->port.ops = &univ8250_port_ops; in serial8250_setup_port()
373 if (up->port.type == PORT_8250_CIR) in serial8250_register_ports()
376 if (up->port.dev) in serial8250_register_ports()
379 up->port.dev = dev; in serial8250_register_ports()
381 if (uart_console_registered(&up->port)) in serial8250_register_ports()
382 pm_runtime_get_sync(up->port.dev); in serial8250_register_ports()
385 uart_add_one_port(drv, &up->port); in serial8250_register_ports()
402 struct uart_port *port; in univ8250_console_setup() local
424 port = &serial8250_ports[co->index].port; in univ8250_console_setup()
426 uart_port_set_cons(port, co); in univ8250_console_setup()
428 retval = serial8250_console_setup(port, options, false); in univ8250_console_setup()
430 uart_port_set_cons(port, NULL); in univ8250_console_setup()
436 struct uart_port *port; in univ8250_console_exit() local
438 port = &serial8250_ports[co->index].port; in univ8250_console_exit()
439 return serial8250_console_exit(port); in univ8250_console_exit()
476 struct uart_port *port = &serial8250_ports[i].port; in univ8250_console_match() local
478 if (port->iotype != iotype) in univ8250_console_match()
482 && (port->mapbase != addr)) in univ8250_console_match()
484 if (iotype == UPIO_PORT && port->iobase != addr) in univ8250_console_match()
488 uart_port_set_cons(port, co); in univ8250_console_match()
489 return serial8250_console_setup(port, options, true); in univ8250_console_match()
538 int __init early_serial_setup(struct uart_port *port) in early_serial_setup() argument
542 if (port->line >= ARRAY_SIZE(serial8250_ports) || nr_uarts == 0) in early_serial_setup()
546 p = &serial8250_ports[port->line].port; in early_serial_setup()
547 p->iobase = port->iobase; in early_serial_setup()
548 p->membase = port->membase; in early_serial_setup()
549 p->irq = port->irq; in early_serial_setup()
550 p->irqflags = port->irqflags; in early_serial_setup()
551 p->uartclk = port->uartclk; in early_serial_setup()
552 p->fifosize = port->fifosize; in early_serial_setup()
553 p->regshift = port->regshift; in early_serial_setup()
554 p->iotype = port->iotype; in early_serial_setup()
555 p->flags = port->flags; in early_serial_setup()
556 p->mapbase = port->mapbase; in early_serial_setup()
557 p->mapsize = port->mapsize; in early_serial_setup()
558 p->private_data = port->private_data; in early_serial_setup()
559 p->type = port->type; in early_serial_setup()
560 p->line = port->line; in early_serial_setup()
564 if (port->serial_in) in early_serial_setup()
565 p->serial_in = port->serial_in; in early_serial_setup()
566 if (port->serial_out) in early_serial_setup()
567 p->serial_out = port->serial_out; in early_serial_setup()
568 if (port->handle_irq) in early_serial_setup()
569 p->handle_irq = port->handle_irq; in early_serial_setup()
583 struct uart_port *port = &up->port; in serial8250_suspend_port() local
585 if (!console_suspend_enabled && uart_console(port) && in serial8250_suspend_port()
586 port->type != PORT_8250) { in serial8250_suspend_port()
594 uart_suspend_port(&serial8250_reg, port); in serial8250_suspend_port()
607 struct uart_port *port = &up->port; in serial8250_resume_port() local
613 serial_port_out(port, UART_LCR, 0xE0); in serial8250_resume_port()
617 serial_port_out(port, UART_LCR, 0); in serial8250_resume_port()
618 port->uartclk = 921600*16; in serial8250_resume_port()
620 uart_resume_port(&serial8250_reg, port); in serial8250_resume_port()
631 static struct uart_8250_port *serial8250_find_match_or_unused(const struct uart_port *port) in serial8250_find_match_or_unused() argument
639 if (uart_match_port(&serial8250_ports[i].port, port)) in serial8250_find_match_or_unused()
643 i = port->line; in serial8250_find_match_or_unused()
644 if (i < nr_uarts && serial8250_ports[i].port.type == PORT_UNKNOWN && in serial8250_find_match_or_unused()
645 serial8250_ports[i].port.iobase == 0) in serial8250_find_match_or_unused()
653 if (serial8250_ports[i].port.type == PORT_UNKNOWN && in serial8250_find_match_or_unused()
654 serial8250_ports[i].port.iobase == 0) in serial8250_find_match_or_unused()
662 if (serial8250_ports[i].port.type == PORT_UNKNOWN) in serial8250_find_match_or_unused()
673 struct uart_port *port = &up->port; in serial_8250_overrun_backoff_work() local
676 uart_port_lock_irqsave(port, &flags); in serial_8250_overrun_backoff_work()
678 up->port.read_status_mask |= UART_LSR_DR; in serial_8250_overrun_backoff_work()
680 uart_port_unlock_irqrestore(port, flags); in serial_8250_overrun_backoff_work()
701 if (up->port.uartclk == 0) in serial8250_register_8250_port()
706 uart = serial8250_find_match_or_unused(&up->port); in serial8250_register_8250_port()
718 if (uart->port.type != PORT_8250_CIR) { in serial8250_register_8250_port()
721 if (uart->port.dev) in serial8250_register_8250_port()
722 uart_remove_one_port(&serial8250_reg, &uart->port); in serial8250_register_8250_port()
724 uart->port.ctrl_id = up->port.ctrl_id; in serial8250_register_8250_port()
725 uart->port.port_id = up->port.port_id; in serial8250_register_8250_port()
726 uart->port.iobase = up->port.iobase; in serial8250_register_8250_port()
727 uart->port.membase = up->port.membase; in serial8250_register_8250_port()
728 uart->port.irq = up->port.irq; in serial8250_register_8250_port()
729 uart->port.irqflags = up->port.irqflags; in serial8250_register_8250_port()
730 uart->port.uartclk = up->port.uartclk; in serial8250_register_8250_port()
731 uart->port.fifosize = up->port.fifosize; in serial8250_register_8250_port()
732 uart->port.regshift = up->port.regshift; in serial8250_register_8250_port()
733 uart->port.iotype = up->port.iotype; in serial8250_register_8250_port()
734 uart->port.flags = up->port.flags | UPF_BOOT_AUTOCONF; in serial8250_register_8250_port()
736 uart->port.mapbase = up->port.mapbase; in serial8250_register_8250_port()
737 uart->port.mapsize = up->port.mapsize; in serial8250_register_8250_port()
738 uart->port.private_data = up->port.private_data; in serial8250_register_8250_port()
741 uart->port.throttle = up->port.throttle; in serial8250_register_8250_port()
742 uart->port.unthrottle = up->port.unthrottle; in serial8250_register_8250_port()
743 uart->port.rs485_config = up->port.rs485_config; in serial8250_register_8250_port()
744 uart->port.rs485_supported = up->port.rs485_supported; in serial8250_register_8250_port()
745 uart->port.rs485 = up->port.rs485; in serial8250_register_8250_port()
752 if (uart->port.fifosize && !uart->tx_loadsz) in serial8250_register_8250_port()
753 uart->tx_loadsz = uart->port.fifosize; in serial8250_register_8250_port()
755 if (up->port.dev) { in serial8250_register_8250_port()
756 uart->port.dev = up->port.dev; in serial8250_register_8250_port()
757 ret = uart_get_rs485_mode(&uart->port); in serial8250_register_8250_port()
762 if (up->port.flags & UPF_FIXED_TYPE) in serial8250_register_8250_port()
763 uart->port.type = up->port.type; in serial8250_register_8250_port()
769 if (!has_acpi_companion(uart->port.dev)) { in serial8250_register_8250_port()
770 gpios = mctrl_gpio_init(&uart->port, 0); in serial8250_register_8250_port()
782 if (up->port.serial_in) in serial8250_register_8250_port()
783 uart->port.serial_in = up->port.serial_in; in serial8250_register_8250_port()
784 if (up->port.serial_out) in serial8250_register_8250_port()
785 uart->port.serial_out = up->port.serial_out; in serial8250_register_8250_port()
786 if (up->port.handle_irq) in serial8250_register_8250_port()
787 uart->port.handle_irq = up->port.handle_irq; in serial8250_register_8250_port()
789 if (up->port.set_termios) in serial8250_register_8250_port()
790 uart->port.set_termios = up->port.set_termios; in serial8250_register_8250_port()
791 if (up->port.set_ldisc) in serial8250_register_8250_port()
792 uart->port.set_ldisc = up->port.set_ldisc; in serial8250_register_8250_port()
793 if (up->port.get_mctrl) in serial8250_register_8250_port()
794 uart->port.get_mctrl = up->port.get_mctrl; in serial8250_register_8250_port()
795 if (up->port.set_mctrl) in serial8250_register_8250_port()
796 uart->port.set_mctrl = up->port.set_mctrl; in serial8250_register_8250_port()
797 if (up->port.get_divisor) in serial8250_register_8250_port()
798 uart->port.get_divisor = up->port.get_divisor; in serial8250_register_8250_port()
799 if (up->port.set_divisor) in serial8250_register_8250_port()
800 uart->port.set_divisor = up->port.set_divisor; in serial8250_register_8250_port()
801 if (up->port.startup) in serial8250_register_8250_port()
802 uart->port.startup = up->port.startup; in serial8250_register_8250_port()
803 if (up->port.shutdown) in serial8250_register_8250_port()
804 uart->port.shutdown = up->port.shutdown; in serial8250_register_8250_port()
805 if (up->port.pm) in serial8250_register_8250_port()
806 uart->port.pm = up->port.pm; in serial8250_register_8250_port()
807 if (up->port.handle_break) in serial8250_register_8250_port()
808 uart->port.handle_break = up->port.handle_break; in serial8250_register_8250_port()
814 if (uart->port.type != PORT_8250_CIR) { in serial8250_register_8250_port()
816 serial8250_isa_config(0, &uart->port, in serial8250_register_8250_port()
821 &uart->port); in serial8250_register_8250_port()
825 ret = uart->port.line; in serial8250_register_8250_port()
827 dev_info(uart->port.dev, in serial8250_register_8250_port()
829 uart->port.iobase, in serial8250_register_8250_port()
830 (unsigned long long)uart->port.mapbase, in serial8250_register_8250_port()
831 uart->port.irq); in serial8250_register_8250_port()
856 uart->port.dev = NULL; in serial8250_register_8250_port()
878 uart_port_lock_irqsave(&uart->port, &flags); in serial8250_unregister_port()
880 uart_port_unlock_irqrestore(&uart->port, flags); in serial8250_unregister_port()
883 uart_remove_one_port(&serial8250_reg, &uart->port); in serial8250_unregister_port()
885 uart->port.flags &= ~UPF_BOOT_AUTOCONF; in serial8250_unregister_port()
886 uart->port.type = PORT_UNKNOWN; in serial8250_unregister_port()
887 uart->port.dev = &serial8250_isa_devs->dev; in serial8250_unregister_port()
888 uart->port.port_id = line; in serial8250_unregister_port()
892 uart_add_one_port(&serial8250_reg, &uart->port); in serial8250_unregister_port()
894 uart->port.dev = NULL; in serial8250_unregister_port()