Lines Matching refs:dg00x

23 	struct snd_dg00x *dg00x = hwdep->private_data;  in hwdep_read()  local
27 spin_lock_irq(&dg00x->lock); in hwdep_read()
29 while (!dg00x->dev_lock_changed && dg00x->msg == 0) { in hwdep_read()
30 prepare_to_wait(&dg00x->hwdep_wait, &wait, TASK_INTERRUPTIBLE); in hwdep_read()
31 spin_unlock_irq(&dg00x->lock); in hwdep_read()
33 finish_wait(&dg00x->hwdep_wait, &wait); in hwdep_read()
36 spin_lock_irq(&dg00x->lock); in hwdep_read()
40 if (dg00x->dev_lock_changed) { in hwdep_read()
42 event.lock_status.status = (dg00x->dev_lock_count > 0); in hwdep_read()
43 dg00x->dev_lock_changed = false; in hwdep_read()
49 event.digi00x_message.message = dg00x->msg; in hwdep_read()
50 dg00x->msg = 0; in hwdep_read()
55 spin_unlock_irq(&dg00x->lock); in hwdep_read()
66 struct snd_dg00x *dg00x = hwdep->private_data; in hwdep_poll() local
69 poll_wait(file, &dg00x->hwdep_wait, wait); in hwdep_poll()
71 spin_lock_irq(&dg00x->lock); in hwdep_poll()
72 if (dg00x->dev_lock_changed || dg00x->msg) in hwdep_poll()
76 spin_unlock_irq(&dg00x->lock); in hwdep_poll()
81 static int hwdep_get_info(struct snd_dg00x *dg00x, void __user *arg) in hwdep_get_info() argument
83 struct fw_device *dev = fw_parent_device(dg00x->unit); in hwdep_get_info()
100 static int hwdep_lock(struct snd_dg00x *dg00x) in hwdep_lock() argument
104 spin_lock_irq(&dg00x->lock); in hwdep_lock()
106 if (dg00x->dev_lock_count == 0) { in hwdep_lock()
107 dg00x->dev_lock_count = -1; in hwdep_lock()
113 spin_unlock_irq(&dg00x->lock); in hwdep_lock()
118 static int hwdep_unlock(struct snd_dg00x *dg00x) in hwdep_unlock() argument
122 spin_lock_irq(&dg00x->lock); in hwdep_unlock()
124 if (dg00x->dev_lock_count == -1) { in hwdep_unlock()
125 dg00x->dev_lock_count = 0; in hwdep_unlock()
131 spin_unlock_irq(&dg00x->lock); in hwdep_unlock()
138 struct snd_dg00x *dg00x = hwdep->private_data; in hwdep_release() local
140 spin_lock_irq(&dg00x->lock); in hwdep_release()
141 if (dg00x->dev_lock_count == -1) in hwdep_release()
142 dg00x->dev_lock_count = 0; in hwdep_release()
143 spin_unlock_irq(&dg00x->lock); in hwdep_release()
151 struct snd_dg00x *dg00x = hwdep->private_data; in hwdep_ioctl() local
155 return hwdep_get_info(dg00x, (void __user *)arg); in hwdep_ioctl()
157 return hwdep_lock(dg00x); in hwdep_ioctl()
159 return hwdep_unlock(dg00x); in hwdep_ioctl()
184 int snd_dg00x_create_hwdep_device(struct snd_dg00x *dg00x) in snd_dg00x_create_hwdep_device() argument
189 err = snd_hwdep_new(dg00x->card, "Digi00x", 0, &hwdep); in snd_dg00x_create_hwdep_device()
196 hwdep->private_data = dg00x; in snd_dg00x_create_hwdep_device()