Merge branch 'clocksource/cleanup' into next/cleanup
authorOlof Johansson <olof@lixom.net>
Mon, 14 Jan 2013 18:20:02 +0000 (10:20 -0800)
committerOlof Johansson <olof@lixom.net>
Mon, 14 Jan 2013 18:20:02 +0000 (10:20 -0800)
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

26 files changed:
1  2 
arch/arm/mach-at91/at91rm9200_time.c
arch/arm/mach-cns3xxx/core.c
arch/arm/mach-davinci/board-dm646x-evm.c
arch/arm/mach-exynos/mct.c
arch/arm/mach-footbridge/dc21285-timer.c
arch/arm/mach-highbank/highbank.c
arch/arm/mach-ixp4xx/common.c
arch/arm/mach-kirkwood/board-dt.c
arch/arm/mach-ks8695/board-acs5k.c
arch/arm/mach-lpc32xx/timer.c
arch/arm/mach-msm/timer.c
arch/arm/mach-netx/time.c
arch/arm/mach-nomadik/board-nhk8815.c
arch/arm/mach-omap1/board-ams-delta.c
arch/arm/mach-omap1/time.c
arch/arm/mach-omap2/timer.c
arch/arm/mach-prima2/timer.c
arch/arm/mach-pxa/time.c
arch/arm/mach-s3c64xx/mach-crag6410.c
arch/arm/mach-sa1100/time.c
arch/arm/mach-tegra/timer.c
arch/arm/mach-ux500/cpu-db8500.c
arch/arm/mach-w90x900/time.c
arch/arm/plat-samsung/include/plat/cpu.h
arch/arm/plat-samsung/s5p-time.c
drivers/clocksource/sunxi_timer.c

Simple merge
Simple merge
Simple merge
@@@ -101,10 -101,10 +101,6 @@@ void __init footbridge_timer_init(void
  
        setup_irq(ce->irq, &footbridge_timer_irq);
  
-       clockevents_calc_mult_shift(ce, mem_fclk_21285, 5);
-       ce->max_delta_ns = clockevent_delta2ns(0xffffff, ce);
-       ce->min_delta_ns = clockevent_delta2ns(0x000004, ce);
        ce->cpumask = cpumask_of(smp_processor_id());
-       clockevents_register_device(ce);
+       clockevents_config_and_register(ce, mem_fclk_21285, 0x4, 0xffffff);
  }
 -
 -struct sys_timer footbridge_timer = {
 -      .init           = footbridge_timer_init,
 -};
@@@ -129,9 -129,13 +129,9 @@@ static void __init highbank_timer_init(
        arch_timer_sched_clock_init();
  }
  
 -static struct sys_timer highbank_timer = {
 -      .init = highbank_timer_init,
 -};
 -
  static void highbank_power_off(void)
  {
-       hignbank_set_pwr_shutdown();
+       highbank_set_pwr_shutdown();
  
        while (1)
                cpu_do_idle();
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
@@@ -140,14 -139,13 +139,9 @@@ void __init netx_timer_init(void
        clocksource_mmio_init(NETX_GPIO_COUNTER_CURRENT(TIMER_CLOCKSOURCE),
                "netx_timer", CLOCK_TICK_RATE, 200, 32, clocksource_mmio_readl_up);
  
-       netx_clockevent.mult = div_sc(CLOCK_TICK_RATE, NSEC_PER_SEC,
-                       netx_clockevent.shift);
-       netx_clockevent.max_delta_ns =
-               clockevent_delta2ns(0xfffffffe, &netx_clockevent);
        /* with max_delta_ns >= delta2ns(0x800) the system currently runs fine.
         * Adding some safety ... */
-       netx_clockevent.min_delta_ns =
-               clockevent_delta2ns(0xa00, &netx_clockevent);
        netx_clockevent.cpumask = cpumask_of(0);
-       clockevents_register_device(&netx_clockevent);
+       clockevents_config_and_register(&netx_clockevent, CLOCK_TICK_RATE,
+                                       0xa00, 0xfffffffe);
  }
 -
 -struct sys_timer netx_timer = {
 -      .init           = netx_timer_init,
 -};
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
@@@ -134,33 -164,3 +134,29 @@@ static struct clock_event_device ckevt_
        .suspend        = pxa_timer_suspend,
        .resume         = pxa_timer_resume,
  };
