[COMMON] clocksource: exynos_mct: restore TCNTB value in resume
authorHosung Kim <hosung0.kim@samsung.com>
Wed, 28 Jun 2017 13:09:18 +0000 (22:09 +0900)
committerYoungmin Nam <youngmin.nam@samsung.com>
Thu, 2 May 2019 07:21:55 +0000 (16:21 +0900)
This commit restores TCNTB value in resume of CPU0.
Other CPUs are controlled hotplug framework while suspend/resume.
But CPU0 is except in this sequence. So some register setting
is needed like TCNTB value.

Change-Id: I1a0dbf2e8f9e73de778910796e180b493c8441d2
Signed-off-by: Hosung Kim <hosung0.kim@samsung.com>
drivers/clocksource/exynos_mct.c

index 27b41aae04fa316b76bee84a9a7e66b3e40cc834..eb641cd628ea5d9589d1f79a1905df7bd0a39515 100644 (file)
@@ -424,6 +424,17 @@ static int set_state_periodic(struct clock_event_device *evt)
        return 0;
 }
 
+static int set_state_resume(struct clock_event_device *evt)
+{
+       struct mct_clock_event_device *mevt;
+
+       mevt = container_of(evt, struct mct_clock_event_device, evt);
+       exynos4_mct_tick_stop(mevt, 1);
+
+       exynos4_mct_write(TICK_BASE_CNT, mevt->base + MCT_L_TCNTB_OFFSET);
+       return 0;
+}
+
 static irqreturn_t exynos4_mct_tick_isr(int irq, void *dev_id)
 {
        struct mct_clock_event_device *mevt = dev_id;
@@ -452,7 +463,7 @@ static int exynos4_mct_starting_cpu(unsigned int cpu)
        evt->set_state_shutdown = set_state_shutdown;
        evt->set_state_oneshot = set_state_shutdown;
        evt->set_state_oneshot_stopped = set_state_shutdown;
-       evt->tick_resume = set_state_shutdown;
+       evt->tick_resume = set_state_resume;
        evt->features = CLOCK_EVT_FEAT_PERIODIC | CLOCK_EVT_FEAT_ONESHOT;
        evt->rating = 450;