diff options
author | Stephen Warren <swarren@nvidia.com> | 2012-11-08 14:40:59 -0500 |
---|---|---|
committer | Stephen Warren <swarren@nvidia.com> | 2012-12-24 11:36:38 -0500 |
commit | 6bb27d7349db51b50c40534710fe164ca0d58902 (patch) | |
tree | 8f227c8bbf27b87275302dc133bb2b949b64622f /arch/arm/mach-integrator | |
parent | 7704c095230e2e9863f3aacd0489a4b4cc00bf45 (diff) |
ARM: delete struct sys_timer
Now that the only field in struct sys_timer is .init, delete the struct,
and replace the machine descriptor .timer field with the initialization
function itself.
This will enable moving timer drivers into drivers/clocksource without
having to place a public prototype of each struct sys_timer object into
include/linux; the intent is to create a single of_clocksource_init()
function that determines which timer driver to initialize by scanning
the device dtree, much like the proposed irqchip_init() at:
http://www.spinics.net/lists/arm-kernel/msg203686.html
Includes mach-omap2 fixes from Igor Grinberg.
Tested-by: Robert Jarzmik <robert.jarzmik@free.fr>
Signed-off-by: Stephen Warren <swarren@nvidia.com>
Diffstat (limited to 'arch/arm/mach-integrator')
-rw-r--r-- | arch/arm/mach-integrator/integrator_ap.c | 16 | ||||
-rw-r--r-- | arch/arm/mach-integrator/integrator_cp.c | 16 |
2 files changed, 8 insertions, 24 deletions
diff --git a/arch/arm/mach-integrator/integrator_ap.c b/arch/arm/mach-integrator/integrator_ap.c index 11e2a4145807..78f1b3814f77 100644 --- a/arch/arm/mach-integrator/integrator_ap.c +++ b/arch/arm/mach-integrator/integrator_ap.c | |||
@@ -425,7 +425,7 @@ void __init ap_init_early(void) | |||
425 | 425 | ||
426 | #ifdef CONFIG_OF | 426 | #ifdef CONFIG_OF |
427 | 427 | ||
428 | static void __init ap_init_timer_of(void) | 428 | static void __init ap_of_timer_init(void) |
429 | { | 429 | { |
430 | struct device_node *node; | 430 | struct device_node *node; |
431 | const char *path; | 431 | const char *path; |
@@ -464,10 +464,6 @@ static void __init ap_init_timer_of(void) | |||
464 | integrator_clockevent_init(rate, base, irq); | 464 | integrator_clockevent_init(rate, base, irq); |
465 | } | 465 | } |
466 | 466 | ||
467 | static struct sys_timer ap_of_timer = { | ||
468 | .init = ap_init_timer_of, | ||
469 | }; | ||
470 | |||
471 | static const struct of_device_id fpga_irq_of_match[] __initconst = { | 467 | static const struct of_device_id fpga_irq_of_match[] __initconst = { |
472 | { .compatible = "arm,versatile-fpga-irq", .data = fpga_irq_of_init, }, | 468 | { .compatible = "arm,versatile-fpga-irq", .data = fpga_irq_of_init, }, |
473 | { /* Sentinel */ } | 469 | { /* Sentinel */ } |
@@ -586,7 +582,7 @@ DT_MACHINE_START(INTEGRATOR_AP_DT, "ARM Integrator/AP (Device Tree)") | |||
586 | .init_early = ap_init_early, | 582 | .init_early = ap_init_early, |
587 | .init_irq = ap_init_irq_of, | 583 | .init_irq = ap_init_irq_of, |
588 | .handle_irq = fpga_handle_irq, | 584 | .handle_irq = fpga_handle_irq, |
589 | .timer = &ap_of_timer, | 585 | .init_time = ap_of_timer_init, |
590 | .init_machine = ap_init_of, | 586 | .init_machine = ap_init_of, |
591 | .restart = integrator_restart, | 587 | .restart = integrator_restart, |
592 | .dt_compat = ap_dt_board_compat, | 588 | .dt_compat = ap_dt_board_compat, |
@@ -638,7 +634,7 @@ static struct platform_device cfi_flash_device = { | |||
638 | .resource = &cfi_flash_resource, | 634 | .resource = &cfi_flash_resource, |
639 | }; | 635 | }; |
640 | 636 | ||
641 | static void __init ap_init_timer(void) | 637 | static void __init ap_timer_init(void) |
642 | { | 638 | { |
643 | struct clk *clk; | 639 | struct clk *clk; |
644 | unsigned long rate; | 640 | unsigned long rate; |
@@ -657,10 +653,6 @@ static void __init ap_init_timer(void) | |||
657 | IRQ_TIMERINT1); | 653 | IRQ_TIMERINT1); |
658 | } | 654 | } |
659 | 655 | ||
660 | static struct sys_timer ap_timer = { | ||
661 | .init = ap_init_timer, | ||
662 | }; | ||
663 | |||
664 | #define INTEGRATOR_SC_VALID_INT 0x003fffff | 656 | #define INTEGRATOR_SC_VALID_INT 0x003fffff |
665 | 657 | ||
666 | static void __init ap_init_irq(void) | 658 | static void __init ap_init_irq(void) |
@@ -716,7 +708,7 @@ MACHINE_START(INTEGRATOR, "ARM-Integrator") | |||
716 | .init_early = ap_init_early, | 708 | .init_early = ap_init_early, |
717 | .init_irq = ap_init_irq, | 709 | .init_irq = ap_init_irq, |
718 | .handle_irq = fpga_handle_irq, | 710 | .handle_irq = fpga_handle_irq, |
719 | .timer = &ap_timer, | 711 | .init_time = ap_timer_init, |
720 | .init_machine = ap_init, | 712 | .init_machine = ap_init, |
721 | .restart = integrator_restart, | 713 | .restart = integrator_restart, |
722 | MACHINE_END | 714 | MACHINE_END |
diff --git a/arch/arm/mach-integrator/integrator_cp.c b/arch/arm/mach-integrator/integrator_cp.c index 7322838c0447..4cef9a0ebbb9 100644 --- a/arch/arm/mach-integrator/integrator_cp.c +++ b/arch/arm/mach-integrator/integrator_cp.c | |||
@@ -251,7 +251,7 @@ static void __init intcp_init_early(void) | |||
251 | 251 | ||
252 | #ifdef CONFIG_OF | 252 | #ifdef CONFIG_OF |
253 | 253 | ||
254 | static void __init intcp_timer_init_of(void) | 254 | static void __init cp_of_timer_init(void) |
255 | { | 255 | { |
256 | struct device_node *node; | 256 | struct device_node *node; |
257 | const char *path; | 257 | const char *path; |
@@ -283,10 +283,6 @@ static void __init intcp_timer_init_of(void) | |||
283 | sp804_clockevents_init(base, irq, node->name); | 283 | sp804_clockevents_init(base, irq, node->name); |
284 | } | 284 | } |
285 | 285 | ||
286 | static struct sys_timer cp_of_timer = { | ||
287 | .init = intcp_timer_init_of, | ||
288 | }; | ||
289 | |||
290 | static const struct of_device_id fpga_irq_of_match[] __initconst = { | 286 | static const struct of_device_id fpga_irq_of_match[] __initconst = { |
291 | { .compatible = "arm,versatile-fpga-irq", .data = fpga_irq_of_init, }, | 287 | { .compatible = "arm,versatile-fpga-irq", .data = fpga_irq_of_init, }, |
292 | { /* Sentinel */ } | 288 | { /* Sentinel */ } |
@@ -390,7 +386,7 @@ DT_MACHINE_START(INTEGRATOR_CP_DT, "ARM Integrator/CP (Device Tree)") | |||
390 | .init_early = intcp_init_early, | 386 | .init_early = intcp_init_early, |
391 | .init_irq = intcp_init_irq_of, | 387 | .init_irq = intcp_init_irq_of, |
392 | .handle_irq = fpga_handle_irq, | 388 | .handle_irq = fpga_handle_irq, |
393 | .timer = &cp_of_timer, | 389 | .init_time = cp_of_timer_init, |
394 | .init_machine = intcp_init_of, | 390 | .init_machine = intcp_init_of, |
395 | .restart = integrator_restart, | 391 | .restart = integrator_restart, |
396 | .dt_compat = intcp_dt_board_compat, | 392 | .dt_compat = intcp_dt_board_compat, |
@@ -512,7 +508,7 @@ static void __init intcp_init_irq(void) | |||
512 | #define TIMER1_VA_BASE __io_address(INTEGRATOR_TIMER1_BASE) | 508 | #define TIMER1_VA_BASE __io_address(INTEGRATOR_TIMER1_BASE) |
513 | #define TIMER2_VA_BASE __io_address(INTEGRATOR_TIMER2_BASE) | 509 | #define TIMER2_VA_BASE __io_address(INTEGRATOR_TIMER2_BASE) |
514 | 510 | ||
515 | static void __init intcp_timer_init(void) | 511 | static void __init cp_timer_init(void) |
516 | { | 512 | { |
517 | writel(0, TIMER0_VA_BASE + TIMER_CTRL); | 513 | writel(0, TIMER0_VA_BASE + TIMER_CTRL); |
518 | writel(0, TIMER1_VA_BASE + TIMER_CTRL); | 514 | writel(0, TIMER1_VA_BASE + TIMER_CTRL); |
@@ -522,10 +518,6 @@ static void __init intcp_timer_init(void) | |||
522 | sp804_clockevents_init(TIMER1_VA_BASE, IRQ_TIMERINT1, "timer1"); | 518 | sp804_clockevents_init(TIMER1_VA_BASE, IRQ_TIMERINT1, "timer1"); |
523 | } | 519 | } |
524 | 520 | ||
525 | static struct sys_timer cp_timer = { | ||
526 | .init = intcp_timer_init, | ||
527 | }; | ||
528 | |||
529 | #define INTEGRATOR_CP_MMC_IRQS { IRQ_CP_MMCIINT0, IRQ_CP_MMCIINT1 } | 521 | #define INTEGRATOR_CP_MMC_IRQS { IRQ_CP_MMCIINT0, IRQ_CP_MMCIINT1 } |
530 | #define INTEGRATOR_CP_AACI_IRQS { IRQ_CP_AACIINT } | 522 | #define INTEGRATOR_CP_AACI_IRQS { IRQ_CP_AACIINT } |
531 | 523 | ||
@@ -565,7 +557,7 @@ MACHINE_START(CINTEGRATOR, "ARM-IntegratorCP") | |||
565 | .init_early = intcp_init_early, | 557 | .init_early = intcp_init_early, |
566 | .init_irq = intcp_init_irq, | 558 | .init_irq = intcp_init_irq, |
567 | .handle_irq = fpga_handle_irq, | 559 | .handle_irq = fpga_handle_irq, |
568 | .timer = &cp_timer, | 560 | .init_time = cp_timer_init, |
569 | .init_machine = intcp_init, | 561 | .init_machine = intcp_init, |
570 | .restart = integrator_restart, | 562 | .restart = integrator_restart, |
571 | MACHINE_END | 563 | MACHINE_END |