aboutsummaryrefslogtreecommitdiff
path: root/lib/utils/timer
diff options
context:
space:
mode:
authorAnup Patel <anup.patel@wdc.com>2021-04-21 22:04:17 +0530
committerAnup Patel <anup@brainfault.org>2021-04-28 17:00:49 +0530
commit559a8f1d3be3210d4903c0db54c2d36e2f8d6ad4 (patch)
tree5a646e54241cfef96ccca4a5a8cc29ee68d77acf /lib/utils/timer
parent068ca086af2312d56efe51a724d78d84e1339ab4 (diff)
downloadopensbi-559a8f1d3be3210d4903c0db54c2d36e2f8d6ad4.zip
opensbi-559a8f1d3be3210d4903c0db54c2d36e2f8d6ad4.tar.gz
opensbi-559a8f1d3be3210d4903c0db54c2d36e2f8d6ad4.tar.bz2
lib: sbi: Simplify timer platform operations
Instead of having timer_value(), timer_event_start(), and timer_event_stop() callbacks in platform operations, it will be much simpler for timer driver to directly register these operations as device to the sbi_timer implementation. Signed-off-by: Anup Patel <anup.patel@wdc.com> Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
Diffstat (limited to 'lib/utils/timer')
-rw-r--r--lib/utils/timer/fdt_timer.c31
-rw-r--r--lib/utils/timer/fdt_timer_clint.c3
2 files changed, 0 insertions, 34 deletions
diff --git a/lib/utils/timer/fdt_timer.c b/lib/utils/timer/fdt_timer.c
index d1d0e0c..92198cd 100644
--- a/lib/utils/timer/fdt_timer.c
+++ b/lib/utils/timer/fdt_timer.c
@@ -17,46 +17,15 @@ static struct fdt_timer *timer_drivers[] = {
&fdt_timer_clint
};
-static u64 dummy_value(void)
-{
- return 0;
-}
-
-static void dummy_event_stop(void)
-{
-}
-
-static void dummy_event_start(u64 next_event)
-{
-}
-
static struct fdt_timer dummy = {
.match_table = NULL,
.cold_init = NULL,
.warm_init = NULL,
.exit = NULL,
- .value = dummy_value,
- .event_stop = dummy_event_stop,
- .event_start = dummy_event_start
};
static struct fdt_timer *current_driver = &dummy;
-u64 fdt_timer_value(void)
-{
- return current_driver->value();
-}
-
-void fdt_timer_event_stop(void)
-{
- current_driver->event_stop();
-}
-
-void fdt_timer_event_start(u64 next_event)
-{
- current_driver->event_start(next_event);
-}
-
void fdt_timer_exit(void)
{
if (current_driver->exit)
diff --git a/lib/utils/timer/fdt_timer_clint.c b/lib/utils/timer/fdt_timer_clint.c
index 6ba6c7b..0352e53 100644
--- a/lib/utils/timer/fdt_timer_clint.c
+++ b/lib/utils/timer/fdt_timer_clint.c
@@ -47,7 +47,4 @@ struct fdt_timer fdt_timer_clint = {
.cold_init = timer_clint_cold_init,
.warm_init = clint_warm_timer_init,
.exit = NULL,
- .value = clint_timer_value,
- .event_stop = clint_timer_event_stop,
- .event_start = clint_timer_event_start,
};