diff options
author | Paul Mundt <lethal@linux-sh.org> | 2006-10-04 00:27:32 -0400 |
---|---|---|
committer | Paul Mundt <pmundt@dysnomia.hsdv.com> | 2006-10-06 02:26:21 -0400 |
commit | a700f3594d63a85af196ac64984f7375d903afad (patch) | |
tree | b5a60ae64be34219a08c96cafc40abc1e754bbfe /arch | |
parent | 458821452642fd5dc2377b73cd1323fd4a9653e7 (diff) |
sh: Kill off timer_ops get_frequency().
We're not using this anywhere these days, kill it off.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/sh/kernel/timers/timer-tmu.c | 58 |
1 files changed, 2 insertions, 56 deletions
diff --git a/arch/sh/kernel/timers/timer-tmu.c b/arch/sh/kernel/timers/timer-tmu.c index 205816fcf0da..badfedb455a9 100644 --- a/arch/sh/kernel/timers/timer-tmu.c +++ b/arch/sh/kernel/timers/timer-tmu.c | |||
@@ -111,60 +111,6 @@ static struct irqaction tmu_irq = { | |||
111 | .mask = CPU_MASK_NONE, | 111 | .mask = CPU_MASK_NONE, |
112 | }; | 112 | }; |
113 | 113 | ||
114 | /* | ||
115 | * Hah! We'll see if this works (switching from usecs to nsecs). | ||
116 | */ | ||
117 | static unsigned long tmu_timer_get_frequency(void) | ||
118 | { | ||
119 | u32 freq; | ||
120 | struct timespec ts1, ts2; | ||
121 | unsigned long diff_nsec; | ||
122 | unsigned long factor; | ||
123 | |||
124 | /* Setup the timer: We don't want to generate interrupts, just | ||
125 | * have it count down at its natural rate. | ||
126 | */ | ||
127 | ctrl_outb(0, TMU_TSTR); | ||
128 | #if !defined(CONFIG_CPU_SUBTYPE_SH7300) && !defined(CONFIG_CPU_SUBTYPE_SH7760) | ||
129 | ctrl_outb(TMU_TOCR_INIT, TMU_TOCR); | ||
130 | #endif | ||
131 | ctrl_outw(TMU0_TCR_CALIB, TMU0_TCR); | ||
132 | ctrl_outl(0xffffffff, TMU0_TCOR); | ||
133 | ctrl_outl(0xffffffff, TMU0_TCNT); | ||
134 | |||
135 | rtc_sh_get_time(&ts2); | ||
136 | |||
137 | do { | ||
138 | rtc_sh_get_time(&ts1); | ||
139 | } while (ts1.tv_nsec == ts2.tv_nsec && ts1.tv_sec == ts2.tv_sec); | ||
140 | |||
141 | /* actually start the timer */ | ||
142 | ctrl_outb(TMU_TSTR_INIT, TMU_TSTR); | ||
143 | |||
144 | do { | ||
145 | rtc_sh_get_time(&ts2); | ||
146 | } while (ts1.tv_nsec == ts2.tv_nsec && ts1.tv_sec == ts2.tv_sec); | ||
147 | |||
148 | freq = 0xffffffff - ctrl_inl(TMU0_TCNT); | ||
149 | if (ts2.tv_nsec < ts1.tv_nsec) { | ||
150 | ts2.tv_nsec += 1000000000; | ||
151 | ts2.tv_sec--; | ||
152 | } | ||
153 | |||
154 | diff_nsec = (ts2.tv_sec - ts1.tv_sec) * 1000000000 + (ts2.tv_nsec - ts1.tv_nsec); | ||
155 | |||
156 | /* this should work well if the RTC has a precision of n Hz, where | ||
157 | * n is an integer. I don't think we have to worry about the other | ||
158 | * cases. */ | ||
159 | factor = (1000000000 + diff_nsec/2) / diff_nsec; | ||
160 | |||
161 | if (factor * diff_nsec > 1100000000 || | ||
162 | factor * diff_nsec < 900000000) | ||
163 | panic("weird RTC (diff_nsec %ld)", diff_nsec); | ||
164 | |||
165 | return freq * factor; | ||
166 | } | ||
167 | |||
168 | static void tmu_clk_init(struct clk *clk) | 114 | static void tmu_clk_init(struct clk *clk) |
169 | { | 115 | { |
170 | u8 divisor = TMU0_TCR_INIT & 0x7; | 116 | u8 divisor = TMU0_TCR_INIT & 0x7; |
@@ -232,12 +178,12 @@ struct sys_timer_ops tmu_timer_ops = { | |||
232 | .init = tmu_timer_init, | 178 | .init = tmu_timer_init, |
233 | .start = tmu_timer_start, | 179 | .start = tmu_timer_start, |
234 | .stop = tmu_timer_stop, | 180 | .stop = tmu_timer_stop, |
235 | .get_frequency = tmu_timer_get_frequency, | 181 | #ifndef CONFIG_GENERIC_TIME |
236 | .get_offset = tmu_timer_get_offset, | 182 | .get_offset = tmu_timer_get_offset, |
183 | #endif | ||
237 | }; | 184 | }; |
238 | 185 | ||
239 | struct sys_timer tmu_timer = { | 186 | struct sys_timer tmu_timer = { |
240 | .name = "tmu", | 187 | .name = "tmu", |
241 | .ops = &tmu_timer_ops, | 188 | .ops = &tmu_timer_ops, |
242 | }; | 189 | }; |
243 | |||