diff options
Diffstat (limited to 'drivers/serial/8250.c')
-rw-r--r-- | drivers/serial/8250.c | 39 |
1 files changed, 27 insertions, 12 deletions
diff --git a/drivers/serial/8250.c b/drivers/serial/8250.c index 342e12fb1c25..8058533f8418 100644 --- a/drivers/serial/8250.c +++ b/drivers/serial/8250.c | |||
@@ -1908,15 +1908,23 @@ static int serial8250_startup(struct uart_port *port) | |||
1908 | * kick the UART on a regular basis. | 1908 | * kick the UART on a regular basis. |
1909 | */ | 1909 | */ |
1910 | if (!(iir1 & UART_IIR_NO_INT) && (iir & UART_IIR_NO_INT)) { | 1910 | if (!(iir1 & UART_IIR_NO_INT) && (iir & UART_IIR_NO_INT)) { |
1911 | up->bugs |= UART_BUG_THRE; | ||
1911 | pr_debug("ttyS%d - using backup timer\n", port->line); | 1912 | pr_debug("ttyS%d - using backup timer\n", port->line); |
1912 | up->timer.function = serial8250_backup_timeout; | ||
1913 | up->timer.data = (unsigned long)up; | ||
1914 | mod_timer(&up->timer, jiffies + | ||
1915 | poll_timeout(up->port.timeout) + HZ / 5); | ||
1916 | } | 1913 | } |
1917 | } | 1914 | } |
1918 | 1915 | ||
1919 | /* | 1916 | /* |
1917 | * The above check will only give an accurate result the first time | ||
1918 | * the port is opened so this value needs to be preserved. | ||
1919 | */ | ||
1920 | if (up->bugs & UART_BUG_THRE) { | ||
1921 | up->timer.function = serial8250_backup_timeout; | ||
1922 | up->timer.data = (unsigned long)up; | ||
1923 | mod_timer(&up->timer, jiffies + | ||
1924 | poll_timeout(up->port.timeout) + HZ / 5); | ||
1925 | } | ||
1926 | |||
1927 | /* | ||
1920 | * If the "interrupt" for this port doesn't correspond with any | 1928 | * If the "interrupt" for this port doesn't correspond with any |
1921 | * hardware interrupt, we use a timer-based system. The original | 1929 | * hardware interrupt, we use a timer-based system. The original |
1922 | * driver used to do this with IRQ0. | 1930 | * driver used to do this with IRQ0. |
@@ -2203,9 +2211,9 @@ serial8250_set_termios(struct uart_port *port, struct ktermios *termios, | |||
2203 | serial_outp(up, UART_EFR, efr); | 2211 | serial_outp(up, UART_EFR, efr); |
2204 | } | 2212 | } |
2205 | 2213 | ||
2206 | #ifdef CONFIG_ARCH_OMAP15XX | 2214 | #ifdef CONFIG_ARCH_OMAP |
2207 | /* Workaround to enable 115200 baud on OMAP1510 internal ports */ | 2215 | /* Workaround to enable 115200 baud on OMAP1510 internal ports */ |
2208 | if (cpu_is_omap1510() && is_omap_port((unsigned int)up->port.membase)) { | 2216 | if (cpu_is_omap1510() && is_omap_port(up)) { |
2209 | if (baud == 115200) { | 2217 | if (baud == 115200) { |
2210 | quot = 1; | 2218 | quot = 1; |
2211 | serial_out(up, UART_OMAP_OSC_12M_SEL, 1); | 2219 | serial_out(up, UART_OMAP_OSC_12M_SEL, 1); |
@@ -2258,18 +2266,27 @@ serial8250_pm(struct uart_port *port, unsigned int state, | |||
2258 | p->pm(port, state, oldstate); | 2266 | p->pm(port, state, oldstate); |
2259 | } | 2267 | } |
2260 | 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 | |||
2261 | /* | 2280 | /* |
2262 | * Resource handling. | 2281 | * Resource handling. |
2263 | */ | 2282 | */ |
2264 | static int serial8250_request_std_resource(struct uart_8250_port *up) | 2283 | static int serial8250_request_std_resource(struct uart_8250_port *up) |
2265 | { | 2284 | { |
2266 | unsigned int size = 8 << up->port.regshift; | 2285 | unsigned int size = serial8250_port_size(up); |
2267 | int ret = 0; | 2286 | int ret = 0; |
2268 | 2287 | ||
2269 | switch (up->port.iotype) { | 2288 | switch (up->port.iotype) { |
2270 | case UPIO_AU: | 2289 | case UPIO_AU: |
2271 | size = 0x100000; | ||
2272 | /* fall thru */ | ||
2273 | case UPIO_TSI: | 2290 | case UPIO_TSI: |
2274 | case UPIO_MEM32: | 2291 | case UPIO_MEM32: |
2275 | case UPIO_MEM: | 2292 | case UPIO_MEM: |
@@ -2303,12 +2320,10 @@ static int serial8250_request_std_resource(struct uart_8250_port *up) | |||
2303 | 2320 | ||
2304 | static void serial8250_release_std_resource(struct uart_8250_port *up) | 2321 | static void serial8250_release_std_resource(struct uart_8250_port *up) |
2305 | { | 2322 | { |
2306 | unsigned int size = 8 << up->port.regshift; | 2323 | unsigned int size = serial8250_port_size(up); |
2307 | 2324 | ||
2308 | switch (up->port.iotype) { | 2325 | switch (up->port.iotype) { |
2309 | case UPIO_AU: | 2326 | case UPIO_AU: |
2310 | size = 0x100000; | ||
2311 | /* fall thru */ | ||
2312 | case UPIO_TSI: | 2327 | case UPIO_TSI: |
2313 | case UPIO_MEM32: | 2328 | case UPIO_MEM32: |
2314 | case UPIO_MEM: | 2329 | case UPIO_MEM: |