Lines Matching full:if
7 #if 0
10 #if 0
61 if (i->min < min) {
65 } else if (i->min == min && !i->openmin && openmin) {
69 if (i->integer) {
70 if (i->openmin) {
75 if (snd_interval_checkempty(i)) {
85 if (i->max > max) {
89 } else if (i->max == max && !i->openmax && openmax) {
93 if (i->integer) {
94 if (i->openmax) {
99 if (snd_interval_checkempty(i)) {
128 if (hw_is_mask(var)) {
129 if (dir)
133 if (hw_is_interval(var)) {
135 if (dir)
154 if (hw_is_mask(var)) {
155 if (dir)
159 if (hw_is_interval(var)) {
161 if (dir)
174 if (changed > 0) {
187 if (changed < 0)
189 if (params->rmask) {
191 if (err < 0)
203 if (dir) {
204 if (dir > 0) {
206 } else if (dir < 0) {
207 if (val > 0) {
213 if (hw_is_mask(var))
216 else if (hw_is_interval(var))
221 if (changed > 0) {
238 * Return new minimum or -EINVAL if the configuration space is empty
246 if (changed < 0)
248 if (params->rmask) {
250 if (err < 0)
262 if (dir) {
263 if (dir < 0) {
265 } else if (dir > 0) {
270 if (hw_is_mask(var)) {
271 if (val == 0 && open) {
277 } else if (hw_is_interval(var))
282 if (changed > 0) {
299 * Return new maximum or -EINVAL if the configuration space is empty
307 if (changed < 0)
309 if (params->rmask) {
311 if (err < 0)
325 if (*cdir == -2) {
327 } else if (*cdir == 2) {
336 if (adir < 0) {
339 } else if (adir > 0)
341 if (bdir < 0) {
344 } else if (bdir > 0)
349 /* Return 1 if min is nearer to best than max */
388 if (best > INT_MAX)
392 if (maxdir > 0)
394 else if (maxdir == 0)
401 if (save == NULL)
406 if (min >= 0) {
408 if (max < 0)
410 if ((unsigned int)min == saved_min && mindir == valdir)
413 if (params1 == NULL)
417 if (max < 0)
419 if (boundary_nearer(max, maxdir, best, valdir, min, mindir)) {
426 if (max < 0)
431 if (last)
443 if (hw_is_mask(var)) {
445 if (val == 0 && dir < 0) {
449 if (dir > 0)
451 else if (dir < 0)
455 } else if (hw_is_interval(var)) {
457 if (val == 0 && dir < 0) {
460 } else if (dir == 0)
468 if (dir < 0) {
479 if (changed > 0) {
496 * Return VAL or -EINVAL if the configuration space is empty
504 if (changed < 0)
506 if (params->rmask) {
508 if (err < 0)
519 if (changed > 0) {
551 if (runtime->oss.plugin_first) {
566 if (runtime->oss.plugin_last) {
582 if (buffer_size == runtime->oss.buffer_bytes)
584 #if BITS_PER_LONG >= 64
598 if (buffer_size == runtime->oss.buffer_bytes)
609 /* define extended formats in the recent OSS versions (if any) */
690 if (oss_buffer_size <= 0)
694 if (oss_buffer_size <= 0)
697 if (atomic_read(&substream->mmap_count)) {
698 if (oss_buffer_size > runtime->oss.mmap_bytes)
702 if (substream->oss.setup.period_size > 16)
704 else if (runtime->oss.fragshift) {
706 if (oss_period_size > oss_buffer_size / 2)
716 if (runtime->oss.subdivision == 0) {
718 if (oss_period_size / sd > 4096)
720 if (oss_period_size / sd < 4096)
725 if (oss_period_size < 16)
731 if (min_period_size > 0) {
734 if (oss_period_size < min_period_size)
740 if (max_period_size > 0) {
743 if (oss_period_size > max_period_size)
749 if (substream->oss.setup.periods > 1)
753 if (s > 0 && runtime->oss.maxfrags && s > runtime->oss.maxfrags)
755 if (oss_periods > s)
759 if (s < 2)
761 if (oss_periods < s)
767 if (oss_period_size < 16)
771 if (oss_period_size > 1024 * 1024)
788 if (save == NULL)
796 if (it->max < rate || (it->max == rate && it->openmax))
798 if (it->min < rate || (it->min == rate && !it->openmin)) {
803 if (ret == (int)rate)
809 if (rate <= prev)
817 /* parameter locking: returns immediately if tried during streaming */
820 if (mutex_lock_interruptible(&runtime->oss.params_lock))
822 if (atomic_read(&runtime->oss.rw_ref)) {
860 if (!runtime->oss.params)
865 if (!sw_params || !params || !sparams) {
870 if (atomic_read(&substream->mmap_count))
879 if (atomic_read(&substream->mmap_count))
883 if (!direct)
887 if (err < 0) {
894 if (err < 0)
899 if (err < 0)
905 if (direct)
910 if ((__force int)sformat < 0 ||
913 if (snd_mask_test_format(sformat_mask, sformat) &&
923 if (err < 0)
926 if (direct) {
950 if (err < 0)
955 if (err < 0)
960 if (err < 0)
966 if (err < 0) {
973 if (!direct) {
976 if (err < 0) {
981 if (runtime->oss.plugin_first) {
984 if (err < 0) {
989 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) {
994 if (err < 0)
1000 if (runtime->oss.trigger) {
1005 if (atomic_read(&substream->mmap_count) ||
1014 if (atomic_read(&substream->mmap_count) ||
1021 if (frames > runtime->buffer_size)
1028 if (err < 0) {
1035 if (oss_period_size < 0) {
1040 if (runtime->oss.plugin_first) {
1042 if (err < 0)
1048 if (oss_buffer_size <= 0) {
1069 if (!runtime->oss.buffer) {
1083 if (err)
1098 if (trylock) {
1099 if (!(mutex_trylock(&runtime->oss.params_lock)))
1101 } else if (mutex_lock_interruptible(&runtime->oss.params_lock))
1116 if (substream == NULL)
1118 if (asubstream == NULL)
1120 if (substream->runtime->oss.params) {
1122 if (err < 0)
1126 if (!asubstream)
1128 if (r_substream)
1143 if (err < 0) {
1162 if (runtime->oss.params) {
1164 if (err < 0)
1167 if (runtime->oss.prepare) {
1168 if (mutex_lock_interruptible(&runtime->oss.params_lock))
1172 if (err < 0)
1185 if (runtime->oss.params) {
1187 if (err < 0)
1190 if (runtime->oss.prepare) {
1192 if (err < 0)
1206 if (err < 0)
1209 if (*delay <= (snd_pcm_sframes_t)runtime->buffer_size)
1217 if (err < 0)
1228 if (runtime->state == SNDRV_PCM_STATE_XRUN ||
1237 if (ret < 0)
1244 if (ret != -EPIPE && ret != -ESTRPIPE)
1246 /* test, if we can't store new data, because the stream */
1248 if (runtime->state == SNDRV_PCM_STATE_PREPARED)
1260 if (runtime->state == SNDRV_PCM_STATE_XRUN ||
1269 if (ret < 0)
1271 } else if (runtime->state == SNDRV_PCM_STATE_SETUP) {
1273 if (ret < 0)
1277 if (ret < 0)
1283 if (ret == -EPIPE) {
1284 if (runtime->state == SNDRV_PCM_STATE_DRAINING) {
1286 if (ret < 0)
1291 if (ret != -ESTRPIPE)
1303 if (runtime->state == SNDRV_PCM_STATE_XRUN ||
1312 if (ret < 0)
1316 if (ret != -EPIPE && ret != -ESTRPIPE)
1319 /* test, if we can't store new data, because the stream */
1321 if (runtime->state == SNDRV_PCM_STATE_PREPARED)
1332 if (runtime->state == SNDRV_PCM_STATE_XRUN ||
1341 if (ret < 0)
1343 } else if (runtime->state == SNDRV_PCM_STATE_SETUP) {
1345 if (ret < 0)
1349 if (ret != -EPIPE && ret != -ESTRPIPE)
1361 if (runtime->oss.plugin_first) {
1364 if (!in_kernel) {
1365 if (copy_from_user(runtime->oss.buffer, (const char __force __user *)buf, bytes))
1371 if (frames1 < 0)
1374 if (frames1 <= 0)
1382 if (frames1 <= 0)
1395 if (atomic_read(&substream->mmap_count))
1400 if (mutex_lock_interruptible(&runtime->oss.params_lock)) {
1405 if (tmp < 0)
1407 if (bytes < runtime->oss.period_bytes || runtime->oss.buffer_used > 0) {
1409 if (tmp + runtime->oss.buffer_used > runtime->oss.period_bytes)
1411 if (tmp > 0) {
1412 if (copy_from_user(runtime->oss.buffer + runtime->oss.buffer_used, buf, tmp)) {
1421 if (substream->oss.setup.partialfrag ||
1425 if (tmp <= 0)
1430 if (runtime->oss.period_ptr == 0 ||
1433 else if ((substream->f_flags & O_NONBLOCK) != 0) {
1442 if (tmp <= 0)
1448 if ((substream->f_flags & O_NONBLOCK) != 0 &&
1454 if (tmp < 0)
1456 if (signal_pending(current)) {
1472 if (runtime->oss.plugin_first) {
1475 if (!in_kernel)
1479 if (frames1 < 0)
1482 if (frames1 <= 0)
1485 if (!in_kernel && copy_to_user(final_dst, buf, bytes))
1492 if (frames1 <= 0)
1505 if (atomic_read(&substream->mmap_count))
1510 if (mutex_lock_interruptible(&runtime->oss.params_lock)) {
1515 if (tmp < 0)
1517 if (bytes < runtime->oss.period_bytes || runtime->oss.buffer_used > 0) {
1518 if (runtime->oss.buffer_used == 0) {
1520 if (tmp <= 0)
1527 if ((size_t) tmp > runtime->oss.buffer_used)
1529 if (copy_to_user(buf, runtime->oss.buffer + (runtime->oss.period_ptr - runtime->oss.buffer_used), tmp)) {
1540 if (tmp <= 0)
1549 if (tmp < 0)
1551 if (signal_pending(current)) {
1569 if (!substream)
1589 if (substream != NULL) {
1591 if (err < 0)
1616 if (result > 0) {
1621 if (result != 0 && result != -EAGAIN)
1627 if (state != SNDRV_PCM_STATE_RUNNING) {
1632 if (signal_pending(current)) {
1636 if (res == 0) {
1658 if (substream != NULL) {
1660 if (atomic_read(&substream->mmap_count))
1663 if (mutex_lock_interruptible(&runtime->oss.params_lock)) {
1668 if (err < 0)
1672 if (runtime->oss.buffer_used > 0) {
1681 if (err < 0)
1683 } else if (runtime->oss.period_ptr > 0) {
1692 if (err < 0)
1700 if (size > 0) {
1702 if (runtime->access == SNDRV_PCM_ACCESS_RW_INTERLEAVED)
1704 else if (runtime->access == SNDRV_PCM_ACCESS_RW_NONINTERLEAVED)
1710 if (err < 0)
1720 if (err < 0)
1728 if (substream != NULL) {
1730 if (err < 0)
1734 if (err < 0)
1753 if (substream == NULL)
1756 if (rate < 1000)
1758 else if (rate > 192000)
1761 if (err < 0)
1763 if (runtime->oss.rate != rate) {
1778 if (err < 0)
1786 if (channels < 1)
1788 if (channels > 128)
1795 if (substream == NULL)
1799 if (err < 0)
1801 if (runtime->oss.channels != channels) {
1816 if (err < 0)
1827 if (err < 0)
1843 if (err < 0)
1845 if (atomic_read(&substream->mmap_count))
1849 if (!direct)
1858 if (!params)
1862 if (err < 0)
1866 if (snd_mask_test(format_mask, fmt)) {
1868 if (f >= 0)
1881 if (format != AFMT_QUERY) {
1883 if (formats < 0)
1885 if (!(formats & format))
1890 if (substream == NULL)
1894 if (err < 0)
1896 if (runtime->oss.format != format) {
1912 if (err < 0)
1922 if (subdivide == 0) {
1924 if (subdivide == 0)
1928 if (runtime->oss.subdivision || runtime->oss.fragshift)
1930 if (subdivide != 1 && subdivide != 2 && subdivide != 4 &&
1946 if (substream == NULL)
1950 if (err < 0)
1954 if (err < 0)
1966 if (runtime->oss.subdivision || runtime->oss.fragshift)
1969 if (fragshift >= 25) /* should be large enough */
1973 if (runtime->oss.fragshift < 4) /* < 16 */
1975 if (runtime->oss.maxfrags < 2)
1989 if (substream == NULL)
1993 if (err < 0)
1997 if (err < 0)
2013 if (substream == NULL) {
2018 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
2019 if (substream->pstr->substream_count > 1)
2024 #if defined(DSP_CAP_REALTIME) && 0
2027 if (runtime->info & (SNDRV_PCM_INFO_BLOCK_TRANSFER|SNDRV_PCM_INFO_BATCH))
2070 if (psubstream) {
2072 if (err < 0)
2075 if (csubstream) {
2077 if (err < 0)
2080 if (psubstream) {
2083 if (mutex_lock_interruptible(&runtime->oss.params_lock))
2085 if (trigger & PCM_ENABLE_OUTPUT) {
2086 if (runtime->oss.trigger)
2088 if (atomic_read(&psubstream->mmap_count))
2095 if (!runtime->oss.trigger)
2104 if (cmd) {
2106 if (err < 0)
2110 if (csubstream) {
2113 if (mutex_lock_interruptible(&runtime->oss.params_lock))
2115 if (trigger & PCM_ENABLE_INPUT) {
2116 if (runtime->oss.trigger)
2122 if (!runtime->oss.trigger)
2131 if (cmd) {
2133 if (err < 0)
2147 if (psubstream && psubstream->runtime && psubstream->runtime->oss.trigger)
2149 if (csubstream && csubstream->runtime && csubstream->runtime->oss.trigger)
2162 if (substream == NULL)
2165 if (err < 0)
2168 if (runtime->oss.params || runtime->oss.prepare)
2171 if (err == -EPIPE)
2173 else if (err < 0)
2187 if (_info == NULL)
2190 if (substream == NULL)
2193 if (err < 0)
2196 if (runtime->oss.params || runtime->oss.prepare) {
2198 if (copy_to_user(_info, &info, sizeof(info)))
2202 if (stream == SNDRV_PCM_STREAM_PLAYBACK) {
2204 if (err == -EPIPE || err == -ESTRPIPE || (! err && delay < 0)) {
2215 if (err < 0)
2218 if (atomic_read(&substream->mmap_count)) {
2222 if (n < 0)
2226 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
2231 if (stream == SNDRV_PCM_STREAM_PLAYBACK) {
2232 if (substream->oss.setup.buggyptr)
2243 if (copy_to_user(_info, &info, sizeof(info)))
2257 if (_info == NULL)
2260 if (substream == NULL)
2264 if (runtime->oss.params) {
2266 if (err < 0)
2272 if (runtime->oss.prepare) {
2273 if (stream == SNDRV_PCM_STREAM_PLAYBACK) {
2281 if (stream == SNDRV_PCM_STREAM_PLAYBACK) {
2283 if (err == -EPIPE || err == -ESTRPIPE || (! err && avail < 0)) {
2295 if (err < 0)
2306 if (copy_to_user(_info, &info, sizeof(info)))
2322 if (*ptr == '/')
2338 if (!strcmp(setup->task_name, task_name))
2343 if (setup)
2361 if (setup->nonblock)
2363 else if (setup->block)
2391 if (!pcm_oss_file)
2395 if (substream)
2413 if (rpcm_oss_file)
2417 if (pcm_oss_file == NULL)
2420 if ((f_mode & (FMODE_WRITE|FMODE_READ)) == (FMODE_WRITE|FMODE_READ) &&
2426 if (setup[idx].disable)
2428 if (! pcm->streams[idx].substream_count)
2430 if (idx == SNDRV_PCM_STREAM_PLAYBACK) {
2431 if (! (f_mode & FMODE_WRITE))
2434 if (! (f_mode & FMODE_READ))
2438 if (err < 0) {
2447 if (!pcm_oss_file->streams[0] && !pcm_oss_file->streams[1]) {
2453 if (rpcm_oss_file)
2463 if (snd_BUG_ON(!task || !name || size < 2))
2482 if (err < 0)
2487 if (pcm == NULL) {
2492 if (err < 0)
2494 if (!try_module_get(pcm->card->module)) {
2498 if (snd_task_name(current, task_name, sizeof(task_name)) < 0) {
2503 if (file->f_mode & FMODE_WRITE)
2506 if (file->f_mode & FMODE_READ)
2511 if (!nonblock)
2520 if (err >= 0)
2522 if (err == -EAGAIN) {
2523 if (nonblock) {
2533 if (pcm->card->shutdown) {
2537 if (signal_pending(current)) {
2544 if (err < 0)
2554 if (pcm)
2567 if (substream == NULL)
2569 if (snd_BUG_ON(!substream))
2572 if (!pcm->card->shutdown)
2590 if (cmd == OSS_GETVERSION)
2592 if (cmd == OSS_ALSAEMULVER)
2594 #if IS_REACHABLE(CONFIG_SND_MIXER_OSS)
2595 if (((cmd >> 8) & 0xff) == 'M') { /* mixer ioctl - for OSS compatibility */
2600 if (substream != NULL)
2603 if (snd_BUG_ON(idx >= 2))
2608 if (((cmd >> 8) & 0xff) != 'P')
2619 if (get_user(res, p))
2622 if (res < 0)
2627 if (res < 0)
2631 if (get_user(res, p))
2635 if (res < 0)
2640 if (res < 0)
2644 if (get_user(res, p))
2647 if (res < 0)
2652 if (res < 0)
2656 if (get_user(res, p))
2659 if (res < 0)
2664 if (res < 0)
2673 if (get_user(res, p))
2676 if (res < 0)
2680 if (get_user(res, p))
2685 if (res < 0)
2698 if (res < 0)
2703 if (res < 0)
2707 if (get_user(res, p))
2726 if (snd_pcm_oss_get_caps(pcm_oss_file) & DSP_CAP_DUPLEX)
2731 if (res < 0) {
2767 if (substream == NULL)
2791 if (substream == NULL)
2805 if (atomic_read(&substream->mmap_count))
2816 if (atomic_read(&substream->mmap_count))
2836 if (psubstream != NULL) {
2840 if (runtime->state != SNDRV_PCM_STATE_DRAINING &&
2846 if (csubstream != NULL) {
2852 if (ostate != SNDRV_PCM_STATE_RUNNING ||
2856 if (ostate != SNDRV_PCM_STATE_RUNNING && runtime->oss.trigger) {
2882 if (substream)
2897 if (substream == NULL)
2900 if (!(runtime->info & SNDRV_PCM_INFO_MMAP_VALID))
2902 if (runtime->info & SNDRV_PCM_INFO_INTERLEAVED)
2907 if (runtime->oss.params) {
2913 if (err < 0)
2917 if (runtime->oss.plugin_first != NULL)
2921 if (area->vm_pgoff != 0)
2925 if (err < 0)
2992 if (!strcmp(task_name, "clear") || !strcmp(task_name, "erase")) {
2997 if (!strcmp(setup->task_name, task_name)) {
3007 if (template.period_size & (1 << idx1))
3013 if (!strcmp(str, "disable")) {
3015 } else if (!strcmp(str, "direct")) {
3017 } else if (!strcmp(str, "block")) {
3019 } else if (!strcmp(str, "non-block")) {
3021 } else if (!strcmp(str, "partial-frag")) {
3023 } else if (!strcmp(str, "no-silence")) {
3025 } else if (!strcmp(str, "buggy-ptr")) {
3029 if (setup == NULL) {
3031 if (! setup) {
3035 if (pstr->oss.setup_list == NULL)
3043 if (! template.task_name) {
3059 if (pstr->substream_count == 0)
3062 if (entry) {
3068 if (snd_info_register(entry) < 0) {
3115 if (snd_register_oss_device(SNDRV_OSS_DEVICE_TYPE_PCM,
3126 if (dsp_map[pcm->card->number] == (int)pcm->device) {
3142 if (adsp_map[pcm->card->number] == (int)pcm->device) {
3148 if (pcm->oss.reg)
3156 if (pcm->oss.reg) {
3157 if (pcm->oss.reg_mask & 1) {
3162 if (pcm->oss.reg_mask & 2) {
3167 if (dsp_map[pcm->card->number] == (int)pcm->device) {
3198 if (dsp_map[i] < 0 || dsp_map[i] >= SNDRV_PCM_DEVICES) {
3203 if (adsp_map[i] < 0 || adsp_map[i] >= SNDRV_PCM_DEVICES) {
3210 if (err < 0)