Lines Matching full:device

10 #include <device.h>
29 * @brief Enable device runtime PM
31 * Called by a device driver to enable device runtime power management.
32 * The device might be asynchronously suspended if runtime PM is enabled
33 * when the device is not use.
37 * @param dev Pointer to device structure of the specific device driver
40 void pm_device_enable(const struct device *dev);
43 * @brief Disable device runtime PM
45 * Called by a device driver to disable device runtime power management.
46 * The device might be asynchronously resumed if runtime PM is disabled
50 * @param dev Pointer to device structure of the specific device driver
53 void pm_device_disable(const struct device *dev);
56 * @brief Call device resume asynchronously based on usage count
58 * Called by a device driver to mark the device as being used.
59 * This API will asynchronously bring the device to resume state
64 * @param dev Pointer to device structure of the specific device driver
67 * the caller need to wait on the poll event linked to device
71 int pm_device_get_async(const struct device *dev);
74 * @brief Call device resume synchronously based on usage count
76 * Called by a device driver to mark the device as being used. It
77 * will bring up or resume the device if it is in suspended state
78 * based on the device usage count. This call is blocked until the
79 * device PM state is changed to resume.
81 * @param dev Pointer to device structure of the specific device driver
86 int pm_device_get(const struct device *dev);
89 * @brief Call device suspend asynchronously based on usage count
91 * Called by a device driver to mark the device as being released.
92 * This API asynchronously put the device to suspend state if
97 * @param dev Pointer to device structure of the specific device driver
100 * the caller need to wait on the poll event linked to device pm
104 int pm_device_put_async(const struct device *dev);
107 * @brief Call device suspend synchronously based on usage count
109 * Called by a device driver to mark the device as being released. It
110 * will put the device to suspended state if is is in active state
111 * based on the device usage count. This call is blocked until the
112 * device PM state is changed to resume.
114 * @param dev Pointer to device structure of the specific device driver
119 int pm_device_put(const struct device *dev);
122 * @brief Wait on a device to finish an operation.
124 * The calling thread blocks until the device finishes a
128 * @param dev Pointer to device structure of the specific device driver
135 int pm_device_wait(const struct device *dev, k_timeout_t timeout);
138 static inline void pm_device_enable(const struct device *dev) { }
139 static inline void pm_device_disable(const struct device *dev) { }
140 static inline int pm_device_get(const struct device *dev) { return -ENOSYS; }
141 static inline int pm_device_get_async(const struct device *dev) { return -ENOSYS; }
142 static inline int pm_device_put(const struct device *dev) { return -ENOSYS; }
143 static inline int pm_device_put_async(const struct device *dev) { return -ENOSYS; }
144 static inline int pm_device_wait(const struct device *dev,