Lines Matching refs:hw
59 struct snd_hwdep *hw = file->private_data; in snd_hwdep_llseek() local
60 if (hw->ops.llseek) in snd_hwdep_llseek()
61 return hw->ops.llseek(hw, file, offset, orig); in snd_hwdep_llseek()
68 struct snd_hwdep *hw = file->private_data; in snd_hwdep_read() local
69 if (hw->ops.read) in snd_hwdep_read()
70 return hw->ops.read(hw, buf, count, offset); in snd_hwdep_read()
77 struct snd_hwdep *hw = file->private_data; in snd_hwdep_write() local
78 if (hw->ops.write) in snd_hwdep_write()
79 return hw->ops.write(hw, buf, count, offset); in snd_hwdep_write()
86 struct snd_hwdep *hw; in snd_hwdep_open() local
91 hw = snd_lookup_minor_data(iminor(inode), in snd_hwdep_open()
95 hw = snd_lookup_oss_minor_data(iminor(inode), in snd_hwdep_open()
100 if (hw == NULL) in snd_hwdep_open()
103 if (!try_module_get(hw->card->module)) { in snd_hwdep_open()
104 snd_card_unref(hw->card); in snd_hwdep_open()
109 add_wait_queue(&hw->open_wait, &wait); in snd_hwdep_open()
110 mutex_lock(&hw->open_mutex); in snd_hwdep_open()
112 if (hw->exclusive && hw->used > 0) { in snd_hwdep_open()
116 if (!hw->ops.open) { in snd_hwdep_open()
120 err = hw->ops.open(hw, file); in snd_hwdep_open()
131 mutex_unlock(&hw->open_mutex); in snd_hwdep_open()
133 mutex_lock(&hw->open_mutex); in snd_hwdep_open()
134 if (hw->card->shutdown) { in snd_hwdep_open()
143 remove_wait_queue(&hw->open_wait, &wait); in snd_hwdep_open()
145 err = snd_card_file_add(hw->card, file); in snd_hwdep_open()
147 file->private_data = hw; in snd_hwdep_open()
148 hw->used++; in snd_hwdep_open()
150 if (hw->ops.release) in snd_hwdep_open()
151 hw->ops.release(hw, file); in snd_hwdep_open()
154 mutex_unlock(&hw->open_mutex); in snd_hwdep_open()
156 module_put(hw->card->module); in snd_hwdep_open()
157 snd_card_unref(hw->card); in snd_hwdep_open()
164 struct snd_hwdep *hw = file->private_data; in snd_hwdep_release() local
165 struct module *mod = hw->card->module; in snd_hwdep_release()
167 mutex_lock(&hw->open_mutex); in snd_hwdep_release()
168 if (hw->ops.release) in snd_hwdep_release()
169 err = hw->ops.release(hw, file); in snd_hwdep_release()
170 if (hw->used > 0) in snd_hwdep_release()
171 hw->used--; in snd_hwdep_release()
172 mutex_unlock(&hw->open_mutex); in snd_hwdep_release()
173 wake_up(&hw->open_wait); in snd_hwdep_release()
175 snd_card_file_remove(hw->card, file); in snd_hwdep_release()
182 struct snd_hwdep *hw = file->private_data; in snd_hwdep_poll() local
183 if (hw->ops.poll) in snd_hwdep_poll()
184 return hw->ops.poll(hw, file, wait); in snd_hwdep_poll()
188 static int snd_hwdep_info(struct snd_hwdep *hw, in snd_hwdep_info() argument
194 info.card = hw->card->number; in snd_hwdep_info()
195 strlcpy(info.id, hw->id, sizeof(info.id)); in snd_hwdep_info()
196 strlcpy(info.name, hw->name, sizeof(info.name)); in snd_hwdep_info()
197 info.iface = hw->iface; in snd_hwdep_info()
203 static int snd_hwdep_dsp_status(struct snd_hwdep *hw, in snd_hwdep_dsp_status() argument
209 if (! hw->ops.dsp_status) in snd_hwdep_dsp_status()
212 info.dsp_loaded = hw->dsp_loaded; in snd_hwdep_dsp_status()
213 if ((err = hw->ops.dsp_status(hw, &info)) < 0) in snd_hwdep_dsp_status()
220 static int snd_hwdep_dsp_load(struct snd_hwdep *hw, in snd_hwdep_dsp_load() argument
226 if (! hw->ops.dsp_load) in snd_hwdep_dsp_load()
232 if (hw->dsp_loaded & (1 << info.index)) in snd_hwdep_dsp_load()
236 err = hw->ops.dsp_load(hw, &info); in snd_hwdep_dsp_load()
239 hw->dsp_loaded |= (1 << info.index); in snd_hwdep_dsp_load()
246 struct snd_hwdep *hw = file->private_data; in snd_hwdep_ioctl() local
252 return snd_hwdep_info(hw, argp); in snd_hwdep_ioctl()
254 return snd_hwdep_dsp_status(hw, argp); in snd_hwdep_ioctl()
256 return snd_hwdep_dsp_load(hw, argp); in snd_hwdep_ioctl()
258 if (hw->ops.ioctl) in snd_hwdep_ioctl()
259 return hw->ops.ioctl(hw, file, cmd, arg); in snd_hwdep_ioctl()
265 struct snd_hwdep *hw = file->private_data; in snd_hwdep_mmap() local
266 if (hw->ops.mmap) in snd_hwdep_mmap()
267 return hw->ops.mmap(hw, file, vma); in snd_hwdep_mmap()