linux-sh.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] serial: sh-sci: Runtime PM support
@ 2011-04-19 10:38 Magnus Damm
  2011-04-19 22:56 ` Simon Horman
  0 siblings, 1 reply; 2+ messages in thread
From: Magnus Damm @ 2011-04-19 10:38 UTC (permalink / raw)
  To: linux-sh

From: Magnus Damm <damm@opensource.se>

Add support for Runtime PM in the sh-sci driver. 

Signed-off-by: Magnus Damm <damm@opensource.se>
---

 drivers/tty/serial/sh-sci.c |   14 ++++++++++++++
 1 file changed, 14 insertions(+)

--- 0006/drivers/tty/serial/sh-sci.c
+++ work/drivers/tty/serial/sh-sci.c	2011-04-19 18:48:01.000000000 +0900
@@ -43,6 +43,7 @@
 #include <linux/platform_device.h>
 #include <linux/serial_sci.h>
 #include <linux/notifier.h>
+#include <linux/pm_runtime.h>
 #include <linux/cpufreq.h>
 #include <linux/clk.h>
 #include <linux/ctype.h>
@@ -562,6 +563,9 @@ static void sci_break_timer(unsigned lon
 {
 	struct sci_port *port = (struct sci_port *)data;
 
+	if (port->enable)
+		port->enable(&port->port);
+
 	if (sci_rxd_in(&port->port) = 0) {
 		port->break_flag = 1;
 		sci_schedule_break_timer(port);
@@ -571,6 +575,9 @@ static void sci_break_timer(unsigned lon
 		sci_schedule_break_timer(port);
 	} else
 		port->break_flag = 0;
+
+	if (port->disable)
+		port->disable(&port->port);
 }
 
 static int sci_handle_errors(struct uart_port *port)
@@ -839,6 +846,8 @@ static void sci_clk_enable(struct uart_p
 {
 	struct sci_port *sci_port = to_sci_port(port);
 
+	pm_runtime_get_sync(port->dev);
+
 	clk_enable(sci_port->iclk);
 	sci_port->port.uartclk = clk_get_rate(sci_port->iclk);
 	clk_enable(sci_port->fclk);
@@ -850,6 +859,8 @@ static void sci_clk_disable(struct uart_
 
 	clk_disable(sci_port->fclk);
 	clk_disable(sci_port->iclk);
+
+	pm_runtime_put_sync(port->dev);
 }
 
 static int sci_request_irq(struct sci_port *port)
@@ -1758,6 +1769,8 @@ static int __devinit sci_init_single(str
 		sci_port->enable = sci_clk_enable;
 		sci_port->disable = sci_clk_disable;
 		port->dev = &dev->dev;
+
+		pm_runtime_enable(&dev->dev);
 	}
 
 	sci_port->break_timer.data = (unsigned long)sci_port;
@@ -1938,6 +1951,7 @@ static int sci_remove(struct platform_de
 	clk_put(port->iclk);
 	clk_put(port->fclk);
 
+	pm_runtime_disable(&dev->dev);
 	return 0;
 }
 

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] serial: sh-sci: Runtime PM support
  2011-04-19 10:38 [PATCH] serial: sh-sci: Runtime PM support Magnus Damm
@ 2011-04-19 22:56 ` Simon Horman
  0 siblings, 0 replies; 2+ messages in thread
From: Simon Horman @ 2011-04-19 22:56 UTC (permalink / raw)
  To: linux-sh

On Tue, Apr 19, 2011 at 07:38:25PM +0900, Magnus Damm wrote:
> From: Magnus Damm <damm@opensource.se>
> 
> Add support for Runtime PM in the sh-sci driver. 

Hi Magnus,

could you please CC me on runtime-pm changes that are relevant to
hardware blocks on the AG5.

Thanks.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2011-04-19 22:56 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-04-19 10:38 [PATCH] serial: sh-sci: Runtime PM support Magnus Damm
2011-04-19 22:56 ` Simon Horman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).