Lines Matching defs:hwdep
38 static int snd_hwdep_hw_close(snd_hwdep_t *hwdep)
41 assert(hwdep);
42 res = close(hwdep->poll_fd) < 0 ? -errno : 0;
46 static int snd_hwdep_hw_nonblock(snd_hwdep_t *hwdep, int nonblock)
49 assert(hwdep);
50 if ((flags = fcntl(hwdep->poll_fd, F_GETFL)) < 0)
56 if (fcntl(hwdep->poll_fd, F_SETFL, flags) < 0)
61 static int snd_hwdep_hw_info(snd_hwdep_t *hwdep, snd_hwdep_info_t *info)
63 assert(hwdep && info);
64 if (ioctl(hwdep->poll_fd, SNDRV_HWDEP_IOCTL_INFO, info) < 0)
69 static int snd_hwdep_hw_ioctl(snd_hwdep_t *hwdep, unsigned int request, void * arg)
71 assert(hwdep);
72 if (ioctl(hwdep->poll_fd, request, arg) < 0)
77 static ssize_t snd_hwdep_hw_write(snd_hwdep_t *hwdep, const void *buffer, size_t size)
80 assert(hwdep && (buffer || size == 0));
81 result = write(hwdep->poll_fd, buffer, size);
87 static ssize_t snd_hwdep_hw_read(snd_hwdep_t *hwdep, void *buffer, size_t size)
90 assert(hwdep && (buffer || size == 0));
91 result = read(hwdep->poll_fd, buffer, size);
110 snd_hwdep_t *hwdep;
134 hwdep = (snd_hwdep_t *) calloc(1, sizeof(snd_hwdep_t));
135 if (hwdep == NULL) {
139 hwdep->name = strdup(name);
140 hwdep->poll_fd = fd;
141 hwdep->mode = mode;
142 hwdep->type = SND_HWDEP_TYPE_HW;
143 hwdep->ops = &snd_hwdep_hw_ops;
144 *handle = hwdep;
148 int _snd_hwdep_hw_open(snd_hwdep_t **hwdep, char *name,
188 return snd_hwdep_hw_open(hwdep, name, card, device, mode);