zephyr/drivers/timer/sys_clock_init.c
Gerard Marull-Paretas 7ccc1a41bc pm: use actions for device PM control
Instead of passing target states, use actions for device PM control.
Actions represent better the meaning of the callback argument.
Furthermore, they are more future proof as they can be suitable for
other PM actions that have no direct mapping to a state. If we compare
with Linux, we could have a multi-stage suspend/resume. Such scenario
would not have a good mapping when using target states.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2021-08-04 08:23:01 -04:00

53 lines
943 B
C

/*
* Copyright (c) 2015 Wind River Systems, Inc.
*
* SPDX-License-Identifier: Apache-2.0
*/
/**
* @file
* @brief Initialize system clock driver
*
* Initializing the timer driver is done in this module to reduce code
* duplication.
*/
#include <kernel.h>
#include <init.h>
#include <drivers/timer/system_timer.h>
/* Weak-linked noop defaults for optional driver interfaces*/
void __weak sys_clock_isr(void *arg)
{
__ASSERT_NO_MSG(false);
}
int __weak sys_clock_driver_init(const struct device *dev)
{
ARG_UNUSED(dev);
return 0;
}
int __weak sys_clock_device_ctrl(const struct device *dev,
enum pm_device_action action)
{
return -ENOSYS;
}
void __weak sys_clock_set_timeout(int32_t ticks, bool idle)
{
}
void __weak sys_clock_idle_exit(void)
{
}
void __weak sys_clock_disable(void)
{
}
SYS_DEVICE_DEFINE("sys_clock", sys_clock_driver_init, sys_clock_device_ctrl,
PRE_KERNEL_2, CONFIG_SYSTEM_CLOCK_INIT_PRIORITY);