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/vf-pit: Encapsulate clocksource enable / disable

For the sake of lisibility, let's encapsulate the writel calls to
enable and disable the timer into a function with a self-explainatory
name.

Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Link: https://lore.kernel.org/r/20250804152344.1109310-14-daniel.lezcano@linaro.org

+12 -2
+12 -2
drivers/clocksource/timer-vf-pit.c
··· 62 62 writel(0, PITTCTRL(pit->clkevt_base)); 63 63 } 64 64 65 + static inline void pit_clocksource_enable(struct pit_timer *pit) 66 + { 67 + writel(PITTCTRL_TEN, PITTCTRL(pit->clksrc_base)); 68 + } 69 + 70 + static inline void pit_clocksource_disable(struct pit_timer *pit) 71 + { 72 + pit_timer_disable(pit); 73 + } 74 + 65 75 static inline void pit_irq_acknowledge(struct pit_timer *pit) 66 76 { 67 77 writel(PITTFLG_TIF, PITTFLG(pit->clkevt_base)); ··· 105 95 pit->cs.flags = CLOCK_SOURCE_IS_CONTINUOUS; 106 96 107 97 /* set the max load value and start the clock source counter */ 108 - pit_timer_disable(pit); 98 + pit_clocksource_disable(pit); 109 99 writel(~0, PITLDVAL(pit->clksrc_base)); 110 - writel(PITTCTRL_TEN, PITTCTRL(pit->clksrc_base)); 100 + pit_clocksource_enable(pit); 111 101 112 102 sched_clock_base = pit->clksrc_base + PITCVAL_OFFSET; 113 103 sched_clock_register(pit_read_sched_clock, 32, rate);