aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authordmitry pervushin <dimka@nomadgs.com>2007-04-24 00:41:12 -0400
committerPaul Mundt <lethal@hera.kernel.org>2007-05-06 22:11:56 -0400
commit1534a3b3dc1cbab006f0add253be1b095d738b82 (patch)
tree198327387726950113863d60ecc19aaf63680218 /drivers
parent1929cb340b74904c130fdf3de3fe5bbedb68a5aa (diff)
serial: sh-sci: Fix module clock refcounting.
This adds the enable/disable hooks for the port clock to sh-sci. Signed-off-by: dmitry pervushin <dimka@nomadgs.com> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/serial/sh-sci.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/drivers/serial/sh-sci.c b/drivers/serial/sh-sci.c
index 0a34fa9e0733..e5cf57f482cf 100644
--- a/drivers/serial/sh-sci.c
+++ b/drivers/serial/sh-sci.c
@@ -77,6 +77,9 @@ struct sci_port {
77 /* Break timer */ 77 /* Break timer */
78 struct timer_list break_timer; 78 struct timer_list break_timer;
79 int break_flag; 79 int break_flag;
80
81 /* Port clock */
82 struct clk *clk;
80}; 83};
81 84
82#ifdef CONFIG_SH_KGDB 85#ifdef CONFIG_SH_KGDB
@@ -955,6 +958,8 @@ static int sci_startup(struct uart_port *port)
955 if (s->enable) 958 if (s->enable)
956 s->enable(port); 959 s->enable(port);
957 960
961 s->clk = clk_get(NULL, "module_clk");
962
958 sci_request_irq(s); 963 sci_request_irq(s);
959 sci_start_tx(port); 964 sci_start_tx(port);
960 sci_start_rx(port, 1); 965 sci_start_rx(port, 1);
@@ -972,6 +977,9 @@ static void sci_shutdown(struct uart_port *port)
972 977
973 if (s->disable) 978 if (s->disable)
974 s->disable(port); 979 s->disable(port);
980
981 clk_put(s->clk);
982 s->clk = NULL;
975} 983}
976 984
977static void sci_set_termios(struct uart_port *port, struct ktermios *termios, 985static void sci_set_termios(struct uart_port *port, struct ktermios *termios,
@@ -990,9 +998,7 @@ static void sci_set_termios(struct uart_port *port, struct ktermios *termios,
990 default: 998 default:
991 { 999 {
992#if defined(CONFIG_SUPERH) && !defined(CONFIG_SUPERH64) 1000#if defined(CONFIG_SUPERH) && !defined(CONFIG_SUPERH64)
993 struct clk *clk = clk_get(NULL, "module_clk"); 1001 t = SCBRR_VALUE(baud, clk_get_rate(s->clk));
994 t = SCBRR_VALUE(baud, clk_get_rate(clk));
995 clk_put(clk);
996#else 1002#else
997 t = SCBRR_VALUE(baud); 1003 t = SCBRR_VALUE(baud);
998#endif 1004#endif