[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1553483149-8922-3-git-send-email-sugaya.taichi@socionext.com>
Date: Mon, 25 Mar 2019 12:05:48 +0900
From: Sugaya Taichi <sugaya.taichi@...ionext.com>
To: Daniel Lezcano <daniel.lezcano@...aro.org>,
Thomas Gleixner <tglx@...utronix.de>,
linux-kernel@...r.kernel.org
Cc: Takao Orito <orito.takao@...ionext.com>,
Kazuhiro Kasai <kasai.kazuhiro@...ionext.com>,
Shinji Kanematsu <kanematsu.shinji@...ionext.com>,
Jassi Brar <jaswinder.singh@...aro.org>,
Masami Hiramatsu <masami.hiramatsu@...aro.org>,
Sugaya Taichi <sugaya.taichi@...ionext.com>
Subject: [PATCH 2/3] clocksource/drivers/timer-milbeaut: Add shutdown function
Add a shutdown operation to support shutdown timer.
Signed-off-by: Sugaya Taichi <sugaya.taichi@...ionext.com>
---
drivers/clocksource/timer-milbeaut.c | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/drivers/clocksource/timer-milbeaut.c b/drivers/clocksource/timer-milbeaut.c
index 9fd5d08..f478061 100644
--- a/drivers/clocksource/timer-milbeaut.c
+++ b/drivers/clocksource/timer-milbeaut.c
@@ -85,6 +85,15 @@ static int mlb_set_state_oneshot(struct clock_event_device *clk)
return 0;
}
+static int mlb_set_state_shutdown(struct clock_event_device *clk)
+{
+ struct timer_of *to = to_timer_of(clk);
+ u32 val = MLB_TMR_TMCSR_CSL_DIV2;
+
+ writel_relaxed(val, timer_of_base(to) + MLB_TMR_EVT_TMCSR_OFS);
+ return 0;
+}
+
static int mlb_clkevt_next_event(unsigned long event,
struct clock_event_device *clk)
{
@@ -125,6 +134,7 @@ static int mlb_config_clock_event(struct timer_of *to)
.features = CLOCK_EVT_FEAT_DYNIRQ | CLOCK_EVT_FEAT_ONESHOT,
.set_state_oneshot = mlb_set_state_oneshot,
.set_state_periodic = mlb_set_state_periodic,
+ .set_state_shutdown = mlb_set_state_shutdown,
.set_next_event = mlb_clkevt_next_event,
},
--
1.9.1
Powered by blists - more mailing lists