Re: [PATCH v2 2/3] clocksource/drivers/timer-ti-dm: Add clocksource support
From: Daniel Lezcano
Date: Tue Jan 20 2026 - 10:04:36 EST
On 12/16/25 21:03, Markus Schneider-Pargmann (TI.com) wrote:
Add support for using the TI Dual-Mode Timer as a clocksource. The
driver automatically picks the first timer that is marked as always-on
on with the "ti,timer-alwon" property to be the clocksource.
The timer can then be used for CPU independent time keeping.
Signed-off-by: Markus Schneider-Pargmann (TI.com) <msp@xxxxxxxxxxxx>
---
[ ... ]
+static int omap_dm_timer_setup_clocksource(struct dmtimer *timer)
+{
+ struct device *dev = &timer->pdev->dev;
+ struct dmtimer_clocksource *clksrc;
+ int err;
+
+ __omap_dm_timer_init_regs(timer);
+
+ timer->reserved = 1;
+
+ clksrc = devm_kzalloc(dev, sizeof(*clksrc), GFP_KERNEL);
+ if (!clksrc)
+ return -ENOMEM;
[ ... ]
+ clksrc->timer = timer;
+ timer->clksrc = clksrc;
This is a cyclic dependency which is not desired in general.
I suggest to have struct dmtimer_clocksource containing struct dmtimer timer
[ ... ]
--
<http://www.linaro.org/> Linaro.org │ Open source software for ARM SoCs
Follow Linaro: <http://www.facebook.com/pages/Linaro> Facebook |
<http://twitter.com/#!/linaroorg> Twitter |
<http://www.linaro.org/linaro-blog/> Blog