• Home
  • Raw
  • Download

Lines Matching refs:hw

44 	struct snd_hwdep *hw = file->private_data;  in snd_hwdep_llseek()  local
45 if (hw->ops.llseek) in snd_hwdep_llseek()
46 return hw->ops.llseek(hw, file, offset, orig); in snd_hwdep_llseek()
53 struct snd_hwdep *hw = file->private_data; in snd_hwdep_read() local
54 if (hw->ops.read) in snd_hwdep_read()
55 return hw->ops.read(hw, buf, count, offset); in snd_hwdep_read()
62 struct snd_hwdep *hw = file->private_data; in snd_hwdep_write() local
63 if (hw->ops.write) in snd_hwdep_write()
64 return hw->ops.write(hw, buf, count, offset); in snd_hwdep_write()
71 struct snd_hwdep *hw; in snd_hwdep_open() local
76 hw = snd_lookup_minor_data(iminor(inode), in snd_hwdep_open()
80 hw = snd_lookup_oss_minor_data(iminor(inode), in snd_hwdep_open()
85 if (hw == NULL) in snd_hwdep_open()
88 if (!try_module_get(hw->card->module)) { in snd_hwdep_open()
89 snd_card_unref(hw->card); in snd_hwdep_open()
94 add_wait_queue(&hw->open_wait, &wait); in snd_hwdep_open()
95 mutex_lock(&hw->open_mutex); in snd_hwdep_open()
97 if (hw->exclusive && hw->used > 0) { in snd_hwdep_open()
101 if (!hw->ops.open) { in snd_hwdep_open()
105 err = hw->ops.open(hw, file); in snd_hwdep_open()
116 mutex_unlock(&hw->open_mutex); in snd_hwdep_open()
118 mutex_lock(&hw->open_mutex); in snd_hwdep_open()
119 if (hw->card->shutdown) { in snd_hwdep_open()
128 remove_wait_queue(&hw->open_wait, &wait); in snd_hwdep_open()
130 err = snd_card_file_add(hw->card, file); in snd_hwdep_open()
132 file->private_data = hw; in snd_hwdep_open()
133 hw->used++; in snd_hwdep_open()
135 if (hw->ops.release) in snd_hwdep_open()
136 hw->ops.release(hw, file); in snd_hwdep_open()
139 mutex_unlock(&hw->open_mutex); in snd_hwdep_open()
141 module_put(hw->card->module); in snd_hwdep_open()
142 snd_card_unref(hw->card); in snd_hwdep_open()
149 struct snd_hwdep *hw = file->private_data; in snd_hwdep_release() local
150 struct module *mod = hw->card->module; in snd_hwdep_release()
152 mutex_lock(&hw->open_mutex); in snd_hwdep_release()
153 if (hw->ops.release) in snd_hwdep_release()
154 err = hw->ops.release(hw, file); in snd_hwdep_release()
155 if (hw->used > 0) in snd_hwdep_release()
156 hw->used--; in snd_hwdep_release()
157 mutex_unlock(&hw->open_mutex); in snd_hwdep_release()
158 wake_up(&hw->open_wait); in snd_hwdep_release()
160 snd_card_file_remove(hw->card, file); in snd_hwdep_release()
167 struct snd_hwdep *hw = file->private_data; in snd_hwdep_poll() local
168 if (hw->ops.poll) in snd_hwdep_poll()
169 return hw->ops.poll(hw, file, wait); in snd_hwdep_poll()
173 static int snd_hwdep_info(struct snd_hwdep *hw, in snd_hwdep_info() argument
179 info.card = hw->card->number; in snd_hwdep_info()
180 strscpy(info.id, hw->id, sizeof(info.id)); in snd_hwdep_info()
181 strscpy(info.name, hw->name, sizeof(info.name)); in snd_hwdep_info()
182 info.iface = hw->iface; in snd_hwdep_info()
188 static int snd_hwdep_dsp_status(struct snd_hwdep *hw, in snd_hwdep_dsp_status() argument
194 if (! hw->ops.dsp_status) in snd_hwdep_dsp_status()
197 info.dsp_loaded = hw->dsp_loaded; in snd_hwdep_dsp_status()
198 err = hw->ops.dsp_status(hw, &info); in snd_hwdep_dsp_status()
206 static int snd_hwdep_dsp_load(struct snd_hwdep *hw, in snd_hwdep_dsp_load() argument
211 if (! hw->ops.dsp_load) in snd_hwdep_dsp_load()
216 if (hw->dsp_loaded & (1u << info->index)) in snd_hwdep_dsp_load()
218 err = hw->ops.dsp_load(hw, info); in snd_hwdep_dsp_load()
221 hw->dsp_loaded |= (1u << info->index); in snd_hwdep_dsp_load()
225 static int snd_hwdep_dsp_load_user(struct snd_hwdep *hw, in snd_hwdep_dsp_load_user() argument
232 return snd_hwdep_dsp_load(hw, &info); in snd_hwdep_dsp_load_user()
239 struct snd_hwdep *hw = file->private_data; in snd_hwdep_ioctl() local
245 return snd_hwdep_info(hw, argp); in snd_hwdep_ioctl()
247 return snd_hwdep_dsp_status(hw, argp); in snd_hwdep_ioctl()
249 return snd_hwdep_dsp_load_user(hw, argp); in snd_hwdep_ioctl()
251 if (hw->ops.ioctl) in snd_hwdep_ioctl()
252 return hw->ops.ioctl(hw, file, cmd, arg); in snd_hwdep_ioctl()
258 struct snd_hwdep *hw = file->private_data; in snd_hwdep_mmap() local
259 if (hw->ops.mmap) in snd_hwdep_mmap()
260 return hw->ops.mmap(hw, file, vma); in snd_hwdep_mmap()