diff options
author | Russell King <rmk@dyn-67.arm.linux.org.uk> | 2008-09-01 21:47:59 +0100 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2008-09-05 17:02:28 +0100 |
commit | f2eda27d1cd218f6544cd9367be47fb01c70a95d (patch) | |
tree | cbdb1ae3e2c41c7f4f4170ea51f71cbd29253bbc /drivers/serial | |
parent | 5668545a08c80e0d9dc325bd6c79028b19227e5d (diff) | |
download | kernel-common-f2eda27d1cd218f6544cd9367be47fb01c70a95d.tar.gz kernel-common-f2eda27d1cd218f6544cd9367be47fb01c70a95d.tar.bz2 kernel-common-f2eda27d1cd218f6544cd9367be47fb01c70a95d.zip |
[SERIAL] 8250: serial8250_port_size() - omap ports are larger
A function to contain common code for the size of the resource we
need to allocate or free. OMAP ports need 22 bytes rather than
the standard 8 bytes.
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'drivers/serial')
-rw-r--r-- | drivers/serial/8250.c | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/drivers/serial/8250.c b/drivers/serial/8250.c index 47a60960bb1c..8058533f8418 100644 --- a/drivers/serial/8250.c +++ b/drivers/serial/8250.c @@ -2211,7 +2211,7 @@ serial8250_set_termios(struct uart_port *port, struct ktermios *termios, serial_outp(up, UART_EFR, efr); } -#ifdef CONFIG_ARCH_OMAP15XX +#ifdef CONFIG_ARCH_OMAP /* Workaround to enable 115200 baud on OMAP1510 internal ports */ if (cpu_is_omap1510() && is_omap_port(up)) { if (baud == 115200) { @@ -2266,18 +2266,27 @@ serial8250_pm(struct uart_port *port, unsigned int state, p->pm(port, state, oldstate); } +static unsigned int serial8250_port_size(struct uart_8250_port *pt) +{ + if (pt->port.iotype == UPIO_AU) + return 0x100000; +#ifdef CONFIG_ARCH_OMAP + if (is_omap_port(pt)) + return 0x16 << pt->port.regshift; +#endif + return 8 << pt->port.regshift; +} + /* * Resource handling. */ static int serial8250_request_std_resource(struct uart_8250_port *up) { - unsigned int size = 8 << up->port.regshift; + unsigned int size = serial8250_port_size(up); int ret = 0; switch (up->port.iotype) { case UPIO_AU: - size = 0x100000; - /* fall thru */ case UPIO_TSI: case UPIO_MEM32: case UPIO_MEM: @@ -2311,12 +2320,10 @@ static int serial8250_request_std_resource(struct uart_8250_port *up) static void serial8250_release_std_resource(struct uart_8250_port *up) { - unsigned int size = 8 << up->port.regshift; + unsigned int size = serial8250_port_size(up); switch (up->port.iotype) { case UPIO_AU: - size = 0x100000; - /* fall thru */ case UPIO_TSI: case UPIO_MEM32: case UPIO_MEM: |