Lines Matching full:up
80 struct uart_8250_port *up; in serial8250_interrupt() local
83 up = list_entry(l, struct uart_8250_port, list); in serial8250_interrupt()
84 port = &up->port; in serial8250_interrupt()
112 static void serial_do_unlink(struct irq_info *i, struct uart_8250_port *up) in serial_do_unlink() argument
117 if (i->head == &up->list) in serial_do_unlink()
119 list_del(&up->list); in serial_do_unlink()
121 BUG_ON(i->head != &up->list); in serial_do_unlink()
132 static int serial_link_irq_chain(struct uart_8250_port *up) in serial_link_irq_chain() argument
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()
161 list_add(&up->list, i->head); in serial_link_irq_chain()
166 INIT_LIST_HEAD(&up->list); in serial_link_irq_chain()
167 i->head = &up->list; 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()
172 serial_do_unlink(i, up); in serial_link_irq_chain()
178 static void serial_unlink_irq_chain(struct uart_8250_port *up) in serial_unlink_irq_chain() argument
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()
197 serial_do_unlink(i, up); in serial_unlink_irq_chain()
209 struct uart_8250_port *up = from_timer(up, t, timer); in serial8250_timeout() local
211 up->port.handle_irq(&up->port); in serial8250_timeout()
212 mod_timer(&up->timer, jiffies + uart_poll_timeout(&up->port)); in serial8250_timeout()
217 struct uart_8250_port *up = from_timer(up, t, timer); in serial8250_backup_timeout() local
221 uart_port_lock_irqsave(&up->port, &flags); in serial8250_backup_timeout()
227 if (up->port.irq) { in serial8250_backup_timeout()
228 ier = serial_in(up, UART_IER); in serial8250_backup_timeout()
229 serial_out(up, UART_IER, 0); in serial8250_backup_timeout()
232 iir = serial_in(up, UART_IIR); in serial8250_backup_timeout()
240 lsr = serial_lsr_in(up); in serial8250_backup_timeout()
241 if ((iir & UART_IIR_NO_INT) && (up->ier & UART_IER_THRI) && 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()
250 serial8250_tx_chars(up); in serial8250_backup_timeout()
252 if (up->port.irq) in serial8250_backup_timeout()
253 serial_out(up, UART_IER, ier); in serial8250_backup_timeout()
255 uart_port_unlock_irqrestore(&up->port, flags); in serial8250_backup_timeout()
258 mod_timer(&up->timer, in serial8250_backup_timeout()
259 jiffies + uart_poll_timeout(&up->port) + HZ / 5); in serial8250_backup_timeout()
262 static void univ8250_setup_timer(struct uart_8250_port *up) in univ8250_setup_timer() argument
264 struct uart_port *port = &up->port; in univ8250_setup_timer()
270 if (up->bugs & UART_BUG_THRE) { in univ8250_setup_timer()
273 up->timer.function = serial8250_backup_timeout; in univ8250_setup_timer()
274 mod_timer(&up->timer, jiffies + in univ8250_setup_timer()
284 mod_timer(&up->timer, jiffies + uart_poll_timeout(port)); in univ8250_setup_timer()
287 static int univ8250_setup_irq(struct uart_8250_port *up) in univ8250_setup_irq() argument
289 struct uart_port *port = &up->port; in univ8250_setup_irq()
292 return serial_link_irq_chain(up); in univ8250_setup_irq()
297 static void univ8250_release_irq(struct uart_8250_port *up) in univ8250_release_irq() argument
299 struct uart_port *port = &up->port; in univ8250_release_irq()
301 del_timer_sync(&up->timer); in univ8250_release_irq()
302 up->timer.function = serial8250_timeout; in univ8250_release_irq()
304 serial_unlink_irq_chain(up); in univ8250_release_irq()
336 static inline void serial8250_apply_quirks(struct uart_8250_port *up) in serial8250_apply_quirks() argument
338 up->port.quirks |= skip_txen_test ? UPQ_NO_TXEN_TEST : 0; in serial8250_apply_quirks()
343 struct uart_8250_port *up; in serial8250_setup_port() local
348 up = &serial8250_ports[index]; in serial8250_setup_port()
349 up->port.line = index; in serial8250_setup_port()
350 up->port.port_id = index; in serial8250_setup_port()
352 serial8250_init_port(up); 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()
357 timer_setup(&up->timer, serial8250_timeout, 0); in serial8250_setup_port()
359 up->ops = &univ8250_driver_ops; in serial8250_setup_port()
361 serial8250_set_defaults(up); in serial8250_setup_port()
363 return up; in serial8250_setup_port()
371 struct uart_8250_port *up = &serial8250_ports[i]; in serial8250_register_ports() local
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()
384 serial8250_apply_quirks(up); in serial8250_register_ports()
385 uart_add_one_port(drv, &up->port); in serial8250_register_ports()
394 struct uart_8250_port *up = &serial8250_ports[co->index]; in univ8250_console_write() local
396 serial8250_console_write(up, s, count); in univ8250_console_write()
401 struct uart_8250_port *up; in univ8250_console_setup() local
414 * If the console is past the initial isa ports, init more ports up to in univ8250_console_setup()
418 up = serial8250_setup_port(i); in univ8250_console_setup()
419 if (!up) in univ8250_console_setup()
582 struct uart_8250_port *up = &serial8250_ports[line]; in serial8250_suspend_port() local
583 struct uart_port *port = &up->port; in serial8250_suspend_port()
589 serial_out(up, UART_SCR, canary); in serial8250_suspend_port()
590 if (serial_in(up, UART_SCR) == canary) in serial8250_suspend_port()
591 up->canary = canary; in serial8250_suspend_port()
606 struct uart_8250_port *up = &serial8250_ports[line]; in serial8250_resume_port() local
607 struct uart_port *port = &up->port; in serial8250_resume_port()
609 up->canary = 0; in serial8250_resume_port()
611 if (up->capabilities & UART_NATSEMI) { in serial8250_resume_port()
615 ns16550a_goto_highspeed(up); in serial8250_resume_port()
670 struct uart_8250_port *up = in serial_8250_overrun_backoff_work() local
673 struct uart_port *port = &up->port; in serial_8250_overrun_backoff_work()
677 up->ier |= UART_IER_RLSI | UART_IER_RDI; in serial_8250_overrun_backoff_work()
678 up->port.read_status_mask |= UART_LSR_DR; in serial_8250_overrun_backoff_work()
679 serial_out(up, UART_IER, up->ier); in serial_8250_overrun_backoff_work()
685 * @up: serial port template
688 * port exists and is in use, it is hung up and unregistered
696 int serial8250_register_8250_port(const struct uart_8250_port *up) in serial8250_register_8250_port() argument
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()
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()
735 uart->bugs = up->bugs; 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()
739 uart->tx_loadsz = up->tx_loadsz; in serial8250_register_8250_port()
740 uart->capabilities = up->capabilities; 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()
746 uart->rs485_start_tx = up->rs485_start_tx; in serial8250_register_8250_port()
747 uart->rs485_stop_tx = up->rs485_stop_tx; in serial8250_register_8250_port()
748 uart->lsr_save_mask = up->lsr_save_mask; in serial8250_register_8250_port()
749 uart->dma = up->dma; 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()
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()
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()
809 if (up->dl_read) in serial8250_register_8250_port()
810 uart->dl_read = up->dl_read; in serial8250_register_8250_port()
811 if (up->dl_write) in serial8250_register_8250_port()
812 uart->dl_write = up->dl_write; in serial8250_register_8250_port()
840 if (up->overrun_backoff_time_ms > 0) { in serial8250_register_8250_port()
842 up->overrun_backoff_time_ms; in serial8250_register_8250_port()