Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 120130
b: refs/heads/master
c: 027e687
h: refs/heads/master
v: v3
  • Loading branch information
Paul Mundt committed Dec 22, 2008
1 parent 23586d5 commit 02071ea
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 29 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: d9341b51f28a5eb4ce231f4a3bbfa02aaecae626
refs/heads/master: 027e68724935599417faa7dd4123c117d18e2483
38 changes: 10 additions & 28 deletions trunk/drivers/serial/sh-sci.c
Original file line number Diff line number Diff line change
Expand Up @@ -748,49 +748,28 @@ static irqreturn_t sci_mpxed_interrupt(int irq, void *ptr)
return ret;
}

#if defined(CONFIG_CPU_FREQ) && defined(CONFIG_HAVE_CLK)
#ifdef CONFIG_HAVE_CLK
/*
* Here we define a transistion notifier so that we can update all of our
* ports' baud rate when the peripheral clock changes.
*/
static int sci_notifier(struct notifier_block *self,
unsigned long phase, void *p)
{
struct cpufreq_freqs *freqs = p;
int i;

if ((phase == CPUFREQ_POSTCHANGE) ||
(phase == CPUFREQ_RESUMECHANGE)) {
(phase == CPUFREQ_RESUMECHANGE))
for (i = 0; i < SCI_NPORTS; i++) {
struct uart_port *port = &sci_ports[i].port;
struct clk *clk;

/*
* Update the uartclk per-port if frequency has
* changed, since it will no longer necessarily be
* consistent with the old frequency.
*
* Really we want to be able to do something like
* uart_change_speed() or something along those lines
* here to implicitly reset the per-port baud rate..
*
* Clean this up later..
*/
clk = clk_get(NULL, "module_clk");
port->uartclk = clk_get_rate(clk);
clk_put(clk);
struct sci_port *s = &sci_ports[i];
s->port.uartclk = clk_get_rate(s->clk);
}

printk(KERN_INFO "%s: got a postchange notification "
"for cpu %d (old %d, new %d)\n",
__func__, freqs->cpu, freqs->old, freqs->new);
}

return NOTIFY_OK;
}

static struct notifier_block sci_nb = { &sci_notifier, NULL, 0 };
#endif /* CONFIG_CPU_FREQ && CONFIG_HAVE_CLK */
#endif

static int sci_request_irq(struct sci_port *port)
{
Expand Down Expand Up @@ -1326,9 +1305,8 @@ static int __devinit sci_probe(struct platform_device *dev)
uart_add_one_port(&sci_uart_driver, &sciport->port);
}

#if defined(CONFIG_CPU_FREQ) && defined(CONFIG_HAVE_CLK)
#ifdef CONFIG_HAVE_CLK
cpufreq_register_notifier(&sci_nb, CPUFREQ_TRANSITION_NOTIFIER);
dev_info(&dev->dev, "CPU frequency notifier registered\n");
#endif

#ifdef CONFIG_SH_STANDARD_BIOS
Expand All @@ -1348,6 +1326,10 @@ static int __devexit sci_remove(struct platform_device *dev)
{
int i;

#ifdef CONFIG_HAVE_CLK
cpufreq_unregister_notifier(&sci_nb, CPUFREQ_TRANSITION_NOTIFIER);
#endif

for (i = 0; i < SCI_NPORTS; i++)
uart_remove_one_port(&sci_uart_driver, &sci_ports[i].port);

Expand Down

0 comments on commit 02071ea

Please sign in to comment.