Lines Matching +full:device +full:- +full:id

4  * SPDX-License-Identifier: Apache-2.0
20 #include <zephyr/device.h>
32 typedef int (*hwspinlock_api_trylock)(const struct device *dev, uint32_t id);
38 typedef void (*hwspinlock_api_lock)(const struct device *dev, uint32_t id);
44 typedef void (*hwspinlock_api_unlock)(const struct device *dev, uint32_t id);
47 * @brief Callback API to get HW spinlock max ID
50 typedef uint32_t (*hwspinlock_api_get_max_id)(const struct device *dev);
68 * @param dev HW spinlock device instance.
69 * @param id Spinlock identifier.
72 * @retval -errno In case of any failure.
74 __syscall int hwspinlock_trylock(const struct device *dev, uint32_t id);
76 static inline int z_impl_hwspinlock_trylock(const struct device *dev, uint32_t id) in z_impl_hwspinlock_trylock() argument
79 (const struct hwspinlock_driver_api *)dev->api; in z_impl_hwspinlock_trylock()
81 if (api->trylock == NULL) { in z_impl_hwspinlock_trylock()
82 return -ENOSYS; in z_impl_hwspinlock_trylock()
85 return api->trylock(dev, id); in z_impl_hwspinlock_trylock()
94 * @param dev HW spinlock device instance.
95 * @param id Spinlock identifier.
97 __syscall void hwspinlock_lock(const struct device *dev, uint32_t id);
99 static inline void z_impl_hwspinlock_lock(const struct device *dev, uint32_t id) in z_impl_hwspinlock_lock() argument
102 (const struct hwspinlock_driver_api *)dev->api; in z_impl_hwspinlock_lock()
104 if (api->lock != NULL) { in z_impl_hwspinlock_lock()
105 api->lock(dev, id); in z_impl_hwspinlock_lock()
115 * @param dev HW spinlock device instance.
116 * @param id Spinlock identifier.
118 __syscall void hwspinlock_unlock(const struct device *dev, uint32_t id);
120 static inline void z_impl_hwspinlock_unlock(const struct device *dev, uint32_t id) in z_impl_hwspinlock_unlock() argument
123 (const struct hwspinlock_driver_api *)dev->api; in z_impl_hwspinlock_unlock()
125 if (api->unlock != NULL) { in z_impl_hwspinlock_unlock()
126 api->unlock(dev, id); in z_impl_hwspinlock_unlock()
131 * @brief Get HW spinlock max ID
133 * This function is used to get the HW spinlock maximum ID. It should
136 * @param dev HW spinlock device instance.
138 * @retval HW spinlock max ID.
141 __syscall uint32_t hwspinlock_get_max_id(const struct device *dev);
143 static inline uint32_t z_impl_hwspinlock_get_max_id(const struct device *dev) in z_impl_hwspinlock_get_max_id()
146 (const struct hwspinlock_driver_api *)dev->api; in z_impl_hwspinlock_get_max_id()
148 if (api->get_max_id == NULL) { in z_impl_hwspinlock_get_max_id()
152 return api->get_max_id(dev); in z_impl_hwspinlock_get_max_id()