diff options
author | Magnus Damm <damm@igel.co.jp> | 2009-04-21 15:24:00 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-04-21 16:41:47 -0400 |
commit | 8e19608e8b5c001e4a66ce482edc474f05fb7355 (patch) | |
tree | 06af4be339136da7476396604c30112238d84339 /arch/arm | |
parent | ff14ed5db6e7e5e5dc23712d3c877891d4d9a1a8 (diff) |
clocksource: pass clocksource to read() callback
Pass clocksource pointer to the read() callback for clocksources. This
allows us to share the callback between multiple instances.
[hugh@veritas.com: fix powerpc build of clocksource pass clocksource mods]
[akpm@linux-foundation.org: cleanup]
Signed-off-by: Magnus Damm <damm@igel.co.jp>
Acked-by: John Stultz <johnstul@us.ibm.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Hugh Dickins <hugh@veritas.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'arch/arm')
-rw-r--r-- | arch/arm/mach-at91/at91rm9200_time.c | 2 | ||||
-rw-r--r-- | arch/arm/mach-at91/at91sam926x_time.c | 2 | ||||
-rw-r--r-- | arch/arm/mach-davinci/time.c | 2 | ||||
-rw-r--r-- | arch/arm/mach-imx/time.c | 2 | ||||
-rw-r--r-- | arch/arm/mach-ixp4xx/common.c | 2 | ||||
-rw-r--r-- | arch/arm/mach-msm/timer.c | 4 | ||||
-rw-r--r-- | arch/arm/mach-netx/time.c | 2 | ||||
-rw-r--r-- | arch/arm/mach-ns9xxx/time-ns9360.c | 2 | ||||
-rw-r--r-- | arch/arm/mach-omap1/time.c | 2 | ||||
-rw-r--r-- | arch/arm/mach-omap2/timer-gp.c | 2 | ||||
-rw-r--r-- | arch/arm/mach-pxa/time.c | 2 | ||||
-rw-r--r-- | arch/arm/mach-realview/core.c | 2 | ||||
-rw-r--r-- | arch/arm/mach-versatile/core.c | 2 | ||||
-rw-r--r-- | arch/arm/plat-mxc/time.c | 2 | ||||
-rw-r--r-- | arch/arm/plat-omap/common.c | 4 | ||||
-rw-r--r-- | arch/arm/plat-orion/time.c | 2 |
16 files changed, 18 insertions, 18 deletions
diff --git a/arch/arm/mach-at91/at91rm9200_time.c b/arch/arm/mach-at91/at91rm9200_time.c index 1ff1bda0a894..309f3511aa20 100644 --- a/arch/arm/mach-at91/at91rm9200_time.c +++ b/arch/arm/mach-at91/at91rm9200_time.c | |||
@@ -85,7 +85,7 @@ static struct irqaction at91rm9200_timer_irq = { | |||
85 | .handler = at91rm9200_timer_interrupt | 85 | .handler = at91rm9200_timer_interrupt |
86 | }; | 86 | }; |
87 | 87 | ||
88 | static cycle_t read_clk32k(void) | 88 | static cycle_t read_clk32k(struct clocksource *cs) |
89 | { | 89 | { |
90 | return read_CRTR(); | 90 | return read_CRTR(); |
91 | } | 91 | } |
diff --git a/arch/arm/mach-at91/at91sam926x_time.c b/arch/arm/mach-at91/at91sam926x_time.c index b63e1d5f1bad..4bd56aee4370 100644 --- a/arch/arm/mach-at91/at91sam926x_time.c +++ b/arch/arm/mach-at91/at91sam926x_time.c | |||
@@ -31,7 +31,7 @@ static u32 pit_cnt; /* access only w/system irq blocked */ | |||
31 | * Clocksource: just a monotonic counter of MCK/16 cycles. | 31 | * Clocksource: just a monotonic counter of MCK/16 cycles. |
32 | * We don't care whether or not PIT irqs are enabled. | 32 | * We don't care whether or not PIT irqs are enabled. |
33 | */ | 33 | */ |
34 | static cycle_t read_pit_clk(void) | 34 | static cycle_t read_pit_clk(struct clocksource *cs) |
35 | { | 35 | { |
36 | unsigned long flags; | 36 | unsigned long flags; |
37 | u32 elapsed; | 37 | u32 elapsed; |
diff --git a/arch/arm/mach-davinci/time.c b/arch/arm/mach-davinci/time.c index f8bcd29d17a6..6c227d4ba998 100644 --- a/arch/arm/mach-davinci/time.c +++ b/arch/arm/mach-davinci/time.c | |||
@@ -238,7 +238,7 @@ static void __init timer_init(void) | |||
238 | /* | 238 | /* |
239 | * clocksource | 239 | * clocksource |
240 | */ | 240 | */ |
241 | static cycle_t read_cycles(void) | 241 | static cycle_t read_cycles(struct clocksource *cs) |
242 | { | 242 | { |
243 | struct timer_s *t = &timers[TID_CLOCKSOURCE]; | 243 | struct timer_s *t = &timers[TID_CLOCKSOURCE]; |
244 | 244 | ||
diff --git a/arch/arm/mach-imx/time.c b/arch/arm/mach-imx/time.c index aff0ebcfa847..5aef18b599e5 100644 --- a/arch/arm/mach-imx/time.c +++ b/arch/arm/mach-imx/time.c | |||
@@ -73,7 +73,7 @@ static void __init imx_timer_hardware_init(void) | |||
73 | IMX_TCTL(TIMER_BASE) = TCTL_FRR | TCTL_CLK_PCLK1 | TCTL_TEN; | 73 | IMX_TCTL(TIMER_BASE) = TCTL_FRR | TCTL_CLK_PCLK1 | TCTL_TEN; |
74 | } | 74 | } |
75 | 75 | ||
76 | cycle_t imx_get_cycles(void) | 76 | cycle_t imx_get_cycles(struct clocksource *cs) |
77 | { | 77 | { |
78 | return IMX_TCN(TIMER_BASE); | 78 | return IMX_TCN(TIMER_BASE); |
79 | } | 79 | } |
diff --git a/arch/arm/mach-ixp4xx/common.c b/arch/arm/mach-ixp4xx/common.c index f4656d2ac8a8..1e93dfee7543 100644 --- a/arch/arm/mach-ixp4xx/common.c +++ b/arch/arm/mach-ixp4xx/common.c | |||
@@ -401,7 +401,7 @@ void __init ixp4xx_sys_init(void) | |||
401 | /* | 401 | /* |
402 | * clocksource | 402 | * clocksource |
403 | */ | 403 | */ |
404 | cycle_t ixp4xx_get_cycles(void) | 404 | cycle_t ixp4xx_get_cycles(struct clocksource *cs) |
405 | { | 405 | { |
406 | return *IXP4XX_OSTS; | 406 | return *IXP4XX_OSTS; |
407 | } | 407 | } |
diff --git a/arch/arm/mach-msm/timer.c b/arch/arm/mach-msm/timer.c index 444d9c0f5ca6..4855b8ca5101 100644 --- a/arch/arm/mach-msm/timer.c +++ b/arch/arm/mach-msm/timer.c | |||
@@ -57,12 +57,12 @@ static irqreturn_t msm_timer_interrupt(int irq, void *dev_id) | |||
57 | return IRQ_HANDLED; | 57 | return IRQ_HANDLED; |
58 | } | 58 | } |
59 | 59 | ||
60 | static cycle_t msm_gpt_read(void) | 60 | static cycle_t msm_gpt_read(struct clocksource *cs) |
61 | { | 61 | { |
62 | return readl(MSM_GPT_BASE + TIMER_COUNT_VAL); | 62 | return readl(MSM_GPT_BASE + TIMER_COUNT_VAL); |
63 | } | 63 | } |
64 | 64 | ||
65 | static cycle_t msm_dgt_read(void) | 65 | static cycle_t msm_dgt_read(struct clocksource *cs) |
66 | { | 66 | { |
67 | return readl(MSM_DGT_BASE + TIMER_COUNT_VAL) >> MSM_DGT_SHIFT; | 67 | return readl(MSM_DGT_BASE + TIMER_COUNT_VAL) >> MSM_DGT_SHIFT; |
68 | } | 68 | } |
diff --git a/arch/arm/mach-netx/time.c b/arch/arm/mach-netx/time.c index f201fddb594f..82801dbf0579 100644 --- a/arch/arm/mach-netx/time.c +++ b/arch/arm/mach-netx/time.c | |||
@@ -104,7 +104,7 @@ static struct irqaction netx_timer_irq = { | |||
104 | .handler = netx_timer_interrupt, | 104 | .handler = netx_timer_interrupt, |
105 | }; | 105 | }; |
106 | 106 | ||
107 | cycle_t netx_get_cycles(void) | 107 | cycle_t netx_get_cycles(struct clocksource *cs) |
108 | { | 108 | { |
109 | return readl(NETX_GPIO_COUNTER_CURRENT(TIMER_CLOCKSOURCE)); | 109 | return readl(NETX_GPIO_COUNTER_CURRENT(TIMER_CLOCKSOURCE)); |
110 | } | 110 | } |
diff --git a/arch/arm/mach-ns9xxx/time-ns9360.c b/arch/arm/mach-ns9xxx/time-ns9360.c index 41df69721769..77281260358a 100644 --- a/arch/arm/mach-ns9xxx/time-ns9360.c +++ b/arch/arm/mach-ns9xxx/time-ns9360.c | |||
@@ -25,7 +25,7 @@ | |||
25 | #define TIMER_CLOCKEVENT 1 | 25 | #define TIMER_CLOCKEVENT 1 |
26 | static u32 latch; | 26 | static u32 latch; |
27 | 27 | ||
28 | static cycle_t ns9360_clocksource_read(void) | 28 | static cycle_t ns9360_clocksource_read(struct clocksource *cs) |
29 | { | 29 | { |
30 | return __raw_readl(SYS_TR(TIMER_CLOCKSOURCE)); | 30 | return __raw_readl(SYS_TR(TIMER_CLOCKSOURCE)); |
31 | } | 31 | } |
diff --git a/arch/arm/mach-omap1/time.c b/arch/arm/mach-omap1/time.c index 495a32c287b4..4d56408d3cff 100644 --- a/arch/arm/mach-omap1/time.c +++ b/arch/arm/mach-omap1/time.c | |||
@@ -198,7 +198,7 @@ static struct irqaction omap_mpu_timer2_irq = { | |||
198 | .handler = omap_mpu_timer2_interrupt, | 198 | .handler = omap_mpu_timer2_interrupt, |
199 | }; | 199 | }; |
200 | 200 | ||
201 | static cycle_t mpu_read(void) | 201 | static cycle_t mpu_read(struct clocksource *cs) |
202 | { | 202 | { |
203 | return ~omap_mpu_timer_read(1); | 203 | return ~omap_mpu_timer_read(1); |
204 | } | 204 | } |
diff --git a/arch/arm/mach-omap2/timer-gp.c b/arch/arm/mach-omap2/timer-gp.c index 9fc13a2cc3f4..1cb2c0909c2b 100644 --- a/arch/arm/mach-omap2/timer-gp.c +++ b/arch/arm/mach-omap2/timer-gp.c | |||
@@ -138,7 +138,7 @@ static inline void __init omap2_gp_clocksource_init(void) {} | |||
138 | * clocksource | 138 | * clocksource |
139 | */ | 139 | */ |
140 | static struct omap_dm_timer *gpt_clocksource; | 140 | static struct omap_dm_timer *gpt_clocksource; |
141 | static cycle_t clocksource_read_cycles(void) | 141 | static cycle_t clocksource_read_cycles(struct clocksource *cs) |
142 | { | 142 | { |
143 | return (cycle_t)omap_dm_timer_read_counter(gpt_clocksource); | 143 | return (cycle_t)omap_dm_timer_read_counter(gpt_clocksource); |
144 | } | 144 | } |
diff --git a/arch/arm/mach-pxa/time.c b/arch/arm/mach-pxa/time.c index 8eb3830fbb0b..750c448db672 100644 --- a/arch/arm/mach-pxa/time.c +++ b/arch/arm/mach-pxa/time.c | |||
@@ -125,7 +125,7 @@ static struct clock_event_device ckevt_pxa_osmr0 = { | |||
125 | .set_mode = pxa_osmr0_set_mode, | 125 | .set_mode = pxa_osmr0_set_mode, |
126 | }; | 126 | }; |
127 | 127 | ||
128 | static cycle_t pxa_read_oscr(void) | 128 | static cycle_t pxa_read_oscr(struct clocksource *cs) |
129 | { | 129 | { |
130 | return OSCR; | 130 | return OSCR; |
131 | } | 131 | } |
diff --git a/arch/arm/mach-realview/core.c b/arch/arm/mach-realview/core.c index 9ab947c14f26..942e1a7eb9b2 100644 --- a/arch/arm/mach-realview/core.c +++ b/arch/arm/mach-realview/core.c | |||
@@ -715,7 +715,7 @@ static struct irqaction realview_timer_irq = { | |||
715 | .handler = realview_timer_interrupt, | 715 | .handler = realview_timer_interrupt, |
716 | }; | 716 | }; |
717 | 717 | ||
718 | static cycle_t realview_get_cycles(void) | 718 | static cycle_t realview_get_cycles(struct clocksource *cs) |
719 | { | 719 | { |
720 | return ~readl(timer3_va_base + TIMER_VALUE); | 720 | return ~readl(timer3_va_base + TIMER_VALUE); |
721 | } | 721 | } |
diff --git a/arch/arm/mach-versatile/core.c b/arch/arm/mach-versatile/core.c index 565776680d8c..1f929c391af7 100644 --- a/arch/arm/mach-versatile/core.c +++ b/arch/arm/mach-versatile/core.c | |||
@@ -948,7 +948,7 @@ static struct irqaction versatile_timer_irq = { | |||
948 | .handler = versatile_timer_interrupt, | 948 | .handler = versatile_timer_interrupt, |
949 | }; | 949 | }; |
950 | 950 | ||
951 | static cycle_t versatile_get_cycles(void) | 951 | static cycle_t versatile_get_cycles(struct clocksource *cs) |
952 | { | 952 | { |
953 | return ~readl(TIMER3_VA_BASE + TIMER_VALUE); | 953 | return ~readl(TIMER3_VA_BASE + TIMER_VALUE); |
954 | } | 954 | } |
diff --git a/arch/arm/plat-mxc/time.c b/arch/arm/plat-mxc/time.c index ef1b3cd85bd3..dab3357196fb 100644 --- a/arch/arm/plat-mxc/time.c +++ b/arch/arm/plat-mxc/time.c | |||
@@ -36,7 +36,7 @@ static enum clock_event_mode clockevent_mode = CLOCK_EVT_MODE_UNUSED; | |||
36 | 36 | ||
37 | /* clock source */ | 37 | /* clock source */ |
38 | 38 | ||
39 | static cycle_t mxc_get_cycles(void) | 39 | static cycle_t mxc_get_cycles(struct clocksource *cs) |
40 | { | 40 | { |
41 | return __raw_readl(TIMER_BASE + MXC_TCN); | 41 | return __raw_readl(TIMER_BASE + MXC_TCN); |
42 | } | 42 | } |
diff --git a/arch/arm/plat-omap/common.c b/arch/arm/plat-omap/common.c index d1797147732f..433021f3d7cc 100644 --- a/arch/arm/plat-omap/common.c +++ b/arch/arm/plat-omap/common.c | |||
@@ -185,7 +185,7 @@ console_initcall(omap_add_serial_console); | |||
185 | 185 | ||
186 | #include <linux/clocksource.h> | 186 | #include <linux/clocksource.h> |
187 | 187 | ||
188 | static cycle_t omap_32k_read(void) | 188 | static cycle_t omap_32k_read(struct clocksource *cs) |
189 | { | 189 | { |
190 | return omap_readl(TIMER_32K_SYNCHRONIZED); | 190 | return omap_readl(TIMER_32K_SYNCHRONIZED); |
191 | } | 191 | } |
@@ -207,7 +207,7 @@ unsigned long long sched_clock(void) | |||
207 | { | 207 | { |
208 | unsigned long long ret; | 208 | unsigned long long ret; |
209 | 209 | ||
210 | ret = (unsigned long long)omap_32k_read(); | 210 | ret = (unsigned long long)omap_32k_read(&clocksource_32k); |
211 | ret = (ret * clocksource_32k.mult_orig) >> clocksource_32k.shift; | 211 | ret = (ret * clocksource_32k.mult_orig) >> clocksource_32k.shift; |
212 | return ret; | 212 | return ret; |
213 | } | 213 | } |
diff --git a/arch/arm/plat-orion/time.c b/arch/arm/plat-orion/time.c index 6fa2923e6dca..2faf9dba4ef7 100644 --- a/arch/arm/plat-orion/time.c +++ b/arch/arm/plat-orion/time.c | |||
@@ -41,7 +41,7 @@ static u32 ticks_per_jiffy; | |||
41 | /* | 41 | /* |
42 | * Clocksource handling. | 42 | * Clocksource handling. |
43 | */ | 43 | */ |
44 | static cycle_t orion_clksrc_read(void) | 44 | static cycle_t orion_clksrc_read(struct clocksource *cs) |
45 | { | 45 | { |
46 | return 0xffffffff - readl(TIMER0_VAL); | 46 | return 0xffffffff - readl(TIMER0_VAL); |
47 | } | 47 | } |