Lines Matching refs: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 devm_hwspin_lock_free(struct device *dev, struct hwspinlock *hwlock);
72 struct hwspinlock *devm_hwspin_lock_request(struct device *dev);
73 struct hwspinlock *devm_hwspin_lock_request_specific(struct device *dev,
91 * we _do_ want users to fail (no point in registering hwspinlock instances if
97 static inline struct hwspinlock *hwspin_lock_request(void)
102 static inline struct hwspinlock *hwspin_lock_request_specific(unsigned int id)
107 static inline int hwspin_lock_free(struct hwspinlock *hwlock)
113 int __hwspin_lock_timeout(struct hwspinlock *hwlock, unsigned int to,
120 int __hwspin_trylock(struct hwspinlock *hwlock, int mode, unsigned long *flags)
126 void __hwspin_unlock(struct hwspinlock *hwlock, int mode, unsigned long *flags)
135 static inline int hwspin_lock_get_id(struct hwspinlock *hwlock)
147 int devm_hwspin_lock_free(struct device *dev, struct hwspinlock *hwlock)
152 static inline struct hwspinlock *devm_hwspin_lock_request(struct device *dev)
158 struct hwspinlock *devm_hwspin_lock_request_specific(struct device *dev,
167 * hwspin_trylock_irqsave() - try to lock an hwspinlock, disable interrupts
168 * @hwlock: an hwspinlock which we want to trylock
171 * This function attempts to lock the underlying hwspinlock, and will
172 * immediately fail if the hwspinlock is already locked.
176 * so the caller must not sleep, and is advised to release the hwspinlock
179 * Returns 0 if we successfully locked the hwspinlock, -EBUSY if
180 * the hwspinlock was already taken, and -EINVAL if @hwlock is invalid.
183 int hwspin_trylock_irqsave(struct hwspinlock *hwlock, unsigned long *flags)
189 * hwspin_trylock_irq() - try to lock an hwspinlock, disable interrupts
190 * @hwlock: an hwspinlock which we want to trylock
192 * This function attempts to lock the underlying hwspinlock, and will
193 * immediately fail if the hwspinlock is already locked.
197 * to release the hwspinlock as soon as possible.
199 * Returns 0 if we successfully locked the hwspinlock, -EBUSY if
200 * the hwspinlock was already taken, and -EINVAL if @hwlock is invalid.
202 static inline int hwspin_trylock_irq(struct hwspinlock *hwlock)
208 * hwspin_trylock_raw() - attempt to lock a specific hwspinlock
209 * @hwlock: an hwspinlock which we want to trylock
211 * This function attempts to lock an hwspinlock, and will immediately fail
212 * if the hwspinlock is already taken.
218 * Returns 0 if we successfully locked the hwspinlock, -EBUSY if
219 * the hwspinlock was already taken, and -EINVAL if @hwlock is invalid.
221 static inline int hwspin_trylock_raw(struct hwspinlock *hwlock)
227 * hwspin_trylock_in_atomic() - attempt to lock a specific hwspinlock
228 * @hwlock: an hwspinlock which we want to trylock
230 * This function attempts to lock an hwspinlock, and will immediately fail
231 * if the hwspinlock is already taken.
235 * Returns 0 if we successfully locked the hwspinlock, -EBUSY if
236 * the hwspinlock was already taken, and -EINVAL if @hwlock is invalid.
238 static inline int hwspin_trylock_in_atomic(struct hwspinlock *hwlock)
244 * hwspin_trylock() - attempt to lock a specific hwspinlock
245 * @hwlock: an hwspinlock which we want to trylock
247 * This function attempts to lock an hwspinlock, and will immediately fail
248 * if the hwspinlock is already taken.
251 * so the caller must not sleep, and is advised to release the hwspinlock
255 * Returns 0 if we successfully locked the hwspinlock, -EBUSY if
256 * the hwspinlock was already taken, and -EINVAL if @hwlock is invalid.
258 static inline int hwspin_trylock(struct hwspinlock *hwlock)
264 * hwspin_lock_timeout_irqsave() - lock hwspinlock, with timeout, disable irqs
265 * @hwlock: the hwspinlock to be locked
275 * not sleep, and is advised to release the hwspinlock as soon as possible.
281 static inline int hwspin_lock_timeout_irqsave(struct hwspinlock *hwlock,
288 * hwspin_lock_timeout_irq() - lock hwspinlock, with timeout, disable irqs
289 * @hwlock: the hwspinlock to be locked
298 * hwspinlock as soon as possible.
305 int hwspin_lock_timeout_irq(struct hwspinlock *hwlock, unsigned int to)
311 * hwspin_lock_timeout_raw() - lock an hwspinlock with timeout limit
312 * @hwlock: the hwspinlock to be locked
328 int hwspin_lock_timeout_raw(struct hwspinlock *hwlock, unsigned int to)
334 * hwspin_lock_timeout_in_atomic() - lock an hwspinlock with timeout limit
335 * @hwlock: the hwspinlock to be locked
350 int hwspin_lock_timeout_in_atomic(struct hwspinlock *hwlock, unsigned int to)
356 * hwspin_lock_timeout() - lock an hwspinlock with timeout limit
357 * @hwlock: the hwspinlock to be locked
365 * so the caller must not sleep, and is advised to release the hwspinlock
375 int hwspin_lock_timeout(struct hwspinlock *hwlock, unsigned int to)
381 * hwspin_unlock_irqrestore() - unlock hwspinlock, restore irq state
382 * @hwlock: a previously-acquired hwspinlock which we want to unlock
385 * This function will unlock a specific hwspinlock, enable preemption and
392 static inline void hwspin_unlock_irqrestore(struct hwspinlock *hwlock,
399 * hwspin_unlock_irq() - unlock hwspinlock, enable interrupts
400 * @hwlock: a previously-acquired hwspinlock which we want to unlock
402 * This function will unlock a specific hwspinlock, enable preemption and
409 static inline void hwspin_unlock_irq(struct hwspinlock *hwlock)
415 * hwspin_unlock_raw() - unlock hwspinlock
416 * @hwlock: a previously-acquired hwspinlock which we want to unlock
418 * This function will unlock a specific hwspinlock.
424 static inline void hwspin_unlock_raw(struct hwspinlock *hwlock)
430 * hwspin_unlock_in_atomic() - unlock hwspinlock
431 * @hwlock: a previously-acquired hwspinlock which we want to unlock
433 * This function will unlock a specific hwspinlock.
439 static inline void hwspin_unlock_in_atomic(struct hwspinlock *hwlock)
445 * hwspin_unlock() - unlock hwspinlock
446 * @hwlock: a previously-acquired hwspinlock which we want to unlock
448 * This function will unlock a specific hwspinlock and enable preemption
455 static inline void hwspin_unlock(struct hwspinlock *hwlock)