Lines Matching refs:oxfw
21 struct snd_oxfw *oxfw = hwdep->private_data; in hwdep_read() local
25 spin_lock_irq(&oxfw->lock); in hwdep_read()
27 while (!oxfw->dev_lock_changed) { in hwdep_read()
28 prepare_to_wait(&oxfw->hwdep_wait, &wait, TASK_INTERRUPTIBLE); in hwdep_read()
29 spin_unlock_irq(&oxfw->lock); in hwdep_read()
31 finish_wait(&oxfw->hwdep_wait, &wait); in hwdep_read()
34 spin_lock_irq(&oxfw->lock); in hwdep_read()
39 event.lock_status.status = (oxfw->dev_lock_count > 0); in hwdep_read()
40 oxfw->dev_lock_changed = false; in hwdep_read()
44 spin_unlock_irq(&oxfw->lock); in hwdep_read()
55 struct snd_oxfw *oxfw = hwdep->private_data; in hwdep_poll() local
58 poll_wait(file, &oxfw->hwdep_wait, wait); in hwdep_poll()
60 spin_lock_irq(&oxfw->lock); in hwdep_poll()
61 if (oxfw->dev_lock_changed) in hwdep_poll()
65 spin_unlock_irq(&oxfw->lock); in hwdep_poll()
70 static int hwdep_get_info(struct snd_oxfw *oxfw, void __user *arg) in hwdep_get_info() argument
72 struct fw_device *dev = fw_parent_device(oxfw->unit); in hwdep_get_info()
89 static int hwdep_lock(struct snd_oxfw *oxfw) in hwdep_lock() argument
93 spin_lock_irq(&oxfw->lock); in hwdep_lock()
95 if (oxfw->dev_lock_count == 0) { in hwdep_lock()
96 oxfw->dev_lock_count = -1; in hwdep_lock()
102 spin_unlock_irq(&oxfw->lock); in hwdep_lock()
107 static int hwdep_unlock(struct snd_oxfw *oxfw) in hwdep_unlock() argument
111 spin_lock_irq(&oxfw->lock); in hwdep_unlock()
113 if (oxfw->dev_lock_count == -1) { in hwdep_unlock()
114 oxfw->dev_lock_count = 0; in hwdep_unlock()
120 spin_unlock_irq(&oxfw->lock); in hwdep_unlock()
127 struct snd_oxfw *oxfw = hwdep->private_data; in hwdep_release() local
129 spin_lock_irq(&oxfw->lock); in hwdep_release()
130 if (oxfw->dev_lock_count == -1) in hwdep_release()
131 oxfw->dev_lock_count = 0; in hwdep_release()
132 spin_unlock_irq(&oxfw->lock); in hwdep_release()
140 struct snd_oxfw *oxfw = hwdep->private_data; in hwdep_ioctl() local
144 return hwdep_get_info(oxfw, (void __user *)arg); in hwdep_ioctl()
146 return hwdep_lock(oxfw); in hwdep_ioctl()
148 return hwdep_unlock(oxfw); in hwdep_ioctl()
165 int snd_oxfw_create_hwdep(struct snd_oxfw *oxfw) in snd_oxfw_create_hwdep() argument
177 err = snd_hwdep_new(oxfw->card, oxfw->card->driver, 0, &hwdep); in snd_oxfw_create_hwdep()
180 strcpy(hwdep->name, oxfw->card->driver); in snd_oxfw_create_hwdep()
183 hwdep->private_data = oxfw; in snd_oxfw_create_hwdep()