Lines Matching refs:port

122 		struct uart_port *port;  in serial8250_interrupt()  local
125 port = &up->port; in serial8250_interrupt()
127 if (port->handle_irq(port)) { in serial8250_interrupt()
181 h = &irq_lists[up->port.irq % NR_IRQ_HASH]; in serial_link_irq_chain()
184 if (i->irq == up->port.irq) in serial_link_irq_chain()
194 i->irq = up->port.irq; in serial_link_irq_chain()
210 ret = request_irq(up->port.irq, serial8250_interrupt, in serial_link_irq_chain()
211 up->port.irqflags, up->port.name, i); in serial_link_irq_chain()
226 h = &irq_lists[up->port.irq % NR_IRQ_HASH]; in serial_unlink_irq_chain()
229 if (i->irq == up->port.irq) in serial_unlink_irq_chain()
236 free_irq(up->port.irq, i); in serial_unlink_irq_chain()
252 up->port.handle_irq(&up->port); in serial8250_timeout()
253 mod_timer(&up->timer, jiffies + uart_poll_timeout(&up->port)); in serial8250_timeout()
262 spin_lock_irqsave(&up->port.lock, flags); in serial8250_backup_timeout()
268 if (up->port.irq) { in serial8250_backup_timeout()
283 (!uart_circ_empty(&up->port.state->xmit) || up->port.x_char) && in serial8250_backup_timeout()
292 if (up->port.irq) in serial8250_backup_timeout()
295 spin_unlock_irqrestore(&up->port.lock, flags); in serial8250_backup_timeout()
299 jiffies + uart_poll_timeout(&up->port) + HZ / 5); in serial8250_backup_timeout()
304 struct uart_port *port = &up->port; in univ8250_setup_timer() local
311 pr_debug("%s - using backup timer\n", port->name); in univ8250_setup_timer()
315 uart_poll_timeout(port) + HZ / 5); in univ8250_setup_timer()
323 if (!port->irq) in univ8250_setup_timer()
324 mod_timer(&up->timer, jiffies + uart_poll_timeout(port)); in univ8250_setup_timer()
329 struct uart_port *port = &up->port; in univ8250_setup_irq() local
331 if (port->irq) in univ8250_setup_irq()
339 struct uart_port *port = &up->port; in univ8250_release_irq() local
343 if (port->irq) in univ8250_release_irq()
350 unsigned long start = UART_RSA_BASE << up->port.regshift; in serial8250_request_rsa_resource()
351 unsigned int size = 8 << up->port.regshift; in serial8250_request_rsa_resource()
352 struct uart_port *port = &up->port; in serial8250_request_rsa_resource() local
355 switch (port->iotype) { in serial8250_request_rsa_resource()
358 start += port->iobase; in serial8250_request_rsa_resource()
371 unsigned long offset = UART_RSA_BASE << up->port.regshift; in serial8250_release_rsa_resource()
372 unsigned int size = 8 << up->port.regshift; in serial8250_release_rsa_resource()
373 struct uart_port *port = &up->port; in serial8250_release_rsa_resource() local
375 switch (port->iotype) { in serial8250_release_rsa_resource()
378 release_region(port->iobase + offset, size); in serial8250_release_rsa_resource()
413 static void (*serial8250_isa_config)(int port, struct uart_port *up,
417 void (*v)(int port, struct uart_port *up, u32 *capabilities)) in serial8250_set_isa_configurator() argument
425 static void univ8250_config_port(struct uart_port *port, int flags) in univ8250_config_port() argument
427 struct uart_8250_port *up = up_to_u8250p(port); in univ8250_config_port()
430 if (port->type == PORT_RSA) { in univ8250_config_port()
437 if (probe_rsa[i] == up->port.iobase) { in univ8250_config_port()
445 base_ops->config_port(port, flags); in univ8250_config_port()
447 if (port->type != PORT_RSA && up->probe & UART_PROBE_RSA) in univ8250_config_port()
451 static int univ8250_request_port(struct uart_port *port) in univ8250_request_port() argument
453 struct uart_8250_port *up = up_to_u8250p(port); in univ8250_request_port()
456 ret = base_ops->request_port(port); in univ8250_request_port()
457 if (ret == 0 && port->type == PORT_RSA) { in univ8250_request_port()
460 base_ops->release_port(port); in univ8250_request_port()
466 static void univ8250_release_port(struct uart_port *port) in univ8250_release_port() argument
468 struct uart_8250_port *up = up_to_u8250p(port); in univ8250_release_port()
470 if (port->type == PORT_RSA) in univ8250_release_port()
472 base_ops->release_port(port); in univ8250_release_port()
488 up->port.quirks |= skip_txen_test ? UPQ_NO_TXEN_TEST : 0; in serial8250_apply_quirks()
499 up->port.line = index; in serial8250_setup_port()
500 up->port.port_id = index; in serial8250_setup_port()
504 base_ops = up->port.ops; in serial8250_setup_port()
505 up->port.ops = &univ8250_port_ops; in serial8250_setup_port()
513 up->port.set_mctrl = alpha_jensen_set_mctrl; in serial8250_setup_port()
551 struct uart_port *port = &up->port; in serial8250_isa_init_ports() local
553 port->iobase = old_serial_port[i].port; in serial8250_isa_init_ports()
554 port->irq = irq_canonicalize(old_serial_port[i].irq); in serial8250_isa_init_ports()
555 port->irqflags = 0; in serial8250_isa_init_ports()
556 port->uartclk = old_serial_port[i].baud_base * 16; in serial8250_isa_init_ports()
557 port->flags = old_serial_port[i].flags; in serial8250_isa_init_ports()
558 port->hub6 = 0; in serial8250_isa_init_ports()
559 port->membase = old_serial_port[i].iomem_base; in serial8250_isa_init_ports()
560 port->iotype = old_serial_port[i].io_type; in serial8250_isa_init_ports()
561 port->regshift = old_serial_port[i].iomem_reg_shift; in serial8250_isa_init_ports()
563 port->irqflags |= irqflag; in serial8250_isa_init_ports()
565 serial8250_isa_config(i, &up->port, &up->capabilities); in serial8250_isa_init_ports()
577 if (up->port.type == PORT_8250_CIR) in serial8250_register_ports()
580 if (up->port.dev) in serial8250_register_ports()
583 up->port.dev = dev; in serial8250_register_ports()
585 if (uart_console_registered(&up->port)) in serial8250_register_ports()
586 pm_runtime_get_sync(up->port.dev); in serial8250_register_ports()
589 uart_add_one_port(drv, &up->port); in serial8250_register_ports()
606 struct uart_port *port; in univ8250_console_setup() local
628 port = &serial8250_ports[co->index].port; in univ8250_console_setup()
630 port->cons = co; in univ8250_console_setup()
632 retval = serial8250_console_setup(port, options, false); in univ8250_console_setup()
634 port->cons = NULL; in univ8250_console_setup()
640 struct uart_port *port; in univ8250_console_exit() local
642 port = &serial8250_ports[co->index].port; in univ8250_console_exit()
643 return serial8250_console_exit(port); in univ8250_console_exit()
680 struct uart_port *port = &serial8250_ports[i].port; in univ8250_console_match() local
682 if (port->iotype != iotype) in univ8250_console_match()
686 && (port->mapbase != addr)) in univ8250_console_match()
688 if (iotype == UPIO_PORT && port->iobase != addr) in univ8250_console_match()
692 port->cons = co; in univ8250_console_match()
693 return serial8250_console_setup(port, options, true); in univ8250_console_match()
742 int __init early_serial_setup(struct uart_port *port) in early_serial_setup() argument
746 if (port->line >= ARRAY_SIZE(serial8250_ports) || nr_uarts == 0) in early_serial_setup()
750 p = &serial8250_ports[port->line].port; in early_serial_setup()
751 p->iobase = port->iobase; in early_serial_setup()
752 p->membase = port->membase; in early_serial_setup()
753 p->irq = port->irq; in early_serial_setup()
754 p->irqflags = port->irqflags; in early_serial_setup()
755 p->uartclk = port->uartclk; in early_serial_setup()
756 p->fifosize = port->fifosize; in early_serial_setup()
757 p->regshift = port->regshift; in early_serial_setup()
758 p->iotype = port->iotype; in early_serial_setup()
759 p->flags = port->flags; in early_serial_setup()
760 p->mapbase = port->mapbase; in early_serial_setup()
761 p->mapsize = port->mapsize; in early_serial_setup()
762 p->private_data = port->private_data; in early_serial_setup()
763 p->type = port->type; in early_serial_setup()
764 p->line = port->line; in early_serial_setup()
768 if (port->serial_in) in early_serial_setup()
769 p->serial_in = port->serial_in; in early_serial_setup()
770 if (port->serial_out) in early_serial_setup()
771 p->serial_out = port->serial_out; in early_serial_setup()
772 if (port->handle_irq) in early_serial_setup()
773 p->handle_irq = port->handle_irq; in early_serial_setup()
787 struct uart_port *port = &up->port; in serial8250_suspend_port() local
789 if (!console_suspend_enabled && uart_console(port) && in serial8250_suspend_port()
790 port->type != PORT_8250) { in serial8250_suspend_port()
798 uart_suspend_port(&serial8250_reg, port); in serial8250_suspend_port()
811 struct uart_port *port = &up->port; in serial8250_resume_port() local
817 serial_port_out(port, UART_LCR, 0xE0); in serial8250_resume_port()
821 serial_port_out(port, UART_LCR, 0); in serial8250_resume_port()
822 port->uartclk = 921600*16; in serial8250_resume_port()
824 uart_resume_port(&serial8250_reg, port); in serial8250_resume_port()
845 uart.port.iobase = p->iobase; in serial8250_probe()
846 uart.port.membase = p->membase; in serial8250_probe()
847 uart.port.irq = p->irq; in serial8250_probe()
848 uart.port.irqflags = p->irqflags; in serial8250_probe()
849 uart.port.uartclk = p->uartclk; in serial8250_probe()
850 uart.port.regshift = p->regshift; in serial8250_probe()
851 uart.port.iotype = p->iotype; in serial8250_probe()
852 uart.port.flags = p->flags; in serial8250_probe()
853 uart.port.mapbase = p->mapbase; in serial8250_probe()
854 uart.port.mapsize = p->mapsize; in serial8250_probe()
855 uart.port.hub6 = p->hub6; in serial8250_probe()
856 uart.port.has_sysrq = p->has_sysrq; in serial8250_probe()
857 uart.port.private_data = p->private_data; in serial8250_probe()
858 uart.port.type = p->type; in serial8250_probe()
860 uart.port.serial_in = p->serial_in; in serial8250_probe()
861 uart.port.serial_out = p->serial_out; in serial8250_probe()
864 uart.port.handle_irq = p->handle_irq; in serial8250_probe()
865 uart.port.handle_break = p->handle_break; in serial8250_probe()
866 uart.port.set_termios = p->set_termios; in serial8250_probe()
867 uart.port.set_ldisc = p->set_ldisc; in serial8250_probe()
868 uart.port.get_mctrl = p->get_mctrl; in serial8250_probe()
869 uart.port.pm = p->pm; in serial8250_probe()
870 uart.port.dev = &dev->dev; in serial8250_probe()
871 uart.port.irqflags |= irqflag; in serial8250_probe()
893 if (up->port.dev == &dev->dev) in serial8250_remove()
906 if (up->port.type != PORT_UNKNOWN && up->port.dev == &dev->dev) in serial8250_suspend()
907 uart_suspend_port(&serial8250_reg, &up->port); in serial8250_suspend()
920 if (up->port.type != PORT_UNKNOWN && up->port.dev == &dev->dev) in serial8250_resume()
950 static struct uart_8250_port *serial8250_find_match_or_unused(const struct uart_port *port) in serial8250_find_match_or_unused() argument
958 if (uart_match_port(&serial8250_ports[i].port, port)) in serial8250_find_match_or_unused()
962 i = port->line; in serial8250_find_match_or_unused()
963 if (i < nr_uarts && serial8250_ports[i].port.type == PORT_UNKNOWN && in serial8250_find_match_or_unused()
964 serial8250_ports[i].port.iobase == 0) in serial8250_find_match_or_unused()
972 if (serial8250_ports[i].port.type == PORT_UNKNOWN && in serial8250_find_match_or_unused()
973 serial8250_ports[i].port.iobase == 0) in serial8250_find_match_or_unused()
981 if (serial8250_ports[i].port.type == PORT_UNKNOWN) in serial8250_find_match_or_unused()
992 struct uart_port *port = &up->port; in serial_8250_overrun_backoff_work() local
995 spin_lock_irqsave(&port->lock, flags); in serial_8250_overrun_backoff_work()
997 up->port.read_status_mask |= UART_LSR_DR; in serial_8250_overrun_backoff_work()
999 spin_unlock_irqrestore(&port->lock, flags); in serial_8250_overrun_backoff_work()
1020 if (up->port.uartclk == 0) in serial8250_register_8250_port()
1025 uart = serial8250_find_match_or_unused(&up->port); in serial8250_register_8250_port()
1037 if (uart->port.type != PORT_8250_CIR) { in serial8250_register_8250_port()
1040 if (uart->port.dev) in serial8250_register_8250_port()
1041 uart_remove_one_port(&serial8250_reg, &uart->port); in serial8250_register_8250_port()
1043 uart->port.ctrl_id = up->port.ctrl_id; in serial8250_register_8250_port()
1044 uart->port.port_id = up->port.port_id; in serial8250_register_8250_port()
1045 uart->port.iobase = up->port.iobase; in serial8250_register_8250_port()
1046 uart->port.membase = up->port.membase; in serial8250_register_8250_port()
1047 uart->port.irq = up->port.irq; in serial8250_register_8250_port()
1048 uart->port.irqflags = up->port.irqflags; in serial8250_register_8250_port()
1049 uart->port.uartclk = up->port.uartclk; in serial8250_register_8250_port()
1050 uart->port.fifosize = up->port.fifosize; in serial8250_register_8250_port()
1051 uart->port.regshift = up->port.regshift; in serial8250_register_8250_port()
1052 uart->port.iotype = up->port.iotype; in serial8250_register_8250_port()
1053 uart->port.flags = up->port.flags | UPF_BOOT_AUTOCONF; in serial8250_register_8250_port()
1055 uart->port.mapbase = up->port.mapbase; in serial8250_register_8250_port()
1056 uart->port.mapsize = up->port.mapsize; in serial8250_register_8250_port()
1057 uart->port.private_data = up->port.private_data; in serial8250_register_8250_port()
1060 uart->port.throttle = up->port.throttle; in serial8250_register_8250_port()
1061 uart->port.unthrottle = up->port.unthrottle; in serial8250_register_8250_port()
1062 uart->port.rs485_config = up->port.rs485_config; in serial8250_register_8250_port()
1063 uart->port.rs485_supported = up->port.rs485_supported; in serial8250_register_8250_port()
1064 uart->port.rs485 = up->port.rs485; in serial8250_register_8250_port()
1071 if (uart->port.fifosize && !uart->tx_loadsz) in serial8250_register_8250_port()
1072 uart->tx_loadsz = uart->port.fifosize; in serial8250_register_8250_port()
1074 if (up->port.dev) { in serial8250_register_8250_port()
1075 uart->port.dev = up->port.dev; in serial8250_register_8250_port()
1076 ret = uart_get_rs485_mode(&uart->port); in serial8250_register_8250_port()
1081 if (up->port.flags & UPF_FIXED_TYPE) in serial8250_register_8250_port()
1082 uart->port.type = up->port.type; in serial8250_register_8250_port()
1088 if (!has_acpi_companion(uart->port.dev)) { in serial8250_register_8250_port()
1089 gpios = mctrl_gpio_init(&uart->port, 0); in serial8250_register_8250_port()
1101 if (up->port.serial_in) in serial8250_register_8250_port()
1102 uart->port.serial_in = up->port.serial_in; in serial8250_register_8250_port()
1103 if (up->port.serial_out) in serial8250_register_8250_port()
1104 uart->port.serial_out = up->port.serial_out; in serial8250_register_8250_port()
1105 if (up->port.handle_irq) in serial8250_register_8250_port()
1106 uart->port.handle_irq = up->port.handle_irq; in serial8250_register_8250_port()
1108 if (up->port.set_termios) in serial8250_register_8250_port()
1109 uart->port.set_termios = up->port.set_termios; in serial8250_register_8250_port()
1110 if (up->port.set_ldisc) in serial8250_register_8250_port()
1111 uart->port.set_ldisc = up->port.set_ldisc; in serial8250_register_8250_port()
1112 if (up->port.get_mctrl) in serial8250_register_8250_port()
1113 uart->port.get_mctrl = up->port.get_mctrl; in serial8250_register_8250_port()
1114 if (up->port.set_mctrl) in serial8250_register_8250_port()
1115 uart->port.set_mctrl = up->port.set_mctrl; in serial8250_register_8250_port()
1116 if (up->port.get_divisor) in serial8250_register_8250_port()
1117 uart->port.get_divisor = up->port.get_divisor; in serial8250_register_8250_port()
1118 if (up->port.set_divisor) in serial8250_register_8250_port()
1119 uart->port.set_divisor = up->port.set_divisor; in serial8250_register_8250_port()
1120 if (up->port.startup) in serial8250_register_8250_port()
1121 uart->port.startup = up->port.startup; in serial8250_register_8250_port()
1122 if (up->port.shutdown) in serial8250_register_8250_port()
1123 uart->port.shutdown = up->port.shutdown; in serial8250_register_8250_port()
1124 if (up->port.pm) in serial8250_register_8250_port()
1125 uart->port.pm = up->port.pm; in serial8250_register_8250_port()
1126 if (up->port.handle_break) in serial8250_register_8250_port()
1127 uart->port.handle_break = up->port.handle_break; in serial8250_register_8250_port()
1133 if (uart->port.type != PORT_8250_CIR) { in serial8250_register_8250_port()
1135 serial8250_isa_config(0, &uart->port, in serial8250_register_8250_port()
1140 &uart->port); in serial8250_register_8250_port()
1144 ret = uart->port.line; in serial8250_register_8250_port()
1146 dev_info(uart->port.dev, in serial8250_register_8250_port()
1148 uart->port.iobase, in serial8250_register_8250_port()
1149 (unsigned long long)uart->port.mapbase, in serial8250_register_8250_port()
1150 uart->port.irq); in serial8250_register_8250_port()
1175 uart->port.dev = NULL; in serial8250_register_8250_port()
1197 spin_lock_irqsave(&uart->port.lock, flags); in serial8250_unregister_port()
1199 spin_unlock_irqrestore(&uart->port.lock, flags); in serial8250_unregister_port()
1202 uart_remove_one_port(&serial8250_reg, &uart->port); in serial8250_unregister_port()
1204 uart->port.flags &= ~UPF_BOOT_AUTOCONF; in serial8250_unregister_port()
1205 uart->port.type = PORT_UNKNOWN; in serial8250_unregister_port()
1206 uart->port.dev = &serial8250_isa_devs->dev; in serial8250_unregister_port()
1207 uart->port.port_id = line; in serial8250_unregister_port()
1211 uart_add_one_port(&serial8250_reg, &uart->port); in serial8250_unregister_port()
1213 uart->port.dev = NULL; in serial8250_unregister_port()