diff options
author | Michael O'Reilly <m@dgmo.org> | 2013-04-17 10:10:44 +0530 |
---|---|---|
committer | Tushar Behera <tushar.behera@linaro.org> | 2013-04-17 10:36:03 +0530 |
commit | 50fc7f8001eaf06f459f7ea07bfcdb3f875ab372 (patch) | |
tree | bb45ba5318a9a3bdf0703441dcacefa9113f1dd3 | |
parent | 8eb9c669c037099a0ef7819fe4787efffe484122 (diff) |
serial: Samsung: Release interrupts on shutdowntracking-samslt-all-ll-20130418.0tracking-samslt-all-ll-20130417.0samsung-lt-v3.9-rc7-1
The serial driver never releases the interrupt on shutdown, but it does
repeatedly acquire it on startup.
$ cat /proc/interrupts
85: 69 0 GIC exynos4210-uart.2, exynos4210-uart.2, exynos4210-uart.2
Signed-off-by: Michael O'Reilly <m@dgmo.org>
Signed-off-by: Tushar Behera <tushar.behera@linaro.org>
-rw-r--r-- | drivers/tty/serial/samsung.c | 26 |
1 files changed, 25 insertions, 1 deletions
diff --git a/drivers/tty/serial/samsung.c b/drivers/tty/serial/samsung.c index 339951a6e7ea..fb4ebae095d9 100644 --- a/drivers/tty/serial/samsung.c +++ b/drivers/tty/serial/samsung.c @@ -524,6 +524,28 @@ static int s3c64xx_serial_startup(struct uart_port *port) return ret; } +static void s3c64xx_serial_shutdown(struct uart_port *port) +{ + struct s3c24xx_uart_port *ourport = to_ourport(port); + + if (ourport->tx_claimed) { + free_irq(port->irq, ourport); + tx_enabled(port) = 0; + ourport->tx_claimed = 0; + } + + if (ourport->rx_claimed) { + ourport->rx_claimed = 0; + rx_enabled(port) = 0; + } + + /* Clear pending interrupts and mask all interrupts */ + if (s3c24xx_serial_has_interrupt_mask(port)) { + wr_regl(port, S3C64XX_UINTP, 0xf); + wr_regl(port, S3C64XX_UINTM, 0xf); + } +} + /* power power management control */ static void s3c24xx_serial_pm(struct uart_port *port, unsigned int level, @@ -1124,8 +1146,10 @@ static int s3c24xx_serial_init_port(struct s3c24xx_uart_port *ourport, port->dev = &platdev->dev; /* Startup sequence is different for s3c64xx and higher SoC's */ - if (s3c24xx_serial_has_interrupt_mask(port)) + if (s3c24xx_serial_has_interrupt_mask(port)) { s3c24xx_serial_ops.startup = s3c64xx_serial_startup; + s3c24xx_serial_ops.shutdown = s3c64xx_serial_shutdown; + } port->uartclk = 1; |