Lines Matching defs:hwdep

2  * \file hwdep/hwdep.c
39 static int snd_hwdep_open_conf(snd_hwdep_t **hwdep,
135 err = open_func(hwdep, name, hwdep_root, hwdep_conf, mode);
137 (*hwdep)->dl_handle = h;
145 static int snd_hwdep_open_noupdate(snd_hwdep_t **hwdep, snd_config_t *root, const char *name, int mode)
149 err = snd_config_search_definition(root, "hwdep", name, &hwdep_conf);
154 err = snd_hwdep_open_conf(hwdep, name, root, hwdep_conf, mode);
161 * \param hwdep Returned handle (NULL if not wanted)
169 int snd_hwdep_open(snd_hwdep_t **hwdep, const char *name, int mode)
174 assert(hwdep && name);
178 err = snd_hwdep_open_noupdate(hwdep, top, name, mode);
185 * \param hwdep Returned handle (NULL if not wanted)
194 int snd_hwdep_open_lconf(snd_hwdep_t **hwdep, const char *name,
197 assert(hwdep && name && lconf);
198 return snd_hwdep_open_noupdate(hwdep, lconf, name, mode);
203 * \param hwdep HwDep handle
209 int snd_hwdep_close(snd_hwdep_t *hwdep)
212 assert(hwdep);
213 err = hwdep->ops->close(hwdep);
214 if (hwdep->dl_handle)
215 snd_dlclose(hwdep->dl_handle);
216 free(hwdep->name);
217 free(hwdep);
223 * \param hwdep a Hwdep handle
229 const char *snd_hwdep_name(snd_hwdep_t *hwdep)
231 assert(hwdep);
232 return hwdep->name;
237 * \param hwdep a HwDep handle
242 snd_hwdep_type_t snd_hwdep_type(snd_hwdep_t *hwdep)
244 assert(hwdep);
245 return hwdep->type;
250 * \param hwdep HwDep handle
253 int snd_hwdep_poll_descriptors_count(snd_hwdep_t *hwdep)
255 assert(hwdep);
261 * \param hwdep HwDep handle
266 int snd_hwdep_poll_descriptors(snd_hwdep_t *hwdep, struct pollfd *pfds, unsigned int space)
268 assert(hwdep);
270 pfds->fd = hwdep->poll_fd;
271 switch (hwdep->mode & O_ACCMODE) {
291 * \param hwdep HwDep handle
297 int snd_hwdep_poll_descriptors_revents(snd_hwdep_t *hwdep, struct pollfd *pfds, unsigned int nfds, unsigned short *revents)
299 assert(hwdep && pfds && revents);
309 * \param hwdep HwDep handle
313 int snd_hwdep_nonblock(snd_hwdep_t *hwdep, int nonblock)
316 assert(hwdep);
317 if ((err = hwdep->ops->nonblock(hwdep, nonblock)) < 0)
320 hwdep->mode |= SND_HWDEP_OPEN_NONBLOCK;
322 hwdep->mode &= ~SND_HWDEP_OPEN_NONBLOCK;
377 * \brief get hwdep card number
379 * \return hwdep card number
388 * \brief get hwdep device number
390 * \return hwdep device number
399 * \brief get hwdep driver identifier
401 * \return hwdep driver identifier
410 * \brief get hwdep driver name
412 * \return hwdep driver name
421 * \brief get hwdep protocol interface
423 * \return hwdep protocol interface
432 * \brief set hwdep device number
434 * \param val hwdep device
444 * \param hwdep HwDep handle
448 int snd_hwdep_info(snd_hwdep_t *hwdep, snd_hwdep_info_t * info)
450 assert(hwdep);
452 return hwdep->ops->info(hwdep, info);
457 * \param hwdep HwDep handle
462 int snd_hwdep_ioctl(snd_hwdep_t *hwdep, unsigned int request, void * arg)
464 assert(hwdep);
465 return hwdep->ops->ioctl(hwdep, request, arg);
470 * \param hwdep HwDep handle
474 ssize_t snd_hwdep_write(snd_hwdep_t *hwdep, const void *buffer, size_t size)
476 assert(hwdep);
477 assert(((hwdep->mode & O_ACCMODE) == O_WRONLY) || ((hwdep->mode & O_ACCMODE) == O_RDWR));
479 return hwdep->ops->write(hwdep, buffer, size);
484 * \param hwdep HwDep handle
488 ssize_t snd_hwdep_read(snd_hwdep_t *hwdep, void *buffer, size_t size)
490 assert(hwdep);
491 assert(((hwdep->mode & O_ACCMODE) == O_RDONLY) || ((hwdep->mode & O_ACCMODE) == O_RDWR));
493 return (hwdep->ops->read)(hwdep, buffer, size);
498 * \param hwdep HwDep handle
502 int snd_hwdep_dsp_status(snd_hwdep_t *hwdep, snd_hwdep_dsp_status_t *info)
504 assert(hwdep);
506 return hwdep->ops->ioctl(hwdep, SNDRV_HWDEP_IOCTL_DSP_STATUS, (void*)info);
511 * \param hwdep HwDep handle
515 int snd_hwdep_dsp_load(snd_hwdep_t *hwdep, snd_hwdep_dsp_image_t *block)
517 assert(hwdep);
519 return hwdep->ops->ioctl(hwdep, SNDRV_HWDEP_IOCTL_DSP_LOAD, (void*)block);