Lines Matching refs:hw
58 struct snd_hwdep *hw = file->private_data; in snd_hwdep_llseek() local
59 if (hw->ops.llseek) in snd_hwdep_llseek()
60 return hw->ops.llseek(hw, file, offset, orig); in snd_hwdep_llseek()
67 struct snd_hwdep *hw = file->private_data; in snd_hwdep_read() local
68 if (hw->ops.read) in snd_hwdep_read()
69 return hw->ops.read(hw, buf, count, offset); in snd_hwdep_read()
76 struct snd_hwdep *hw = file->private_data; in snd_hwdep_write() local
77 if (hw->ops.write) in snd_hwdep_write()
78 return hw->ops.write(hw, buf, count, offset); in snd_hwdep_write()
85 struct snd_hwdep *hw; in snd_hwdep_open() local
90 hw = snd_lookup_minor_data(iminor(inode), in snd_hwdep_open()
94 hw = snd_lookup_oss_minor_data(iminor(inode), in snd_hwdep_open()
99 if (hw == NULL) in snd_hwdep_open()
102 if (!try_module_get(hw->card->module)) { in snd_hwdep_open()
103 snd_card_unref(hw->card); in snd_hwdep_open()
108 add_wait_queue(&hw->open_wait, &wait); in snd_hwdep_open()
109 mutex_lock(&hw->open_mutex); in snd_hwdep_open()
111 if (hw->exclusive && hw->used > 0) { in snd_hwdep_open()
115 if (!hw->ops.open) { in snd_hwdep_open()
119 err = hw->ops.open(hw, file); in snd_hwdep_open()
130 mutex_unlock(&hw->open_mutex); in snd_hwdep_open()
132 mutex_lock(&hw->open_mutex); in snd_hwdep_open()
133 if (hw->card->shutdown) { in snd_hwdep_open()
142 remove_wait_queue(&hw->open_wait, &wait); in snd_hwdep_open()
144 err = snd_card_file_add(hw->card, file); in snd_hwdep_open()
146 file->private_data = hw; in snd_hwdep_open()
147 hw->used++; in snd_hwdep_open()
149 if (hw->ops.release) in snd_hwdep_open()
150 hw->ops.release(hw, file); in snd_hwdep_open()
153 mutex_unlock(&hw->open_mutex); in snd_hwdep_open()
155 module_put(hw->card->module); in snd_hwdep_open()
156 snd_card_unref(hw->card); in snd_hwdep_open()
163 struct snd_hwdep *hw = file->private_data; in snd_hwdep_release() local
164 struct module *mod = hw->card->module; in snd_hwdep_release()
166 mutex_lock(&hw->open_mutex); in snd_hwdep_release()
167 if (hw->ops.release) in snd_hwdep_release()
168 err = hw->ops.release(hw, file); in snd_hwdep_release()
169 if (hw->used > 0) in snd_hwdep_release()
170 hw->used--; in snd_hwdep_release()
171 mutex_unlock(&hw->open_mutex); in snd_hwdep_release()
172 wake_up(&hw->open_wait); in snd_hwdep_release()
174 snd_card_file_remove(hw->card, file); in snd_hwdep_release()
181 struct snd_hwdep *hw = file->private_data; in snd_hwdep_poll() local
182 if (hw->ops.poll) in snd_hwdep_poll()
183 return hw->ops.poll(hw, file, wait); in snd_hwdep_poll()
187 static int snd_hwdep_info(struct snd_hwdep *hw, in snd_hwdep_info() argument
193 info.card = hw->card->number; in snd_hwdep_info()
194 strlcpy(info.id, hw->id, sizeof(info.id)); in snd_hwdep_info()
195 strlcpy(info.name, hw->name, sizeof(info.name)); in snd_hwdep_info()
196 info.iface = hw->iface; in snd_hwdep_info()
202 static int snd_hwdep_dsp_status(struct snd_hwdep *hw, in snd_hwdep_dsp_status() argument
208 if (! hw->ops.dsp_status) in snd_hwdep_dsp_status()
211 info.dsp_loaded = hw->dsp_loaded; in snd_hwdep_dsp_status()
212 if ((err = hw->ops.dsp_status(hw, &info)) < 0) in snd_hwdep_dsp_status()
219 static int snd_hwdep_dsp_load(struct snd_hwdep *hw, in snd_hwdep_dsp_load() argument
225 if (! hw->ops.dsp_load) in snd_hwdep_dsp_load()
231 if (hw->dsp_loaded & (1 << info.index)) in snd_hwdep_dsp_load()
235 err = hw->ops.dsp_load(hw, &info); in snd_hwdep_dsp_load()
238 hw->dsp_loaded |= (1 << info.index); in snd_hwdep_dsp_load()
245 struct snd_hwdep *hw = file->private_data; in snd_hwdep_ioctl() local
251 return snd_hwdep_info(hw, argp); in snd_hwdep_ioctl()
253 return snd_hwdep_dsp_status(hw, argp); in snd_hwdep_ioctl()
255 return snd_hwdep_dsp_load(hw, argp); in snd_hwdep_ioctl()
257 if (hw->ops.ioctl) in snd_hwdep_ioctl()
258 return hw->ops.ioctl(hw, file, cmd, arg); in snd_hwdep_ioctl()
264 struct snd_hwdep *hw = file->private_data; in snd_hwdep_mmap() local
265 if (hw->ops.mmap) in snd_hwdep_mmap()
266 return hw->ops.mmap(hw, file, vma); in snd_hwdep_mmap()