zephyr/drivers/timer/sys_clock_init.c
Ramakrishna Pallala e1639b5345 device: Extend device_set_power_state API to support async requests
The existing device_set_power_state() API works only in synchronous
mode and this is not desirable for devices(ex: Gyro) which take
longer time (few 100 mSec) to suspend/resume.

To support async mode, a new callback argument is added to the API.
The device drivers can asynchronously suspend/resume and call the
callback function upon completion of the async request.

This commit adds the missing callback parameter to all the drivers
to make it compliant with the new API.

Signed-off-by: Ramakrishna Pallala <ramakrishna.pallala@intel.com>
2019-03-14 14:26:15 +01:00

51 lines
930 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/system_timer.h>
/* Weak-linked noop defaults for optional driver interfaces: */
void __weak z_clock_isr(void *arg)
{
__ASSERT_NO_MSG(false);
}
int __weak z_clock_driver_init(struct device *device)
{
return 0;
}
int __weak z_clock_device_ctrl(struct device *device, u32_t ctrl_command,
void *context, device_pm_cb cb, void *arg)
{
return 0;
}
void __weak z_clock_set_timeout(s32_t ticks, bool idle)
{
}
void __weak z_clock_idle_exit(void)
{
}
void __weak sys_clock_disable(void)
{
}
SYS_DEVICE_DEFINE("sys_clock", z_clock_driver_init, z_clock_device_ctrl,
PRE_KERNEL_2, CONFIG_SYSTEM_CLOCK_INIT_PRIORITY);