Lines Matching refs:tty

47 static int spk_ttyio_ldisc_open(struct tty_struct *tty)  in spk_ttyio_ldisc_open()  argument
51 if (tty != speakup_tty) in spk_ttyio_ldisc_open()
55 if (!tty->ops->write) in spk_ttyio_ldisc_open()
64 tty->disc_data = ldisc_data; in spk_ttyio_ldisc_open()
69 static void spk_ttyio_ldisc_close(struct tty_struct *tty) in spk_ttyio_ldisc_close() argument
71 kfree(tty->disc_data); in spk_ttyio_ldisc_close()
74 static int spk_ttyio_receive_buf2(struct tty_struct *tty, in spk_ttyio_receive_buf2() argument
78 struct spk_ldisc_data *ldisc_data = tty->disc_data; in spk_ttyio_receive_buf2()
136 static inline void get_termios(struct tty_struct *tty, in get_termios() argument
139 down_read(&tty->termios_rwsem); in get_termios()
140 *out_termios = tty->termios; in get_termios()
141 up_read(&tty->termios_rwsem); in get_termios()
147 struct tty_struct *tty; in spk_ttyio_initialise_ldisc() local
155 tty = tty_kopen_exclusive(dev); in spk_ttyio_initialise_ldisc()
156 if (IS_ERR(tty)) in spk_ttyio_initialise_ldisc()
157 return PTR_ERR(tty); in spk_ttyio_initialise_ldisc()
159 if (tty->ops->open) in spk_ttyio_initialise_ldisc()
160 ret = tty->ops->open(tty, NULL); in spk_ttyio_initialise_ldisc()
165 tty_unlock(tty); in spk_ttyio_initialise_ldisc()
169 clear_bit(TTY_HUPPED, &tty->flags); in spk_ttyio_initialise_ldisc()
171 get_termios(tty, &tmp_termios); in spk_ttyio_initialise_ldisc()
174 tty_set_termios(tty, &tmp_termios); in spk_ttyio_initialise_ldisc()
180 get_termios(tty, &tmp_termios); in spk_ttyio_initialise_ldisc()
185 tty_unlock(tty); in spk_ttyio_initialise_ldisc()
188 speakup_tty = tty; in spk_ttyio_initialise_ldisc()
189 ret = tty_set_ldisc(tty, N_SPEAKUP); in spk_ttyio_initialise_ldisc()
195 struct spk_ldisc_data *ldisc_data = tty->disc_data; in spk_ttyio_initialise_ldisc()
198 synth->dev = tty; in spk_ttyio_initialise_ldisc()
204 tty_lock(tty); in spk_ttyio_initialise_ldisc()
205 if (tty->ops->close) in spk_ttyio_initialise_ldisc()
206 tty->ops->close(tty, NULL); in spk_ttyio_initialise_ldisc()
207 tty_unlock(tty); in spk_ttyio_initialise_ldisc()
209 tty_kclose(tty); in spk_ttyio_initialise_ldisc()
227 struct tty_struct *tty = in_synth->dev; in spk_ttyio_out() local
230 if (!in_synth->alive || !tty->ops->write) in spk_ttyio_out()
233 ret = tty->ops->write(tty, &ch, 1); in spk_ttyio_out()
273 struct tty_struct *tty = in_synth->dev; in spk_ttyio_send_xchar() local
275 if (tty->ops->send_xchar) in spk_ttyio_send_xchar()
276 tty->ops->send_xchar(tty, ch); in spk_ttyio_send_xchar()
281 struct tty_struct *tty = in_synth->dev; in spk_ttyio_tiocmset() local
283 if (tty->ops->tiocmset) in spk_ttyio_tiocmset()
284 tty->ops->tiocmset(tty, set, clear); in spk_ttyio_tiocmset()
294 struct tty_struct *tty = in_synth->dev; in ttyio_in() local
295 struct spk_ldisc_data *ldisc_data = tty->disc_data; in ttyio_in()
315 tty_schedule_flip(tty->port); in ttyio_in()
334 struct tty_struct *tty = in_synth->dev; in spk_ttyio_flush_buffer() local
336 if (tty->ops->flush_buffer) in spk_ttyio_flush_buffer()
337 tty->ops->flush_buffer(tty); in spk_ttyio_flush_buffer()
355 struct tty_struct *tty = in_synth->dev; in spk_ttyio_release() local
357 tty_lock(tty); in spk_ttyio_release()
359 if (tty->ops->close) in spk_ttyio_release()
360 tty->ops->close(tty, NULL); in spk_ttyio_release()
362 tty_ldisc_flush(tty); in spk_ttyio_release()
363 tty_unlock(tty); in spk_ttyio_release()
364 tty_kclose(tty); in spk_ttyio_release()
372 struct tty_struct *tty = in_synth->dev; in spk_ttyio_synth_immediate() local
378 if (tty_write_room(tty) < 1 || in spk_ttyio_synth_immediate()