-       clockevents_calc_mult_shift(&ckevt_pxa_osmr0, clock_tick_rate, 4);
-       ckevt_pxa_osmr0.max_delta_ns =
-               clockevent_delta2ns(0x7fffffff, &ckevt_pxa_osmr0);
-       ckevt_pxa_osmr0.min_delta_ns =
-               clockevent_delta2ns(MIN_OSCR_DELTA * 2, &ckevt_pxa_osmr0) + 1;
 +
 +static struct irqaction pxa_ost0_irq = {
 +      .name           = "ost0",
 +      .flags          = IRQF_DISABLED | IRQF_TIMER | IRQF_IRQPOLL,
 +      .handler        = pxa_ost0_interrupt,
 +      .dev_id         = &ckevt_pxa_osmr0,
 +};
 +
 +void __init pxa_timer_init(void)
 +{
 +      unsigned long clock_tick_rate = get_clock_tick_rate();
 +
 +      writel_relaxed(0, OIER);
 +      writel_relaxed(OSSR_M0 | OSSR_M1 | OSSR_M2 | OSSR_M3, OSSR);
 +
 +      setup_sched_clock(pxa_read_sched_clock, 32, clock_tick_rate);
 +
-       clockevents_register_device(&ckevt_pxa_osmr0);
 +      ckevt_pxa_osmr0.cpumask = cpumask_of(0);
 +
 +      setup_irq(IRQ_OST0, &pxa_ost0_irq);
 +
 +      clocksource_mmio_init(OSCR, "oscr0", clock_tick_rate, 200, 32,
 +              clocksource_mmio_readl_up);
++      clockevents_config_and_register(&ckevt_pxa_osmr0, clock_tick_rate,
++              MIN_OSCR_DELTA * 2, 0x7fffffff);
 +}
Simple merge
@@@ -109,31 -137,3 +109,27 @@@ static struct clock_event_device ckevt_
        .suspend        = sa1100_timer_suspend,
        .resume         = sa1100_timer_resume,
  };
-       clockevents_calc_mult_shift(&ckevt_sa1100_osmr0, 3686400, 4);
-       ckevt_sa1100_osmr0.max_delta_ns =
-               clockevent_delta2ns(0x7fffffff, &ckevt_sa1100_osmr0);
-       ckevt_sa1100_osmr0.min_delta_ns =
-               clockevent_delta2ns(MIN_OSCR_DELTA * 2, &ckevt_sa1100_osmr0) + 1;
 +
 +static struct irqaction sa1100_timer_irq = {
 +      .name           = "ost0",
 +      .flags          = IRQF_DISABLED | IRQF_TIMER | IRQF_IRQPOLL,
 +      .handler        = sa1100_ost0_interrupt,
 +      .dev_id         = &ckevt_sa1100_osmr0,
 +};
 +
 +void __init sa1100_timer_init(void)
 +{
 +      writel_relaxed(0, OIER);
 +      writel_relaxed(OSSR_M0 | OSSR_M1 | OSSR_M2 | OSSR_M3, OSSR);
 +
 +      setup_sched_clock(sa1100_read_sched_clock, 32, 3686400);
 +
-       clockevents_register_device(&ckevt_sa1100_osmr0);
 +      ckevt_sa1100_osmr0.cpumask = cpumask_of(0);
 +
 +      setup_irq(IRQ_OST0, &sa1100_timer_irq);
 +
 +      clocksource_mmio_init(OSCR, "oscr", CLOCK_TICK_RATE, 200, 32,
 +              clocksource_mmio_readl_up);
++      clockevents_config_and_register(&ckevt_sa1100_osmr0, 3686400,
++                                      MIN_OSCR_DELTA * 2, 0x7fffffff);
 +}
Simple merge
Simple merge
Simple merge
Simple merge
@@@ -154,14 -153,12 +153,8 @@@ void __init sunxi_timer_init(void
        val = readl(timer_base + TIMER_CTL_REG);
        writel(val | TIMER_CTL_ENABLE, timer_base + TIMER_CTL_REG);
  
-       sunxi_clockevent.mult = div_sc(rate / TIMER_SCAL,
-                               NSEC_PER_SEC,
-                               sunxi_clockevent.shift);
-       sunxi_clockevent.max_delta_ns = clockevent_delta2ns(0xff,
-                                                           &sunxi_clockevent);
-       sunxi_clockevent.min_delta_ns = clockevent_delta2ns(0x1,
-                                                           &sunxi_clockevent);
        sunxi_clockevent.cpumask = cpumask_of(0);
  
-       clockevents_register_device(&sunxi_clockevent);
+       clockevents_config_and_register(&sunxi_clockevent, rate / TIMER_SCAL,
+                                       0x1, 0xff);
  }
 -
 -struct sys_timer sunxi_timer = {
 -      .init = sunxi_timer_init,
 -};