diff options
author | Huang Shijie <b32955@freescale.com> | 2012-05-09 11:36:29 +0800 |
---|---|---|
committer | Nitin Garg <nitin.garg@freescale.com> | 2012-06-07 12:38:58 -0500 |
commit | e80836e63ee58d8cb31750cc11618de0e0f8f8fb (patch) | |
tree | 2d7c363ab5b5d1897062c2a403bafb23b7893c1a | |
parent | 03f80efd6a7480bdee3c9c69507916feb8745168 (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.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/tty/serial/imx.c b/drivers/tty/serial/imx.c index d3075e55b116..beba18533371 100644 --- a/drivers/tty/serial/imx.c +++ b/drivers/tty/serial/imx.c @@ -959,6 +959,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 @@ -1189,6 +1191,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 @@ -1803,6 +1806,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) @@ -1832,8 +1836,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); @@ -1869,7 +1871,6 @@ static int __init imx_serial_init(void) if (ret != 0) uart_unregister_driver(&imx_reg); - printk(KERN_INFO "Serial: IMX driver done\n"); return 0; } |