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

Configure Feed

Select the types of activity you want to include in your feed.

clocksource/drivers/fttmr010: Parametrise shutdown

In preparation for supporting the ast2600 which uses a different method
to clear bits in the control register, use a callback for performing the
shutdown sequence.

Reviewed-by: Cédric Le Goater <clg@kaod.org>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Joel Stanley <joel@jms.id.au>
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Link: https://lore.kernel.org/r/20191107094218.13210-2-joel@jms.id.au

authored by

Joel Stanley and committed by
Daniel Lezcano
84fb64c2 5fb1c2a5

+8 -11
+8 -11
drivers/clocksource/timer-fttmr010.c
··· 97 97 bool is_aspeed; 98 98 u32 t1_enable_val; 99 99 struct clock_event_device clkevt; 100 + int (*timer_shutdown)(struct clock_event_device *evt); 100 101 #ifdef CONFIG_ARM 101 102 struct delay_timer delay_timer; 102 103 #endif ··· 141 140 u32 cr; 142 141 143 142 /* Stop */ 144 - cr = readl(fttmr010->base + TIMER_CR); 145 - cr &= ~fttmr010->t1_enable_val; 146 - writel(cr, fttmr010->base + TIMER_CR); 143 + fttmr010->timer_shutdown(evt); 147 144 148 145 if (fttmr010->is_aspeed) { 149 146 /* ··· 182 183 u32 cr; 183 184 184 185 /* Stop */ 185 - cr = readl(fttmr010->base + TIMER_CR); 186 - cr &= ~fttmr010->t1_enable_val; 187 - writel(cr, fttmr010->base + TIMER_CR); 186 + fttmr010->timer_shutdown(evt); 188 187 189 188 /* Setup counter start from 0 or ~0 */ 190 189 writel(0, fttmr010->base + TIMER1_COUNT); ··· 208 211 u32 cr; 209 212 210 213 /* Stop */ 211 - cr = readl(fttmr010->base + TIMER_CR); 212 - cr &= ~fttmr010->t1_enable_val; 213 - writel(cr, fttmr010->base + TIMER_CR); 214 + fttmr010->timer_shutdown(evt); 214 215 215 216 /* Setup timer to fire at 1/HZ intervals. */ 216 217 if (fttmr010->is_aspeed) { ··· 345 350 fttmr010->tick_rate); 346 351 } 347 352 353 + fttmr010->timer_shutdown = fttmr010_timer_shutdown; 354 + 348 355 /* 349 356 * Setup clockevent timer (interrupt-driven) on timer 1. 350 357 */ ··· 367 370 fttmr010->clkevt.features = CLOCK_EVT_FEAT_PERIODIC | 368 371 CLOCK_EVT_FEAT_ONESHOT; 369 372 fttmr010->clkevt.set_next_event = fttmr010_timer_set_next_event; 370 - fttmr010->clkevt.set_state_shutdown = fttmr010_timer_shutdown; 373 + fttmr010->clkevt.set_state_shutdown = fttmr010->timer_shutdown; 371 374 fttmr010->clkevt.set_state_periodic = fttmr010_timer_set_periodic; 372 375 fttmr010->clkevt.set_state_oneshot = fttmr010_timer_set_oneshot; 373 - fttmr010->clkevt.tick_resume = fttmr010_timer_shutdown; 376 + fttmr010->clkevt.tick_resume = fttmr010->timer_shutdown; 374 377 fttmr010->clkevt.cpumask = cpumask_of(0); 375 378 fttmr010->clkevt.irq = irq; 376 379 clockevents_config_and_register(&fttmr010->clkevt,