Greg Kroah-Hartman | b244131 | 2017-11-01 15:07:57 +0100 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0 */ |
William Hubbs | c6e3fd2 | 2010-10-07 13:20:02 -0500 | [diff] [blame] | 2 | #ifndef _SPEAKUP_SERIAL_H |
| 3 | #define _SPEAKUP_SERIAL_H |
| 4 | |
Paul Gortmaker | 4b71598 | 2012-08-20 19:56:28 -0400 | [diff] [blame] | 5 | #include <linux/serial.h> /* for rs_table, serial constants */ |
William Hubbs | c6e3fd2 | 2010-10-07 13:20:02 -0500 | [diff] [blame] | 6 | #include <linux/serial_reg.h> /* for more serial constants */ |
Okash Khawaja | ff59f2a | 2016-03-10 20:21:35 +0000 | [diff] [blame] | 7 | #include <linux/serial_core.h> |
William Hubbs | c6e3fd2 | 2010-10-07 13:20:02 -0500 | [diff] [blame] | 8 | |
Okash Khawaja | 6b9ad1c | 2017-05-15 18:45:35 +0100 | [diff] [blame] | 9 | #include "spk_priv.h" |
| 10 | |
Jiri Slaby | 3ee0017 | 2012-03-05 14:52:11 +0100 | [diff] [blame] | 11 | /* |
| 12 | * this is cut&paste from 8250.h. Get rid of the structure, the definitions |
| 13 | * and this whole broken driver. |
| 14 | */ |
| 15 | struct old_serial_port { |
| 16 | unsigned int uart; /* unused */ |
| 17 | unsigned int baud_base; |
| 18 | unsigned int port; |
| 19 | unsigned int irq; |
Okash Khawaja | ff59f2a | 2016-03-10 20:21:35 +0000 | [diff] [blame] | 20 | upf_t flags; /* unused */ |
Jiri Slaby | 3ee0017 | 2012-03-05 14:52:11 +0100 | [diff] [blame] | 21 | }; |
| 22 | |
William Hubbs | c6e3fd2 | 2010-10-07 13:20:02 -0500 | [diff] [blame] | 23 | /* countdown values for serial timeouts in us */ |
Okash Khawaja | 6b9ad1c | 2017-05-15 18:45:35 +0100 | [diff] [blame] | 24 | #define SPK_SERIAL_TIMEOUT SPK_SYNTH_TIMEOUT |
William Hubbs | c6e3fd2 | 2010-10-07 13:20:02 -0500 | [diff] [blame] | 25 | /* countdown values transmitter/dsr timeouts in us */ |
| 26 | #define SPK_XMITR_TIMEOUT 100000 |
| 27 | /* countdown values cts timeouts in us */ |
| 28 | #define SPK_CTS_TIMEOUT 100000 |
| 29 | /* check ttyS0 ... ttyS3 */ |
| 30 | #define SPK_LO_TTY 0 |
| 31 | #define SPK_HI_TTY 3 |
| 32 | /* # of timeouts permitted before disable */ |
| 33 | #define NUM_DISABLE_TIMEOUTS 3 |
| 34 | /* buffer timeout in ms */ |
| 35 | #define SPK_TIMEOUT 100 |
| 36 | #define BOTH_EMPTY (UART_LSR_TEMT | UART_LSR_THRE) |
| 37 | |
Shirish Gajera | 63b8ebe | 2015-03-28 13:21:39 -0700 | [diff] [blame] | 38 | #define spk_serial_tx_busy() \ |
| 39 | ((inb(speakup_info.port_tts + UART_LSR) & BOTH_EMPTY) != BOTH_EMPTY) |
William Hubbs | c6e3fd2 | 2010-10-07 13:20:02 -0500 | [diff] [blame] | 40 | |
William Hubbs | c6e3fd2 | 2010-10-07 13:20:02 -0500 | [diff] [blame] | 41 | #endif |