summary refs log tree commit diff
path: root/drivers/serial
diff options
context:
space:
mode:
authorAlan Cox <alan@linux.intel.com>2010-10-18 11:38:02 -0700
committerGreg Kroah-Hartman <gregkh@suse.de>2010-10-22 10:20:10 -0700
commitaf7f3743567e3d5b40e2f9c21541b7f40b99c103 (patch)
treed5a8ef131861af6620d3a7947db167f2e0ebe1bf /drivers/serial
parent4e4e66029af090c98cb10fafd13e8dd5039037a9 (diff)
downloadlinux-af7f3743567e3d5b40e2f9c21541b7f40b99c103.tar.gz
serial: abstraction for 8250 legacy ports
Not every platform that has generic legacy 8250 ports manages to have them
clocked the right way or without errata. Provide a generic interface to
allow platforms to override the default behaviour in a manner that dumps
the complexity in *their* code not the 8250 driver.

Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Dirk Brandewie <dirk.brandewie@gmail.com>
Acked-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

Diffstat (limited to 'drivers/serial')
-rw-r--r--drivers/serial/8250.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/drivers/serial/8250.c b/drivers/serial/8250.c
index 6994afb5571a..37f19a678c97 100644
--- a/drivers/serial/8250.c
+++ b/drivers/serial/8250.c
@@ -2672,6 +2672,16 @@ static struct uart_ops serial8250_pops = {
 
 static struct uart_8250_port serial8250_ports[UART_NR];
 
+static void (*serial8250_isa_config)(int port, struct uart_port *up,
+	unsigned short *capabilities);
+
+void serial8250_set_isa_configurator(
+	void (*v)(int port, struct uart_port *up, unsigned short *capabilities))
+{
+	serial8250_isa_config = v;
+}
+EXPORT_SYMBOL(serial8250_set_isa_configurator);
+
 static void __init serial8250_isa_init_ports(void)
 {
 	struct uart_8250_port *up;
@@ -2717,6 +2727,9 @@ static void __init serial8250_isa_init_ports(void)
 		up->port.regshift = old_serial_port[i].iomem_reg_shift;
 		set_io_from_upio(&up->port);
 		up->port.irqflags |= irqflag;
+		if (serial8250_isa_config != NULL)
+			serial8250_isa_config(i, &up->port, &up->capabilities);
+
 	}
 }
 
@@ -3178,6 +3191,10 @@ int serial8250_register_port(struct uart_port *port)
 		if (port->pm)
 			uart->port.pm = port->pm;
 
+		if (serial8250_isa_config != NULL)
+			serial8250_isa_config(0, &uart->port,
+					&uart->capabilities);
+
 		ret = uart_add_one_port(&serial8250_reg, &uart->port);
 		if (ret == 0)
 			ret = uart->port.line;