summaryrefslogtreecommitdiff
path: root/drivers/clocksource
diff options
context:
space:
mode:
authorJoshua Yeong <joshua.yeong@starfivetech.com>2023-11-16 18:53:12 +0800
committerDaniel Lezcano <daniel.lezcano@linaro.org>2023-12-27 15:37:11 +0100
commit6a902b118e7f30dbf0e6248f7b0f97e12c0939c3 (patch)
tree80a620e91ca8a084954e4c99c014fcf28cd61252 /drivers/clocksource
parente0cf60151e6317c654c42ba0e8b1fb6ff477489a (diff)
clocksource/timer-riscv: Add riscv_clock_shutdown callback
Add clocksource detach/shutdown callback to disable RISC-V timer interrupt when switching out riscv timer as clock source Signed-off-by: Joshua Yeong <joshua.yeong@starfivetech.com> Reviewed-by: Anup Patel <anup@brainfault.org> Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org> Link: https://lore.kernel.org/r/20231116105312.4800-1-joshua.yeong@starfivetech.com
Diffstat (limited to 'drivers/clocksource')
-rw-r--r--drivers/clocksource/timer-riscv.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/clocksource/timer-riscv.c b/drivers/clocksource/timer-riscv.c
index 57857c0dfba9..e66dcbd66566 100644
--- a/drivers/clocksource/timer-riscv.c
+++ b/drivers/clocksource/timer-riscv.c
@@ -61,12 +61,19 @@ static int riscv_clock_next_event(unsigned long delta,
return 0;
}
+static int riscv_clock_shutdown(struct clock_event_device *evt)
+{
+ riscv_clock_event_stop();
+ return 0;
+}
+
static unsigned int riscv_clock_event_irq;
static DEFINE_PER_CPU(struct clock_event_device, riscv_clock_event) = {
.name = "riscv_timer_clockevent",
.features = CLOCK_EVT_FEAT_ONESHOT,
.rating = 100,
.set_next_event = riscv_clock_next_event,
+ .set_state_shutdown = riscv_clock_shutdown,
};
/*