Lines Matching refs:port

68 	struct uart_port	port;  member
175 switch (up->port.iotype) { in sio_in()
177 return __raw_readl(up->port.membase + offset); in sio_in()
179 return inl(up->port.iobase + offset); in sio_in()
186 switch (up->port.iotype) { in sio_out()
188 __raw_writel(value, up->port.membase + offset); in sio_out()
191 outl(value, up->port.iobase + offset); in sio_out()
223 static struct uart_txx9_port *to_uart_txx9_port(struct uart_port *port) in to_uart_txx9_port() argument
225 return container_of(port, struct uart_txx9_port, port); in to_uart_txx9_port()
228 static void serial_txx9_stop_tx(struct uart_port *port) in serial_txx9_stop_tx() argument
230 struct uart_txx9_port *up = to_uart_txx9_port(port); in serial_txx9_stop_tx()
234 static void serial_txx9_start_tx(struct uart_port *port) in serial_txx9_start_tx() argument
236 struct uart_txx9_port *up = to_uart_txx9_port(port); in serial_txx9_start_tx()
240 static void serial_txx9_stop_rx(struct uart_port *port) in serial_txx9_stop_rx() argument
242 struct uart_txx9_port *up = to_uart_txx9_port(port); in serial_txx9_stop_rx()
243 up->port.read_status_mask &= ~TXX9_SIDISR_RDIS; in serial_txx9_stop_rx()
246 static void serial_txx9_initialize(struct uart_port *port) in serial_txx9_initialize() argument
248 struct uart_txx9_port *up = to_uart_txx9_port(port); in serial_txx9_initialize()
264 ((up->port.flags & UPF_TXX9_USE_SCLK) ? in serial_txx9_initialize()
266 sio_quot_set(up, uart_get_divisor(port, 9600)); in serial_txx9_initialize()
283 up->port.icount.rx++; in receive_chars()
287 up->port.ignore_status_mask & ~TXX9_SIDISR_RFDN_MASK; in receive_chars()
295 up->port.icount.brk++; in receive_chars()
302 if (uart_handle_break(&up->port)) in receive_chars()
305 up->port.icount.parity++; in receive_chars()
307 up->port.icount.frame++; in receive_chars()
309 up->port.icount.overrun++; in receive_chars()
323 disr &= up->port.read_status_mask; in receive_chars()
332 if (uart_handle_sysrq_char(&up->port, ch)) in receive_chars()
335 uart_insert_char(&up->port, disr, TXX9_SIDISR_UOER, ch, flag); in receive_chars()
338 up->port.ignore_status_mask = next_ignore_status_mask; in receive_chars()
341 spin_unlock(&up->port.lock); in receive_chars()
342 tty_flip_buffer_push(&up->port.state->port); in receive_chars()
343 spin_lock(&up->port.lock); in receive_chars()
349 struct circ_buf *xmit = &up->port.state->xmit; in transmit_chars()
352 if (up->port.x_char) { in transmit_chars()
353 sio_out(up, TXX9_SITFIFO, up->port.x_char); in transmit_chars()
354 up->port.icount.tx++; in transmit_chars()
355 up->port.x_char = 0; in transmit_chars()
358 if (uart_circ_empty(xmit) || uart_tx_stopped(&up->port)) { in transmit_chars()
359 serial_txx9_stop_tx(&up->port); in transmit_chars()
367 up->port.icount.tx++; in transmit_chars()
373 uart_write_wakeup(&up->port); in transmit_chars()
376 serial_txx9_stop_tx(&up->port); in transmit_chars()
386 spin_lock(&up->port.lock); in serial_txx9_interrupt()
392 spin_unlock(&up->port.lock); in serial_txx9_interrupt()
404 spin_unlock(&up->port.lock); in serial_txx9_interrupt()
413 static unsigned int serial_txx9_tx_empty(struct uart_port *port) in serial_txx9_tx_empty() argument
415 struct uart_txx9_port *up = to_uart_txx9_port(port); in serial_txx9_tx_empty()
419 spin_lock_irqsave(&up->port.lock, flags); in serial_txx9_tx_empty()
421 spin_unlock_irqrestore(&up->port.lock, flags); in serial_txx9_tx_empty()
426 static unsigned int serial_txx9_get_mctrl(struct uart_port *port) in serial_txx9_get_mctrl() argument
428 struct uart_txx9_port *up = to_uart_txx9_port(port); in serial_txx9_get_mctrl()
439 static void serial_txx9_set_mctrl(struct uart_port *port, unsigned int mctrl) in serial_txx9_set_mctrl() argument
441 struct uart_txx9_port *up = to_uart_txx9_port(port); in serial_txx9_set_mctrl()
449 static void serial_txx9_break_ctl(struct uart_port *port, int break_state) in serial_txx9_break_ctl() argument
451 struct uart_txx9_port *up = to_uart_txx9_port(port); in serial_txx9_break_ctl()
454 spin_lock_irqsave(&up->port.lock, flags); in serial_txx9_break_ctl()
459 spin_unlock_irqrestore(&up->port.lock, flags); in serial_txx9_break_ctl()
476 if (up->port.flags & UPF_CONS_FLOW) { in wait_for_xmitr()
491 static int serial_txx9_get_poll_char(struct uart_port *port) in serial_txx9_get_poll_char() argument
495 struct uart_txx9_port *up = to_uart_txx9_port(port); in serial_txx9_get_poll_char()
518 static void serial_txx9_put_poll_char(struct uart_port *port, unsigned char c) in serial_txx9_put_poll_char() argument
521 struct uart_txx9_port *up = to_uart_txx9_port(port); in serial_txx9_put_poll_char()
545 static int serial_txx9_startup(struct uart_port *port) in serial_txx9_startup() argument
547 struct uart_txx9_port *up = to_uart_txx9_port(port); in serial_txx9_startup()
567 retval = request_irq(up->port.irq, serial_txx9_interrupt, in serial_txx9_startup()
575 spin_lock_irqsave(&up->port.lock, flags); in serial_txx9_startup()
576 serial_txx9_set_mctrl(&up->port, up->port.mctrl); in serial_txx9_startup()
577 spin_unlock_irqrestore(&up->port.lock, flags); in serial_txx9_startup()
590 static void serial_txx9_shutdown(struct uart_port *port) in serial_txx9_shutdown() argument
592 struct uart_txx9_port *up = to_uart_txx9_port(port); in serial_txx9_shutdown()
600 spin_lock_irqsave(&up->port.lock, flags); in serial_txx9_shutdown()
601 serial_txx9_set_mctrl(&up->port, up->port.mctrl); in serial_txx9_shutdown()
602 spin_unlock_irqrestore(&up->port.lock, flags); in serial_txx9_shutdown()
610 if (up->port.cons && up->port.line == up->port.cons->index) { in serial_txx9_shutdown()
611 free_irq(up->port.irq, up); in serial_txx9_shutdown()
625 free_irq(up->port.irq, up); in serial_txx9_shutdown()
629 serial_txx9_set_termios(struct uart_port *port, struct ktermios *termios, in serial_txx9_set_termios() argument
632 struct uart_txx9_port *up = to_uart_txx9_port(port); in serial_txx9_set_termios()
672 baud = uart_get_baud_rate(port, termios, old, 0, port->uartclk/16/2); in serial_txx9_set_termios()
673 quot = uart_get_divisor(port, baud); in serial_txx9_set_termios()
683 spin_lock_irqsave(&up->port.lock, flags); in serial_txx9_set_termios()
688 uart_update_timeout(port, termios->c_cflag, baud); in serial_txx9_set_termios()
690 up->port.read_status_mask = TXX9_SIDISR_UOER | in serial_txx9_set_termios()
693 up->port.read_status_mask |= TXX9_SIDISR_UFER | TXX9_SIDISR_UPER; in serial_txx9_set_termios()
695 up->port.read_status_mask |= TXX9_SIDISR_UBRK; in serial_txx9_set_termios()
700 up->port.ignore_status_mask = 0; in serial_txx9_set_termios()
702 up->port.ignore_status_mask |= TXX9_SIDISR_UPER | TXX9_SIDISR_UFER; in serial_txx9_set_termios()
704 up->port.ignore_status_mask |= TXX9_SIDISR_UBRK; in serial_txx9_set_termios()
710 up->port.ignore_status_mask |= TXX9_SIDISR_UOER; in serial_txx9_set_termios()
717 up->port.ignore_status_mask |= TXX9_SIDISR_RDIS; in serial_txx9_set_termios()
721 (up->port.flags & UPF_TXX9_HAVE_CTS_LINE)) { in serial_txx9_set_termios()
733 serial_txx9_set_mctrl(&up->port, up->port.mctrl); in serial_txx9_set_termios()
734 spin_unlock_irqrestore(&up->port.lock, flags); in serial_txx9_set_termios()
738 serial_txx9_pm(struct uart_port *port, unsigned int state, in serial_txx9_pm() argument
750 serial_txx9_initialize(port); in serial_txx9_pm()
758 switch (up->port.iotype) { in serial_txx9_request_resource()
760 if (!up->port.mapbase) in serial_txx9_request_resource()
763 if (!request_mem_region(up->port.mapbase, size, "serial_txx9")) { in serial_txx9_request_resource()
768 if (up->port.flags & UPF_IOREMAP) { in serial_txx9_request_resource()
769 up->port.membase = ioremap(up->port.mapbase, size); in serial_txx9_request_resource()
770 if (!up->port.membase) { in serial_txx9_request_resource()
771 release_mem_region(up->port.mapbase, size); in serial_txx9_request_resource()
778 if (!request_region(up->port.iobase, size, "serial_txx9")) in serial_txx9_request_resource()
789 switch (up->port.iotype) { in serial_txx9_release_resource()
791 if (!up->port.mapbase) in serial_txx9_release_resource()
794 if (up->port.flags & UPF_IOREMAP) { in serial_txx9_release_resource()
795 iounmap(up->port.membase); in serial_txx9_release_resource()
796 up->port.membase = NULL; in serial_txx9_release_resource()
799 release_mem_region(up->port.mapbase, size); in serial_txx9_release_resource()
803 release_region(up->port.iobase, size); in serial_txx9_release_resource()
808 static void serial_txx9_release_port(struct uart_port *port) in serial_txx9_release_port() argument
810 struct uart_txx9_port *up = to_uart_txx9_port(port); in serial_txx9_release_port()
814 static int serial_txx9_request_port(struct uart_port *port) in serial_txx9_request_port() argument
816 struct uart_txx9_port *up = to_uart_txx9_port(port); in serial_txx9_request_port()
820 static void serial_txx9_config_port(struct uart_port *port, int uflags) in serial_txx9_config_port() argument
822 struct uart_txx9_port *up = to_uart_txx9_port(port); in serial_txx9_config_port()
832 port->type = PORT_TXX9; in serial_txx9_config_port()
833 up->port.fifosize = TXX9_SIO_TX_FIFO; in serial_txx9_config_port()
836 if (up->port.line == up->port.cons->index) in serial_txx9_config_port()
839 serial_txx9_initialize(port); in serial_txx9_config_port()
843 serial_txx9_type(struct uart_port *port) in serial_txx9_type() argument
880 up->port.line = i; in serial_txx9_register_ports()
881 up->port.ops = &serial_txx9_pops; in serial_txx9_register_ports()
882 up->port.dev = dev; in serial_txx9_register_ports()
883 if (up->port.iobase || up->port.mapbase) in serial_txx9_register_ports()
884 uart_add_one_port(drv, &up->port); in serial_txx9_register_ports()
890 static void serial_txx9_console_putchar(struct uart_port *port, int ch) in serial_txx9_console_putchar() argument
892 struct uart_txx9_port *up = to_uart_txx9_port(port); in serial_txx9_console_putchar()
919 if (!(up->port.flags & UPF_CONS_FLOW) && (flcr & TXX9_SIFLCR_TES)) in serial_txx9_console_write()
922 uart_console_write(&up->port, s, count, serial_txx9_console_putchar); in serial_txx9_console_write()
935 struct uart_port *port; in serial_txx9_console_setup() local
950 port = &up->port; in serial_txx9_console_setup()
951 if (!port->ops) in serial_txx9_console_setup()
954 serial_txx9_initialize(&up->port); in serial_txx9_console_setup()
959 return uart_set_options(port, co, baud, parity, bits, flow); in serial_txx9_console_setup()
995 int __init early_serial_txx9_setup(struct uart_port *port) in early_serial_txx9_setup() argument
997 if (port->line >= ARRAY_SIZE(serial_txx9_ports)) in early_serial_txx9_setup()
1000 serial_txx9_ports[port->line].port = *port; in early_serial_txx9_setup()
1001 serial_txx9_ports[port->line].port.ops = &serial_txx9_pops; in early_serial_txx9_setup()
1002 serial_txx9_ports[port->line].port.flags |= in early_serial_txx9_setup()
1020 static int serial_txx9_register_port(struct uart_port *port) in serial_txx9_register_port() argument
1029 if (uart_match_port(&uart->port, port)) { in serial_txx9_register_port()
1030 uart_remove_one_port(&serial_txx9_reg, &uart->port); in serial_txx9_register_port()
1038 if (!(uart->port.iobase || uart->port.mapbase)) in serial_txx9_register_port()
1043 uart->port.iobase = port->iobase; in serial_txx9_register_port()
1044 uart->port.membase = port->membase; in serial_txx9_register_port()
1045 uart->port.irq = port->irq; in serial_txx9_register_port()
1046 uart->port.uartclk = port->uartclk; in serial_txx9_register_port()
1047 uart->port.iotype = port->iotype; in serial_txx9_register_port()
1048 uart->port.flags = port->flags in serial_txx9_register_port()
1050 uart->port.mapbase = port->mapbase; in serial_txx9_register_port()
1051 if (port->dev) in serial_txx9_register_port()
1052 uart->port.dev = port->dev; in serial_txx9_register_port()
1053 ret = uart_add_one_port(&serial_txx9_reg, &uart->port); in serial_txx9_register_port()
1055 ret = uart->port.line; in serial_txx9_register_port()
1073 uart_remove_one_port(&serial_txx9_reg, &uart->port); in serial_txx9_unregister_port()
1074 uart->port.flags = 0; in serial_txx9_unregister_port()
1075 uart->port.type = PORT_UNKNOWN; in serial_txx9_unregister_port()
1076 uart->port.iobase = 0; in serial_txx9_unregister_port()
1077 uart->port.mapbase = 0; in serial_txx9_unregister_port()
1078 uart->port.membase = NULL; in serial_txx9_unregister_port()
1079 uart->port.dev = NULL; in serial_txx9_unregister_port()
1089 struct uart_port port; in serial_txx9_probe() local
1092 memset(&port, 0, sizeof(struct uart_port)); in serial_txx9_probe()
1094 port.iobase = p->iobase; in serial_txx9_probe()
1095 port.membase = p->membase; in serial_txx9_probe()
1096 port.irq = p->irq; in serial_txx9_probe()
1097 port.uartclk = p->uartclk; in serial_txx9_probe()
1098 port.iotype = p->iotype; in serial_txx9_probe()
1099 port.flags = p->flags; in serial_txx9_probe()
1100 port.mapbase = p->mapbase; in serial_txx9_probe()
1101 port.dev = &dev->dev; in serial_txx9_probe()
1102 ret = serial_txx9_register_port(&port); in serial_txx9_probe()
1123 if (up->port.dev == &dev->dev) in serial_txx9_remove()
1137 if (up->port.type != PORT_UNKNOWN && up->port.dev == &dev->dev) in serial_txx9_suspend()
1138 uart_suspend_port(&serial_txx9_reg, &up->port); in serial_txx9_suspend()
1151 if (up->port.type != PORT_UNKNOWN && up->port.dev == &dev->dev) in serial_txx9_resume()
1152 uart_resume_port(&serial_txx9_reg, &up->port); in serial_txx9_resume()
1179 struct uart_port port; in pciserial_txx9_init_one() local
1187 memset(&port, 0, sizeof(port)); in pciserial_txx9_init_one()
1188 port.ops = &serial_txx9_pops; in pciserial_txx9_init_one()
1189 port.flags |= UPF_TXX9_HAVE_CTS_LINE; in pciserial_txx9_init_one()
1190 port.uartclk = 66670000; in pciserial_txx9_init_one()
1191 port.irq = dev->irq; in pciserial_txx9_init_one()
1192 port.iotype = UPIO_PORT; in pciserial_txx9_init_one()
1193 port.iobase = pci_resource_start(dev, 1); in pciserial_txx9_init_one()
1194 port.dev = &dev->dev; in pciserial_txx9_init_one()
1195 line = serial_txx9_register_port(&port); in pciserial_txx9_init_one()
1211 serial_txx9_unregister_port(up->port.line); in pciserial_txx9_remove_one()
1222 uart_suspend_port(&serial_txx9_reg, &up->port); in pciserial_txx9_suspend_one()
1235 uart_resume_port(&serial_txx9_reg, &up->port); in pciserial_txx9_resume_one()
1315 if (up->port.iobase || up->port.mapbase) in serial_txx9_exit()
1316 uart_remove_one_port(&serial_txx9_reg, &up->port); in serial_txx9_exit()