summaryrefslogtreecommitdiff
path: root/drivers/tty
diff options
context:
space:
mode:
authorHuang Shijie <b32955@freescale.com>2012-05-02 15:48:45 +0800
committerJason Liu <r64343@freescale.com>2012-07-20 13:36:58 +0800
commit1028fee6ef1f2dc137d563760f8ebf5cb024444f (patch)
treecdb48f8bfde5c0e1e34272d16d085950b4f47411 /drivers/tty
parente06bd223b1f5b8590cd5dcb741ba4c8b4a88c0f2 (diff)
ENGR00175578 serial/imx : disable the clock when the uart is not used
Disable the clock when the uart port is not used. Signed-off-by: Huang Shijie <b32955@freescale.com>
Diffstat (limited to 'drivers/tty')
-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 a2a33fb815ca..9a6e8b60223d 100644
--- a/drivers/tty/serial/imx.c
+++ b/drivers/tty/serial/imx.c
@@ -932,6 +932,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
@@ -1162,6 +1164,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
@@ -1708,6 +1711,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)
@@ -1737,8 +1741,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);