summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorHuang Shijie <b32955@freescale.com>2012-05-02 15:48:45 +0800
committerNitin Garg <nitin.garg@freescale.com>2012-06-07 12:37:58 -0500
commit6ca84c532be3be8c1f7c0cab03c62004c102fc51 (patch)
treebe4adae85845ada77ec55737363f4698fd0b1c7a /drivers
parentcd47338f98d9a6e779ae54824e33d05a96463b0e (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')
-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 4cb727056a55..f376458ae3bc 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);