Re: [PATCH v4 2/3] clocksource/drivers/timer-ti-dm: Add clocksource support
From: Daniel Lezcano
Date: Wed May 06 2026 - 11:14:00 EST
On Mon, Mar 09, 2026 at 11:45:47AM +0100, Markus Schneider-Pargmann 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>
> ---
> drivers/clocksource/timer-ti-dm.c | 137 ++++++++++++++++++++++++++++++++++++++
> 1 file changed, 137 insertions(+)
[ ... ]
>
> timer->pdev = pdev;
>
> + res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> +
> + if (omap_dm_timer_clocksource_base && res &&
> + res->start == omap_dm_timer_clocksource_base &&
> + !IS_ERR_OR_NULL(timer->fclk)) {
> + ret = omap_dm_timer_setup_clocksource(timer);
> + if (ret)
> + return ret;
> + }
No please, this is very confusing.
timer->capability |= OMAP_TIMER_ALWON is available
res->start has not to be checked against omap_dm_timer_clocksource_base
Basically, you should endup with one change in this probe function.
if (!omap_dm_timer_clocksource_base) {
ret = omap_dm_timer_setup_clocksource(timer);
if (ret)
return ret;
}
I suggest to do some cleanups in the driver in order to set the scene
for your changes.
> +
> pm_runtime_enable(dev);
>
> if (!timer->reserved) {
>
> --
> 2.53.0
>
--