diff options
author | Russell King <rmk@dyn-67.arm.linux.org.uk> | 2008-09-01 16:47:59 -0400 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2008-09-05 12:02:28 -0400 |
commit | f2eda27d1cd218f6544cd9367be47fb01c70a95d (patch) | |
tree | cbdb1ae3e2c41c7f4f4170ea51f71cbd29253bbc /drivers | |
parent | 5668545a08c80e0d9dc325bd6c79028b19227e5d (diff) |
[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')
-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, | |||
2211 | serial_outp(up, UART_EFR, efr); | 2211 | serial_outp(up, UART_EFR, efr); |
2212 | } | 2212 | } |
2213 | 2213 | ||
2214 | #ifdef CONFIG_ARCH_OMAP15XX | 2214 | #ifdef CONFIG_ARCH_OMAP |
2215 | /* Workaround to enable 115200 baud on OMAP1510 internal ports */ | 2215 | /* Workaround to enable 115200 baud on OMAP1510 internal ports */ |
2216 | if (cpu_is_omap1510() && is_omap_port(up)) { | 2216 | if (cpu_is_omap1510() && is_omap_port(up)) { |
2217 | if (baud == 115200) { | 2217 | if (baud == 115200) { |
@@ -2266,18 +2266,27 @@ serial8250_pm(struct uart_port *port, unsigned int state, | |||
2266 | p->pm(port, state, oldstate); | 2266 | p->pm(port, state, oldstate); |
2267 | } | 2267 | } |
2268 | 2268 | ||
2269 | static unsigned int serial8250_port_size(struct uart_8250_port *pt) | ||
2270 | { | ||
2271 | if (pt->port.iotype == UPIO_AU) | ||
2272 | return 0x100000; | ||
2273 | #ifdef CONFIG_ARCH_OMAP | ||
2274 | if (is_omap_port(pt)) | ||
2275 | return 0x16 << pt->port.regshift; | ||
2276 | #endif | ||
2277 | return 8 << pt->port.regshift; | ||
2278 | } | ||
2279 | |||
2269 | /* | 2280 | /* |
2270 | * Resource handling. | 2281 | * Resource handling. |
2271 | */ | 2282 | */ |
2272 | static int serial8250_request_std_resource(struct uart_8250_port *up) | 2283 | static int serial8250_request_std_resource(struct uart_8250_port *up) |
2273 | { | 2284 | { |
2274 | unsigned int size = 8 << up->port.regshift; | 2285 | unsigned int size = serial8250_port_size(up); |
2275 | int ret = 0; | 2286 | int ret = 0; |
2276 | 2287 | ||
2277 | switch (up->port.iotype) { | 2288 | switch (up->port.iotype) { |
2278 | case UPIO_AU: | 2289 | case UPIO_AU: |
2279 | size = 0x100000; | ||
2280 | /* fall thru */ | ||
2281 | case UPIO_TSI: | 2290 | case UPIO_TSI: |
2282 | case UPIO_MEM32: | 2291 | case UPIO_MEM32: |
2283 | case UPIO_MEM: | 2292 | case UPIO_MEM: |
@@ -2311,12 +2320,10 @@ static int serial8250_request_std_resource(struct uart_8250_port *up) | |||
2311 | 2320 | ||
2312 | static void serial8250_release_std_resource(struct uart_8250_port *up) | 2321 | static void serial8250_release_std_resource(struct uart_8250_port *up) |
2313 | { | 2322 | { |
2314 | unsigned int size = 8 << up->port.regshift; | 2323 | unsigned int size = serial8250_port_size(up); |
2315 | 2324 | ||
2316 | switch (up->port.iotype) { | 2325 | switch (up->port.iotype) { |
2317 | case UPIO_AU: | 2326 | case UPIO_AU: |
2318 | size = 0x100000; | ||
2319 | /* fall thru */ | ||
2320 | case UPIO_TSI: | 2327 | case UPIO_TSI: |
2321 | case UPIO_MEM32: | 2328 | case UPIO_MEM32: |
2322 | case UPIO_MEM: | 2329 | case UPIO_MEM: |