summaryrefslogtreecommitdiff
path: root/drivers/clocksource/timer-ti-dm.c
diff options
context:
space:
mode:
authorThomas Gleixner <tglx@linutronix.de>2021-06-18 17:57:47 +0200
committerThomas Gleixner <tglx@linutronix.de>2021-06-18 17:57:47 +0200
commitf6b6a80360995ad175e43d220af979f119e52cd3 (patch)
tree9405c8fc1df1e38c424d875dd875f0109b3ea609 /drivers/clocksource/timer-ti-dm.c
parent245a057fee18be08d6ac12357463579d06bea077 (diff)
parent3d41fff3ae3980c055f3c7861264c46c924f3e4c (diff)
Merge tag 'timers-v5.14' of https://git.linaro.org/people/daniel.lezcano/linux into timers/core
Pull clockevent/source updates from Daniel Lezcano: - Remove arch_timer_rate1 variable as it is unused in the architected ARM timer (Jisheng Zhang) - Minor cleanups (whitespace, constification, ...) for the Samsung pwm timer (Krzysztof Kozlowski) - Acknowledge and disable the timer interrupt at suspend time to prevent the suspend to be aborted by the ATF if there is a pending one on the Mediatek timer (Evan Benn) - Save and restore the configuration register at suspend/resume time for TI dm timer (Tony Lindgren) - Set the scene for the next timers support by renaming the array variables on the Ingenic time (Zhou Yanjie) - Add the clock rate change notification to adjust the prescalar value and compensate the clock source on the ARM global timer (Andrea Merello) - Add missing variable static annotation on the ARM global timer (Zou Wei) - Remove a duplicate argument when building the bits field on the ARM global timer (Wan Jiabing) - Improve the timer workaround function by reducing the loop on the Allwinner A64 timer (Samuel Holland) - Do no restore the register context in case of error on the TI dm timer (Tony Lindgren) Link: https://lore.kernel.org/r/65ed5f60-d7a5-b4ae-ff78-0382d4671cc5@linaro.org
Diffstat (limited to 'drivers/clocksource/timer-ti-dm.c')
-rw-r--r--drivers/clocksource/timer-ti-dm.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/drivers/clocksource/timer-ti-dm.c b/drivers/clocksource/timer-ti-dm.c
index 33eeabf9c3d1..3e52c5226c4d 100644
--- a/drivers/clocksource/timer-ti-dm.c
+++ b/drivers/clocksource/timer-ti-dm.c
@@ -78,6 +78,9 @@ static void omap_dm_timer_write_reg(struct omap_dm_timer *timer, u32 reg,
static void omap_timer_restore_context(struct omap_dm_timer *timer)
{
+ __omap_dm_timer_write(timer, OMAP_TIMER_OCP_CFG_OFFSET,
+ timer->context.ocp_cfg, 0);
+
omap_dm_timer_write_reg(timer, OMAP_TIMER_WAKEUP_EN_REG,
timer->context.twer);
omap_dm_timer_write_reg(timer, OMAP_TIMER_COUNTER_REG,
@@ -95,6 +98,9 @@ static void omap_timer_restore_context(struct omap_dm_timer *timer)
static void omap_timer_save_context(struct omap_dm_timer *timer)
{
+ timer->context.ocp_cfg =
+ __omap_dm_timer_read(timer, OMAP_TIMER_OCP_CFG_OFFSET, 0);
+
timer->context.tclr =
omap_dm_timer_read_reg(timer, OMAP_TIMER_CTRL_REG);
timer->context.twer =
@@ -122,7 +128,8 @@ static int omap_timer_context_notifier(struct notifier_block *nb,
break;
omap_timer_save_context(timer);
break;
- case CPU_CLUSTER_PM_ENTER_FAILED:
+ case CPU_CLUSTER_PM_ENTER_FAILED: /* No need to restore context */
+ break;
case CPU_CLUSTER_PM_EXIT:
if ((timer->capability & OMAP_TIMER_ALWON) ||
!atomic_read(&timer->enabled))