mirror of
https://github.com/followmsi/android_kernel_google_msm.git
synced 2024-09-22 04:32:41 +00:00
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>
This commit is contained in:
parent
1929cb340b
commit
1534a3b3dc
1 changed files with 9 additions and 3 deletions
|
@ -77,6 +77,9 @@ struct sci_port {
|
||||||
/* Break timer */
|
/* Break timer */
|
||||||
struct timer_list break_timer;
|
struct timer_list break_timer;
|
||||||
int break_flag;
|
int break_flag;
|
||||||
|
|
||||||
|
/* Port clock */
|
||||||
|
struct clk *clk;
|
||||||
};
|
};
|
||||||
|
|
||||||
#ifdef CONFIG_SH_KGDB
|
#ifdef CONFIG_SH_KGDB
|
||||||
|
@ -955,6 +958,8 @@ static int sci_startup(struct uart_port *port)
|
||||||
if (s->enable)
|
if (s->enable)
|
||||||
s->enable(port);
|
s->enable(port);
|
||||||
|
|
||||||
|
s->clk = clk_get(NULL, "module_clk");
|
||||||
|
|
||||||
sci_request_irq(s);
|
sci_request_irq(s);
|
||||||
sci_start_tx(port);
|
sci_start_tx(port);
|
||||||
sci_start_rx(port, 1);
|
sci_start_rx(port, 1);
|
||||||
|
@ -972,6 +977,9 @@ static void sci_shutdown(struct uart_port *port)
|
||||||
|
|
||||||
if (s->disable)
|
if (s->disable)
|
||||||
s->disable(port);
|
s->disable(port);
|
||||||
|
|
||||||
|
clk_put(s->clk);
|
||||||
|
s->clk = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void sci_set_termios(struct uart_port *port, struct ktermios *termios,
|
static 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,
|
||||||
default:
|
default:
|
||||||
{
|
{
|
||||||
#if defined(CONFIG_SUPERH) && !defined(CONFIG_SUPERH64)
|
#if defined(CONFIG_SUPERH) && !defined(CONFIG_SUPERH64)
|
||||||
struct clk *clk = clk_get(NULL, "module_clk");
|
t = SCBRR_VALUE(baud, clk_get_rate(s->clk));
|
||||||
t = SCBRR_VALUE(baud, clk_get_rate(clk));
|
|
||||||
clk_put(clk);
|
|
||||||
#else
|
#else
|
||||||
t = SCBRR_VALUE(baud);
|
t = SCBRR_VALUE(baud);
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in a new issue