Lines Matching full:tty
34 #include <linux/tty.h>
141 * the tty layer. Be careful to prevent any further access in sdio_uart_port_remove()
142 * to the SDIO function and arrange for the tty layer to in sdio_uart_port_remove()
411 struct tty_struct *tty; in sdio_uart_transmit_chars() local
422 tty = tty_port_tty_get(&port->port); in sdio_uart_transmit_chars()
424 if (tty == NULL || !kfifo_len(xmit) || in sdio_uart_transmit_chars()
425 tty->flow.stopped || tty->hw_stopped) { in sdio_uart_transmit_chars()
427 tty_kref_put(tty); in sdio_uart_transmit_chars()
439 tty_wakeup(tty); in sdio_uart_transmit_chars()
443 tty_kref_put(tty); in sdio_uart_transmit_chars()
448 struct tty_struct *tty; in sdio_uart_check_modem_status() local
466 /* DCD drop - hang up if tty attached */ in sdio_uart_check_modem_status()
472 tty = tty_port_tty_get(&port->port); in sdio_uart_check_modem_status()
473 if (tty && C_CRTSCTS(tty)) { in sdio_uart_check_modem_status()
475 if (tty->hw_stopped) { in sdio_uart_check_modem_status()
477 tty->hw_stopped = false; in sdio_uart_check_modem_status()
479 tty_wakeup(tty); in sdio_uart_check_modem_status()
483 tty->hw_stopped = true; in sdio_uart_check_modem_status()
488 tty_kref_put(tty); in sdio_uart_check_modem_status()
504 * interaction with the tty core may end up calling us back in sdio_uart_irq()
540 * @tport: tty port to be updated
543 * Called by the tty port helpers when the modem signals need to be
563 * @tport: tty port to activate
564 * @tty: tty bound to this port
566 * Activate a tty port. The port locking guarantees us this will be
576 static int sdio_uart_activate(struct tty_port *tport, struct tty_struct *tty) in sdio_uart_activate() argument
583 * Set the TTY IO error marker - we will only clear this in sdio_uart_activate()
586 set_bit(TTY_IO_ERROR, &tty->flags); in sdio_uart_activate()
625 sdio_uart_change_speed(port, &tty->termios, NULL); in sdio_uart_activate()
627 if (C_BAUD(tty)) in sdio_uart_activate()
630 if (C_CRTSCTS(tty)) in sdio_uart_activate()
632 tty->hw_stopped = true; in sdio_uart_activate()
634 clear_bit(TTY_IO_ERROR, &tty->flags); in sdio_uart_activate()
651 * @tport: tty port to shut down
653 * Deactivate a tty port. The port locking guarantees us this will be
702 * @tty: the tty being bound
704 * Look up and bind the tty and the driver together. Initialize
708 static int sdio_uart_install(struct tty_driver *driver, struct tty_struct *tty) in sdio_uart_install() argument
710 int idx = tty->index; in sdio_uart_install()
712 int ret = tty_standard_install(driver, tty); in sdio_uart_install()
716 tty->driver_data = port; in sdio_uart_install()
723 * sdio_uart_cleanup - called on the last tty kref drop
724 * @tty: the tty being destroyed
726 * Called asynchronously when the last reference to the tty is dropped.
727 * We cannot destroy the tty->driver_data port kref until this point
730 static void sdio_uart_cleanup(struct tty_struct *tty) in sdio_uart_cleanup() argument
732 struct sdio_uart_port *port = tty->driver_data; in sdio_uart_cleanup()
733 tty->driver_data = NULL; /* Bug trap */ in sdio_uart_cleanup()
741 static int sdio_uart_open(struct tty_struct *tty, struct file *filp) in sdio_uart_open() argument
743 struct sdio_uart_port *port = tty->driver_data; in sdio_uart_open()
744 return tty_port_open(&port->port, tty, filp); in sdio_uart_open()
747 static void sdio_uart_close(struct tty_struct *tty, struct file * filp) in sdio_uart_close() argument
749 struct sdio_uart_port *port = tty->driver_data; in sdio_uart_close()
750 tty_port_close(&port->port, tty, filp); in sdio_uart_close()
753 static void sdio_uart_hangup(struct tty_struct *tty) in sdio_uart_hangup() argument
755 struct sdio_uart_port *port = tty->driver_data; in sdio_uart_hangup()
759 static ssize_t sdio_uart_write(struct tty_struct *tty, const u8 *buf, in sdio_uart_write() argument
762 struct sdio_uart_port *port = tty->driver_data; in sdio_uart_write()
782 static unsigned int sdio_uart_write_room(struct tty_struct *tty) in sdio_uart_write_room() argument
784 struct sdio_uart_port *port = tty->driver_data; in sdio_uart_write_room()
788 static unsigned int sdio_uart_chars_in_buffer(struct tty_struct *tty) in sdio_uart_chars_in_buffer() argument
790 struct sdio_uart_port *port = tty->driver_data; in sdio_uart_chars_in_buffer()
794 static void sdio_uart_send_xchar(struct tty_struct *tty, u8 ch) in sdio_uart_send_xchar() argument
796 struct sdio_uart_port *port = tty->driver_data; in sdio_uart_send_xchar()
808 static void sdio_uart_throttle(struct tty_struct *tty) in sdio_uart_throttle() argument
810 struct sdio_uart_port *port = tty->driver_data; in sdio_uart_throttle()
812 if (!I_IXOFF(tty) && !C_CRTSCTS(tty)) in sdio_uart_throttle()
818 if (I_IXOFF(tty)) { in sdio_uart_throttle()
819 port->x_char = STOP_CHAR(tty); in sdio_uart_throttle()
823 if (C_CRTSCTS(tty)) in sdio_uart_throttle()
830 static void sdio_uart_unthrottle(struct tty_struct *tty) in sdio_uart_unthrottle() argument
832 struct sdio_uart_port *port = tty->driver_data; in sdio_uart_unthrottle()
834 if (!I_IXOFF(tty) && !C_CRTSCTS(tty)) in sdio_uart_unthrottle()
840 if (I_IXOFF(tty)) { in sdio_uart_unthrottle()
844 port->x_char = START_CHAR(tty); in sdio_uart_unthrottle()
849 if (C_CRTSCTS(tty)) in sdio_uart_unthrottle()
856 static void sdio_uart_set_termios(struct tty_struct *tty, in sdio_uart_set_termios() argument
859 struct sdio_uart_port *port = tty->driver_data; in sdio_uart_set_termios()
860 unsigned int cflag = tty->termios.c_cflag; in sdio_uart_set_termios()
865 sdio_uart_change_speed(port, &tty->termios, old_termios); in sdio_uart_set_termios()
874 if (!(cflag & CRTSCTS) || !tty_throttled(tty)) in sdio_uart_set_termios()
881 tty->hw_stopped = false; in sdio_uart_set_termios()
888 tty->hw_stopped = true; in sdio_uart_set_termios()
896 static int sdio_uart_break_ctl(struct tty_struct *tty, int break_state) in sdio_uart_break_ctl() argument
898 struct sdio_uart_port *port = tty->driver_data; in sdio_uart_break_ctl()
915 static int sdio_uart_tiocmget(struct tty_struct *tty) in sdio_uart_tiocmget() argument
917 struct sdio_uart_port *port = tty->driver_data; in sdio_uart_tiocmget()
929 static int sdio_uart_tiocmset(struct tty_struct *tty, in sdio_uart_tiocmset() argument
932 struct sdio_uart_port *port = tty->driver_data; in sdio_uart_tiocmset()