2015-07-07 04:20:19 +08:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2015 Wind River Systems, Inc.
|
|
|
|
*
|
2017-01-19 09:01:01 +08:00
|
|
|
* SPDX-License-Identifier: Apache-2.0
|
2015-07-07 04:20:19 +08:00
|
|
|
*/
|
|
|
|
|
2015-12-04 23:09:39 +08:00
|
|
|
/**
|
|
|
|
* @file
|
|
|
|
* @brief Initialize system clock driver
|
|
|
|
*
|
2015-10-21 00:42:33 +08:00
|
|
|
* Initializing the timer driver is done in this module to reduce code
|
2016-12-20 07:41:17 +08:00
|
|
|
* duplication.
|
2015-12-04 23:09:39 +08:00
|
|
|
*/
|
2015-07-07 04:20:19 +08:00
|
|
|
|
2016-12-05 04:59:37 +08:00
|
|
|
#include <kernel.h>
|
2015-07-07 04:20:19 +08:00
|
|
|
#include <init.h>
|
|
|
|
#include <drivers/system_timer.h>
|
|
|
|
|
2018-09-25 23:53:33 +08:00
|
|
|
/* Weak-linked noop defaults for optional driver interfaces: */
|
|
|
|
|
2019-02-03 16:36:40 +08:00
|
|
|
void __weak z_clock_isr(void *arg)
|
|
|
|
{
|
|
|
|
__ASSERT_NO_MSG(false);
|
|
|
|
}
|
|
|
|
|
2018-09-22 00:33:36 +08:00
|
|
|
int __weak z_clock_driver_init(struct device *device)
|
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2019-02-14 12:05:42 +08:00
|
|
|
int __weak z_clock_device_ctrl(struct device *device, u32_t ctrl_command,
|
|
|
|
void *context, device_pm_cb cb, void *arg)
|
2018-09-22 00:33:36 +08:00
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
2018-09-25 23:53:33 +08:00
|
|
|
|
|
|
|
void __weak z_clock_set_timeout(s32_t ticks, bool idle)
|
|
|
|
{
|
|
|
|
}
|
2018-11-02 04:25:37 +08:00
|
|
|
|
2018-10-12 13:46:59 +08:00
|
|
|
void __weak z_clock_idle_exit(void)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
void __weak sys_clock_disable(void)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2018-11-02 04:25:37 +08:00
|
|
|
SYS_DEVICE_DEFINE("sys_clock", z_clock_driver_init, z_clock_device_ctrl,
|
|
|
|
PRE_KERNEL_2, CONFIG_SYSTEM_CLOCK_INIT_PRIORITY);
|