Lines Matching refs:ff
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()
39 event.lock_status.status = (ff->dev_lock_count > 0); in hwdep_read()
40 ff->dev_lock_changed = false; in hwdep_read()
44 spin_unlock_irq(&ff->lock); in hwdep_read()
55 struct snd_ff *ff = hwdep->private_data; in hwdep_poll() local
58 poll_wait(file, &ff->hwdep_wait, wait); in hwdep_poll()
60 spin_lock_irq(&ff->lock); in hwdep_poll()
61 if (ff->dev_lock_changed) in hwdep_poll()
65 spin_unlock_irq(&ff->lock); in hwdep_poll()
70 static int hwdep_get_info(struct snd_ff *ff, void __user *arg) in hwdep_get_info() argument
72 struct fw_device *dev = fw_parent_device(ff->unit); in hwdep_get_info()
89 static int hwdep_lock(struct snd_ff *ff) in hwdep_lock() argument
93 spin_lock_irq(&ff->lock); in hwdep_lock()
95 if (ff->dev_lock_count == 0) { in hwdep_lock()
96 ff->dev_lock_count = -1; in hwdep_lock()
102 spin_unlock_irq(&ff->lock); in hwdep_lock()
107 static int hwdep_unlock(struct snd_ff *ff) in hwdep_unlock() argument
111 spin_lock_irq(&ff->lock); in hwdep_unlock()
113 if (ff->dev_lock_count == -1) { in hwdep_unlock()
114 ff->dev_lock_count = 0; in hwdep_unlock()
120 spin_unlock_irq(&ff->lock); in hwdep_unlock()
127 struct snd_ff *ff = hwdep->private_data; in hwdep_release() local
129 spin_lock_irq(&ff->lock); in hwdep_release()
130 if (ff->dev_lock_count == -1) in hwdep_release()
131 ff->dev_lock_count = 0; in hwdep_release()
132 spin_unlock_irq(&ff->lock); in hwdep_release()
140 struct snd_ff *ff = hwdep->private_data; in hwdep_ioctl() local
144 return hwdep_get_info(ff, (void __user *)arg); in hwdep_ioctl()
146 return hwdep_lock(ff); in hwdep_ioctl()
148 return hwdep_unlock(ff); in hwdep_ioctl()
165 int snd_ff_create_hwdep_devices(struct snd_ff *ff) in snd_ff_create_hwdep_devices() argument
177 err = snd_hwdep_new(ff->card, ff->card->driver, 0, &hwdep); in snd_ff_create_hwdep_devices()
181 strcpy(hwdep->name, ff->card->driver); in snd_ff_create_hwdep_devices()
184 hwdep->private_data = ff; in snd_ff_create_hwdep_devices()