[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250705160129.3688026-13-daniel.lezcano@linaro.org>
Date: Sat, 5 Jul 2025 18:01:19 +0200
From: Daniel Lezcano <daniel.lezcano@...aro.org>
To: daniel.lezcano@...aro.org,
tglx@...utronix.de
Cc: ghennadi.procopciuc@....nxp.com,
S32@....com,
linux-kernel@...r.kernel.org
Subject: [PATCH 13/20] 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@...aro.org>
---
drivers/clocksource/timer-vf-pit.c | 14 ++++++++++++--
1 file changed, 12 insertions(+), 2 deletions(-)
diff --git a/drivers/clocksource/timer-vf-pit.c b/drivers/clocksource/timer-vf-pit.c
index 71a17b6aab06..2799cff2a296 100644
--- a/drivers/clocksource/timer-vf-pit.c
+++ b/drivers/clocksource/timer-vf-pit.c
@@ -62,6 +62,16 @@ static inline void pit_timer_disable(struct pit_timer *pit)
writel(0, PITTCTRL(pit->clkevt_base));
}
+static inline void pit_clocksource_enable(struct pit_timer *pit)
+{
+ writel(PITTCTRL_TEN, PITTCTRL(pit->clksrc_base));
+}
+
+static inline void pit_clocksource_disable(struct pit_timer *pit)
+{
+ pit_timer_disable(pit);
+}
+
static inline void pit_irq_acknowledge(struct pit_timer *pit)
{
writel(PITTFLG_TIF, PITTFLG(pit->clkevt_base));
@@ -95,9 +105,9 @@ static int __init pit_clocksource_init(struct pit_timer *pit, const char *name,
pit->cs.flags = CLOCK_SOURCE_IS_CONTINUOUS;
/* set the max load value and start the clock source counter */
- pit_timer_disable(pit);
+ pit_clocksource_disable(pit);
writel(~0, PITLDVAL(pit->clksrc_base));
- writel(PITTCTRL_TEN, PITTCTRL(pit->clksrc_base));
+ pit_clocksource_enable(pit);
sched_clock_base = pit->clksrc_base + PITCVAL_OFFSET;
sched_clock_register(pit_read_sched_clock, 32, rate);
--
2.43.0
Powered by blists - more mailing lists