summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHuang Shijie <b32955@freescale.com>2012-05-09 11:36:29 +0800
committerXinyu Chen <xinyu.chen@freescale.com>2012-05-21 15:11:24 +0800
commit5978ebd2aaf42600253caffa392d53c74e9e8f2e (patch)
treee00c28decad6118b4687c2bef635fc30b44fb090
parentc3faf51d80911d8b4e2a27d95fe58b9f3ce30817 (diff)
ENGR00182346-1 serial/imx : disable the clock when the uart is not used
This patch is just the re-revert of the commit:ENGR00182048 Disable the clock when the uart port is not used. Signed-off-by: Huang Shijie <b32955@freescale.com>
-rw-r--r--drivers/tty/serial/imx.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/tty/serial/imx.c b/drivers/tty/serial/imx.c
index d65c589cef60..781e11f5cf34 100644
--- a/drivers/tty/serial/imx.c
+++ b/drivers/tty/serial/imx.c
@@ -934,6 +934,8 @@ static int imx_startup(struct uart_port *port)
unsigned long flags, temp;
struct tty_struct *tty;
+ clk_enable(sport->clk);
+
#ifndef CONFIG_SERIAL_CORE_CONSOLE
imx_setup_ufcr(sport, 0);
#endif
@@ -1164,6 +1166,7 @@ static void imx_shutdown(struct uart_port *port)
writel(temp, sport->port.membase + UCR4);
}
spin_unlock_irqrestore(&sport->port.lock, flags);
+ clk_disable(sport->clk);
}
static void
@@ -1701,6 +1704,7 @@ static int serial_imx_probe(struct platform_device *pdev)
goto deinit;
platform_set_drvdata(pdev, &sport->port);
+ clk_disable(sport->clk);
return 0;
deinit:
if (pdata && pdata->exit)
@@ -1730,8 +1734,6 @@ static int serial_imx_remove(struct platform_device *pdev)
clk_put(sport->clk);
}
- clk_disable(sport->clk);
-
if (pdata && pdata->exit)
pdata->exit(pdev);