TTY: speakup, do not use serialP

The structures there are going away. And speakup has enough troubles
already.

So define a structure similar to what 8250 does: old_serial_port.
There define an array of speed, port base and so on needed for
configuration. Then use this structure instead of serial_state defined
in serialP.h.

Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Cc: William Hubbs <w.d.hubbs@gmail.com>
Cc: Chris Brannon <chris@the-brannons.com>
Cc: Kirk Reiser <kirk@braille.uwo.ca>
Cc: Samuel Thibault <samuel.thibault@ens-lyon.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
Jiri Slaby 2012-03-05 14:52:11 +01:00 committed by Greg Kroah-Hartman
parent 11ba8899f9
commit 3ee0017e03
4 changed files with 19 additions and 9 deletions

View File

@ -8,21 +8,20 @@
static void start_serial_interrupt(int irq); static void start_serial_interrupt(int irq);
static struct serial_state rs_table[] = { static const struct old_serial_port rs_table[] = {
SERIAL_PORT_DFNS SERIAL_PORT_DFNS
}; };
static struct serial_state *serstate; static const struct old_serial_port *serstate;
static int timeouts; static int timeouts;
struct serial_state *spk_serial_init(int index) const struct old_serial_port *spk_serial_init(int index)
{ {
int baud = 9600, quot = 0; int baud = 9600, quot = 0;
unsigned int cval = 0; unsigned int cval = 0;
int cflag = CREAD | HUPCL | CLOCAL | B9600 | CS8; int cflag = CREAD | HUPCL | CLOCAL | B9600 | CS8;
struct serial_state *ser = NULL; const struct old_serial_port *ser = rs_table + index;
int err; int err;
ser = rs_table + index;
/* Divisor, bytesize and parity */ /* Divisor, bytesize and parity */
quot = ser->baud_base / baud; quot = ser->baud_base / baud;
cval = cflag & (CSIZE | CSTOPB); cval = cflag & (CSIZE | CSTOPB);
@ -41,7 +40,7 @@ struct serial_state *spk_serial_init(int index)
__release_region(&ioport_resource, ser->port, 8); __release_region(&ioport_resource, ser->port, 8);
err = synth_request_region(ser->port, 8); err = synth_request_region(ser->port, 8);
if (err) { if (err) {
pr_warn("Unable to allocate port at %lx, errno %i", pr_warn("Unable to allocate port at %x, errno %i",
ser->port, err); ser->port, err);
return NULL; return NULL;
} }

View File

@ -4,11 +4,22 @@
#include <linux/serial.h> /* for rs_table, serial constants & #include <linux/serial.h> /* for rs_table, serial constants &
serial_uart_config */ serial_uart_config */
#include <linux/serial_reg.h> /* for more serial constants */ #include <linux/serial_reg.h> /* for more serial constants */
#include <linux/serialP.h> /* for struct serial_state */
#ifndef __sparc__ #ifndef __sparc__
#include <asm/serial.h> #include <asm/serial.h>
#endif #endif
/*
* this is cut&paste from 8250.h. Get rid of the structure, the definitions
* and this whole broken driver.
*/
struct old_serial_port {
unsigned int uart; /* unused */
unsigned int baud_base;
unsigned int port;
unsigned int irq;
unsigned int flags; /* unused */
};
/* countdown values for serial timeouts in us */ /* countdown values for serial timeouts in us */
#define SPK_SERIAL_TIMEOUT 100000 #define SPK_SERIAL_TIMEOUT 100000
/* countdown values transmitter/dsr timeouts in us */ /* countdown values transmitter/dsr timeouts in us */

View File

@ -44,7 +44,7 @@
#define KT_SPKUP 15 #define KT_SPKUP 15
extern struct serial_state *spk_serial_init(int index); extern const struct old_serial_port *spk_serial_init(int index);
extern void stop_serial_interrupt(void); extern void stop_serial_interrupt(void);
extern int wait_for_xmitr(void); extern int wait_for_xmitr(void);
extern unsigned char spk_serial_in(void); extern unsigned char spk_serial_in(void);

View File

@ -34,7 +34,7 @@ static int do_synth_init(struct spk_synth *in_synth);
int serial_synth_probe(struct spk_synth *synth) int serial_synth_probe(struct spk_synth *synth)
{ {
struct serial_state *ser; const struct old_serial_port *ser;
int failed = 0; int failed = 0;
if ((synth->ser >= SPK_LO_TTY) && (synth->ser <= SPK_HI_TTY)) { if ((synth->ser >= SPK_LO_TTY) && (synth->ser <= SPK_HI_TTY)) {