Lines Matching refs:port
121 struct uart_port *port; in serial8250_interrupt() local
124 port = &up->port; in serial8250_interrupt()
126 if (port->handle_irq(port)) { in serial8250_interrupt()
180 h = &irq_lists[up->port.irq % NR_IRQ_HASH]; in serial_link_irq_chain()
183 if (i->irq == up->port.irq) in serial_link_irq_chain()
193 i->irq = up->port.irq; in serial_link_irq_chain()
209 ret = request_irq(up->port.irq, serial8250_interrupt, in serial_link_irq_chain()
210 up->port.irqflags, up->port.name, i); in serial_link_irq_chain()
225 h = &irq_lists[up->port.irq % NR_IRQ_HASH]; in serial_unlink_irq_chain()
228 if (i->irq == up->port.irq) in serial_unlink_irq_chain()
235 free_irq(up->port.irq, i); in serial_unlink_irq_chain()
251 up->port.handle_irq(&up->port); in serial8250_timeout()
252 mod_timer(&up->timer, jiffies + uart_poll_timeout(&up->port)); in serial8250_timeout()
261 spin_lock_irqsave(&up->port.lock, flags); in serial8250_backup_timeout()
267 if (up->port.irq) { in serial8250_backup_timeout()
282 (!uart_circ_empty(&up->port.state->xmit) || up->port.x_char) && in serial8250_backup_timeout()
291 if (up->port.irq) in serial8250_backup_timeout()
294 spin_unlock_irqrestore(&up->port.lock, flags); in serial8250_backup_timeout()
298 jiffies + uart_poll_timeout(&up->port) + HZ / 5); in serial8250_backup_timeout()
303 struct uart_port *port = &up->port; in univ8250_setup_timer() local
310 pr_debug("%s - using backup timer\n", port->name); in univ8250_setup_timer()
314 uart_poll_timeout(port) + HZ / 5); in univ8250_setup_timer()
322 if (!port->irq) in univ8250_setup_timer()
323 mod_timer(&up->timer, jiffies + uart_poll_timeout(port)); in univ8250_setup_timer()
328 struct uart_port *port = &up->port; in univ8250_setup_irq() local
330 if (port->irq) in univ8250_setup_irq()
338 struct uart_port *port = &up->port; in univ8250_release_irq() local
342 if (port->irq) in univ8250_release_irq()
349 unsigned long start = UART_RSA_BASE << up->port.regshift; in serial8250_request_rsa_resource()
350 unsigned int size = 8 << up->port.regshift; in serial8250_request_rsa_resource()
351 struct uart_port *port = &up->port; in serial8250_request_rsa_resource() local
354 switch (port->iotype) { in serial8250_request_rsa_resource()
357 start += port->iobase; in serial8250_request_rsa_resource()
370 unsigned long offset = UART_RSA_BASE << up->port.regshift; in serial8250_release_rsa_resource()
371 unsigned int size = 8 << up->port.regshift; in serial8250_release_rsa_resource()
372 struct uart_port *port = &up->port; in serial8250_release_rsa_resource() local
374 switch (port->iotype) { in serial8250_release_rsa_resource()
377 release_region(port->iobase + offset, size); in serial8250_release_rsa_resource()
412 static void (*serial8250_isa_config)(int port, struct uart_port *up,
416 void (*v)(int port, struct uart_port *up, u32 *capabilities)) in serial8250_set_isa_configurator() argument
424 static void univ8250_config_port(struct uart_port *port, int flags) in univ8250_config_port() argument
426 struct uart_8250_port *up = up_to_u8250p(port); in univ8250_config_port()
429 if (port->type == PORT_RSA) { in univ8250_config_port()
436 if (probe_rsa[i] == up->port.iobase) { in univ8250_config_port()
444 base_ops->config_port(port, flags); in univ8250_config_port()
446 if (port->type != PORT_RSA && up->probe & UART_PROBE_RSA) in univ8250_config_port()
450 static int univ8250_request_port(struct uart_port *port) in univ8250_request_port() argument
452 struct uart_8250_port *up = up_to_u8250p(port); in univ8250_request_port()
455 ret = base_ops->request_port(port); in univ8250_request_port()
456 if (ret == 0 && port->type == PORT_RSA) { in univ8250_request_port()
459 base_ops->release_port(port); in univ8250_request_port()
465 static void univ8250_release_port(struct uart_port *port) in univ8250_release_port() argument
467 struct uart_8250_port *up = up_to_u8250p(port); in univ8250_release_port()
469 if (port->type == PORT_RSA) in univ8250_release_port()
471 base_ops->release_port(port); in univ8250_release_port()
487 up->port.quirks |= skip_txen_test ? UPQ_NO_TXEN_TEST : 0; in serial8250_apply_quirks()
505 struct uart_port *port = &up->port; in serial8250_isa_init_ports() local
507 port->line = i; in serial8250_isa_init_ports()
510 base_ops = port->ops; in serial8250_isa_init_ports()
511 port->ops = &univ8250_port_ops; in serial8250_isa_init_ports()
519 port->set_mctrl = alpha_jensen_set_mctrl; in serial8250_isa_init_ports()
534 struct uart_port *port = &up->port; in serial8250_isa_init_ports() local
536 port->iobase = old_serial_port[i].port; in serial8250_isa_init_ports()
537 port->irq = irq_canonicalize(old_serial_port[i].irq); in serial8250_isa_init_ports()
538 port->irqflags = 0; in serial8250_isa_init_ports()
539 port->uartclk = old_serial_port[i].baud_base * 16; in serial8250_isa_init_ports()
540 port->flags = old_serial_port[i].flags; in serial8250_isa_init_ports()
541 port->hub6 = 0; in serial8250_isa_init_ports()
542 port->membase = old_serial_port[i].iomem_base; in serial8250_isa_init_ports()
543 port->iotype = old_serial_port[i].io_type; in serial8250_isa_init_ports()
544 port->regshift = old_serial_port[i].iomem_reg_shift; in serial8250_isa_init_ports()
546 port->irqflags |= irqflag; in serial8250_isa_init_ports()
548 serial8250_isa_config(i, &up->port, &up->capabilities); in serial8250_isa_init_ports()
560 if (up->port.type == PORT_8250_CIR) in serial8250_register_ports()
563 if (up->port.dev) in serial8250_register_ports()
566 up->port.dev = dev; in serial8250_register_ports()
568 if (uart_console_enabled(&up->port)) in serial8250_register_ports()
569 pm_runtime_get_sync(up->port.dev); in serial8250_register_ports()
572 uart_add_one_port(drv, &up->port); in serial8250_register_ports()
588 struct uart_port *port; in univ8250_console_setup() local
598 port = &serial8250_ports[co->index].port; in univ8250_console_setup()
600 port->cons = co; in univ8250_console_setup()
602 retval = serial8250_console_setup(port, options, false); in univ8250_console_setup()
604 port->cons = NULL; in univ8250_console_setup()
610 struct uart_port *port; in univ8250_console_exit() local
612 port = &serial8250_ports[co->index].port; in univ8250_console_exit()
613 return serial8250_console_exit(port); in univ8250_console_exit()
650 struct uart_port *port = &serial8250_ports[i].port; in univ8250_console_match() local
652 if (port->iotype != iotype) in univ8250_console_match()
656 && (port->mapbase != addr)) in univ8250_console_match()
658 if (iotype == UPIO_PORT && port->iobase != addr) in univ8250_console_match()
662 port->cons = co; in univ8250_console_match()
663 return serial8250_console_setup(port, options, true); in univ8250_console_match()
712 int __init early_serial_setup(struct uart_port *port) in early_serial_setup() argument
716 if (port->line >= ARRAY_SIZE(serial8250_ports) || nr_uarts == 0) in early_serial_setup()
720 p = &serial8250_ports[port->line].port; in early_serial_setup()
721 p->iobase = port->iobase; in early_serial_setup()
722 p->membase = port->membase; in early_serial_setup()
723 p->irq = port->irq; in early_serial_setup()
724 p->irqflags = port->irqflags; in early_serial_setup()
725 p->uartclk = port->uartclk; in early_serial_setup()
726 p->fifosize = port->fifosize; in early_serial_setup()
727 p->regshift = port->regshift; in early_serial_setup()
728 p->iotype = port->iotype; in early_serial_setup()
729 p->flags = port->flags; in early_serial_setup()
730 p->mapbase = port->mapbase; in early_serial_setup()
731 p->mapsize = port->mapsize; in early_serial_setup()
732 p->private_data = port->private_data; in early_serial_setup()
733 p->type = port->type; in early_serial_setup()
734 p->line = port->line; in early_serial_setup()
738 if (port->serial_in) in early_serial_setup()
739 p->serial_in = port->serial_in; in early_serial_setup()
740 if (port->serial_out) in early_serial_setup()
741 p->serial_out = port->serial_out; in early_serial_setup()
742 if (port->handle_irq) in early_serial_setup()
743 p->handle_irq = port->handle_irq; in early_serial_setup()
757 struct uart_port *port = &up->port; in serial8250_suspend_port() local
759 if (!console_suspend_enabled && uart_console(port) && in serial8250_suspend_port()
760 port->type != PORT_8250) { in serial8250_suspend_port()
768 uart_suspend_port(&serial8250_reg, port); in serial8250_suspend_port()
781 struct uart_port *port = &up->port; in serial8250_resume_port() local
787 serial_port_out(port, UART_LCR, 0xE0); in serial8250_resume_port()
791 serial_port_out(port, UART_LCR, 0); in serial8250_resume_port()
792 port->uartclk = 921600*16; in serial8250_resume_port()
794 uart_resume_port(&serial8250_reg, port); in serial8250_resume_port()
815 uart.port.iobase = p->iobase; in serial8250_probe()
816 uart.port.membase = p->membase; in serial8250_probe()
817 uart.port.irq = p->irq; in serial8250_probe()
818 uart.port.irqflags = p->irqflags; in serial8250_probe()
819 uart.port.uartclk = p->uartclk; in serial8250_probe()
820 uart.port.regshift = p->regshift; in serial8250_probe()
821 uart.port.iotype = p->iotype; in serial8250_probe()
822 uart.port.flags = p->flags; in serial8250_probe()
823 uart.port.mapbase = p->mapbase; in serial8250_probe()
824 uart.port.hub6 = p->hub6; in serial8250_probe()
825 uart.port.has_sysrq = p->has_sysrq; in serial8250_probe()
826 uart.port.private_data = p->private_data; in serial8250_probe()
827 uart.port.type = p->type; in serial8250_probe()
828 uart.port.serial_in = p->serial_in; in serial8250_probe()
829 uart.port.serial_out = p->serial_out; in serial8250_probe()
830 uart.port.handle_irq = p->handle_irq; in serial8250_probe()
831 uart.port.handle_break = p->handle_break; in serial8250_probe()
832 uart.port.set_termios = p->set_termios; in serial8250_probe()
833 uart.port.set_ldisc = p->set_ldisc; in serial8250_probe()
834 uart.port.get_mctrl = p->get_mctrl; in serial8250_probe()
835 uart.port.pm = p->pm; in serial8250_probe()
836 uart.port.dev = &dev->dev; in serial8250_probe()
837 uart.port.irqflags |= irqflag; in serial8250_probe()
859 if (up->port.dev == &dev->dev) in serial8250_remove()
872 if (up->port.type != PORT_UNKNOWN && up->port.dev == &dev->dev) in serial8250_suspend()
873 uart_suspend_port(&serial8250_reg, &up->port); in serial8250_suspend()
886 if (up->port.type != PORT_UNKNOWN && up->port.dev == &dev->dev) in serial8250_resume()
916 static struct uart_8250_port *serial8250_find_match_or_unused(const struct uart_port *port) in serial8250_find_match_or_unused() argument
924 if (uart_match_port(&serial8250_ports[i].port, port)) in serial8250_find_match_or_unused()
928 i = port->line; in serial8250_find_match_or_unused()
929 if (i < nr_uarts && serial8250_ports[i].port.type == PORT_UNKNOWN && in serial8250_find_match_or_unused()
930 serial8250_ports[i].port.iobase == 0) in serial8250_find_match_or_unused()
938 if (serial8250_ports[i].port.type == PORT_UNKNOWN && in serial8250_find_match_or_unused()
939 serial8250_ports[i].port.iobase == 0) in serial8250_find_match_or_unused()
947 if (serial8250_ports[i].port.type == PORT_UNKNOWN) in serial8250_find_match_or_unused()
958 struct uart_port *port = &up->port; in serial_8250_overrun_backoff_work() local
961 spin_lock_irqsave(&port->lock, flags); in serial_8250_overrun_backoff_work()
963 up->port.read_status_mask |= UART_LSR_DR; in serial_8250_overrun_backoff_work()
965 spin_unlock_irqrestore(&port->lock, flags); in serial_8250_overrun_backoff_work()
986 if (up->port.uartclk == 0) in serial8250_register_8250_port()
991 uart = serial8250_find_match_or_unused(&up->port); in serial8250_register_8250_port()
992 if (uart && uart->port.type != PORT_8250_CIR) { in serial8250_register_8250_port()
995 if (uart->port.dev) in serial8250_register_8250_port()
996 uart_remove_one_port(&serial8250_reg, &uart->port); in serial8250_register_8250_port()
998 uart->port.iobase = up->port.iobase; in serial8250_register_8250_port()
999 uart->port.membase = up->port.membase; in serial8250_register_8250_port()
1000 uart->port.irq = up->port.irq; in serial8250_register_8250_port()
1001 uart->port.irqflags = up->port.irqflags; in serial8250_register_8250_port()
1002 uart->port.uartclk = up->port.uartclk; in serial8250_register_8250_port()
1003 uart->port.fifosize = up->port.fifosize; in serial8250_register_8250_port()
1004 uart->port.regshift = up->port.regshift; in serial8250_register_8250_port()
1005 uart->port.iotype = up->port.iotype; in serial8250_register_8250_port()
1006 uart->port.flags = up->port.flags | UPF_BOOT_AUTOCONF; in serial8250_register_8250_port()
1008 uart->port.mapbase = up->port.mapbase; in serial8250_register_8250_port()
1009 uart->port.mapsize = up->port.mapsize; in serial8250_register_8250_port()
1010 uart->port.private_data = up->port.private_data; in serial8250_register_8250_port()
1013 uart->port.throttle = up->port.throttle; in serial8250_register_8250_port()
1014 uart->port.unthrottle = up->port.unthrottle; in serial8250_register_8250_port()
1015 uart->port.rs485_config = up->port.rs485_config; in serial8250_register_8250_port()
1016 uart->port.rs485_supported = up->port.rs485_supported; in serial8250_register_8250_port()
1017 uart->port.rs485 = up->port.rs485; in serial8250_register_8250_port()
1024 if (uart->port.fifosize && !uart->tx_loadsz) in serial8250_register_8250_port()
1025 uart->tx_loadsz = uart->port.fifosize; in serial8250_register_8250_port()
1027 if (up->port.dev) { in serial8250_register_8250_port()
1028 uart->port.dev = up->port.dev; in serial8250_register_8250_port()
1029 ret = uart_get_rs485_mode(&uart->port); in serial8250_register_8250_port()
1034 if (up->port.flags & UPF_FIXED_TYPE) in serial8250_register_8250_port()
1035 uart->port.type = up->port.type; in serial8250_register_8250_port()
1041 if (!has_acpi_companion(uart->port.dev)) { in serial8250_register_8250_port()
1042 gpios = mctrl_gpio_init(&uart->port, 0); in serial8250_register_8250_port()
1054 if (up->port.serial_in) in serial8250_register_8250_port()
1055 uart->port.serial_in = up->port.serial_in; in serial8250_register_8250_port()
1056 if (up->port.serial_out) in serial8250_register_8250_port()
1057 uart->port.serial_out = up->port.serial_out; in serial8250_register_8250_port()
1058 if (up->port.handle_irq) in serial8250_register_8250_port()
1059 uart->port.handle_irq = up->port.handle_irq; in serial8250_register_8250_port()
1061 if (up->port.set_termios) in serial8250_register_8250_port()
1062 uart->port.set_termios = up->port.set_termios; in serial8250_register_8250_port()
1063 if (up->port.set_ldisc) in serial8250_register_8250_port()
1064 uart->port.set_ldisc = up->port.set_ldisc; in serial8250_register_8250_port()
1065 if (up->port.get_mctrl) in serial8250_register_8250_port()
1066 uart->port.get_mctrl = up->port.get_mctrl; in serial8250_register_8250_port()
1067 if (up->port.set_mctrl) in serial8250_register_8250_port()
1068 uart->port.set_mctrl = up->port.set_mctrl; in serial8250_register_8250_port()
1069 if (up->port.get_divisor) in serial8250_register_8250_port()
1070 uart->port.get_divisor = up->port.get_divisor; in serial8250_register_8250_port()
1071 if (up->port.set_divisor) in serial8250_register_8250_port()
1072 uart->port.set_divisor = up->port.set_divisor; in serial8250_register_8250_port()
1073 if (up->port.startup) in serial8250_register_8250_port()
1074 uart->port.startup = up->port.startup; in serial8250_register_8250_port()
1075 if (up->port.shutdown) in serial8250_register_8250_port()
1076 uart->port.shutdown = up->port.shutdown; in serial8250_register_8250_port()
1077 if (up->port.pm) in serial8250_register_8250_port()
1078 uart->port.pm = up->port.pm; in serial8250_register_8250_port()
1079 if (up->port.handle_break) in serial8250_register_8250_port()
1080 uart->port.handle_break = up->port.handle_break; in serial8250_register_8250_port()
1086 if (uart->port.type != PORT_8250_CIR) { in serial8250_register_8250_port()
1088 serial8250_isa_config(0, &uart->port, in serial8250_register_8250_port()
1093 &uart->port); in serial8250_register_8250_port()
1097 ret = uart->port.line; in serial8250_register_8250_port()
1099 dev_info(uart->port.dev, in serial8250_register_8250_port()
1101 uart->port.iobase, in serial8250_register_8250_port()
1102 (unsigned long long)uart->port.mapbase, in serial8250_register_8250_port()
1103 uart->port.irq); in serial8250_register_8250_port()
1127 uart->port.dev = NULL; in serial8250_register_8250_port()
1149 spin_lock_irqsave(&uart->port.lock, flags); in serial8250_unregister_port()
1151 spin_unlock_irqrestore(&uart->port.lock, flags); in serial8250_unregister_port()
1154 uart_remove_one_port(&serial8250_reg, &uart->port); in serial8250_unregister_port()
1156 uart->port.flags &= ~UPF_BOOT_AUTOCONF; in serial8250_unregister_port()
1157 uart->port.type = PORT_UNKNOWN; in serial8250_unregister_port()
1158 uart->port.dev = &serial8250_isa_devs->dev; in serial8250_unregister_port()
1161 uart_add_one_port(&serial8250_reg, &uart->port); in serial8250_unregister_port()
1163 uart->port.dev = NULL; in serial8250_unregister_port()