blob: 1b399214ecf7361ef5cf1ad83c650d0fb1bbc296 [file] [log] [blame]
William Hubbsc6e3fd22010-10-07 13:20:02 -05001#ifndef _SPEAKUP_SERIAL_H
2#define _SPEAKUP_SERIAL_H
3
Paul Gortmaker4b715982012-08-20 19:56:28 -04004#include <linux/serial.h> /* for rs_table, serial constants */
William Hubbsc6e3fd22010-10-07 13:20:02 -05005#include <linux/serial_reg.h> /* for more serial constants */
William Hubbsc6e3fd22010-10-07 13:20:02 -05006#ifndef __sparc__
Melike Yurtogluf79b0d92014-10-01 01:24:01 +03007#include <linux/serial.h>
William Hubbsc6e3fd22010-10-07 13:20:02 -05008#endif
9
Jiri Slaby3ee00172012-03-05 14:52:11 +010010/*
11 * this is cut&paste from 8250.h. Get rid of the structure, the definitions
12 * and this whole broken driver.
13 */
14struct old_serial_port {
15 unsigned int uart; /* unused */
16 unsigned int baud_base;
17 unsigned int port;
18 unsigned int irq;
19 unsigned int flags; /* unused */
20};
21
William Hubbsc6e3fd22010-10-07 13:20:02 -050022/* countdown values for serial timeouts in us */
23#define SPK_SERIAL_TIMEOUT 100000
24/* countdown values transmitter/dsr timeouts in us */
25#define SPK_XMITR_TIMEOUT 100000
26/* countdown values cts timeouts in us */
27#define SPK_CTS_TIMEOUT 100000
28/* check ttyS0 ... ttyS3 */
29#define SPK_LO_TTY 0
30#define SPK_HI_TTY 3
31/* # of timeouts permitted before disable */
32#define NUM_DISABLE_TIMEOUTS 3
33/* buffer timeout in ms */
34#define SPK_TIMEOUT 100
35#define BOTH_EMPTY (UART_LSR_TEMT | UART_LSR_THRE)
36
Shirish Gajera63b8ebe2015-03-28 13:21:39 -070037#define spk_serial_tx_busy() \
38 ((inb(speakup_info.port_tts + UART_LSR) & BOTH_EMPTY) != BOTH_EMPTY)
William Hubbsc6e3fd22010-10-07 13:20:02 -050039
William Hubbsc6e3fd22010-10-07 13:20:02 -050040#endif