Lines Matching refs:efw

22 hwdep_read_resp_buf(struct snd_efw *efw, char __user *buf, long remained,  in hwdep_read_resp_buf()  argument
41 spin_lock_irq(&efw->lock); in hwdep_read_resp_buf()
48 pull_ptr = efw->pull_ptr; in hwdep_read_resp_buf()
50 while (efw->push_ptr != pull_ptr) { in hwdep_read_resp_buf()
61 (unsigned int)(pull_ptr - efw->resp_buf); in hwdep_read_resp_buf()
64 spin_unlock_irq(&efw->lock); in hwdep_read_resp_buf()
69 spin_lock_irq(&efw->lock); in hwdep_read_resp_buf()
72 if (pull_ptr >= efw->resp_buf + snd_efw_resp_buf_size) in hwdep_read_resp_buf()
90 efw->pull_ptr = pull_ptr; in hwdep_read_resp_buf()
92 spin_unlock_irq(&efw->lock); in hwdep_read_resp_buf()
98 hwdep_read_locked(struct snd_efw *efw, char __user *buf, long count, in hwdep_read_locked() argument
105 spin_lock_irq(&efw->lock); in hwdep_read_locked()
107 event.lock_status.status = (efw->dev_lock_count > 0); in hwdep_read_locked()
108 efw->dev_lock_changed = false; in hwdep_read_locked()
110 spin_unlock_irq(&efw->lock); in hwdep_read_locked()
124 struct snd_efw *efw = hwdep->private_data; in hwdep_read() local
129 spin_lock_irq(&efw->lock); in hwdep_read()
131 dev_lock_changed = efw->dev_lock_changed; in hwdep_read()
132 queued = efw->push_ptr != efw->pull_ptr; in hwdep_read()
135 prepare_to_wait(&efw->hwdep_wait, &wait, TASK_INTERRUPTIBLE); in hwdep_read()
136 spin_unlock_irq(&efw->lock); in hwdep_read()
138 finish_wait(&efw->hwdep_wait, &wait); in hwdep_read()
141 spin_lock_irq(&efw->lock); in hwdep_read()
142 dev_lock_changed = efw->dev_lock_changed; in hwdep_read()
143 queued = efw->push_ptr != efw->pull_ptr; in hwdep_read()
146 spin_unlock_irq(&efw->lock); in hwdep_read()
149 count = hwdep_read_locked(efw, buf, count, offset); in hwdep_read()
151 count = hwdep_read_resp_buf(efw, buf, count, offset); in hwdep_read()
160 struct snd_efw *efw = hwdep->private_data; in hwdep_write() local
179 if (snd_efw_transaction_cmd(efw->unit, buf, count) < 0) in hwdep_write()
189 struct snd_efw *efw = hwdep->private_data; in hwdep_poll() local
192 poll_wait(file, &efw->hwdep_wait, wait); in hwdep_poll()
194 spin_lock_irq(&efw->lock); in hwdep_poll()
195 if (efw->dev_lock_changed || efw->pull_ptr != efw->push_ptr) in hwdep_poll()
199 spin_unlock_irq(&efw->lock); in hwdep_poll()
205 hwdep_get_info(struct snd_efw *efw, void __user *arg) in hwdep_get_info() argument
207 struct fw_device *dev = fw_parent_device(efw->unit); in hwdep_get_info()
225 hwdep_lock(struct snd_efw *efw) in hwdep_lock() argument
229 spin_lock_irq(&efw->lock); in hwdep_lock()
231 if (efw->dev_lock_count == 0) { in hwdep_lock()
232 efw->dev_lock_count = -1; in hwdep_lock()
238 spin_unlock_irq(&efw->lock); in hwdep_lock()
244 hwdep_unlock(struct snd_efw *efw) in hwdep_unlock() argument
248 spin_lock_irq(&efw->lock); in hwdep_unlock()
250 if (efw->dev_lock_count == -1) { in hwdep_unlock()
251 efw->dev_lock_count = 0; in hwdep_unlock()
257 spin_unlock_irq(&efw->lock); in hwdep_unlock()
265 struct snd_efw *efw = hwdep->private_data; in hwdep_release() local
267 spin_lock_irq(&efw->lock); in hwdep_release()
268 if (efw->dev_lock_count == -1) in hwdep_release()
269 efw->dev_lock_count = 0; in hwdep_release()
270 spin_unlock_irq(&efw->lock); in hwdep_release()
279 struct snd_efw *efw = hwdep->private_data; in hwdep_ioctl() local
283 return hwdep_get_info(efw, (void __user *)arg); in hwdep_ioctl()
285 return hwdep_lock(efw); in hwdep_ioctl()
287 return hwdep_unlock(efw); in hwdep_ioctl()
305 int snd_efw_create_hwdep_device(struct snd_efw *efw) in snd_efw_create_hwdep_device() argument
318 err = snd_hwdep_new(efw->card, "Fireworks", 0, &hwdep); in snd_efw_create_hwdep_device()
324 hwdep->private_data = efw; in snd_efw_create_hwdep_device()