Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ARM: 8822/1: smp_twd: Remove legacy TWD registration

As of commit 7484c727b636a838 ("ARM: realview: delete the RealView board
files"), the ARM Timer and Watchdog Unit is instantiated from DT only.
Moreover, the driver is selected from ARCH_MULTIPLATFORM platforms only,
which implies OF, TIMER_OF, and COMMON_CLK.

Hence remove all unused legacy infrastructure from the driver.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Acked-by: Marc Zyngier <marc.zyngier@arm.com>
Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>

authored by

Geert Uytterhoeven and committed by
Russell King
fec9eac6 8f433ec4

-83
-1
arch/arm/Kconfig
··· 1316 1316 1317 1317 config HAVE_ARM_TWD 1318 1318 bool 1319 - select TIMER_OF if OF 1320 1319 help 1321 1320 This options enables support for the ARM timer and watchdog unit 1322 1321
-16
arch/arm/include/asm/smp_twd.h
··· 19 19 #define TWD_TIMER_CONTROL_PERIODIC (1 << 1) 20 20 #define TWD_TIMER_CONTROL_IT_ENABLE (1 << 2) 21 21 22 - #include <linux/ioport.h> 23 - 24 - struct twd_local_timer { 25 - struct resource res[2]; 26 - }; 27 - 28 - #define DEFINE_TWD_LOCAL_TIMER(name,base,irq) \ 29 - struct twd_local_timer name __initdata = { \ 30 - .res = { \ 31 - DEFINE_RES_MEM(base, 0x10), \ 32 - DEFINE_RES_IRQ(irq), \ 33 - }, \ 34 - }; 35 - 36 - int twd_local_timer_register(struct twd_local_timer *); 37 - 38 22 #endif
-66
arch/arm/kernel/smp_twd.c
··· 100 100 disable_percpu_irq(clk->irq); 101 101 } 102 102 103 - #ifdef CONFIG_COMMON_CLK 104 - 105 103 /* 106 104 * Updates clockevent frequency when the cpu frequency changes. 107 105 * Called on the cpu that is changing frequency with interrupts disabled. ··· 140 142 return 0; 141 143 } 142 144 core_initcall(twd_clk_init); 143 - 144 - #elif defined (CONFIG_CPU_FREQ) 145 - 146 - #include <linux/cpufreq.h> 147 - 148 - /* 149 - * Updates clockevent frequency when the cpu frequency changes. 150 - * Called on the cpu that is changing frequency with interrupts disabled. 151 - */ 152 - static void twd_update_frequency(void *data) 153 - { 154 - twd_timer_rate = clk_get_rate(twd_clk); 155 - 156 - clockevents_update_freq(raw_cpu_ptr(twd_evt), twd_timer_rate); 157 - } 158 - 159 - static int twd_cpufreq_transition(struct notifier_block *nb, 160 - unsigned long state, void *data) 161 - { 162 - struct cpufreq_freqs *freqs = data; 163 - 164 - /* 165 - * The twd clock events must be reprogrammed to account for the new 166 - * frequency. The timer is local to a cpu, so cross-call to the 167 - * changing cpu. 168 - */ 169 - if (state == CPUFREQ_POSTCHANGE) 170 - smp_call_function_single(freqs->cpu, twd_update_frequency, 171 - NULL, 1); 172 - 173 - return NOTIFY_OK; 174 - } 175 - 176 - static struct notifier_block twd_cpufreq_nb = { 177 - .notifier_call = twd_cpufreq_transition, 178 - }; 179 - 180 - static int twd_cpufreq_init(void) 181 - { 182 - if (twd_evt && raw_cpu_ptr(twd_evt) && !IS_ERR(twd_clk)) 183 - return cpufreq_register_notifier(&twd_cpufreq_nb, 184 - CPUFREQ_TRANSITION_NOTIFIER); 185 - 186 - return 0; 187 - } 188 - core_initcall(twd_cpufreq_init); 189 - 190 - #endif 191 145 192 146 static void twd_calibrate_rate(void) 193 147 { ··· 316 366 return err; 317 367 } 318 368 319 - int __init twd_local_timer_register(struct twd_local_timer *tlt) 320 - { 321 - if (twd_base || twd_evt) 322 - return -EBUSY; 323 - 324 - twd_ppi = tlt->res[1].start; 325 - 326 - twd_base = ioremap(tlt->res[0].start, resource_size(&tlt->res[0])); 327 - if (!twd_base) 328 - return -ENOMEM; 329 - 330 - return twd_local_timer_common_register(NULL); 331 - } 332 - 333 - #ifdef CONFIG_OF 334 369 static int __init twd_local_timer_of_register(struct device_node *np) 335 370 { 336 371 int err; ··· 341 406 TIMER_OF_DECLARE(arm_twd_a9, "arm,cortex-a9-twd-timer", twd_local_timer_of_register); 342 407 TIMER_OF_DECLARE(arm_twd_a5, "arm,cortex-a5-twd-timer", twd_local_timer_of_register); 343 408 TIMER_OF_DECLARE(arm_twd_11mp, "arm,arm11mp-twd-timer", twd_local_timer_of_register); 344 - #endif