[PATCH 1/2] clocksource: timer-ti-dm: replace magic constant with descriptive macros

Ahmad Fatoum a.fatoum at pengutronix.de
Tue Apr 29 06:25:49 PDT 2025


This improves readability a bit, but introduces no functional change.

Suggested-by: Daniel Lezcano <daniel.lezcano at linaro.org>
Signed-off-by: Ahmad Fatoum <a.fatoum at pengutronix.de>
---
 drivers/clocksource/timer-ti-dm.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/clocksource/timer-ti-dm.c b/drivers/clocksource/timer-ti-dm.c
index 1090b96a0e94..572ea2fdc945 100644
--- a/drivers/clocksource/timer-ti-dm.c
+++ b/drivers/clocksource/timer-ti-dm.c
@@ -37,6 +37,8 @@
 #define IRQSTATUS_CLR		0x30
 #define IRQWAKEEN		0x34
 #define TCLR			0x38
+#define		TCLR_START		BIT(0)	/* Start=1 */
+#define		TCLR_AUTO_RELOAD	BIT(1)	/* Auto reload */
 #define TCRR			0x3C
 #define TLDR			0x40
 #define TTGR			0x44
@@ -76,7 +78,7 @@ int omap_dmtimer_init(void __iomem *mmio_start, unsigned clk_speed)
 	dmtimer_cs.mult = clocksource_hz2mult(clk_speed, dmtimer_cs.shift);
 
 	/* Enable counter */
-	writel(0x3, base + TCLR);
+	writel(TCLR_START | TCLR_AUTO_RELOAD, base + TCLR);
 
 	return init_clock(&dmtimer_cs);
 }
-- 
2.39.5




More information about the barebox mailing list