Commit a700f3594d63a85af196ac64984f7375d903afad

Authored by Paul Mundt
Committed by Paul Mundt
1 parent 4588214526

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>

Showing 2 changed files with 2 additions and 62 deletions Side-by-side Diff

arch/sh/kernel/timers/timer-tmu.c
... ... @@ -111,60 +111,6 @@
111 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 114 static void tmu_clk_init(struct clk *clk)
169 115 {
170 116 u8 divisor = TMU0_TCR_INIT & 0x7;
171 117  
... ... @@ -232,8 +178,9 @@
232 178 .init = tmu_timer_init,
233 179 .start = tmu_timer_start,
234 180 .stop = tmu_timer_stop,
235   - .get_frequency = tmu_timer_get_frequency,
  181 +#ifndef CONFIG_GENERIC_TIME
236 182 .get_offset = tmu_timer_get_offset,
  183 +#endif
237 184 };
238 185  
239 186 struct sys_timer tmu_timer = {
include/asm-sh/timer.h
... ... @@ -11,7 +11,6 @@
11 11 #ifndef CONFIG_GENERIC_TIME
12 12 unsigned long (*get_offset)(void);
13 13 #endif
14   - unsigned long (*get_frequency)(void);
15 14 };
16 15  
17 16 struct sys_timer {
... ... @@ -32,11 +31,6 @@
32 31 return sys_timer->ops->get_offset();
33 32 }
34 33 #endif
35   -
36   -static inline unsigned long get_timer_frequency(void)
37   -{
38   - return sys_timer->ops->get_frequency();
39   -}
40 34  
41 35 /* arch/sh/kernel/timers/timer.c */
42 36 struct sys_timer *get_sys_timer(void);