aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/clocksource
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2010-02-26 19:54:27 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2010-02-26 19:54:27 -0500
commit64d497f55379b1e320a08ec2426468d96f5642ec (patch)
tree22b9ab3c5e69c5cc2728cbc2ca7fc7623beef8f1 /drivers/clocksource
parent37d4008484977f60d5d37499a2670c79b214dd46 (diff)
parentb5f5fe80fa98a60daa0fa94512d1599b1e26674c (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/lethal/sh-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/lethal/sh-2.6: (187 commits) sh: remove dead LED code for migo-r and ms7724se sh: ecovec build fix for CONFIG_I2C=n sh: ecovec r-standby support sh: ms7724se r-standby support sh: SH-Mobile R-standby register save/restore clocksource: Fix up a registration/IRQ race in the sh drivers. sh: ms7724: modify scan_timing for KEYSC sh: ms7724: Add sh_sir support sh: mach-ecovec24: Add sh_sir support sh: wire up SET/GET_UNALIGN_CTL. sh: allow alignment fault mode to be configured at kernel boot. sh: sh7724: Update FSI/SPU2 clock sh: always enable sh7724 vpu_clk and set to 166MHz on Ecovec sh: add sh7724 kick callback to clk_div4_table sh: introduce struct clk_div4_table sh: clock-cpg div4 set_rate() shift fix sh: Turn on speculative return for SH7785 and SH7786 sh: Merge legacy and dynamic PMB modes. sh: Use uncached I/O helpers in PMB setup. sh: Provide uncached I/O helpers. ...
Diffstat (limited to 'drivers/clocksource')
-rw-r--r--drivers/clocksource/sh_cmt.c32
-rw-r--r--drivers/clocksource/sh_mtu2.c6
-rw-r--r--drivers/clocksource/sh_tmu.c6
3 files changed, 25 insertions, 19 deletions
diff --git a/drivers/clocksource/sh_cmt.c b/drivers/clocksource/sh_cmt.c
index 6b3e0c2f33e2..6fe4f7701188 100644
--- a/drivers/clocksource/sh_cmt.c
+++ b/drivers/clocksource/sh_cmt.c
@@ -603,18 +603,13 @@ static int sh_cmt_setup(struct sh_cmt_priv *p, struct platform_device *pdev)
603 p->irqaction.handler = sh_cmt_interrupt; 603 p->irqaction.handler = sh_cmt_interrupt;
604 p->irqaction.dev_id = p; 604 p->irqaction.dev_id = p;
605 p->irqaction.flags = IRQF_DISABLED | IRQF_TIMER | IRQF_IRQPOLL; 605 p->irqaction.flags = IRQF_DISABLED | IRQF_TIMER | IRQF_IRQPOLL;
606 ret = setup_irq(irq, &p->irqaction);
607 if (ret) {
608 pr_err("sh_cmt: failed to request irq %d\n", irq);
609 goto err1;
610 }
611 606
612 /* get hold of clock */ 607 /* get hold of clock */
613 p->clk = clk_get(&p->pdev->dev, cfg->clk); 608 p->clk = clk_get(&p->pdev->dev, cfg->clk);
614 if (IS_ERR(p->clk)) { 609 if (IS_ERR(p->clk)) {
615 pr_err("sh_cmt: cannot get clock \"%s\"\n", cfg->clk); 610 pr_err("sh_cmt: cannot get clock \"%s\"\n", cfg->clk);
616 ret = PTR_ERR(p->clk); 611 ret = PTR_ERR(p->clk);
617 goto err2; 612 goto err1;
618 } 613 }
619 614
620 if (resource_size(res) == 6) { 615 if (resource_size(res) == 6) {
@@ -627,14 +622,25 @@ static int sh_cmt_setup(struct sh_cmt_priv *p, struct platform_device *pdev)
627 p->clear_bits = ~0xc000; 622 p->clear_bits = ~0xc000;
628 } 623 }
629 624
630 return sh_cmt_register(p, cfg->name, 625 ret = sh_cmt_register(p, cfg->name,
631 cfg->clockevent_rating, 626 cfg->clockevent_rating,
632 cfg->clocksource_rating); 627 cfg->clocksource_rating);
633 err2: 628 if (ret) {
634 remove_irq(irq, &p->irqaction); 629 pr_err("sh_cmt: registration failed\n");
635 err1: 630 goto err1;
631 }
632
633 ret = setup_irq(irq, &p->irqaction);
634 if (ret) {
635 pr_err("sh_cmt: failed to request irq %d\n", irq);
636 goto err1;
637 }
638
639 return 0;
640
641err1:
636 iounmap(p->mapbase); 642 iounmap(p->mapbase);
637 err0: 643err0:
638 return ret; 644 return ret;
639} 645}
640 646
diff --git a/drivers/clocksource/sh_mtu2.c b/drivers/clocksource/sh_mtu2.c
index 973e714d6051..4c8a759e60cd 100644
--- a/drivers/clocksource/sh_mtu2.c
+++ b/drivers/clocksource/sh_mtu2.c
@@ -221,15 +221,15 @@ static void sh_mtu2_register_clockevent(struct sh_mtu2_priv *p,
221 ced->cpumask = cpumask_of(0); 221 ced->cpumask = cpumask_of(0);
222 ced->set_mode = sh_mtu2_clock_event_mode; 222 ced->set_mode = sh_mtu2_clock_event_mode;
223 223
224 pr_info("sh_mtu2: %s used for clock events\n", ced->name);
225 clockevents_register_device(ced);
226
224 ret = setup_irq(p->irqaction.irq, &p->irqaction); 227 ret = setup_irq(p->irqaction.irq, &p->irqaction);
225 if (ret) { 228 if (ret) {
226 pr_err("sh_mtu2: failed to request irq %d\n", 229 pr_err("sh_mtu2: failed to request irq %d\n",
227 p->irqaction.irq); 230 p->irqaction.irq);
228 return; 231 return;
229 } 232 }
230
231 pr_info("sh_mtu2: %s used for clock events\n", ced->name);
232 clockevents_register_device(ced);
233} 233}
234 234
235static int sh_mtu2_register(struct sh_mtu2_priv *p, char *name, 235static int sh_mtu2_register(struct sh_mtu2_priv *p, char *name,
diff --git a/drivers/clocksource/sh_tmu.c b/drivers/clocksource/sh_tmu.c
index 93c2322feab7..961f5b5ef6a3 100644
--- a/drivers/clocksource/sh_tmu.c
+++ b/drivers/clocksource/sh_tmu.c
@@ -323,15 +323,15 @@ static void sh_tmu_register_clockevent(struct sh_tmu_priv *p,
323 ced->set_next_event = sh_tmu_clock_event_next; 323 ced->set_next_event = sh_tmu_clock_event_next;
324 ced->set_mode = sh_tmu_clock_event_mode; 324 ced->set_mode = sh_tmu_clock_event_mode;
325 325
326 pr_info("sh_tmu: %s used for clock events\n", ced->name);
327 clockevents_register_device(ced);
328
326 ret = setup_irq(p->irqaction.irq, &p->irqaction); 329 ret = setup_irq(p->irqaction.irq, &p->irqaction);
327 if (ret) { 330 if (ret) {
328 pr_err("sh_tmu: failed to request irq %d\n", 331 pr_err("sh_tmu: failed to request irq %d\n",
329 p->irqaction.irq); 332 p->irqaction.irq);
330 return; 333 return;
331 } 334 }
332
333 pr_info("sh_tmu: %s used for clock events\n", ced->name);
334 clockevents_register_device(ced);
335} 335}
336 336
337static int sh_tmu_register(struct sh_tmu_priv *p, char *name, 337static int sh_tmu_register(struct sh_tmu_priv *p, char *name,