Lines Matching full:hwspinlock
16 /* hwspinlock mode argument */
24 struct hwspinlock;
29 * struct hwspinlock_pdata - platform data for hwspinlock drivers
30 * @base_id: base id for this hwspinlock device
32 * hwspinlock devices provide system-wide hardware locks that are used
39 * Usually boards have a single hwspinlock device, which provides several
44 * should be used for each hwspinlock device (they can't all use 0 as
48 * for each device (which is trivially 0 when only a single hwspinlock
61 struct hwspinlock *hwspin_lock_request(void);
62 struct hwspinlock *hwspin_lock_request_specific(unsigned int id);
63 int hwspin_lock_free(struct hwspinlock *hwlock);
65 int hwspin_lock_get_id(struct hwspinlock *hwlock);
66 int __hwspin_lock_timeout(struct hwspinlock *, unsigned int, int,
68 int __hwspin_trylock(struct hwspinlock *, int, unsigned long *);
69 void __hwspin_unlock(struct hwspinlock *, int, unsigned long *);
71 int hwspin_lock_bust(struct hwspinlock *hwlock, unsigned int id);
72 int devm_hwspin_lock_free(struct device *dev, struct hwspinlock *hwlock);
73 struct hwspinlock *devm_hwspin_lock_request(struct device *dev);
74 struct hwspinlock *devm_hwspin_lock_request_specific(struct device *dev,
92 * we _do_ want users to fail (no point in registering hwspinlock instances if
98 static inline struct hwspinlock *hwspin_lock_request(void) in hwspin_lock_request()
103 static inline struct hwspinlock *hwspin_lock_request_specific(unsigned int id) in hwspin_lock_request_specific()
108 static inline int hwspin_lock_free(struct hwspinlock *hwlock) in hwspin_lock_free()
114 int __hwspin_lock_timeout(struct hwspinlock *hwlock, unsigned int to, in __hwspin_lock_timeout()
121 int __hwspin_trylock(struct hwspinlock *hwlock, int mode, unsigned long *flags) in __hwspin_trylock()
127 void __hwspin_unlock(struct hwspinlock *hwlock, int mode, unsigned long *flags) in __hwspin_unlock()
131 static inline int hwspin_lock_bust(struct hwspinlock *hwlock, unsigned int id) in hwspin_lock_bust()
141 static inline int hwspin_lock_get_id(struct hwspinlock *hwlock) in hwspin_lock_get_id()
153 int devm_hwspin_lock_free(struct device *dev, struct hwspinlock *hwlock) in devm_hwspin_lock_free()
158 static inline struct hwspinlock *devm_hwspin_lock_request(struct device *dev) in devm_hwspin_lock_request()
164 struct hwspinlock *devm_hwspin_lock_request_specific(struct device *dev, in devm_hwspin_lock_request_specific()
173 * hwspin_trylock_irqsave() - try to lock an hwspinlock, disable interrupts
174 * @hwlock: an hwspinlock which we want to trylock
177 * This function attempts to lock the underlying hwspinlock, and will
178 * immediately fail if the hwspinlock is already locked.
182 * so the caller must not sleep, and is advised to release the hwspinlock
185 * Returns 0 if we successfully locked the hwspinlock, -EBUSY if
186 * the hwspinlock was already taken, and -EINVAL if @hwlock is invalid.
189 int hwspin_trylock_irqsave(struct hwspinlock *hwlock, unsigned long *flags) in hwspin_trylock_irqsave()
195 * hwspin_trylock_irq() - try to lock an hwspinlock, disable interrupts
196 * @hwlock: an hwspinlock which we want to trylock
198 * This function attempts to lock the underlying hwspinlock, and will
199 * immediately fail if the hwspinlock is already locked.
203 * to release the hwspinlock as soon as possible.
205 * Returns 0 if we successfully locked the hwspinlock, -EBUSY if
206 * the hwspinlock was already taken, and -EINVAL if @hwlock is invalid.
208 static inline int hwspin_trylock_irq(struct hwspinlock *hwlock) in hwspin_trylock_irq()
214 * hwspin_trylock_raw() - attempt to lock a specific hwspinlock
215 * @hwlock: an hwspinlock which we want to trylock
217 * This function attempts to lock an hwspinlock, and will immediately fail
218 * if the hwspinlock is already taken.
224 * Returns 0 if we successfully locked the hwspinlock, -EBUSY if
225 * the hwspinlock was already taken, and -EINVAL if @hwlock is invalid.
227 static inline int hwspin_trylock_raw(struct hwspinlock *hwlock) in hwspin_trylock_raw()
233 * hwspin_trylock_in_atomic() - attempt to lock a specific hwspinlock
234 * @hwlock: an hwspinlock which we want to trylock
236 * This function attempts to lock an hwspinlock, and will immediately fail
237 * if the hwspinlock is already taken.
241 * Returns 0 if we successfully locked the hwspinlock, -EBUSY if
242 * the hwspinlock was already taken, and -EINVAL if @hwlock is invalid.
244 static inline int hwspin_trylock_in_atomic(struct hwspinlock *hwlock) in hwspin_trylock_in_atomic()
250 * hwspin_trylock() - attempt to lock a specific hwspinlock
251 * @hwlock: an hwspinlock which we want to trylock
253 * This function attempts to lock an hwspinlock, and will immediately fail
254 * if the hwspinlock is already taken.
257 * so the caller must not sleep, and is advised to release the hwspinlock
261 * Returns 0 if we successfully locked the hwspinlock, -EBUSY if
262 * the hwspinlock was already taken, and -EINVAL if @hwlock is invalid.
264 static inline int hwspin_trylock(struct hwspinlock *hwlock) in hwspin_trylock()
270 * hwspin_lock_timeout_irqsave() - lock hwspinlock, with timeout, disable irqs
271 * @hwlock: the hwspinlock to be locked
281 * not sleep, and is advised to release the hwspinlock as soon as possible.
287 static inline int hwspin_lock_timeout_irqsave(struct hwspinlock *hwlock, in hwspin_lock_timeout_irqsave()
294 * hwspin_lock_timeout_irq() - lock hwspinlock, with timeout, disable irqs
295 * @hwlock: the hwspinlock to be locked
304 * hwspinlock as soon as possible.
311 int hwspin_lock_timeout_irq(struct hwspinlock *hwlock, unsigned int to) in hwspin_lock_timeout_irq()
317 * hwspin_lock_timeout_raw() - lock an hwspinlock with timeout limit
318 * @hwlock: the hwspinlock to be locked
334 int hwspin_lock_timeout_raw(struct hwspinlock *hwlock, unsigned int to) in hwspin_lock_timeout_raw()
340 * hwspin_lock_timeout_in_atomic() - lock an hwspinlock with timeout limit
341 * @hwlock: the hwspinlock to be locked
356 int hwspin_lock_timeout_in_atomic(struct hwspinlock *hwlock, unsigned int to) in hwspin_lock_timeout_in_atomic()
362 * hwspin_lock_timeout() - lock an hwspinlock with timeout limit
363 * @hwlock: the hwspinlock to be locked
371 * so the caller must not sleep, and is advised to release the hwspinlock
381 int hwspin_lock_timeout(struct hwspinlock *hwlock, unsigned int to) in hwspin_lock_timeout()
387 * hwspin_unlock_irqrestore() - unlock hwspinlock, restore irq state
388 * @hwlock: a previously-acquired hwspinlock which we want to unlock
391 * This function will unlock a specific hwspinlock, enable preemption and
398 static inline void hwspin_unlock_irqrestore(struct hwspinlock *hwlock, in hwspin_unlock_irqrestore()
405 * hwspin_unlock_irq() - unlock hwspinlock, enable interrupts
406 * @hwlock: a previously-acquired hwspinlock which we want to unlock
408 * This function will unlock a specific hwspinlock, enable preemption and
415 static inline void hwspin_unlock_irq(struct hwspinlock *hwlock) in hwspin_unlock_irq()
421 * hwspin_unlock_raw() - unlock hwspinlock
422 * @hwlock: a previously-acquired hwspinlock which we want to unlock
424 * This function will unlock a specific hwspinlock.
430 static inline void hwspin_unlock_raw(struct hwspinlock *hwlock) in hwspin_unlock_raw()
436 * hwspin_unlock_in_atomic() - unlock hwspinlock
437 * @hwlock: a previously-acquired hwspinlock which we want to unlock
439 * This function will unlock a specific hwspinlock.
445 static inline void hwspin_unlock_in_atomic(struct hwspinlock *hwlock) in hwspin_unlock_in_atomic()
451 * hwspin_unlock() - unlock hwspinlock
452 * @hwlock: a previously-acquired hwspinlock which we want to unlock
454 * This function will unlock a specific hwspinlock and enable preemption
461 static inline void hwspin_unlock(struct hwspinlock *hwlock) in hwspin_unlock()