Lines Matching full:ff
3 * ff-hwdep.c - a part of driver for RME Fireface series
16 #include "ff.h"
21 struct snd_ff *ff = hwdep->private_data; in hwdep_read() local
25 spin_lock_irq(&ff->lock); in hwdep_read()
27 while (!ff->dev_lock_changed) { in hwdep_read()
28 prepare_to_wait(&ff->hwdep_wait, &wait, TASK_INTERRUPTIBLE); in hwdep_read()
29 spin_unlock_irq(&ff->lock); in hwdep_read()
31 finish_wait(&ff->hwdep_wait, &wait); in hwdep_read()
34 spin_lock_irq(&ff->lock); in hwdep_read()
38 if (ff->dev_lock_changed) { in hwdep_read()
40 event.lock_status.status = (ff->dev_lock_count > 0); in hwdep_read()
41 ff->dev_lock_changed = false; in hwdep_read()
46 spin_unlock_irq(&ff->lock); in hwdep_read()
57 struct snd_ff *ff = hwdep->private_data; in hwdep_poll() local
60 poll_wait(file, &ff->hwdep_wait, wait); in hwdep_poll()
62 spin_lock_irq(&ff->lock); in hwdep_poll()
63 if (ff->dev_lock_changed) in hwdep_poll()
67 spin_unlock_irq(&ff->lock); in hwdep_poll()
72 static int hwdep_get_info(struct snd_ff *ff, void __user *arg) in hwdep_get_info() argument
74 struct fw_device *dev = fw_parent_device(ff->unit); in hwdep_get_info()
91 static int hwdep_lock(struct snd_ff *ff) in hwdep_lock() argument
95 spin_lock_irq(&ff->lock); in hwdep_lock()
97 if (ff->dev_lock_count == 0) { in hwdep_lock()
98 ff->dev_lock_count = -1; in hwdep_lock()
104 spin_unlock_irq(&ff->lock); in hwdep_lock()
109 static int hwdep_unlock(struct snd_ff *ff) in hwdep_unlock() argument
113 spin_lock_irq(&ff->lock); in hwdep_unlock()
115 if (ff->dev_lock_count == -1) { in hwdep_unlock()
116 ff->dev_lock_count = 0; in hwdep_unlock()
122 spin_unlock_irq(&ff->lock); in hwdep_unlock()
129 struct snd_ff *ff = hwdep->private_data; in hwdep_release() local
131 spin_lock_irq(&ff->lock); in hwdep_release()
132 if (ff->dev_lock_count == -1) in hwdep_release()
133 ff->dev_lock_count = 0; in hwdep_release()
134 spin_unlock_irq(&ff->lock); in hwdep_release()
142 struct snd_ff *ff = hwdep->private_data; in hwdep_ioctl() local
146 return hwdep_get_info(ff, (void __user *)arg); in hwdep_ioctl()
148 return hwdep_lock(ff); in hwdep_ioctl()
150 return hwdep_unlock(ff); in hwdep_ioctl()
167 int snd_ff_create_hwdep_devices(struct snd_ff *ff) in snd_ff_create_hwdep_devices() argument
179 err = snd_hwdep_new(ff->card, ff->card->driver, 0, &hwdep); in snd_ff_create_hwdep_devices()
183 strcpy(hwdep->name, ff->card->driver); in snd_ff_create_hwdep_devices()
186 hwdep->private_data = ff; in snd_ff_create_hwdep_devices()