Skip to content

Commit 664ad59

Browse files
tmlinddlezcano
authored andcommitted
clocksource/drivers/timer-ti-dm: Add flag to detect omap1
Let's make it clear that some features need to be tested currently on omap1. Only omap1 still uses platform_data. Signed-off-by: Tony Lindgren <tony@atomide.com> Reviewed-by: Janusz Krzysztofik <jmkrzyszt@gmail.com> Link: https://lore.kernel.org/r/20220815131250.34603-9-tony@atomide.com Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
1 parent a6e543f commit 664ad59

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

drivers/clocksource/timer-ti-dm.c

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,7 @@ struct dmtimer {
133133
unsigned long rate;
134134
unsigned reserved:1;
135135
unsigned posted:1;
136+
unsigned omap1:1;
136137
struct timer_regs context;
137138
int revision;
138139
u32 capability;
@@ -423,7 +424,7 @@ static int omap_dm_timer_set_source(struct omap_dm_timer *cookie, int source)
423424
* use the clock framework to set the parent clock. To be removed
424425
* once OMAP1 migrated to using clock framework for dmtimers
425426
*/
426-
if (pdata && pdata->set_timer_src)
427+
if (timer->omap1 && pdata && pdata->set_timer_src)
427428
return pdata->set_timer_src(timer->pdev, source);
428429

429430
#if defined(CONFIG_COMMON_CLK)
@@ -476,7 +477,7 @@ static int omap_dm_timer_prepare(struct dmtimer *timer)
476477
* FIXME: OMAP1 devices do not use the clock framework for dmtimers so
477478
* do not call clk_get() for these devices.
478479
*/
479-
if (!(timer->capability & OMAP_TIMER_NEEDS_RESET)) {
480+
if (!timer->omap1) {
480481
timer->fclk = clk_get(&timer->pdev->dev, "fck");
481482
if (WARN_ON_ONCE(IS_ERR(timer->fclk))) {
482483
dev_err(&timer->pdev->dev, ": No fclk handle.\n");
@@ -763,7 +764,7 @@ static int omap_dm_timer_stop(struct omap_dm_timer *cookie)
763764

764765
dev = &timer->pdev->dev;
765766

766-
if (!(timer->capability & OMAP_TIMER_NEEDS_RESET))
767+
if (!timer->omap1)
767768
rate = clk_get_rate(timer->fclk);
768769

769770
__omap_dm_timer_stop(timer, rate);
@@ -1119,6 +1120,8 @@ static int omap_dm_timer_probe(struct platform_device *pdev)
11191120
timer->reserved = omap_dm_timer_reserved_systimer(timer->id);
11201121
}
11211122

1123+
timer->omap1 = timer->capability & OMAP_TIMER_NEEDS_RESET;
1124+
11221125
if (!(timer->capability & OMAP_TIMER_ALWON)) {
11231126
timer->nb.notifier_call = omap_timer_context_notifier;
11241127
cpu_pm_register_notifier(&timer->nb);

0 commit comments

Comments
 (0)