diff options
author | Alan Cox <alan@linux.intel.com> | 2010-10-18 14:38:02 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2010-10-22 13:20:10 -0400 |
commit | af7f3743567e3d5b40e2f9c21541b7f40b99c103 (patch) | |
tree | d5a8ef131861af6620d3a7947db167f2e0ebe1bf /drivers/serial/8250.c | |
parent | 4e4e66029af090c98cb10fafd13e8dd5039037a9 (diff) |
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/8250.c')
-rw-r--r-- | drivers/serial/8250.c | 17 |
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 = { | |||
2672 | 2672 | ||
2673 | static struct uart_8250_port serial8250_ports[UART_NR]; | 2673 | static struct uart_8250_port serial8250_ports[UART_NR]; |
2674 | 2674 | ||
2675 | static void (*serial8250_isa_config)(int port, struct uart_port *up, | ||
2676 | unsigned short *capabilities); | ||
2677 | |||
2678 | void serial8250_set_isa_configurator( | ||
2679 | void (*v)(int port, struct uart_port *up, unsigned short *capabilities)) | ||
2680 | { | ||
2681 | serial8250_isa_config = v; | ||
2682 | } | ||
2683 | EXPORT_SYMBOL(serial8250_set_isa_configurator); | ||
2684 | |||
2675 | static void __init serial8250_isa_init_ports(void) | 2685 | static void __init serial8250_isa_init_ports(void) |
2676 | { | 2686 | { |
2677 | struct uart_8250_port *up; | 2687 | struct uart_8250_port *up; |
@@ -2717,6 +2727,9 @@ static void __init serial8250_isa_init_ports(void) | |||
2717 | up->port.regshift = old_serial_port[i].iomem_reg_shift; | 2727 | up->port.regshift = old_serial_port[i].iomem_reg_shift; |
2718 | set_io_from_upio(&up->port); | 2728 | set_io_from_upio(&up->port); |
2719 | up->port.irqflags |= irqflag; | 2729 | up->port.irqflags |= irqflag; |
2730 | if (serial8250_isa_config != NULL) | ||
2731 | serial8250_isa_config(i, &up->port, &up->capabilities); | ||
2732 | |||
2720 | } | 2733 | } |
2721 | } | 2734 | } |
2722 | 2735 | ||
@@ -3178,6 +3191,10 @@ int serial8250_register_port(struct uart_port *port) | |||
3178 | if (port->pm) | 3191 | if (port->pm) |
3179 | uart->port.pm = port->pm; | 3192 | uart->port.pm = port->pm; |
3180 | 3193 | ||
3194 | if (serial8250_isa_config != NULL) | ||
3195 | serial8250_isa_config(0, &uart->port, | ||
3196 | &uart->capabilities); | ||
3197 | |||
3181 | ret = uart_add_one_port(&serial8250_reg, &uart->port); | 3198 | ret = uart_add_one_port(&serial8250_reg, &uart->port); |
3182 | if (ret == 0) | 3199 | if (ret == 0) |
3183 | ret = uart->port.line; | 3200 | ret = uart->port.line; |