diff options
author | Michael O'Reilly <m@dgmo.org> | 2013-04-17 10:10:44 +0530 |
---|---|---|
committer | Tushar Behera <tushar.behera@linaro.org> | 2013-06-19 16:52:56 +0530 |
commit | 99c62771c652c021e5b6f56eb309915fb414f5d5 (patch) | |
tree | 340d3ecfdaf03a5d6fd2255c226c2333f6c1e66a | |
parent | c5b59c31de7754fcf32f7feb05ddc6a976da84a9 (diff) |
serial: Samsung: Release interrupts on shutdown
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 b9d30a79cd2..d349756dd45 100644 --- a/drivers/tty/serial/samsung.c +++ b/drivers/tty/serial/samsung.c @@ -528,6 +528,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, @@ -1128,8 +1150,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; |