Lines Matching refs:ff

3  * ff-hwdep.c - a part of driver for RME Fireface series
16 #include "ff.h"
18 static bool has_msg(struct snd_ff *ff)
20 if (ff->spec->protocol->has_msg)
21 return ff->spec->protocol->has_msg(ff);
29 struct snd_ff *ff = hwdep->private_data;
32 spin_lock_irq(&ff->lock);
34 while (!ff->dev_lock_changed && !has_msg(ff)) {
35 prepare_to_wait(&ff->hwdep_wait, &wait, TASK_INTERRUPTIBLE);
36 spin_unlock_irq(&ff->lock);
38 finish_wait(&ff->hwdep_wait, &wait);
41 spin_lock_irq(&ff->lock);
44 if (ff->dev_lock_changed && count >= sizeof(struct snd_firewire_event_lock_status)) {
47 .status = (ff->dev_lock_count > 0),
50 ff->dev_lock_changed = false;
52 spin_unlock_irq(&ff->lock);
57 } else if (has_msg(ff)) {
60 count = ff->spec->protocol->copy_msg_to_user(ff, buf, count);
61 spin_unlock_irq(&ff->lock);
63 spin_unlock_irq(&ff->lock);
74 struct snd_ff *ff = hwdep->private_data;
77 poll_wait(file, &ff->hwdep_wait, wait);
79 spin_lock_irq(&ff->lock);
80 if (ff->dev_lock_changed || has_msg(ff))
84 spin_unlock_irq(&ff->lock);
89 static int hwdep_get_info(struct snd_ff *ff, void __user *arg)
91 struct fw_device *dev = fw_parent_device(ff->unit);
108 static int hwdep_lock(struct snd_ff *ff)
112 spin_lock_irq(&ff->lock);
114 if (ff->dev_lock_count == 0) {
115 ff->dev_lock_count = -1;
121 spin_unlock_irq(&ff->lock);
126 static int hwdep_unlock(struct snd_ff *ff)
130 spin_lock_irq(&ff->lock);
132 if (ff->dev_lock_count == -1) {
133 ff->dev_lock_count = 0;
139 spin_unlock_irq(&ff->lock);
146 struct snd_ff *ff = hwdep->private_data;
148 spin_lock_irq(&ff->lock);
149 if (ff->dev_lock_count == -1)
150 ff->dev_lock_count = 0;
151 spin_unlock_irq(&ff->lock);
159 struct snd_ff *ff = hwdep->private_data;
163 return hwdep_get_info(ff, (void __user *)arg);
165 return hwdep_lock(ff);
167 return hwdep_unlock(ff);
184 int snd_ff_create_hwdep_devices(struct snd_ff *ff)
196 err = snd_hwdep_new(ff->card, ff->card->driver, 0, &hwdep);
200 strcpy(hwdep->name, ff->card->driver);
203 hwdep->private_data = ff;