diff options
author | Olof Johansson <olof@lixom.net> | 2013-01-14 13:20:02 -0500 |
---|---|---|
committer | Olof Johansson <olof@lixom.net> | 2013-01-14 13:20:02 -0500 |
commit | 8d84981e395850aab31c3f2ca7e2738e03f671d7 (patch) | |
tree | 933425fddb23d28be802277471df3fe3f6c2711d /drivers/clocksource | |
parent | 00c82d64405631967dca3890a9ce80ab35d04cc7 (diff) | |
parent | 77cc982f6a3b33a5aa058ad3b20cda8866db2948 (diff) |
Merge branch 'clocksource/cleanup' into next/cleanup
Clockevent cleanup series from Shawn Guo.
Resolved move/change conflict in mach-pxa/time.c due to the sys_timer
cleanup.
* clocksource/cleanup:
clocksource: use clockevents_config_and_register() where possible
ARM: use clockevents_config_and_register() where possible
clockevents: export clockevents_config_and_register for module use
+ sync to Linux 3.8-rc3
Signed-off-by: Olof Johansson <olof@lixom.net>
Conflicts:
arch/arm/mach-pxa/time.c
Diffstat (limited to 'drivers/clocksource')
-rw-r--r-- | drivers/clocksource/acpi_pm.c | 6 | ||||
-rw-r--r-- | drivers/clocksource/cs5535-clockevt.c | 11 | ||||
-rw-r--r-- | drivers/clocksource/em_sti.c | 8 | ||||
-rw-r--r-- | drivers/clocksource/sh_cmt.c | 6 | ||||
-rw-r--r-- | drivers/clocksource/sh_mtu2.c | 6 | ||||
-rw-r--r-- | drivers/clocksource/sh_tmu.c | 6 | ||||
-rw-r--r-- | drivers/clocksource/sunxi_timer.c | 11 | ||||
-rw-r--r-- | drivers/clocksource/tcb_clksrc.c | 7 |
8 files changed, 21 insertions, 40 deletions
diff --git a/drivers/clocksource/acpi_pm.c b/drivers/clocksource/acpi_pm.c index 5d1b9268bcaf..6efe4d1ab3aa 100644 --- a/drivers/clocksource/acpi_pm.c +++ b/drivers/clocksource/acpi_pm.c | |||
@@ -73,7 +73,7 @@ static struct clocksource clocksource_acpi_pm = { | |||
73 | 73 | ||
74 | 74 | ||
75 | #ifdef CONFIG_PCI | 75 | #ifdef CONFIG_PCI |
76 | static int __devinitdata acpi_pm_good; | 76 | static int acpi_pm_good; |
77 | static int __init acpi_pm_good_setup(char *__str) | 77 | static int __init acpi_pm_good_setup(char *__str) |
78 | { | 78 | { |
79 | acpi_pm_good = 1; | 79 | acpi_pm_good = 1; |
@@ -102,7 +102,7 @@ static inline void acpi_pm_need_workaround(void) | |||
102 | * incorrect when read). As a result, the ACPI free running count up | 102 | * incorrect when read). As a result, the ACPI free running count up |
103 | * timer specification is violated due to erroneous reads. | 103 | * timer specification is violated due to erroneous reads. |
104 | */ | 104 | */ |
105 | static void __devinit acpi_pm_check_blacklist(struct pci_dev *dev) | 105 | static void acpi_pm_check_blacklist(struct pci_dev *dev) |
106 | { | 106 | { |
107 | if (acpi_pm_good) | 107 | if (acpi_pm_good) |
108 | return; | 108 | return; |
@@ -120,7 +120,7 @@ static void __devinit acpi_pm_check_blacklist(struct pci_dev *dev) | |||
120 | DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82371AB_3, | 120 | DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82371AB_3, |
121 | acpi_pm_check_blacklist); | 121 | acpi_pm_check_blacklist); |
122 | 122 | ||
123 | static void __devinit acpi_pm_check_graylist(struct pci_dev *dev) | 123 | static void acpi_pm_check_graylist(struct pci_dev *dev) |
124 | { | 124 | { |
125 | if (acpi_pm_good) | 125 | if (acpi_pm_good) |
126 | return; | 126 | return; |
diff --git a/drivers/clocksource/cs5535-clockevt.c b/drivers/clocksource/cs5535-clockevt.c index d9279385304d..ea210482dd20 100644 --- a/drivers/clocksource/cs5535-clockevt.c +++ b/drivers/clocksource/cs5535-clockevt.c | |||
@@ -100,7 +100,6 @@ static struct clock_event_device cs5535_clockevent = { | |||
100 | .set_mode = mfgpt_set_mode, | 100 | .set_mode = mfgpt_set_mode, |
101 | .set_next_event = mfgpt_next_event, | 101 | .set_next_event = mfgpt_next_event, |
102 | .rating = 250, | 102 | .rating = 250, |
103 | .shift = 32 | ||
104 | }; | 103 | }; |
105 | 104 | ||
106 | static irqreturn_t mfgpt_tick(int irq, void *dev_id) | 105 | static irqreturn_t mfgpt_tick(int irq, void *dev_id) |
@@ -169,17 +168,11 @@ static int __init cs5535_mfgpt_init(void) | |||
169 | cs5535_mfgpt_write(cs5535_event_clock, MFGPT_REG_SETUP, val); | 168 | cs5535_mfgpt_write(cs5535_event_clock, MFGPT_REG_SETUP, val); |
170 | 169 | ||
171 | /* Set up the clock event */ | 170 | /* Set up the clock event */ |
172 | cs5535_clockevent.mult = div_sc(MFGPT_HZ, NSEC_PER_SEC, | ||
173 | cs5535_clockevent.shift); | ||
174 | cs5535_clockevent.min_delta_ns = clockevent_delta2ns(0xF, | ||
175 | &cs5535_clockevent); | ||
176 | cs5535_clockevent.max_delta_ns = clockevent_delta2ns(0xFFFE, | ||
177 | &cs5535_clockevent); | ||
178 | |||
179 | printk(KERN_INFO DRV_NAME | 171 | printk(KERN_INFO DRV_NAME |
180 | ": Registering MFGPT timer as a clock event, using IRQ %d\n", | 172 | ": Registering MFGPT timer as a clock event, using IRQ %d\n", |
181 | timer_irq); | 173 | timer_irq); |
182 | clockevents_register_device(&cs5535_clockevent); | 174 | clockevents_config_and_register(&cs5535_clockevent, MFGPT_HZ, |
175 | 0xF, 0xFFFE); | ||
183 | 176 | ||
184 | return 0; | 177 | return 0; |
185 | 178 | ||
diff --git a/drivers/clocksource/em_sti.c b/drivers/clocksource/em_sti.c index 372051d1bba8..e6a553cb73e8 100644 --- a/drivers/clocksource/em_sti.c +++ b/drivers/clocksource/em_sti.c | |||
@@ -311,7 +311,7 @@ static void em_sti_register_clockevent(struct em_sti_priv *p) | |||
311 | clockevents_config_and_register(ced, 1, 2, 0xffffffff); | 311 | clockevents_config_and_register(ced, 1, 2, 0xffffffff); |
312 | } | 312 | } |
313 | 313 | ||
314 | static int __devinit em_sti_probe(struct platform_device *pdev) | 314 | static int em_sti_probe(struct platform_device *pdev) |
315 | { | 315 | { |
316 | struct em_sti_priv *p; | 316 | struct em_sti_priv *p; |
317 | struct resource *res; | 317 | struct resource *res; |
@@ -379,12 +379,12 @@ err0: | |||
379 | return ret; | 379 | return ret; |
380 | } | 380 | } |
381 | 381 | ||
382 | static int __devexit em_sti_remove(struct platform_device *pdev) | 382 | static int em_sti_remove(struct platform_device *pdev) |
383 | { | 383 | { |
384 | return -EBUSY; /* cannot unregister clockevent and clocksource */ | 384 | return -EBUSY; /* cannot unregister clockevent and clocksource */ |
385 | } | 385 | } |
386 | 386 | ||
387 | static const struct of_device_id em_sti_dt_ids[] __devinitconst = { | 387 | static const struct of_device_id em_sti_dt_ids[] = { |
388 | { .compatible = "renesas,em-sti", }, | 388 | { .compatible = "renesas,em-sti", }, |
389 | {}, | 389 | {}, |
390 | }; | 390 | }; |
@@ -392,7 +392,7 @@ MODULE_DEVICE_TABLE(of, em_sti_dt_ids); | |||
392 | 392 | ||
393 | static struct platform_driver em_sti_device_driver = { | 393 | static struct platform_driver em_sti_device_driver = { |
394 | .probe = em_sti_probe, | 394 | .probe = em_sti_probe, |
395 | .remove = __devexit_p(em_sti_remove), | 395 | .remove = em_sti_remove, |
396 | .driver = { | 396 | .driver = { |
397 | .name = "em_sti", | 397 | .name = "em_sti", |
398 | .of_match_table = em_sti_dt_ids, | 398 | .of_match_table = em_sti_dt_ids, |
diff --git a/drivers/clocksource/sh_cmt.c b/drivers/clocksource/sh_cmt.c index a5f7829f2799..488c14cc8dbf 100644 --- a/drivers/clocksource/sh_cmt.c +++ b/drivers/clocksource/sh_cmt.c | |||
@@ -726,7 +726,7 @@ err0: | |||
726 | return ret; | 726 | return ret; |
727 | } | 727 | } |
728 | 728 | ||
729 | static int __devinit sh_cmt_probe(struct platform_device *pdev) | 729 | static int sh_cmt_probe(struct platform_device *pdev) |
730 | { | 730 | { |
731 | struct sh_cmt_priv *p = platform_get_drvdata(pdev); | 731 | struct sh_cmt_priv *p = platform_get_drvdata(pdev); |
732 | struct sh_timer_config *cfg = pdev->dev.platform_data; | 732 | struct sh_timer_config *cfg = pdev->dev.platform_data; |
@@ -767,14 +767,14 @@ static int __devinit sh_cmt_probe(struct platform_device *pdev) | |||
767 | return 0; | 767 | return 0; |
768 | } | 768 | } |
769 | 769 | ||
770 | static int __devexit sh_cmt_remove(struct platform_device *pdev) | 770 | static int sh_cmt_remove(struct platform_device *pdev) |
771 | { | 771 | { |
772 | return -EBUSY; /* cannot unregister clockevent and clocksource */ | 772 | return -EBUSY; /* cannot unregister clockevent and clocksource */ |
773 | } | 773 | } |
774 | 774 | ||
775 | static struct platform_driver sh_cmt_device_driver = { | 775 | static struct platform_driver sh_cmt_device_driver = { |
776 | .probe = sh_cmt_probe, | 776 | .probe = sh_cmt_probe, |
777 | .remove = __devexit_p(sh_cmt_remove), | 777 | .remove = sh_cmt_remove, |
778 | .driver = { | 778 | .driver = { |
779 | .name = "sh_cmt", | 779 | .name = "sh_cmt", |
780 | } | 780 | } |
diff --git a/drivers/clocksource/sh_mtu2.c b/drivers/clocksource/sh_mtu2.c index c5eea858054a..83943e27cfac 100644 --- a/drivers/clocksource/sh_mtu2.c +++ b/drivers/clocksource/sh_mtu2.c | |||
@@ -321,7 +321,7 @@ static int sh_mtu2_setup(struct sh_mtu2_priv *p, struct platform_device *pdev) | |||
321 | return ret; | 321 | return ret; |
322 | } | 322 | } |
323 | 323 | ||
324 | static int __devinit sh_mtu2_probe(struct platform_device *pdev) | 324 | static int sh_mtu2_probe(struct platform_device *pdev) |
325 | { | 325 | { |
326 | struct sh_mtu2_priv *p = platform_get_drvdata(pdev); | 326 | struct sh_mtu2_priv *p = platform_get_drvdata(pdev); |
327 | struct sh_timer_config *cfg = pdev->dev.platform_data; | 327 | struct sh_timer_config *cfg = pdev->dev.platform_data; |
@@ -362,14 +362,14 @@ static int __devinit sh_mtu2_probe(struct platform_device *pdev) | |||
362 | return 0; | 362 | return 0; |
363 | } | 363 | } |
364 | 364 | ||
365 | static int __devexit sh_mtu2_remove(struct platform_device *pdev) | 365 | static int sh_mtu2_remove(struct platform_device *pdev) |
366 | { | 366 | { |
367 | return -EBUSY; /* cannot unregister clockevent */ | 367 | return -EBUSY; /* cannot unregister clockevent */ |
368 | } | 368 | } |
369 | 369 | ||
370 | static struct platform_driver sh_mtu2_device_driver = { | 370 | static struct platform_driver sh_mtu2_device_driver = { |
371 | .probe = sh_mtu2_probe, | 371 | .probe = sh_mtu2_probe, |
372 | .remove = __devexit_p(sh_mtu2_remove), | 372 | .remove = sh_mtu2_remove, |
373 | .driver = { | 373 | .driver = { |
374 | .name = "sh_mtu2", | 374 | .name = "sh_mtu2", |
375 | } | 375 | } |
diff --git a/drivers/clocksource/sh_tmu.c b/drivers/clocksource/sh_tmu.c index 0cc4add88279..b4502edce2a1 100644 --- a/drivers/clocksource/sh_tmu.c +++ b/drivers/clocksource/sh_tmu.c | |||
@@ -484,7 +484,7 @@ static int sh_tmu_setup(struct sh_tmu_priv *p, struct platform_device *pdev) | |||
484 | return ret; | 484 | return ret; |
485 | } | 485 | } |
486 | 486 | ||
487 | static int __devinit sh_tmu_probe(struct platform_device *pdev) | 487 | static int sh_tmu_probe(struct platform_device *pdev) |
488 | { | 488 | { |
489 | struct sh_tmu_priv *p = platform_get_drvdata(pdev); | 489 | struct sh_tmu_priv *p = platform_get_drvdata(pdev); |
490 | struct sh_timer_config *cfg = pdev->dev.platform_data; | 490 | struct sh_timer_config *cfg = pdev->dev.platform_data; |
@@ -525,14 +525,14 @@ static int __devinit sh_tmu_probe(struct platform_device *pdev) | |||
525 | return 0; | 525 | return 0; |
526 | } | 526 | } |
527 | 527 | ||
528 | static int __devexit sh_tmu_remove(struct platform_device *pdev) | 528 | static int sh_tmu_remove(struct platform_device *pdev) |
529 | { | 529 | { |
530 | return -EBUSY; /* cannot unregister clockevent and clocksource */ | 530 | return -EBUSY; /* cannot unregister clockevent and clocksource */ |
531 | } | 531 | } |
532 | 532 | ||
533 | static struct platform_driver sh_tmu_device_driver = { | 533 | static struct platform_driver sh_tmu_device_driver = { |
534 | .probe = sh_tmu_probe, | 534 | .probe = sh_tmu_probe, |
535 | .remove = __devexit_p(sh_tmu_remove), | 535 | .remove = sh_tmu_remove, |
536 | .driver = { | 536 | .driver = { |
537 | .name = "sh_tmu", | 537 | .name = "sh_tmu", |
538 | } | 538 | } |
diff --git a/drivers/clocksource/sunxi_timer.c b/drivers/clocksource/sunxi_timer.c index 6c2ed56e8b14..0ce85e29769b 100644 --- a/drivers/clocksource/sunxi_timer.c +++ b/drivers/clocksource/sunxi_timer.c | |||
@@ -74,7 +74,6 @@ static int sunxi_clkevt_next_event(unsigned long evt, | |||
74 | 74 | ||
75 | static struct clock_event_device sunxi_clockevent = { | 75 | static struct clock_event_device sunxi_clockevent = { |
76 | .name = "sunxi_tick", | 76 | .name = "sunxi_tick", |
77 | .shift = 32, | ||
78 | .rating = 300, | 77 | .rating = 300, |
79 | .features = CLOCK_EVT_FEAT_PERIODIC | CLOCK_EVT_FEAT_ONESHOT, | 78 | .features = CLOCK_EVT_FEAT_PERIODIC | CLOCK_EVT_FEAT_ONESHOT, |
80 | .set_mode = sunxi_clkevt_mode, | 79 | .set_mode = sunxi_clkevt_mode, |
@@ -154,14 +153,8 @@ void __init sunxi_timer_init(void) | |||
154 | val = readl(timer_base + TIMER_CTL_REG); | 153 | val = readl(timer_base + TIMER_CTL_REG); |
155 | writel(val | TIMER_CTL_ENABLE, timer_base + TIMER_CTL_REG); | 154 | writel(val | TIMER_CTL_ENABLE, timer_base + TIMER_CTL_REG); |
156 | 155 | ||
157 | sunxi_clockevent.mult = div_sc(rate / TIMER_SCAL, | ||
158 | NSEC_PER_SEC, | ||
159 | sunxi_clockevent.shift); | ||
160 | sunxi_clockevent.max_delta_ns = clockevent_delta2ns(0xff, | ||
161 | &sunxi_clockevent); | ||
162 | sunxi_clockevent.min_delta_ns = clockevent_delta2ns(0x1, | ||
163 | &sunxi_clockevent); | ||
164 | sunxi_clockevent.cpumask = cpumask_of(0); | 156 | sunxi_clockevent.cpumask = cpumask_of(0); |
165 | 157 | ||
166 | clockevents_register_device(&sunxi_clockevent); | 158 | clockevents_config_and_register(&sunxi_clockevent, rate / TIMER_SCAL, |
159 | 0x1, 0xff); | ||
167 | } | 160 | } |
diff --git a/drivers/clocksource/tcb_clksrc.c b/drivers/clocksource/tcb_clksrc.c index 32cb929b8eb6..8a6187225dd0 100644 --- a/drivers/clocksource/tcb_clksrc.c +++ b/drivers/clocksource/tcb_clksrc.c | |||
@@ -157,7 +157,6 @@ static struct tc_clkevt_device clkevt = { | |||
157 | .name = "tc_clkevt", | 157 | .name = "tc_clkevt", |
158 | .features = CLOCK_EVT_FEAT_PERIODIC | 158 | .features = CLOCK_EVT_FEAT_PERIODIC |
159 | | CLOCK_EVT_FEAT_ONESHOT, | 159 | | CLOCK_EVT_FEAT_ONESHOT, |
160 | .shift = 32, | ||
161 | /* Should be lower than at91rm9200's system timer */ | 160 | /* Should be lower than at91rm9200's system timer */ |
162 | .rating = 125, | 161 | .rating = 125, |
163 | .set_next_event = tc_next_event, | 162 | .set_next_event = tc_next_event, |
@@ -196,13 +195,9 @@ static void __init setup_clkevents(struct atmel_tc *tc, int clk32k_divisor_idx) | |||
196 | 195 | ||
197 | timer_clock = clk32k_divisor_idx; | 196 | timer_clock = clk32k_divisor_idx; |
198 | 197 | ||
199 | clkevt.clkevt.mult = div_sc(32768, NSEC_PER_SEC, clkevt.clkevt.shift); | ||
200 | clkevt.clkevt.max_delta_ns | ||
201 | = clockevent_delta2ns(0xffff, &clkevt.clkevt); | ||
202 | clkevt.clkevt.min_delta_ns = clockevent_delta2ns(1, &clkevt.clkevt) + 1; | ||
203 | clkevt.clkevt.cpumask = cpumask_of(0); | 198 | clkevt.clkevt.cpumask = cpumask_of(0); |
204 | 199 | ||
205 | clockevents_register_device(&clkevt.clkevt); | 200 | clockevents_config_and_register(&clkevt.clkevt, 32768, 1, 0xffff); |
206 | 201 | ||
207 | setup_irq(irq, &tc_irqaction); | 202 | setup_irq(irq, &tc_irqaction); |
208 | } | 203 | } |