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