Lines Matching refs:dg00x

22 	struct snd_dg00x *dg00x = hwdep->private_data;  in hwdep_read()  local
26 spin_lock_irq(&dg00x->lock); in hwdep_read()
28 while (!dg00x->dev_lock_changed && dg00x->msg == 0) { in hwdep_read()
29 prepare_to_wait(&dg00x->hwdep_wait, &wait, TASK_INTERRUPTIBLE); in hwdep_read()
30 spin_unlock_irq(&dg00x->lock); in hwdep_read()
32 finish_wait(&dg00x->hwdep_wait, &wait); in hwdep_read()
35 spin_lock_irq(&dg00x->lock); in hwdep_read()
39 if (dg00x->dev_lock_changed) { in hwdep_read()
41 event.lock_status.status = (dg00x->dev_lock_count > 0); in hwdep_read()
42 dg00x->dev_lock_changed = false; in hwdep_read()
48 event.digi00x_message.message = dg00x->msg; in hwdep_read()
49 dg00x->msg = 0; in hwdep_read()
54 spin_unlock_irq(&dg00x->lock); in hwdep_read()
65 struct snd_dg00x *dg00x = hwdep->private_data; in hwdep_poll() local
68 poll_wait(file, &dg00x->hwdep_wait, wait); in hwdep_poll()
70 spin_lock_irq(&dg00x->lock); in hwdep_poll()
71 if (dg00x->dev_lock_changed || dg00x->msg) in hwdep_poll()
75 spin_unlock_irq(&dg00x->lock); in hwdep_poll()
80 static int hwdep_get_info(struct snd_dg00x *dg00x, void __user *arg) in hwdep_get_info() argument
82 struct fw_device *dev = fw_parent_device(dg00x->unit); in hwdep_get_info()
99 static int hwdep_lock(struct snd_dg00x *dg00x) in hwdep_lock() argument
103 spin_lock_irq(&dg00x->lock); in hwdep_lock()
105 if (dg00x->dev_lock_count == 0) { in hwdep_lock()
106 dg00x->dev_lock_count = -1; in hwdep_lock()
112 spin_unlock_irq(&dg00x->lock); in hwdep_lock()
117 static int hwdep_unlock(struct snd_dg00x *dg00x) in hwdep_unlock() argument
121 spin_lock_irq(&dg00x->lock); in hwdep_unlock()
123 if (dg00x->dev_lock_count == -1) { in hwdep_unlock()
124 dg00x->dev_lock_count = 0; in hwdep_unlock()
130 spin_unlock_irq(&dg00x->lock); in hwdep_unlock()
137 struct snd_dg00x *dg00x = hwdep->private_data; in hwdep_release() local
139 spin_lock_irq(&dg00x->lock); in hwdep_release()
140 if (dg00x->dev_lock_count == -1) in hwdep_release()
141 dg00x->dev_lock_count = 0; in hwdep_release()
142 spin_unlock_irq(&dg00x->lock); in hwdep_release()
150 struct snd_dg00x *dg00x = hwdep->private_data; in hwdep_ioctl() local
154 return hwdep_get_info(dg00x, (void __user *)arg); in hwdep_ioctl()
156 return hwdep_lock(dg00x); in hwdep_ioctl()
158 return hwdep_unlock(dg00x); in hwdep_ioctl()
175 int snd_dg00x_create_hwdep_device(struct snd_dg00x *dg00x) in snd_dg00x_create_hwdep_device() argument
187 err = snd_hwdep_new(dg00x->card, "Digi00x", 0, &hwdep); in snd_dg00x_create_hwdep_device()
194 hwdep->private_data = dg00x; in snd_dg00x_create_hwdep_device()