Lines Matching refs:uport
60 static int uart_dcd_enabled(struct uart_port *uport) in uart_dcd_enabled() argument
62 return !!(uport->status & UPSTAT_DCD_ENABLE); in uart_dcd_enabled()
72 static inline void uart_port_deref(struct uart_port *uport) in uart_port_deref() argument
74 if (atomic_dec_and_test(&uport->state->refcount)) in uart_port_deref()
75 wake_up(&uport->state->remove_wait); in uart_port_deref()
86 #define uart_port_unlock(uport, flags) \ argument
88 struct uart_port *__uport = uport; \
193 static void uart_port_dtr_rts(struct uart_port *uport, bool active) in uart_port_dtr_rts() argument
196 uart_set_mctrl(uport, TIOCM_DTR | TIOCM_RTS); in uart_port_dtr_rts()
198 uart_clear_mctrl(uport, TIOCM_DTR | TIOCM_RTS); in uart_port_dtr_rts()
205 struct uart_port *uport = uart_port_check(state); in uart_change_line_settings() local
213 if (!tty || uport->type == PORT_UNKNOWN) in uart_change_line_settings()
217 uport->ops->set_termios(uport, termios, old_termios); in uart_change_line_settings()
222 spin_lock_irq(&uport->lock); in uart_change_line_settings()
224 uport->status |= UPSTAT_CTS_ENABLE; in uart_change_line_settings()
226 uport->status &= ~UPSTAT_CTS_ENABLE; in uart_change_line_settings()
229 uport->status &= ~UPSTAT_DCD_ENABLE; in uart_change_line_settings()
231 uport->status |= UPSTAT_DCD_ENABLE; in uart_change_line_settings()
234 old_hw_stopped = uport->hw_stopped; in uart_change_line_settings()
235 uport->hw_stopped = uart_softcts_mode(uport) && in uart_change_line_settings()
236 !(uport->ops->get_mctrl(uport) & TIOCM_CTS); in uart_change_line_settings()
237 if (uport->hw_stopped != old_hw_stopped) { in uart_change_line_settings()
239 uport->ops->stop_tx(uport); in uart_change_line_settings()
243 spin_unlock_irq(&uport->lock); in uart_change_line_settings()
253 struct uart_port *uport = uart_port_check(state); in uart_port_startup() local
258 if (uport->type == PORT_UNKNOWN) in uart_port_startup()
278 uart_port_unlock(uport, flags); in uart_port_startup()
280 uart_port_unlock(uport, flags); in uart_port_startup()
288 retval = uport->ops->startup(uport); in uart_port_startup()
290 if (uart_console(uport) && uport->cons->cflag) { in uart_port_startup()
291 tty->termios.c_cflag = uport->cons->cflag; in uart_port_startup()
292 tty->termios.c_ispeed = uport->cons->ispeed; in uart_port_startup()
293 tty->termios.c_ospeed = uport->cons->ospeed; in uart_port_startup()
294 uport->cons->cflag = 0; in uart_port_startup()
295 uport->cons->ispeed = 0; in uart_port_startup()
296 uport->cons->ospeed = 0; in uart_port_startup()
308 uart_port_dtr_rts(uport, true); in uart_port_startup()
347 struct uart_port *uport = uart_port_check(state); in uart_shutdown() local
364 if (uport && uart_console(uport) && tty) { in uart_shutdown()
365 uport->cons->cflag = tty->termios.c_cflag; in uart_shutdown()
366 uport->cons->ispeed = tty->termios.c_ispeed; in uart_shutdown()
367 uport->cons->ospeed = tty->termios.c_ospeed; in uart_shutdown()
371 uart_port_dtr_rts(uport, false); in uart_shutdown()
392 uart_port_unlock(uport, flags); in uart_shutdown()
680 void uart_xchar_out(struct uart_port *uport, int offset) in uart_xchar_out() argument
682 serial_port_out(uport, offset, uport->x_char); in uart_xchar_out()
683 uport->icount.tx++; in uart_xchar_out()
684 uport->x_char = 0; in uart_xchar_out()
775 struct uart_port *uport; in uart_get_info() local
783 uport = uart_port_check(state); in uart_get_info()
784 if (!uport) in uart_get_info()
787 retinfo->type = uport->type; in uart_get_info()
788 retinfo->line = uport->line; in uart_get_info()
789 retinfo->port = uport->iobase; in uart_get_info()
791 retinfo->port_high = (long) uport->iobase >> HIGH_BITS_OFFSET; in uart_get_info()
792 retinfo->irq = uport->irq; in uart_get_info()
793 retinfo->flags = (__force int)uport->flags; in uart_get_info()
794 retinfo->xmit_fifo_size = uport->fifosize; in uart_get_info()
795 retinfo->baud_base = uport->uartclk / 16; in uart_get_info()
800 retinfo->custom_divisor = uport->custom_divisor; in uart_get_info()
801 retinfo->hub6 = uport->hub6; in uart_get_info()
802 retinfo->io_type = uport->iotype; in uart_get_info()
803 retinfo->iomem_reg_shift = uport->regshift; in uart_get_info()
804 retinfo->iomem_base = (void *)(unsigned long)uport->mapbase; in uart_get_info()
825 struct uart_port *uport = uart_port_check(state); in uart_set_info() local
832 if (!uport) in uart_set_info()
846 change_irq = !(uport->flags & UPF_FIXED_PORT) in uart_set_info()
847 && new_info->irq != uport->irq; in uart_set_info()
854 change_port = !(uport->flags & UPF_FIXED_PORT) in uart_set_info()
855 && (new_port != uport->iobase || in uart_set_info()
856 (unsigned long)new_info->iomem_base != uport->mapbase || in uart_set_info()
857 new_info->hub6 != uport->hub6 || in uart_set_info()
858 new_info->io_type != uport->iotype || in uart_set_info()
859 new_info->iomem_reg_shift != uport->regshift || in uart_set_info()
860 new_info->type != uport->type); in uart_set_info()
862 old_flags = uport->flags; in uart_set_info()
864 old_custom_divisor = uport->custom_divisor; in uart_set_info()
869 (new_info->baud_base != uport->uartclk / 16) || in uart_set_info()
873 new_info->xmit_fifo_size != uport->fifosize) || in uart_set_info()
876 uport->flags = ((uport->flags & ~UPF_USR_MASK) | in uart_set_info()
878 uport->custom_divisor = new_info->custom_divisor; in uart_set_info()
891 if (uport->ops->verify_port) in uart_set_info()
892 retval = uport->ops->verify_port(uport, new_info); in uart_set_info()
921 old_iobase = uport->iobase; in uart_set_info()
922 old_mapbase = uport->mapbase; in uart_set_info()
923 old_type = uport->type; in uart_set_info()
924 old_hub6 = uport->hub6; in uart_set_info()
925 old_iotype = uport->iotype; in uart_set_info()
926 old_shift = uport->regshift; in uart_set_info()
931 if (old_type != PORT_UNKNOWN && uport->ops->release_port) in uart_set_info()
932 uport->ops->release_port(uport); in uart_set_info()
934 uport->iobase = new_port; in uart_set_info()
935 uport->type = new_info->type; in uart_set_info()
936 uport->hub6 = new_info->hub6; in uart_set_info()
937 uport->iotype = new_info->io_type; in uart_set_info()
938 uport->regshift = new_info->iomem_reg_shift; in uart_set_info()
939 uport->mapbase = (unsigned long)new_info->iomem_base; in uart_set_info()
944 if (uport->type != PORT_UNKNOWN && uport->ops->request_port) { in uart_set_info()
945 retval = uport->ops->request_port(uport); in uart_set_info()
956 uport->iobase = old_iobase; in uart_set_info()
957 uport->type = old_type; in uart_set_info()
958 uport->hub6 = old_hub6; in uart_set_info()
959 uport->iotype = old_iotype; in uart_set_info()
960 uport->regshift = old_shift; in uart_set_info()
961 uport->mapbase = old_mapbase; in uart_set_info()
964 retval = uport->ops->request_port(uport); in uart_set_info()
970 uport->type = PORT_UNKNOWN; in uart_set_info()
984 uport->irq = new_info->irq; in uart_set_info()
985 if (!(uport->flags & UPF_FIXED_PORT)) in uart_set_info()
986 uport->uartclk = new_info->baud_base * 16; in uart_set_info()
987 uport->flags = (uport->flags & ~UPF_CHANGE_MASK) | in uart_set_info()
989 uport->custom_divisor = new_info->custom_divisor; in uart_set_info()
993 uport->fifosize = new_info->xmit_fifo_size; in uart_set_info()
997 if (uport->type == PORT_UNKNOWN) in uart_set_info()
1000 if (((old_flags ^ uport->flags) & UPF_SPD_MASK) || in uart_set_info()
1001 old_custom_divisor != uport->custom_divisor) { in uart_set_info()
1006 if (uport->flags & UPF_SPD_MASK) { in uart_set_info()
1007 dev_notice_ratelimited(uport->dev, in uart_set_info()
1055 struct uart_port *uport = uart_port_check(state); in uart_get_lsr_info() local
1058 result = uport->ops->tx_empty(uport); in uart_get_lsr_info()
1066 if (uport->x_char || in uart_get_lsr_info()
1068 !uart_tx_stopped(uport))) in uart_get_lsr_info()
1078 struct uart_port *uport; in uart_tiocmget() local
1082 uport = uart_port_check(state); in uart_tiocmget()
1083 if (!uport) in uart_tiocmget()
1087 result = uport->mctrl; in uart_tiocmget()
1088 spin_lock_irq(&uport->lock); in uart_tiocmget()
1089 result |= uport->ops->get_mctrl(uport); in uart_tiocmget()
1090 spin_unlock_irq(&uport->lock); in uart_tiocmget()
1102 struct uart_port *uport; in uart_tiocmset() local
1106 uport = uart_port_check(state); in uart_tiocmset()
1107 if (!uport) in uart_tiocmset()
1111 uart_update_mctrl(uport, set, clear); in uart_tiocmset()
1123 struct uart_port *uport; in uart_break_ctl() local
1127 uport = uart_port_check(state); in uart_break_ctl()
1128 if (!uport) in uart_break_ctl()
1131 if (uport->type != PORT_UNKNOWN && uport->ops->break_ctl) in uart_break_ctl()
1132 uport->ops->break_ctl(uport, break_state); in uart_break_ctl()
1142 struct uart_port *uport; in uart_do_autoconfig() local
1156 uport = uart_port_check(state); in uart_do_autoconfig()
1157 if (!uport) { in uart_do_autoconfig()
1170 if (uport->type != PORT_UNKNOWN && uport->ops->release_port) in uart_do_autoconfig()
1171 uport->ops->release_port(uport); in uart_do_autoconfig()
1174 if (uport->flags & UPF_AUTO_IRQ) in uart_do_autoconfig()
1181 uport->ops->config_port(uport, flags); in uart_do_autoconfig()
1194 static void uart_enable_ms(struct uart_port *uport) in uart_enable_ms() argument
1199 if (uport->ops->enable_ms) in uart_enable_ms()
1200 uport->ops->enable_ms(uport); in uart_enable_ms()
1214 struct uart_port *uport; in uart_wait_modem_status() local
1223 uport = uart_port_ref(state); in uart_wait_modem_status()
1224 if (!uport) in uart_wait_modem_status()
1226 spin_lock_irq(&uport->lock); in uart_wait_modem_status()
1227 memcpy(&cprev, &uport->icount, sizeof(struct uart_icount)); in uart_wait_modem_status()
1228 uart_enable_ms(uport); in uart_wait_modem_status()
1229 spin_unlock_irq(&uport->lock); in uart_wait_modem_status()
1233 spin_lock_irq(&uport->lock); in uart_wait_modem_status()
1234 memcpy(&cnow, &uport->icount, sizeof(struct uart_icount)); in uart_wait_modem_status()
1235 spin_unlock_irq(&uport->lock); in uart_wait_modem_status()
1259 uart_port_deref(uport); in uart_wait_modem_status()
1275 struct uart_port *uport; in uart_get_icount() local
1277 uport = uart_port_ref(state); in uart_get_icount()
1278 if (!uport) in uart_get_icount()
1280 spin_lock_irq(&uport->lock); in uart_get_icount()
1281 memcpy(&cnow, &uport->icount, sizeof(struct uart_icount)); in uart_get_icount()
1282 spin_unlock_irq(&uport->lock); in uart_get_icount()
1283 uart_port_deref(uport); in uart_get_icount()
1569 struct uart_port *uport; in uart_ioctl() local
1610 uport = uart_port_check(state); in uart_ioctl()
1612 if (!uport || tty_io_error(tty)) { in uart_ioctl()
1628 ret = uart_get_rs485_config(uport, uarg); in uart_ioctl()
1632 ret = uart_set_rs485_config(tty, uport, uarg); in uart_ioctl()
1643 if (uport->ops->ioctl) in uart_ioctl()
1644 ret = uport->ops->ioctl(uport, cmd, arg); in uart_ioctl()
1658 struct uart_port *uport; in uart_set_ldisc() local
1665 uport = uart_port_check(state); in uart_set_ldisc()
1666 if (uport && uport->ops->set_ldisc) in uart_set_ldisc()
1667 uport->ops->set_ldisc(uport, &tty->termios); in uart_set_ldisc()
1675 struct uart_port *uport; in uart_set_termios() local
1681 uport = uart_port_check(state); in uart_set_termios()
1682 if (!uport) in uart_set_termios()
1689 if (uport->flags & UPF_SOFT_FLOW) { in uart_set_termios()
1716 uart_clear_mctrl(uport, TIOCM_RTS | TIOCM_DTR); in uart_set_termios()
1723 uart_set_mctrl(uport, mask); in uart_set_termios()
1758 struct uart_port *uport = uart_port_check(state); in uart_tty_port_shutdown() local
1765 if (WARN(!uport, "detached port still initialized!\n")) in uart_tty_port_shutdown()
1768 spin_lock_irq(&uport->lock); in uart_tty_port_shutdown()
1769 uport->ops->stop_rx(uport); in uart_tty_port_shutdown()
1770 spin_unlock_irq(&uport->lock); in uart_tty_port_shutdown()
1784 spin_lock_irq(&uport->lock); in uart_tty_port_shutdown()
1787 spin_unlock_irq(&uport->lock); in uart_tty_port_shutdown()
1866 struct uart_port *uport; in uart_hangup() local
1872 uport = uart_port_check(state); in uart_hangup()
1873 WARN(!uport, "hangup of detached port!\n"); in uart_hangup()
1883 if (uport && !uart_console(uport)) in uart_hangup()
1895 struct uart_port *uport = uart_port_check(state); in uart_port_shutdown() local
1906 if (uport) { in uart_port_shutdown()
1908 uport->ops->shutdown(uport); in uart_port_shutdown()
1911 synchronize_irq(uport->irq); in uart_port_shutdown()
1918 struct uart_port *uport; in uart_carrier_raised() local
1921 uport = uart_port_ref(state); in uart_carrier_raised()
1928 if (WARN_ON(!uport)) in uart_carrier_raised()
1930 spin_lock_irq(&uport->lock); in uart_carrier_raised()
1931 uart_enable_ms(uport); in uart_carrier_raised()
1932 mctrl = uport->ops->get_mctrl(uport); in uart_carrier_raised()
1933 spin_unlock_irq(&uport->lock); in uart_carrier_raised()
1934 uart_port_deref(uport); in uart_carrier_raised()
1942 struct uart_port *uport; in uart_dtr_rts() local
1944 uport = uart_port_ref(state); in uart_dtr_rts()
1945 if (!uport) in uart_dtr_rts()
1947 uart_port_dtr_rts(uport, active); in uart_dtr_rts()
1948 uart_port_deref(uport); in uart_dtr_rts()
1986 struct uart_port *uport; in uart_port_activate() local
1989 uport = uart_port_check(state); in uart_port_activate()
1990 if (!uport || uport->flags & UPF_DEAD) in uart_port_activate()
2023 struct uart_port *uport; in uart_line_info() local
2029 uport = uart_port_check(state); in uart_line_info()
2030 if (!uport) in uart_line_info()
2033 mmio = uport->iotype >= UPIO_MEM; in uart_line_info()
2035 uport->line, uart_type(uport), in uart_line_info()
2037 mmio ? (unsigned long long)uport->mapbase in uart_line_info()
2038 : (unsigned long long)uport->iobase, in uart_line_info()
2039 uport->irq); in uart_line_info()
2041 if (uport->type == PORT_UNKNOWN) { in uart_line_info()
2050 spin_lock_irq(&uport->lock); in uart_line_info()
2051 status = uport->ops->get_mctrl(uport); in uart_line_info()
2052 spin_unlock_irq(&uport->lock); in uart_line_info()
2057 uport->icount.tx, uport->icount.rx); in uart_line_info()
2058 if (uport->icount.frame) in uart_line_info()
2059 seq_printf(m, " fe:%d", uport->icount.frame); in uart_line_info()
2060 if (uport->icount.parity) in uart_line_info()
2061 seq_printf(m, " pe:%d", uport->icount.parity); in uart_line_info()
2062 if (uport->icount.brk) in uart_line_info()
2063 seq_printf(m, " brk:%d", uport->icount.brk); in uart_line_info()
2064 if (uport->icount.overrun) in uart_line_info()
2065 seq_printf(m, " oe:%d", uport->icount.overrun); in uart_line_info()
2066 if (uport->icount.buf_overrun) in uart_line_info()
2067 seq_printf(m, " bo:%d", uport->icount.buf_overrun); in uart_line_info()
2070 if (uport->mctrl & (bit)) \ in uart_line_info()
2365 int uart_suspend_port(struct uart_driver *drv, struct uart_port *uport) in uart_suspend_port() argument
2367 struct uart_state *state = drv->state + uport->line; in uart_suspend_port()
2370 struct uart_match match = {uport, drv}; in uart_suspend_port()
2374 tty_dev = device_find_child(uport->dev, &match, serial_match_port); in uart_suspend_port()
2376 enable_irq_wake(uport->irq); in uart_suspend_port()
2389 if (!console_suspend_enabled && uart_console(uport)) { in uart_suspend_port()
2390 if (uport->ops->start_rx) { in uart_suspend_port()
2391 spin_lock_irq(&uport->lock); in uart_suspend_port()
2392 uport->ops->stop_rx(uport); in uart_suspend_port()
2393 spin_unlock_irq(&uport->lock); in uart_suspend_port()
2398 uport->suspended = 1; in uart_suspend_port()
2401 const struct uart_ops *ops = uport->ops; in uart_suspend_port()
2408 spin_lock_irq(&uport->lock); in uart_suspend_port()
2409 ops->stop_tx(uport); in uart_suspend_port()
2410 if (!(uport->rs485.flags & SER_RS485_ENABLED)) in uart_suspend_port()
2411 ops->set_mctrl(uport, 0); in uart_suspend_port()
2413 mctrl = uport->mctrl; in uart_suspend_port()
2414 uport->mctrl = 0; in uart_suspend_port()
2415 ops->stop_rx(uport); in uart_suspend_port()
2416 spin_unlock_irq(&uport->lock); in uart_suspend_port()
2421 for (tries = 3; !ops->tx_empty(uport) && tries; tries--) in uart_suspend_port()
2424 dev_err(uport->dev, "%s: Unable to drain transmitter\n", in uart_suspend_port()
2425 uport->name); in uart_suspend_port()
2427 ops->shutdown(uport); in uart_suspend_port()
2428 uport->mctrl = mctrl; in uart_suspend_port()
2434 if (uart_console(uport)) in uart_suspend_port()
2435 console_stop(uport->cons); in uart_suspend_port()
2445 int uart_resume_port(struct uart_driver *drv, struct uart_port *uport) in uart_resume_port() argument
2447 struct uart_state *state = drv->state + uport->line; in uart_resume_port()
2450 struct uart_match match = {uport, drv}; in uart_resume_port()
2455 tty_dev = device_find_child(uport->dev, &match, serial_match_port); in uart_resume_port()
2456 if (!uport->suspended && device_may_wakeup(tty_dev)) { in uart_resume_port()
2457 if (irqd_is_wakeup_set(irq_get_irq_data((uport->irq)))) in uart_resume_port()
2458 disable_irq_wake(uport->irq); in uart_resume_port()
2464 uport->suspended = 0; in uart_resume_port()
2469 if (uart_console(uport)) { in uart_resume_port()
2474 termios.c_cflag = uport->cons->cflag; in uart_resume_port()
2475 termios.c_ispeed = uport->cons->ispeed; in uart_resume_port()
2476 termios.c_ospeed = uport->cons->ospeed; in uart_resume_port()
2486 uport->ops->set_termios(uport, &termios, NULL); in uart_resume_port()
2487 if (!console_suspend_enabled && uport->ops->start_rx) { in uart_resume_port()
2488 spin_lock_irq(&uport->lock); in uart_resume_port()
2489 uport->ops->start_rx(uport); in uart_resume_port()
2490 spin_unlock_irq(&uport->lock); in uart_resume_port()
2493 console_start(uport->cons); in uart_resume_port()
2497 const struct uart_ops *ops = uport->ops; in uart_resume_port()
2501 spin_lock_irq(&uport->lock); in uart_resume_port()
2502 if (!(uport->rs485.flags & SER_RS485_ENABLED)) in uart_resume_port()
2503 ops->set_mctrl(uport, 0); in uart_resume_port()
2504 spin_unlock_irq(&uport->lock); in uart_resume_port()
2505 if (console_suspend_enabled || !uart_console(uport)) { in uart_resume_port()
2509 ret = ops->startup(uport); in uart_resume_port()
2513 uart_rs485_config(uport); in uart_resume_port()
2514 spin_lock_irq(&uport->lock); in uart_resume_port()
2515 if (!(uport->rs485.flags & SER_RS485_ENABLED)) in uart_resume_port()
2516 ops->set_mctrl(uport, uport->mctrl); in uart_resume_port()
2517 ops->start_tx(uport); in uart_resume_port()
2518 spin_unlock_irq(&uport->lock); in uart_resume_port()
3019 struct uart_port *uport; in console_show() local
3023 uport = uart_port_check(state); in console_show()
3024 if (uport) in console_show()
3025 console = uart_console_registered(uport); in console_show()
3036 struct uart_port *uport; in console_store() local
3045 uport = uart_port_check(state); in console_store()
3046 if (uport) { in console_store()
3047 oldconsole = uart_console_registered(uport); in console_store()
3049 ret = unregister_console(uport->cons); in console_store()
3051 if (uart_console(uport)) { in console_store()
3052 uport->console_reinit = 1; in console_store()
3053 register_console(uport->cons); in console_store()
3115 static int serial_core_add_one_port(struct uart_driver *drv, struct uart_port *uport) in serial_core_add_one_port() argument
3123 if (uport->line >= drv->nr) in serial_core_add_one_port()
3126 state = drv->state + uport->line; in serial_core_add_one_port()
3138 state->uart_port = uport; in serial_core_add_one_port()
3139 uport->state = state; in serial_core_add_one_port()
3142 uport->cons = drv->cons; in serial_core_add_one_port()
3143 uport->minor = drv->tty_driver->minor_start + uport->line; in serial_core_add_one_port()
3144 uport->name = kasprintf(GFP_KERNEL, "%s%d", drv->dev_name, in serial_core_add_one_port()
3145 drv->tty_driver->name_base + uport->line); in serial_core_add_one_port()
3146 if (!uport->name) { in serial_core_add_one_port()
3155 if (!uart_console_registered(uport)) in serial_core_add_one_port()
3156 uart_port_spin_lock_init(uport); in serial_core_add_one_port()
3158 if (uport->cons && uport->dev) in serial_core_add_one_port()
3159 of_console_check(uport->dev->of_node, uport->cons->name, uport->line); in serial_core_add_one_port()
3161 tty_port_link_device(port, drv->tty_driver, uport->line); in serial_core_add_one_port()
3162 uart_configure_port(drv, state, uport); in serial_core_add_one_port()
3164 port->console = uart_console(uport); in serial_core_add_one_port()
3167 if (uport->attr_group) in serial_core_add_one_port()
3170 uport->tty_groups = kcalloc(num_groups, sizeof(*uport->tty_groups), in serial_core_add_one_port()
3172 if (!uport->tty_groups) { in serial_core_add_one_port()
3176 uport->tty_groups[0] = &tty_dev_attr_group; in serial_core_add_one_port()
3177 if (uport->attr_group) in serial_core_add_one_port()
3178 uport->tty_groups[1] = uport->attr_group; in serial_core_add_one_port()
3185 uport->line, uport->dev, port, uport->tty_groups); in serial_core_add_one_port()
3189 dev_err(uport->dev, "Cannot register tty device on line %d\n", in serial_core_add_one_port()
3190 uport->line); in serial_core_add_one_port()
3211 struct uart_port *uport) in serial_core_remove_one_port() argument
3213 struct uart_state *state = drv->state + uport->line; in serial_core_remove_one_port()
3220 if (uart_port != uport) in serial_core_remove_one_port()
3221 dev_alert(uport->dev, "Removing wrong port: %p != %p\n", in serial_core_remove_one_port()
3222 uart_port, uport); in serial_core_remove_one_port()
3233 tty_port_unregister_device(port, drv->tty_driver, uport->line); in serial_core_remove_one_port()
3244 if (uart_console(uport)) in serial_core_remove_one_port()
3245 unregister_console(uport->cons); in serial_core_remove_one_port()
3250 if (uport->type != PORT_UNKNOWN && uport->ops->release_port) in serial_core_remove_one_port()
3251 uport->ops->release_port(uport); in serial_core_remove_one_port()
3252 kfree(uport->tty_groups); in serial_core_remove_one_port()
3253 kfree(uport->name); in serial_core_remove_one_port()
3258 uport->type = PORT_UNKNOWN; in serial_core_remove_one_port()
3259 uport->port_dev = NULL; in serial_core_remove_one_port()
3446 void uart_handle_dcd_change(struct uart_port *uport, bool active) in uart_handle_dcd_change() argument
3448 struct tty_port *port = &uport->state->port; in uart_handle_dcd_change()
3452 lockdep_assert_held_once(&uport->lock); in uart_handle_dcd_change()
3463 uport->icount.dcd++; in uart_handle_dcd_change()
3465 if (uart_dcd_enabled(uport)) { in uart_handle_dcd_change()
3481 void uart_handle_cts_change(struct uart_port *uport, bool active) in uart_handle_cts_change() argument
3483 lockdep_assert_held_once(&uport->lock); in uart_handle_cts_change()
3485 uport->icount.cts++; in uart_handle_cts_change()
3487 if (uart_softcts_mode(uport)) { in uart_handle_cts_change()
3488 if (uport->hw_stopped) { in uart_handle_cts_change()
3490 uport->hw_stopped = false; in uart_handle_cts_change()
3491 uport->ops->start_tx(uport); in uart_handle_cts_change()
3492 uart_write_wakeup(uport); in uart_handle_cts_change()
3496 uport->hw_stopped = true; in uart_handle_cts_change()
3497 uport->ops->stop_tx(uport); in uart_handle_cts_change()