Zephyr API
4.4.99
A Scalable Open Source RTOS
Toggle main menu visibility
Loading...
Searching...
No Matches
device_runtime.h
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2015 Intel Corporation.
3
* Copyright (c) 2021 Nordic Semiconductor ASA
4
*
5
* SPDX-License-Identifier: Apache-2.0
6
*/
7
13
14
#ifndef ZEPHYR_INCLUDE_PM_DEVICE_RUNTIME_H_
15
#define ZEPHYR_INCLUDE_PM_DEVICE_RUNTIME_H_
16
17
#include <
zephyr/device.h
>
18
#include <
zephyr/kernel.h
>
19
20
#ifdef __cplusplus
21
extern
"C"
{
22
#endif
23
30
31
#if defined(CONFIG_PM_DEVICE_RUNTIME) || defined(__DOXYGEN__)
43
int
pm_device_runtime_auto_enable
(
const
struct
device
*dev);
44
61
int
pm_device_runtime_enable
(
const
struct
device
*dev);
62
75
int
pm_device_runtime_disable
(
const
struct
device
*dev);
76
99
int
pm_device_runtime_get
(
const
struct
device
*dev);
100
120
int
pm_device_runtime_put
(
const
struct
device
*dev);
121
146
int
pm_device_runtime_put_async
(
const
struct
device
*dev,
k_timeout_t
delay);
147
160
bool
pm_device_runtime_is_enabled
(
const
struct
device
*dev);
161
172
int
pm_device_runtime_usage
(
const
struct
device
*dev);
173
174
#else
175
176
static
inline
int
pm_device_runtime_auto_enable
(
const
struct
device
*dev)
177
{
178
ARG_UNUSED(dev);
179
return
0;
180
}
181
182
static
inline
int
pm_device_runtime_enable
(
const
struct
device
*dev)
183
{
184
ARG_UNUSED(dev);
185
return
0;
186
}
187
188
static
inline
int
pm_device_runtime_disable
(
const
struct
device
*dev)
189
{
190
ARG_UNUSED(dev);
191
return
0;
192
}
193
194
static
inline
int
pm_device_runtime_get
(
const
struct
device
*dev)
195
{
196
ARG_UNUSED(dev);
197
return
0;
198
}
199
200
static
inline
int
pm_device_runtime_put
(
const
struct
device
*dev)
201
{
202
ARG_UNUSED(dev);
203
return
0;
204
}
205
206
static
inline
int
pm_device_runtime_put_async
(
const
struct
device
*dev,
207
k_timeout_t
delay)
208
{
209
ARG_UNUSED(dev);
210
ARG_UNUSED(delay);
211
return
0;
212
}
213
214
static
inline
bool
pm_device_runtime_is_enabled
(
const
struct
device
*dev)
215
{
216
ARG_UNUSED(dev);
217
return
false
;
218
}
219
220
static
inline
int
pm_device_runtime_usage
(
const
struct
device
*dev)
221
{
222
ARG_UNUSED(dev);
223
return
-
ENOSYS
;
224
}
225
226
#endif
227
229
230
#ifdef __cplusplus
231
}
232
#endif
233
234
#endif
/* ZEPHYR_INCLUDE_PM_DEVICE_RUNTIME_H_ */
device.h
pm_device_runtime_get
int pm_device_runtime_get(const struct device *dev)
Resume a device based on usage count.
pm_device_runtime_is_enabled
bool pm_device_runtime_is_enabled(const struct device *dev)
Check if device runtime is enabled for a given device.
pm_device_runtime_put
int pm_device_runtime_put(const struct device *dev)
Suspend a device based on usage count.
pm_device_runtime_put_async
int pm_device_runtime_put_async(const struct device *dev, k_timeout_t delay)
Suspend a device based on usage count (asynchronously).
pm_device_runtime_disable
int pm_device_runtime_disable(const struct device *dev)
Disable device runtime PM.
pm_device_runtime_enable
int pm_device_runtime_enable(const struct device *dev)
Enable device runtime PM.
pm_device_runtime_usage
int pm_device_runtime_usage(const struct device *dev)
Return the current device usage counter.
pm_device_runtime_auto_enable
int pm_device_runtime_auto_enable(const struct device *dev)
Automatically enable device runtime based on devicetree properties.
ENOSYS
#define ENOSYS
Function not implemented.
Definition
errno.h:83
kernel.h
Public kernel APIs.
device
Runtime device structure (in ROM) per driver instance.
Definition
device.h:513
k_timeout_t
Kernel timeout type.
Definition
clock.h:65
zephyr
pm
device_runtime.h
Generated on
for Zephyr API by
1.17.0