From 77ce1cd1b9dbb5d070183a4f8e3c13ffb676baf7 Mon Sep 17 00:00:00 2001 From: Huang Shijie Date: Wed, 9 May 2012 11:36:29 +0800 Subject: [PATCH] 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 --- drivers/tty/serial/imx.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/tty/serial/imx.c b/drivers/tty/serial/imx.c index 44564e3fcdbe..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); -- 2.39.5