Lines Matching full:if
7 #if 0
10 #if 0
61 if (i->min < min) { in snd_interval_refine_min()
65 } else if (i->min == min && !i->openmin && openmin) { in snd_interval_refine_min()
69 if (i->integer) { in snd_interval_refine_min()
70 if (i->openmin) { in snd_interval_refine_min()
75 if (snd_interval_checkempty(i)) { in snd_interval_refine_min()
85 if (i->max > max) { in snd_interval_refine_max()
89 } else if (i->max == max && !i->openmax && openmax) { in snd_interval_refine_max()
93 if (i->integer) { in snd_interval_refine_max()
94 if (i->openmax) { in snd_interval_refine_max()
99 if (snd_interval_checkempty(i)) { in snd_interval_refine_max()
128 if (hw_is_mask(var)) { in snd_pcm_hw_param_value_min()
129 if (dir) in snd_pcm_hw_param_value_min()
133 if (hw_is_interval(var)) { in snd_pcm_hw_param_value_min()
135 if (dir) in snd_pcm_hw_param_value_min()
154 if (hw_is_mask(var)) { in snd_pcm_hw_param_value_max()
155 if (dir) in snd_pcm_hw_param_value_max()
159 if (hw_is_interval(var)) { in snd_pcm_hw_param_value_max()
161 if (dir) in snd_pcm_hw_param_value_max()
174 if (changed > 0) { in _snd_pcm_hw_param_mask()
187 if (changed < 0) in snd_pcm_hw_param_mask()
189 if (params->rmask) { in snd_pcm_hw_param_mask()
191 if (err < 0) in snd_pcm_hw_param_mask()
203 if (dir) { in _snd_pcm_hw_param_min()
204 if (dir > 0) { in _snd_pcm_hw_param_min()
206 } else if (dir < 0) { in _snd_pcm_hw_param_min()
207 if (val > 0) { in _snd_pcm_hw_param_min()
213 if (hw_is_mask(var)) in _snd_pcm_hw_param_min()
216 else if (hw_is_interval(var)) in _snd_pcm_hw_param_min()
221 if (changed > 0) { in _snd_pcm_hw_param_min()
238 * Return new minimum or -EINVAL if the configuration space is empty
246 if (changed < 0) in snd_pcm_hw_param_min()
248 if (params->rmask) { in snd_pcm_hw_param_min()
250 if (err < 0) in snd_pcm_hw_param_min()
262 if (dir) { in _snd_pcm_hw_param_max()
263 if (dir < 0) { in _snd_pcm_hw_param_max()
265 } else if (dir > 0) { in _snd_pcm_hw_param_max()
270 if (hw_is_mask(var)) { in _snd_pcm_hw_param_max()
271 if (val == 0 && open) { in _snd_pcm_hw_param_max()
277 } else if (hw_is_interval(var)) in _snd_pcm_hw_param_max()
282 if (changed > 0) { in _snd_pcm_hw_param_max()
299 * Return new maximum or -EINVAL if the configuration space is empty
307 if (changed < 0) in snd_pcm_hw_param_max()
309 if (params->rmask) { in snd_pcm_hw_param_max()
311 if (err < 0) in snd_pcm_hw_param_max()
325 if (*cdir == -2) { in boundary_sub()
327 } else if (*cdir == 2) { in boundary_sub()
336 if (adir < 0) { in boundary_lt()
339 } else if (adir > 0) in boundary_lt()
341 if (bdir < 0) { in boundary_lt()
344 } else if (bdir > 0) in boundary_lt()
349 /* Return 1 if min is nearer to best than max */
388 if (best > INT_MAX) in snd_pcm_hw_param_near()
392 if (maxdir > 0) in snd_pcm_hw_param_near()
394 else if (maxdir == 0) in snd_pcm_hw_param_near()
401 if (save == NULL) in snd_pcm_hw_param_near()
406 if (min >= 0) { in snd_pcm_hw_param_near()
408 if (max < 0) in snd_pcm_hw_param_near()
410 if ((unsigned int)min == saved_min && mindir == valdir) in snd_pcm_hw_param_near()
413 if (params1 == NULL) in snd_pcm_hw_param_near()
417 if (max < 0) in snd_pcm_hw_param_near()
419 if (boundary_nearer(max, maxdir, best, valdir, min, mindir)) { in snd_pcm_hw_param_near()
426 if (max < 0) in snd_pcm_hw_param_near()
431 if (last) in snd_pcm_hw_param_near()
443 if (hw_is_mask(var)) { in _snd_pcm_hw_param_set()
445 if (val == 0 && dir < 0) { in _snd_pcm_hw_param_set()
449 if (dir > 0) in _snd_pcm_hw_param_set()
451 else if (dir < 0) in _snd_pcm_hw_param_set()
455 } else if (hw_is_interval(var)) { in _snd_pcm_hw_param_set()
457 if (val == 0 && dir < 0) { in _snd_pcm_hw_param_set()
460 } else if (dir == 0) in _snd_pcm_hw_param_set()
468 if (dir < 0) { in _snd_pcm_hw_param_set()
479 if (changed > 0) { in _snd_pcm_hw_param_set()
496 * Return VAL or -EINVAL if the configuration space is empty
504 if (changed < 0) in snd_pcm_hw_param_set()
506 if (params->rmask) { in snd_pcm_hw_param_set()
508 if (err < 0) in snd_pcm_hw_param_set()
519 if (changed > 0) { in _snd_pcm_hw_param_setinteger()
551 if (runtime->oss.plugin_first) { in snd_pcm_plugin_insert()
566 if (runtime->oss.plugin_last) { in snd_pcm_plugin_append()
582 if (buffer_size == runtime->oss.buffer_bytes) in snd_pcm_oss_bytes()
584 #if BITS_PER_LONG >= 64 in snd_pcm_oss_bytes()
598 if (buffer_size == runtime->oss.buffer_bytes) in snd_pcm_alsa_frames()
609 /* define extended formats in the recent OSS versions (if any) */
690 if (oss_buffer_size <= 0) in snd_pcm_oss_period_size()
694 if (oss_buffer_size <= 0) in snd_pcm_oss_period_size()
697 if (atomic_read(&substream->mmap_count)) { in snd_pcm_oss_period_size()
698 if (oss_buffer_size > runtime->oss.mmap_bytes) in snd_pcm_oss_period_size()
702 if (substream->oss.setup.period_size > 16) in snd_pcm_oss_period_size()
704 else if (runtime->oss.fragshift) { in snd_pcm_oss_period_size()
706 if (oss_period_size > oss_buffer_size / 2) in snd_pcm_oss_period_size()
716 if (runtime->oss.subdivision == 0) { in snd_pcm_oss_period_size()
718 if (oss_period_size / sd > 4096) in snd_pcm_oss_period_size()
720 if (oss_period_size / sd < 4096) in snd_pcm_oss_period_size()
725 if (oss_period_size < 16) in snd_pcm_oss_period_size()
731 if (min_period_size > 0) { in snd_pcm_oss_period_size()
734 if (oss_period_size < min_period_size) in snd_pcm_oss_period_size()
740 if (max_period_size > 0) { in snd_pcm_oss_period_size()
743 if (oss_period_size > max_period_size) in snd_pcm_oss_period_size()
749 if (substream->oss.setup.periods > 1) in snd_pcm_oss_period_size()
753 if (s > 0 && runtime->oss.maxfrags && s > runtime->oss.maxfrags) in snd_pcm_oss_period_size()
755 if (oss_periods > s) in snd_pcm_oss_period_size()
759 if (s < 2) in snd_pcm_oss_period_size()
761 if (oss_periods < s) in snd_pcm_oss_period_size()
767 if (oss_period_size < 16) in snd_pcm_oss_period_size()
771 if (oss_period_size > 1024 * 1024) in snd_pcm_oss_period_size()
788 if (save == NULL) in choose_rate()
796 if (it->max < rate || (it->max == rate && it->openmax)) in choose_rate()
798 if (it->min < rate || (it->min == rate && !it->openmin)) { in choose_rate()
803 if (ret == (int)rate) in choose_rate()
809 if (rate <= prev) in choose_rate()
817 /* parameter locking: returns immediately if tried during streaming */
820 if (mutex_lock_interruptible(&runtime->oss.params_lock)) in lock_params()
822 if (atomic_read(&runtime->oss.rw_ref)) { in lock_params()
860 if (!runtime->oss.params) in snd_pcm_oss_change_params_locked()
865 if (!sw_params || !params || !sparams) { in snd_pcm_oss_change_params_locked()
870 if (atomic_read(&substream->mmap_count)) in snd_pcm_oss_change_params_locked()
879 if (atomic_read(&substream->mmap_count)) in snd_pcm_oss_change_params_locked()
883 if (!direct) in snd_pcm_oss_change_params_locked()
887 if (err < 0) { in snd_pcm_oss_change_params_locked()
894 if (err < 0) in snd_pcm_oss_change_params_locked()
899 if (err < 0) in snd_pcm_oss_change_params_locked()
905 if (direct) in snd_pcm_oss_change_params_locked()
910 if ((__force int)sformat < 0 || in snd_pcm_oss_change_params_locked()
913 if (snd_mask_test_format(sformat_mask, sformat) && in snd_pcm_oss_change_params_locked()
923 if (err < 0) in snd_pcm_oss_change_params_locked()
926 if (direct) { in snd_pcm_oss_change_params_locked()
950 if (err < 0) in snd_pcm_oss_change_params_locked()
955 if (err < 0) in snd_pcm_oss_change_params_locked()
960 if (err < 0) in snd_pcm_oss_change_params_locked()
966 if (err < 0) { in snd_pcm_oss_change_params_locked()
973 if (!direct) { in snd_pcm_oss_change_params_locked()
976 if (err < 0) { in snd_pcm_oss_change_params_locked()
981 if (runtime->oss.plugin_first) { in snd_pcm_oss_change_params_locked()
984 if (err < 0) { in snd_pcm_oss_change_params_locked()
989 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { in snd_pcm_oss_change_params_locked()
994 if (err < 0) in snd_pcm_oss_change_params_locked()
1000 if (runtime->oss.trigger) { in snd_pcm_oss_change_params_locked()
1005 if (atomic_read(&substream->mmap_count) || in snd_pcm_oss_change_params_locked()
1014 if (atomic_read(&substream->mmap_count) || in snd_pcm_oss_change_params_locked()
1021 if (frames > runtime->buffer_size) in snd_pcm_oss_change_params_locked()
1028 if (err < 0) { in snd_pcm_oss_change_params_locked()
1035 if (oss_period_size < 0) { in snd_pcm_oss_change_params_locked()
1040 if (runtime->oss.plugin_first) { in snd_pcm_oss_change_params_locked()
1042 if (err < 0) in snd_pcm_oss_change_params_locked()
1048 if (oss_buffer_size <= 0) { in snd_pcm_oss_change_params_locked()
1069 if (!runtime->oss.buffer) { in snd_pcm_oss_change_params_locked()
1083 if (err) in snd_pcm_oss_change_params_locked()
1098 if (trylock) { in snd_pcm_oss_change_params()
1099 if (!(mutex_trylock(&runtime->oss.params_lock))) in snd_pcm_oss_change_params()
1101 } else if (mutex_lock_interruptible(&runtime->oss.params_lock)) in snd_pcm_oss_change_params()
1116 if (substream == NULL) in snd_pcm_oss_get_active_substream()
1118 if (asubstream == NULL) in snd_pcm_oss_get_active_substream()
1120 if (substream->runtime->oss.params) { in snd_pcm_oss_get_active_substream()
1122 if (err < 0) in snd_pcm_oss_get_active_substream()
1126 if (!asubstream) in snd_pcm_oss_get_active_substream()
1128 if (r_substream) in snd_pcm_oss_get_active_substream()
1143 if (err < 0) { in snd_pcm_oss_prepare()
1162 if (runtime->oss.params) { in snd_pcm_oss_make_ready()
1164 if (err < 0) in snd_pcm_oss_make_ready()
1167 if (runtime->oss.prepare) { in snd_pcm_oss_make_ready()
1168 if (mutex_lock_interruptible(&runtime->oss.params_lock)) in snd_pcm_oss_make_ready()
1172 if (err < 0) in snd_pcm_oss_make_ready()
1185 if (runtime->oss.params) { in snd_pcm_oss_make_ready_locked()
1187 if (err < 0) in snd_pcm_oss_make_ready_locked()
1190 if (runtime->oss.prepare) { in snd_pcm_oss_make_ready_locked()
1192 if (err < 0) in snd_pcm_oss_make_ready_locked()
1206 if (err < 0) in snd_pcm_oss_capture_position_fixup()
1209 if (*delay <= (snd_pcm_sframes_t)runtime->buffer_size) in snd_pcm_oss_capture_position_fixup()
1217 if (err < 0) in snd_pcm_oss_capture_position_fixup()
1228 if (runtime->state == SNDRV_PCM_STATE_XRUN || in snd_pcm_oss_write3()
1237 if (ret < 0) in snd_pcm_oss_write3()
1244 if (ret != -EPIPE && ret != -ESTRPIPE) in snd_pcm_oss_write3()
1246 /* test, if we can't store new data, because the stream */ in snd_pcm_oss_write3()
1248 if (runtime->state == SNDRV_PCM_STATE_PREPARED) in snd_pcm_oss_write3()
1260 if (runtime->state == SNDRV_PCM_STATE_XRUN || in snd_pcm_oss_read3()
1269 if (ret < 0) in snd_pcm_oss_read3()
1271 } else if (runtime->state == SNDRV_PCM_STATE_SETUP) { in snd_pcm_oss_read3()
1273 if (ret < 0) in snd_pcm_oss_read3()
1277 if (ret < 0) in snd_pcm_oss_read3()
1283 if (ret == -EPIPE) { in snd_pcm_oss_read3()
1284 if (runtime->state == SNDRV_PCM_STATE_DRAINING) { in snd_pcm_oss_read3()
1286 if (ret < 0) in snd_pcm_oss_read3()
1291 if (ret != -ESTRPIPE) in snd_pcm_oss_read3()
1303 if (runtime->state == SNDRV_PCM_STATE_XRUN || in snd_pcm_oss_writev3()
1312 if (ret < 0) in snd_pcm_oss_writev3()
1316 if (ret != -EPIPE && ret != -ESTRPIPE) in snd_pcm_oss_writev3()
1319 /* test, if we can't store new data, because the stream */ in snd_pcm_oss_writev3()
1321 if (runtime->state == SNDRV_PCM_STATE_PREPARED) in snd_pcm_oss_writev3()
1332 if (runtime->state == SNDRV_PCM_STATE_XRUN || in snd_pcm_oss_readv3()
1341 if (ret < 0) in snd_pcm_oss_readv3()
1343 } else if (runtime->state == SNDRV_PCM_STATE_SETUP) { in snd_pcm_oss_readv3()
1345 if (ret < 0) in snd_pcm_oss_readv3()
1349 if (ret != -EPIPE && ret != -ESTRPIPE) in snd_pcm_oss_readv3()
1361 if (runtime->oss.plugin_first) { in snd_pcm_oss_write2()
1364 if (!in_kernel) { in snd_pcm_oss_write2()
1365 if (copy_from_user(runtime->oss.buffer, (const char __force __user *)buf, bytes)) in snd_pcm_oss_write2()
1371 if (frames1 < 0) in snd_pcm_oss_write2()
1374 if (frames1 <= 0) in snd_pcm_oss_write2()
1382 if (frames1 <= 0) in snd_pcm_oss_write2()
1395 if (atomic_read(&substream->mmap_count)) in snd_pcm_oss_write1()
1400 if (mutex_lock_interruptible(&runtime->oss.params_lock)) { in snd_pcm_oss_write1()
1405 if (tmp < 0) in snd_pcm_oss_write1()
1407 if (bytes < runtime->oss.period_bytes || runtime->oss.buffer_used > 0) { in snd_pcm_oss_write1()
1409 if (tmp + runtime->oss.buffer_used > runtime->oss.period_bytes) in snd_pcm_oss_write1()
1411 if (tmp > 0) { in snd_pcm_oss_write1()
1412 if (copy_from_user(runtime->oss.buffer + runtime->oss.buffer_used, buf, tmp)) { in snd_pcm_oss_write1()
1421 if (substream->oss.setup.partialfrag || in snd_pcm_oss_write1()
1425 if (tmp <= 0) in snd_pcm_oss_write1()
1430 if (runtime->oss.period_ptr == 0 || in snd_pcm_oss_write1()
1433 else if ((substream->f_flags & O_NONBLOCK) != 0) { in snd_pcm_oss_write1()
1442 if (tmp <= 0) in snd_pcm_oss_write1()
1448 if ((substream->f_flags & O_NONBLOCK) != 0 && in snd_pcm_oss_write1()
1454 if (tmp < 0) in snd_pcm_oss_write1()
1456 if (signal_pending(current)) { in snd_pcm_oss_write1()
1472 if (runtime->oss.plugin_first) { in snd_pcm_oss_read2()
1475 if (!in_kernel) in snd_pcm_oss_read2()
1479 if (frames1 < 0) in snd_pcm_oss_read2()
1482 if (frames1 <= 0) in snd_pcm_oss_read2()
1485 if (!in_kernel && copy_to_user(final_dst, buf, bytes)) in snd_pcm_oss_read2()
1492 if (frames1 <= 0) in snd_pcm_oss_read2()
1505 if (atomic_read(&substream->mmap_count)) in snd_pcm_oss_read1()
1510 if (mutex_lock_interruptible(&runtime->oss.params_lock)) { in snd_pcm_oss_read1()
1515 if (tmp < 0) in snd_pcm_oss_read1()
1517 if (bytes < runtime->oss.period_bytes || runtime->oss.buffer_used > 0) { in snd_pcm_oss_read1()
1518 if (runtime->oss.buffer_used == 0) { in snd_pcm_oss_read1()
1520 if (tmp <= 0) in snd_pcm_oss_read1()
1527 if ((size_t) tmp > runtime->oss.buffer_used) in snd_pcm_oss_read1()
1529 …if (copy_to_user(buf, runtime->oss.buffer + (runtime->oss.period_ptr - runtime->oss.buffer_used), … in snd_pcm_oss_read1()
1540 if (tmp <= 0) in snd_pcm_oss_read1()
1549 if (tmp < 0) in snd_pcm_oss_read1()
1551 if (signal_pending(current)) { in snd_pcm_oss_read1()
1569 if (!substream) in snd_pcm_oss_reset()
1589 if (substream != NULL) { in snd_pcm_oss_post()
1591 if (err < 0) in snd_pcm_oss_post()
1616 if (result > 0) { in snd_pcm_oss_sync1()
1621 if (result != 0 && result != -EAGAIN) in snd_pcm_oss_sync1()
1627 if (state != SNDRV_PCM_STATE_RUNNING) { in snd_pcm_oss_sync1()
1632 if (signal_pending(current)) { in snd_pcm_oss_sync1()
1636 if (res == 0) { in snd_pcm_oss_sync1()
1658 if (substream != NULL) { in snd_pcm_oss_sync()
1660 if (atomic_read(&substream->mmap_count)) in snd_pcm_oss_sync()
1663 if (mutex_lock_interruptible(&runtime->oss.params_lock)) { in snd_pcm_oss_sync()
1668 if (err < 0) in snd_pcm_oss_sync()
1672 if (runtime->oss.buffer_used > 0) { in snd_pcm_oss_sync()
1681 if (err < 0) in snd_pcm_oss_sync()
1683 } else if (runtime->oss.period_ptr > 0) { in snd_pcm_oss_sync()
1692 if (err < 0) in snd_pcm_oss_sync()
1700 if (size > 0) { in snd_pcm_oss_sync()
1702 if (runtime->access == SNDRV_PCM_ACCESS_RW_INTERLEAVED) in snd_pcm_oss_sync()
1704 else if (runtime->access == SNDRV_PCM_ACCESS_RW_NONINTERLEAVED) in snd_pcm_oss_sync()
1710 if (err < 0) in snd_pcm_oss_sync()
1720 if (err < 0) in snd_pcm_oss_sync()
1728 if (substream != NULL) { in snd_pcm_oss_sync()
1730 if (err < 0) in snd_pcm_oss_sync()
1734 if (err < 0) in snd_pcm_oss_sync()
1753 if (substream == NULL) in snd_pcm_oss_set_rate()
1756 if (rate < 1000) in snd_pcm_oss_set_rate()
1758 else if (rate > 192000) in snd_pcm_oss_set_rate()
1761 if (err < 0) in snd_pcm_oss_set_rate()
1763 if (runtime->oss.rate != rate) { in snd_pcm_oss_set_rate()
1778 if (err < 0) in snd_pcm_oss_get_rate()
1786 if (channels < 1) in snd_pcm_oss_set_channels()
1788 if (channels > 128) in snd_pcm_oss_set_channels()
1795 if (substream == NULL) in snd_pcm_oss_set_channels()
1799 if (err < 0) in snd_pcm_oss_set_channels()
1801 if (runtime->oss.channels != channels) { in snd_pcm_oss_set_channels()
1816 if (err < 0) in snd_pcm_oss_get_channels()
1827 if (err < 0) in snd_pcm_oss_get_block_size()
1843 if (err < 0) in snd_pcm_oss_get_formats()
1845 if (atomic_read(&substream->mmap_count)) in snd_pcm_oss_get_formats()
1849 if (!direct) in snd_pcm_oss_get_formats()
1858 if (!params) in snd_pcm_oss_get_formats()
1862 if (err < 0) in snd_pcm_oss_get_formats()
1866 if (snd_mask_test(format_mask, fmt)) { in snd_pcm_oss_get_formats()
1868 if (f >= 0) in snd_pcm_oss_get_formats()
1881 if (format != AFMT_QUERY) { in snd_pcm_oss_set_format()
1883 if (formats < 0) in snd_pcm_oss_set_format()
1885 if (!(formats & format)) in snd_pcm_oss_set_format()
1890 if (substream == NULL) in snd_pcm_oss_set_format()
1894 if (err < 0) in snd_pcm_oss_set_format()
1896 if (runtime->oss.format != format) { in snd_pcm_oss_set_format()
1912 if (err < 0) in snd_pcm_oss_get_format()
1922 if (subdivide == 0) { in snd_pcm_oss_set_subdivide1()
1924 if (subdivide == 0) in snd_pcm_oss_set_subdivide1()
1928 if (runtime->oss.subdivision || runtime->oss.fragshift) in snd_pcm_oss_set_subdivide1()
1930 if (subdivide != 1 && subdivide != 2 && subdivide != 4 && in snd_pcm_oss_set_subdivide1()
1946 if (substream == NULL) in snd_pcm_oss_set_subdivide()
1950 if (err < 0) in snd_pcm_oss_set_subdivide()
1954 if (err < 0) in snd_pcm_oss_set_subdivide()
1966 if (runtime->oss.subdivision || runtime->oss.fragshift) in snd_pcm_oss_set_fragment1()
1969 if (fragshift >= 25) /* should be large enough */ in snd_pcm_oss_set_fragment1()
1973 if (runtime->oss.fragshift < 4) /* < 16 */ in snd_pcm_oss_set_fragment1()
1975 if (runtime->oss.maxfrags < 2) in snd_pcm_oss_set_fragment1()
1989 if (substream == NULL) in snd_pcm_oss_set_fragment()
1993 if (err < 0) in snd_pcm_oss_set_fragment()
1997 if (err < 0) in snd_pcm_oss_set_fragment()
2014 if (substream == NULL) { in snd_pcm_oss_get_caps1()
2019 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) in snd_pcm_oss_get_caps1()
2020 if (substream->pstr->substream_count > 1) in snd_pcm_oss_get_caps1()
2025 #if defined(DSP_CAP_REALTIME) && 0 in snd_pcm_oss_get_caps1()
2028 if (runtime->info & (SNDRV_PCM_INFO_BLOCK_TRANSFER|SNDRV_PCM_INFO_BATCH)) in snd_pcm_oss_get_caps1()
2071 if (psubstream) { in snd_pcm_oss_set_trigger()
2073 if (err < 0) in snd_pcm_oss_set_trigger()
2076 if (csubstream) { in snd_pcm_oss_set_trigger()
2078 if (err < 0) in snd_pcm_oss_set_trigger()
2081 if (psubstream) { in snd_pcm_oss_set_trigger()
2084 if (mutex_lock_interruptible(&runtime->oss.params_lock)) in snd_pcm_oss_set_trigger()
2086 if (trigger & PCM_ENABLE_OUTPUT) { in snd_pcm_oss_set_trigger()
2087 if (runtime->oss.trigger) in snd_pcm_oss_set_trigger()
2089 if (atomic_read(&psubstream->mmap_count)) in snd_pcm_oss_set_trigger()
2096 if (!runtime->oss.trigger) in snd_pcm_oss_set_trigger()
2105 if (cmd) { in snd_pcm_oss_set_trigger()
2107 if (err < 0) in snd_pcm_oss_set_trigger()
2111 if (csubstream) { in snd_pcm_oss_set_trigger()
2114 if (mutex_lock_interruptible(&runtime->oss.params_lock)) in snd_pcm_oss_set_trigger()
2116 if (trigger & PCM_ENABLE_INPUT) { in snd_pcm_oss_set_trigger()
2117 if (runtime->oss.trigger) in snd_pcm_oss_set_trigger()
2123 if (!runtime->oss.trigger) in snd_pcm_oss_set_trigger()
2132 if (cmd) { in snd_pcm_oss_set_trigger()
2134 if (err < 0) in snd_pcm_oss_set_trigger()
2148 if (psubstream && psubstream->runtime && psubstream->runtime->oss.trigger) in snd_pcm_oss_get_trigger()
2150 if (csubstream && csubstream->runtime && csubstream->runtime->oss.trigger) in snd_pcm_oss_get_trigger()
2163 if (substream == NULL) in snd_pcm_oss_get_odelay()
2166 if (err < 0) in snd_pcm_oss_get_odelay()
2169 if (runtime->oss.params || runtime->oss.prepare) in snd_pcm_oss_get_odelay()
2172 if (err == -EPIPE) in snd_pcm_oss_get_odelay()
2174 else if (err < 0) in snd_pcm_oss_get_odelay()
2188 if (_info == NULL) in snd_pcm_oss_get_ptr()
2191 if (substream == NULL) in snd_pcm_oss_get_ptr()
2194 if (err < 0) in snd_pcm_oss_get_ptr()
2197 if (runtime->oss.params || runtime->oss.prepare) { in snd_pcm_oss_get_ptr()
2199 if (copy_to_user(_info, &info, sizeof(info))) in snd_pcm_oss_get_ptr()
2203 if (stream == SNDRV_PCM_STREAM_PLAYBACK) { in snd_pcm_oss_get_ptr()
2205 if (err == -EPIPE || err == -ESTRPIPE || (! err && delay < 0)) { in snd_pcm_oss_get_ptr()
2216 if (err < 0) in snd_pcm_oss_get_ptr()
2219 if (atomic_read(&substream->mmap_count)) { in snd_pcm_oss_get_ptr()
2223 if (n < 0) in snd_pcm_oss_get_ptr()
2227 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) in snd_pcm_oss_get_ptr()
2232 if (stream == SNDRV_PCM_STREAM_PLAYBACK) { in snd_pcm_oss_get_ptr()
2233 if (substream->oss.setup.buggyptr) in snd_pcm_oss_get_ptr()
2244 if (copy_to_user(_info, &info, sizeof(info))) in snd_pcm_oss_get_ptr()
2258 if (_info == NULL) in snd_pcm_oss_get_space()
2261 if (substream == NULL) in snd_pcm_oss_get_space()
2265 if (runtime->oss.params) { in snd_pcm_oss_get_space()
2267 if (err < 0) in snd_pcm_oss_get_space()
2273 if (runtime->oss.prepare) { in snd_pcm_oss_get_space()
2274 if (stream == SNDRV_PCM_STREAM_PLAYBACK) { in snd_pcm_oss_get_space()
2282 if (stream == SNDRV_PCM_STREAM_PLAYBACK) { in snd_pcm_oss_get_space()
2284 if (err == -EPIPE || err == -ESTRPIPE || (! err && avail < 0)) { in snd_pcm_oss_get_space()
2296 if (err < 0) in snd_pcm_oss_get_space()
2307 if (copy_to_user(_info, &info, sizeof(info))) in snd_pcm_oss_get_space()
2323 if (*ptr == '/') in strip_task_path()
2339 if (!strcmp(setup->task_name, task_name)) in snd_pcm_oss_look_for_setup()
2344 if (setup) in snd_pcm_oss_look_for_setup()
2362 if (setup->nonblock) in snd_pcm_oss_init_substream()
2364 else if (setup->block) in snd_pcm_oss_init_substream()
2392 if (!pcm_oss_file) in snd_pcm_oss_release_file()
2396 if (substream) in snd_pcm_oss_release_file()
2414 if (rpcm_oss_file) in snd_pcm_oss_open_file()
2418 if (pcm_oss_file == NULL) in snd_pcm_oss_open_file()
2421 if ((f_mode & (FMODE_WRITE|FMODE_READ)) == (FMODE_WRITE|FMODE_READ) && in snd_pcm_oss_open_file()
2427 if (setup[idx].disable) in snd_pcm_oss_open_file()
2429 if (! pcm->streams[idx].substream_count) in snd_pcm_oss_open_file()
2431 if (idx == SNDRV_PCM_STREAM_PLAYBACK) { in snd_pcm_oss_open_file()
2432 if (! (f_mode & FMODE_WRITE)) in snd_pcm_oss_open_file()
2435 if (! (f_mode & FMODE_READ)) in snd_pcm_oss_open_file()
2439 if (err < 0) { in snd_pcm_oss_open_file()
2448 if (!pcm_oss_file->streams[0] && !pcm_oss_file->streams[1]) { in snd_pcm_oss_open_file()
2454 if (rpcm_oss_file) in snd_pcm_oss_open_file()
2464 if (snd_BUG_ON(!task || !name || size < 2)) in snd_task_name()
2483 if (err < 0) in snd_pcm_oss_open()
2488 if (pcm == NULL) { in snd_pcm_oss_open()
2493 if (err < 0) in snd_pcm_oss_open()
2495 if (!try_module_get(pcm->card->module)) { in snd_pcm_oss_open()
2499 if (snd_task_name(current, task_name, sizeof(task_name)) < 0) { in snd_pcm_oss_open()
2504 if (file->f_mode & FMODE_WRITE) in snd_pcm_oss_open()
2507 if (file->f_mode & FMODE_READ) in snd_pcm_oss_open()
2512 if (!nonblock) in snd_pcm_oss_open()
2521 if (err >= 0) in snd_pcm_oss_open()
2523 if (err == -EAGAIN) { in snd_pcm_oss_open()
2524 if (nonblock) { in snd_pcm_oss_open()
2534 if (pcm->card->shutdown) { in snd_pcm_oss_open()
2538 if (signal_pending(current)) { in snd_pcm_oss_open()
2545 if (err < 0) in snd_pcm_oss_open()
2555 if (pcm) in snd_pcm_oss_open()
2568 if (substream == NULL) in snd_pcm_oss_release()
2570 if (snd_BUG_ON(!substream)) in snd_pcm_oss_release()
2573 if (!pcm->card->shutdown) in snd_pcm_oss_release()
2591 if (cmd == OSS_GETVERSION) in snd_pcm_oss_ioctl()
2593 if (cmd == OSS_ALSAEMULVER) in snd_pcm_oss_ioctl()
2595 #if IS_REACHABLE(CONFIG_SND_MIXER_OSS) in snd_pcm_oss_ioctl()
2596 if (((cmd >> 8) & 0xff) == 'M') { /* mixer ioctl - for OSS compatibility */ in snd_pcm_oss_ioctl()
2601 if (substream != NULL) in snd_pcm_oss_ioctl()
2604 if (snd_BUG_ON(idx >= 2)) in snd_pcm_oss_ioctl()
2609 if (((cmd >> 8) & 0xff) != 'P') in snd_pcm_oss_ioctl()
2620 if (get_user(res, p)) in snd_pcm_oss_ioctl()
2623 if (res < 0) in snd_pcm_oss_ioctl()
2628 if (res < 0) in snd_pcm_oss_ioctl()
2632 if (get_user(res, p)) in snd_pcm_oss_ioctl()
2636 if (res < 0) in snd_pcm_oss_ioctl()
2641 if (res < 0) in snd_pcm_oss_ioctl()
2645 if (get_user(res, p)) in snd_pcm_oss_ioctl()
2648 if (res < 0) in snd_pcm_oss_ioctl()
2653 if (res < 0) in snd_pcm_oss_ioctl()
2657 if (get_user(res, p)) in snd_pcm_oss_ioctl()
2660 if (res < 0) in snd_pcm_oss_ioctl()
2665 if (res < 0) in snd_pcm_oss_ioctl()
2674 if (get_user(res, p)) in snd_pcm_oss_ioctl()
2677 if (res < 0) in snd_pcm_oss_ioctl()
2681 if (get_user(res, p)) in snd_pcm_oss_ioctl()
2686 if (res < 0) in snd_pcm_oss_ioctl()
2699 if (res < 0) in snd_pcm_oss_ioctl()
2704 if (res < 0) in snd_pcm_oss_ioctl()
2708 if (get_user(res, p)) in snd_pcm_oss_ioctl()
2727 if (snd_pcm_oss_get_caps(pcm_oss_file) & DSP_CAP_DUPLEX) in snd_pcm_oss_ioctl()
2732 if (res < 0) { in snd_pcm_oss_ioctl()
2768 if (substream == NULL) in snd_pcm_oss_read()
2792 if (substream == NULL) in snd_pcm_oss_write()
2806 if (atomic_read(&substream->mmap_count)) in snd_pcm_oss_playback_ready()
2817 if (atomic_read(&substream->mmap_count)) in snd_pcm_oss_capture_ready()
2837 if (psubstream != NULL) { in snd_pcm_oss_poll()
2841 if (runtime->state != SNDRV_PCM_STATE_DRAINING && in snd_pcm_oss_poll()
2847 if (csubstream != NULL) { in snd_pcm_oss_poll()
2853 if (ostate != SNDRV_PCM_STATE_RUNNING || in snd_pcm_oss_poll()
2857 if (ostate != SNDRV_PCM_STATE_RUNNING && runtime->oss.trigger) { in snd_pcm_oss_poll()
2883 if (substream) in snd_pcm_oss_mmap()
2898 if (substream == NULL) in snd_pcm_oss_mmap()
2901 if (!(runtime->info & SNDRV_PCM_INFO_MMAP_VALID)) in snd_pcm_oss_mmap()
2903 if (runtime->info & SNDRV_PCM_INFO_INTERLEAVED) in snd_pcm_oss_mmap()
2908 if (runtime->oss.params) { in snd_pcm_oss_mmap()
2914 if (err < 0) in snd_pcm_oss_mmap()
2918 if (runtime->oss.plugin_first != NULL) in snd_pcm_oss_mmap()
2922 if (area->vm_pgoff != 0) in snd_pcm_oss_mmap()
2926 if (err < 0) in snd_pcm_oss_mmap()
2993 if (!strcmp(task_name, "clear") || !strcmp(task_name, "erase")) { in snd_pcm_oss_proc_write()
2998 if (!strcmp(setup->task_name, task_name)) { in snd_pcm_oss_proc_write()
3008 if (template.period_size & (1 << idx1)) in snd_pcm_oss_proc_write()
3014 if (!strcmp(str, "disable")) { in snd_pcm_oss_proc_write()
3016 } else if (!strcmp(str, "direct")) { in snd_pcm_oss_proc_write()
3018 } else if (!strcmp(str, "block")) { in snd_pcm_oss_proc_write()
3020 } else if (!strcmp(str, "non-block")) { in snd_pcm_oss_proc_write()
3022 } else if (!strcmp(str, "partial-frag")) { in snd_pcm_oss_proc_write()
3024 } else if (!strcmp(str, "no-silence")) { in snd_pcm_oss_proc_write()
3026 } else if (!strcmp(str, "buggy-ptr")) { in snd_pcm_oss_proc_write()
3030 if (setup == NULL) { in snd_pcm_oss_proc_write()
3032 if (! setup) { in snd_pcm_oss_proc_write()
3036 if (pstr->oss.setup_list == NULL) in snd_pcm_oss_proc_write()
3044 if (! template.task_name) { in snd_pcm_oss_proc_write()
3060 if (pstr->substream_count == 0) in snd_pcm_oss_proc_init()
3063 if (entry) { in snd_pcm_oss_proc_init()
3069 if (snd_info_register(entry) < 0) { in snd_pcm_oss_proc_init()
3116 if (snd_register_oss_device(SNDRV_OSS_DEVICE_TYPE_PCM, in register_oss_dsp()
3127 if (dsp_map[pcm->card->number] == (int)pcm->device) { in snd_pcm_oss_register_minor()
3143 if (adsp_map[pcm->card->number] == (int)pcm->device) { in snd_pcm_oss_register_minor()
3149 if (pcm->oss.reg) in snd_pcm_oss_register_minor()
3157 if (pcm->oss.reg) { in snd_pcm_oss_disconnect_minor()
3158 if (pcm->oss.reg_mask & 1) { in snd_pcm_oss_disconnect_minor()
3163 if (pcm->oss.reg_mask & 2) { in snd_pcm_oss_disconnect_minor()
3168 if (dsp_map[pcm->card->number] == (int)pcm->device) { in snd_pcm_oss_disconnect_minor()
3199 if (dsp_map[i] < 0 || dsp_map[i] >= SNDRV_PCM_DEVICES) { in alsa_pcm_oss_init()
3204 if (adsp_map[i] < 0 || adsp_map[i] >= SNDRV_PCM_DEVICES) { in alsa_pcm_oss_init()
3211 if (err < 0) in alsa_pcm_oss_init()