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()
419 if (max < 0) { in snd_pcm_hw_param_near()
423 if (boundary_nearer(max, maxdir, best, valdir, min, mindir)) { in snd_pcm_hw_param_near()
431 if (max < 0) { in snd_pcm_hw_param_near()
439 if (last) in snd_pcm_hw_param_near()
451 if (hw_is_mask(var)) { in _snd_pcm_hw_param_set()
453 if (val == 0 && dir < 0) { in _snd_pcm_hw_param_set()
457 if (dir > 0) in _snd_pcm_hw_param_set()
459 else if (dir < 0) in _snd_pcm_hw_param_set()
463 } else if (hw_is_interval(var)) { in _snd_pcm_hw_param_set()
465 if (val == 0 && dir < 0) { in _snd_pcm_hw_param_set()
468 } else if (dir == 0) in _snd_pcm_hw_param_set()
476 if (dir < 0) { in _snd_pcm_hw_param_set()
487 if (changed > 0) { in _snd_pcm_hw_param_set()
504 * Return VAL or -EINVAL if the configuration space is empty
512 if (changed < 0) in snd_pcm_hw_param_set()
514 if (params->rmask) { in snd_pcm_hw_param_set()
516 if (err < 0) in snd_pcm_hw_param_set()
527 if (changed > 0) { in _snd_pcm_hw_param_setinteger()
559 if (runtime->oss.plugin_first) { in snd_pcm_plugin_insert()
574 if (runtime->oss.plugin_last) { in snd_pcm_plugin_append()
590 if (buffer_size == runtime->oss.buffer_bytes) in snd_pcm_oss_bytes()
592 #if BITS_PER_LONG >= 64 in snd_pcm_oss_bytes()
606 if (buffer_size == runtime->oss.buffer_bytes) in snd_pcm_alsa_frames()
617 /* define extended formats in the recent OSS versions (if any) */
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()
733 if (oss_period_size < min_period_size) in snd_pcm_oss_period_size()
740 if (oss_period_size > max_period_size) in snd_pcm_oss_period_size()
745 if (substream->oss.setup.periods > 1) in snd_pcm_oss_period_size()
749 if (runtime->oss.maxfrags && s > runtime->oss.maxfrags) in snd_pcm_oss_period_size()
751 if (oss_periods > s) in snd_pcm_oss_period_size()
755 if (s < 2) in snd_pcm_oss_period_size()
757 if (oss_periods < s) in snd_pcm_oss_period_size()
763 if (oss_period_size < 16) in snd_pcm_oss_period_size()
779 if (save == NULL) in choose_rate()
787 if (it->max < rate || (it->max == rate && it->openmax)) in choose_rate()
789 if (it->min < rate || (it->min == rate && !it->openmin)) { in choose_rate()
794 if (ret == (int)rate) { in choose_rate()
802 if (rate <= prev) in choose_rate()
811 /* parameter locking: returns immediately if tried during streaming */
814 if (mutex_lock_interruptible(&runtime->oss.params_lock)) in lock_params()
816 if (atomic_read(&runtime->oss.rw_ref)) { in lock_params()
843 if (!runtime->oss.params) in snd_pcm_oss_change_params_locked()
848 if (!sw_params || !params || !sparams) { in snd_pcm_oss_change_params_locked()
853 if (atomic_read(&substream->mmap_count)) in snd_pcm_oss_change_params_locked()
862 if (atomic_read(&substream->mmap_count)) in snd_pcm_oss_change_params_locked()
866 if (!direct) in snd_pcm_oss_change_params_locked()
870 if (err < 0) { in snd_pcm_oss_change_params_locked()
881 if (direct) in snd_pcm_oss_change_params_locked()
886 if ((__force int)sformat < 0 || in snd_pcm_oss_change_params_locked()
889 if (snd_mask_test_format(sformat_mask, sformat) && in snd_pcm_oss_change_params_locked()
899 if (err < 0) in snd_pcm_oss_change_params_locked()
902 if (direct) { in snd_pcm_oss_change_params_locked()
926 if (err < 0) in snd_pcm_oss_change_params_locked()
931 if (err < 0) in snd_pcm_oss_change_params_locked()
936 if (err < 0) in snd_pcm_oss_change_params_locked()
942 if (err < 0) { in snd_pcm_oss_change_params_locked()
949 if (!direct) { in snd_pcm_oss_change_params_locked()
952 if ((err = snd_pcm_plug_format_plugins(substream, in snd_pcm_oss_change_params_locked()
960 if (runtime->oss.plugin_first) { in snd_pcm_oss_change_params_locked()
962 if ((err = snd_pcm_plugin_build_io(substream, sparams, &plugin)) < 0) { in snd_pcm_oss_change_params_locked()
968 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { in snd_pcm_oss_change_params_locked()
973 if (err < 0) { in snd_pcm_oss_change_params_locked()
981 if (runtime->oss.trigger) { in snd_pcm_oss_change_params_locked()
986 if (atomic_read(&substream->mmap_count) || in snd_pcm_oss_change_params_locked()
995 if (atomic_read(&substream->mmap_count) || in snd_pcm_oss_change_params_locked()
1002 if (frames > runtime->buffer_size) in snd_pcm_oss_change_params_locked()
1008 if ((err = snd_pcm_kernel_ioctl(substream, SNDRV_PCM_IOCTL_SW_PARAMS, sw_params)) < 0) { in snd_pcm_oss_change_params_locked()
1015 if (oss_period_size < 0) { in snd_pcm_oss_change_params_locked()
1020 if (runtime->oss.plugin_first) { in snd_pcm_oss_change_params_locked()
1022 if (err < 0) in snd_pcm_oss_change_params_locked()
1029 if (oss_buffer_size < 0) { in snd_pcm_oss_change_params_locked()
1050 if (!runtime->oss.buffer) { in snd_pcm_oss_change_params_locked()
1058 if (runtime->dma_area) in snd_pcm_oss_change_params_locked()
1078 if (trylock) { in snd_pcm_oss_change_params()
1079 if (!(mutex_trylock(&runtime->oss.params_lock))) in snd_pcm_oss_change_params()
1081 } else if (mutex_lock_interruptible(&runtime->oss.params_lock)) in snd_pcm_oss_change_params()
1096 if (substream == NULL) in snd_pcm_oss_get_active_substream()
1098 if (asubstream == NULL) in snd_pcm_oss_get_active_substream()
1100 if (substream->runtime->oss.params) { in snd_pcm_oss_get_active_substream()
1102 if (err < 0) in snd_pcm_oss_get_active_substream()
1106 if (!asubstream) in snd_pcm_oss_get_active_substream()
1108 if (r_substream) in snd_pcm_oss_get_active_substream()
1123 if (err < 0) { in snd_pcm_oss_prepare()
1142 if (runtime->oss.params) { in snd_pcm_oss_make_ready()
1144 if (err < 0) in snd_pcm_oss_make_ready()
1147 if (runtime->oss.prepare) { in snd_pcm_oss_make_ready()
1148 if (mutex_lock_interruptible(&runtime->oss.params_lock)) in snd_pcm_oss_make_ready()
1152 if (err < 0) in snd_pcm_oss_make_ready()
1165 if (runtime->oss.params) { in snd_pcm_oss_make_ready_locked()
1167 if (err < 0) in snd_pcm_oss_make_ready_locked()
1170 if (runtime->oss.prepare) { in snd_pcm_oss_make_ready_locked()
1172 if (err < 0) in snd_pcm_oss_make_ready_locked()
1186 if (err < 0) in snd_pcm_oss_capture_position_fixup()
1189 if (*delay <= (snd_pcm_sframes_t)runtime->buffer_size) in snd_pcm_oss_capture_position_fixup()
1197 if (err < 0) in snd_pcm_oss_capture_position_fixup()
1208 if (runtime->status->state == SNDRV_PCM_STATE_XRUN || in snd_pcm_oss_write3()
1217 if (ret < 0) in snd_pcm_oss_write3()
1224 if (ret != -EPIPE && ret != -ESTRPIPE) in snd_pcm_oss_write3()
1226 /* test, if we can't store new data, because the stream */ in snd_pcm_oss_write3()
1228 if (runtime->status->state == SNDRV_PCM_STATE_PREPARED) in snd_pcm_oss_write3()
1240 if (runtime->status->state == SNDRV_PCM_STATE_XRUN || in snd_pcm_oss_read3()
1249 if (ret < 0) in snd_pcm_oss_read3()
1251 } else if (runtime->status->state == SNDRV_PCM_STATE_SETUP) { in snd_pcm_oss_read3()
1253 if (ret < 0) in snd_pcm_oss_read3()
1257 if (ret < 0) in snd_pcm_oss_read3()
1263 if (ret == -EPIPE) { in snd_pcm_oss_read3()
1264 if (runtime->status->state == SNDRV_PCM_STATE_DRAINING) { in snd_pcm_oss_read3()
1266 if (ret < 0) in snd_pcm_oss_read3()
1271 if (ret != -ESTRPIPE) in snd_pcm_oss_read3()
1283 if (runtime->status->state == SNDRV_PCM_STATE_XRUN || in snd_pcm_oss_writev3()
1292 if (ret < 0) in snd_pcm_oss_writev3()
1296 if (ret != -EPIPE && ret != -ESTRPIPE) in snd_pcm_oss_writev3()
1299 /* test, if we can't store new data, because the stream */ in snd_pcm_oss_writev3()
1301 if (runtime->status->state == SNDRV_PCM_STATE_PREPARED) in snd_pcm_oss_writev3()
1312 if (runtime->status->state == SNDRV_PCM_STATE_XRUN || in snd_pcm_oss_readv3()
1321 if (ret < 0) in snd_pcm_oss_readv3()
1323 } else if (runtime->status->state == SNDRV_PCM_STATE_SETUP) { in snd_pcm_oss_readv3()
1325 if (ret < 0) in snd_pcm_oss_readv3()
1329 if (ret != -EPIPE && ret != -ESTRPIPE) in snd_pcm_oss_readv3()
1341 if (runtime->oss.plugin_first) { in snd_pcm_oss_write2()
1344 if (!in_kernel) { in snd_pcm_oss_write2()
1345 if (copy_from_user(runtime->oss.buffer, (const char __force __user *)buf, bytes)) in snd_pcm_oss_write2()
1351 if (frames1 < 0) in snd_pcm_oss_write2()
1354 if (frames1 <= 0) in snd_pcm_oss_write2()
1362 if (frames1 <= 0) in snd_pcm_oss_write2()
1375 if (atomic_read(&substream->mmap_count)) in snd_pcm_oss_write1()
1380 if (mutex_lock_interruptible(&runtime->oss.params_lock)) { in snd_pcm_oss_write1()
1385 if (tmp < 0) in snd_pcm_oss_write1()
1387 if (bytes < runtime->oss.period_bytes || runtime->oss.buffer_used > 0) { in snd_pcm_oss_write1()
1389 if (tmp + runtime->oss.buffer_used > runtime->oss.period_bytes) in snd_pcm_oss_write1()
1391 if (tmp > 0) { in snd_pcm_oss_write1()
1392 if (copy_from_user(runtime->oss.buffer + runtime->oss.buffer_used, buf, tmp)) { in snd_pcm_oss_write1()
1401 if (substream->oss.setup.partialfrag || in snd_pcm_oss_write1()
1405 if (tmp <= 0) in snd_pcm_oss_write1()
1410 if (runtime->oss.period_ptr == 0 || in snd_pcm_oss_write1()
1413 else if ((substream->f_flags & O_NONBLOCK) != 0) { in snd_pcm_oss_write1()
1422 if (tmp <= 0) in snd_pcm_oss_write1()
1428 if ((substream->f_flags & O_NONBLOCK) != 0 && in snd_pcm_oss_write1()
1434 if (tmp < 0) in snd_pcm_oss_write1()
1436 if (signal_pending(current)) { in snd_pcm_oss_write1()
1452 if (runtime->oss.plugin_first) { in snd_pcm_oss_read2()
1455 if (!in_kernel) in snd_pcm_oss_read2()
1459 if (frames1 < 0) in snd_pcm_oss_read2()
1462 if (frames1 <= 0) in snd_pcm_oss_read2()
1465 if (!in_kernel && copy_to_user(final_dst, buf, bytes)) in snd_pcm_oss_read2()
1472 if (frames1 <= 0) in snd_pcm_oss_read2()
1485 if (atomic_read(&substream->mmap_count)) in snd_pcm_oss_read1()
1490 if (mutex_lock_interruptible(&runtime->oss.params_lock)) { in snd_pcm_oss_read1()
1495 if (tmp < 0) in snd_pcm_oss_read1()
1497 if (bytes < runtime->oss.period_bytes || runtime->oss.buffer_used > 0) { in snd_pcm_oss_read1()
1498 if (runtime->oss.buffer_used == 0) { in snd_pcm_oss_read1()
1500 if (tmp <= 0) in snd_pcm_oss_read1()
1507 if ((size_t) tmp > runtime->oss.buffer_used) in snd_pcm_oss_read1()
1509if (copy_to_user(buf, runtime->oss.buffer + (runtime->oss.period_ptr - runtime->oss.buffer_used), … in snd_pcm_oss_read1()
1520 if (tmp <= 0) in snd_pcm_oss_read1()
1529 if (tmp < 0) in snd_pcm_oss_read1()
1531 if (signal_pending(current)) { in snd_pcm_oss_read1()
1549 if (!substream) in snd_pcm_oss_reset()
1569 if (substream != NULL) { in snd_pcm_oss_post()
1570 if ((err = snd_pcm_oss_make_ready(substream)) < 0) in snd_pcm_oss_post()
1595 if (result > 0) { in snd_pcm_oss_sync1()
1600 if (result != 0 && result != -EAGAIN) in snd_pcm_oss_sync1()
1607 if (state != SNDRV_PCM_STATE_RUNNING) { in snd_pcm_oss_sync1()
1612 if (signal_pending(current)) { in snd_pcm_oss_sync1()
1616 if (res == 0) { in snd_pcm_oss_sync1()
1638 if (substream != NULL) { in snd_pcm_oss_sync()
1640 if (atomic_read(&substream->mmap_count)) in snd_pcm_oss_sync()
1642 if ((err = snd_pcm_oss_make_ready(substream)) < 0) in snd_pcm_oss_sync()
1645 if (mutex_lock_interruptible(&runtime->oss.params_lock)) { in snd_pcm_oss_sync()
1651 if (runtime->oss.buffer_used > 0) { in snd_pcm_oss_sync()
1660 if (err < 0) in snd_pcm_oss_sync()
1662 } else if (runtime->oss.period_ptr > 0) { in snd_pcm_oss_sync()
1671 if (err < 0) in snd_pcm_oss_sync()
1679 if (size > 0) { in snd_pcm_oss_sync()
1681 if (runtime->access == SNDRV_PCM_ACCESS_RW_INTERLEAVED) in snd_pcm_oss_sync()
1683 else if (runtime->access == SNDRV_PCM_ACCESS_RW_NONINTERLEAVED) in snd_pcm_oss_sync()
1689 if (err < 0) in snd_pcm_oss_sync()
1699 if (err < 0) in snd_pcm_oss_sync()
1707 if (substream != NULL) { in snd_pcm_oss_sync()
1708 if ((err = snd_pcm_oss_make_ready(substream)) < 0) in snd_pcm_oss_sync()
1712 if (err < 0) in snd_pcm_oss_sync()
1731 if (substream == NULL) in snd_pcm_oss_set_rate()
1734 if (rate < 1000) in snd_pcm_oss_set_rate()
1736 else if (rate > 192000) in snd_pcm_oss_set_rate()
1739 if (err < 0) in snd_pcm_oss_set_rate()
1741 if (runtime->oss.rate != rate) { in snd_pcm_oss_set_rate()
1755 if ((err = snd_pcm_oss_get_active_substream(pcm_oss_file, &substream)) < 0) in snd_pcm_oss_get_rate()
1763 if (channels < 1) in snd_pcm_oss_set_channels()
1765 if (channels > 128) in snd_pcm_oss_set_channels()
1772 if (substream == NULL) in snd_pcm_oss_set_channels()
1776 if (err < 0) in snd_pcm_oss_set_channels()
1778 if (runtime->oss.channels != channels) { in snd_pcm_oss_set_channels()
1792 if ((err = snd_pcm_oss_get_active_substream(pcm_oss_file, &substream)) < 0) in snd_pcm_oss_get_channels()
1802 if ((err = snd_pcm_oss_get_active_substream(pcm_oss_file, &substream)) < 0) in snd_pcm_oss_get_block_size()
1817 if ((err = snd_pcm_oss_get_active_substream(pcm_oss_file, &substream)) < 0) in snd_pcm_oss_get_formats()
1819 if (atomic_read(&substream->mmap_count)) in snd_pcm_oss_get_formats()
1823 if (!direct) in snd_pcm_oss_get_formats()
1832 if (!params) in snd_pcm_oss_get_formats()
1836 if (err < 0) in snd_pcm_oss_get_formats()
1840 if (snd_mask_test(format_mask, fmt)) { in snd_pcm_oss_get_formats()
1842 if (f >= 0) in snd_pcm_oss_get_formats()
1857 if (format != AFMT_QUERY) { in snd_pcm_oss_set_format()
1859 if (formats < 0) in snd_pcm_oss_set_format()
1861 if (!(formats & format)) in snd_pcm_oss_set_format()
1866 if (substream == NULL) in snd_pcm_oss_set_format()
1870 if (err < 0) in snd_pcm_oss_set_format()
1872 if (runtime->oss.format != format) { in snd_pcm_oss_set_format()
1887 if ((err = snd_pcm_oss_get_active_substream(pcm_oss_file, &substream)) < 0) in snd_pcm_oss_get_format()
1897 if (subdivide == 0) { in snd_pcm_oss_set_subdivide1()
1899 if (subdivide == 0) in snd_pcm_oss_set_subdivide1()
1903 if (runtime->oss.subdivision || runtime->oss.fragshift) in snd_pcm_oss_set_subdivide1()
1905 if (subdivide != 1 && subdivide != 2 && subdivide != 4 && in snd_pcm_oss_set_subdivide1()
1921 if (substream == NULL) in snd_pcm_oss_set_subdivide()
1925 if (err < 0) in snd_pcm_oss_set_subdivide()
1929 if (err < 0) in snd_pcm_oss_set_subdivide()
1940 if (runtime->oss.subdivision || runtime->oss.fragshift) in snd_pcm_oss_set_fragment1()
1944 if (runtime->oss.fragshift < 4) /* < 16 */ in snd_pcm_oss_set_fragment1()
1946 if (runtime->oss.maxfrags < 2) in snd_pcm_oss_set_fragment1()
1960 if (substream == NULL) in snd_pcm_oss_set_fragment()
1964 if (err < 0) in snd_pcm_oss_set_fragment()
1968 if (err < 0) in snd_pcm_oss_set_fragment()
1985 if (substream == NULL) { in snd_pcm_oss_get_caps1()
1990 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) in snd_pcm_oss_get_caps1()
1991 if (substream->pstr->substream_count > 1) in snd_pcm_oss_get_caps1()
1996 #if defined(DSP_CAP_REALTIME) && 0 in snd_pcm_oss_get_caps1()
1999 if (runtime->info & (SNDRV_PCM_INFO_BLOCK_TRANSFER|SNDRV_PCM_INFO_BATCH)) in snd_pcm_oss_get_caps1()
2042 if (psubstream) { in snd_pcm_oss_set_trigger()
2043 if ((err = snd_pcm_oss_make_ready(psubstream)) < 0) in snd_pcm_oss_set_trigger()
2046 if (csubstream) { in snd_pcm_oss_set_trigger()
2047 if ((err = snd_pcm_oss_make_ready(csubstream)) < 0) in snd_pcm_oss_set_trigger()
2050 if (psubstream) { in snd_pcm_oss_set_trigger()
2053 if (mutex_lock_interruptible(&runtime->oss.params_lock)) in snd_pcm_oss_set_trigger()
2055 if (trigger & PCM_ENABLE_OUTPUT) { in snd_pcm_oss_set_trigger()
2056 if (runtime->oss.trigger) in snd_pcm_oss_set_trigger()
2058 if (atomic_read(&psubstream->mmap_count)) in snd_pcm_oss_set_trigger()
2065 if (!runtime->oss.trigger) in snd_pcm_oss_set_trigger()
2074 if (cmd) { in snd_pcm_oss_set_trigger()
2076 if (err < 0) in snd_pcm_oss_set_trigger()
2080 if (csubstream) { in snd_pcm_oss_set_trigger()
2083 if (mutex_lock_interruptible(&runtime->oss.params_lock)) in snd_pcm_oss_set_trigger()
2085 if (trigger & PCM_ENABLE_INPUT) { in snd_pcm_oss_set_trigger()
2086 if (runtime->oss.trigger) in snd_pcm_oss_set_trigger()
2092 if (!runtime->oss.trigger) in snd_pcm_oss_set_trigger()
2101 if (cmd) { in snd_pcm_oss_set_trigger()
2103 if (err < 0) in snd_pcm_oss_set_trigger()
2117 if (psubstream && psubstream->runtime && psubstream->runtime->oss.trigger) in snd_pcm_oss_get_trigger()
2119 if (csubstream && csubstream->runtime && csubstream->runtime->oss.trigger) in snd_pcm_oss_get_trigger()
2132 if (substream == NULL) in snd_pcm_oss_get_odelay()
2134 if ((err = snd_pcm_oss_make_ready(substream)) < 0) in snd_pcm_oss_get_odelay()
2137 if (runtime->oss.params || runtime->oss.prepare) in snd_pcm_oss_get_odelay()
2140 if (err == -EPIPE) in snd_pcm_oss_get_odelay()
2142 else if (err < 0) in snd_pcm_oss_get_odelay()
2156 if (_info == NULL) in snd_pcm_oss_get_ptr()
2159 if (substream == NULL) in snd_pcm_oss_get_ptr()
2161 if ((err = snd_pcm_oss_make_ready(substream)) < 0) in snd_pcm_oss_get_ptr()
2164 if (runtime->oss.params || runtime->oss.prepare) { in snd_pcm_oss_get_ptr()
2166 if (copy_to_user(_info, &info, sizeof(info))) in snd_pcm_oss_get_ptr()
2170 if (stream == SNDRV_PCM_STREAM_PLAYBACK) { in snd_pcm_oss_get_ptr()
2172 if (err == -EPIPE || err == -ESTRPIPE || (! err && delay < 0)) { in snd_pcm_oss_get_ptr()
2183 if (err < 0) in snd_pcm_oss_get_ptr()
2186 if (atomic_read(&substream->mmap_count)) { in snd_pcm_oss_get_ptr()
2190 if (n < 0) in snd_pcm_oss_get_ptr()
2194 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) in snd_pcm_oss_get_ptr()
2199 if (stream == SNDRV_PCM_STREAM_PLAYBACK) { in snd_pcm_oss_get_ptr()
2200 if (substream->oss.setup.buggyptr) in snd_pcm_oss_get_ptr()
2211 if (copy_to_user(_info, &info, sizeof(info))) in snd_pcm_oss_get_ptr()
2225 if (_info == NULL) in snd_pcm_oss_get_space()
2228 if (substream == NULL) in snd_pcm_oss_get_space()
2232 if (runtime->oss.params && in snd_pcm_oss_get_space()
2238 if (runtime->oss.prepare) { in snd_pcm_oss_get_space()
2239 if (stream == SNDRV_PCM_STREAM_PLAYBACK) { in snd_pcm_oss_get_space()
2247 if (stream == SNDRV_PCM_STREAM_PLAYBACK) { in snd_pcm_oss_get_space()
2249 if (err == -EPIPE || err == -ESTRPIPE || (! err && avail < 0)) { in snd_pcm_oss_get_space()
2261 if (err < 0) in snd_pcm_oss_get_space()
2272 if (copy_to_user(_info, &info, sizeof(info))) in snd_pcm_oss_get_space()
2288 if (*ptr == '/') in strip_task_path()
2304 if (!strcmp(setup->task_name, task_name)) in snd_pcm_oss_look_for_setup()
2309 if (setup) in snd_pcm_oss_look_for_setup()
2334 if (setup->nonblock) in snd_pcm_oss_init_substream()
2336 else if (setup->block) in snd_pcm_oss_init_substream()
2364 if (!pcm_oss_file) in snd_pcm_oss_release_file()
2368 if (substream) in snd_pcm_oss_release_file()
2386 if (rpcm_oss_file) in snd_pcm_oss_open_file()
2390 if (pcm_oss_file == NULL) in snd_pcm_oss_open_file()
2393 if ((f_mode & (FMODE_WRITE|FMODE_READ)) == (FMODE_WRITE|FMODE_READ) && in snd_pcm_oss_open_file()
2399 if (setup[idx].disable) in snd_pcm_oss_open_file()
2401 if (! pcm->streams[idx].substream_count) in snd_pcm_oss_open_file()
2403 if (idx == SNDRV_PCM_STREAM_PLAYBACK) { in snd_pcm_oss_open_file()
2404 if (! (f_mode & FMODE_WRITE)) in snd_pcm_oss_open_file()
2407 if (! (f_mode & FMODE_READ)) in snd_pcm_oss_open_file()
2411 if (err < 0) { in snd_pcm_oss_open_file()
2420 if (!pcm_oss_file->streams[0] && !pcm_oss_file->streams[1]) { in snd_pcm_oss_open_file()
2426 if (rpcm_oss_file) in snd_pcm_oss_open_file()
2436 if (snd_BUG_ON(!task || !name || size < 2)) in snd_task_name()
2455 if (err < 0) in snd_pcm_oss_open()
2460 if (pcm == NULL) { in snd_pcm_oss_open()
2465 if (err < 0) in snd_pcm_oss_open()
2467 if (!try_module_get(pcm->card->module)) { in snd_pcm_oss_open()
2471 if (snd_task_name(current, task_name, sizeof(task_name)) < 0) { in snd_pcm_oss_open()
2476 if (file->f_mode & FMODE_WRITE) in snd_pcm_oss_open()
2479 if (file->f_mode & FMODE_READ) in snd_pcm_oss_open()
2484 if (!nonblock) in snd_pcm_oss_open()
2493 if (err >= 0) in snd_pcm_oss_open()
2495 if (err == -EAGAIN) { in snd_pcm_oss_open()
2496 if (nonblock) { in snd_pcm_oss_open()
2506 if (pcm->card->shutdown) { in snd_pcm_oss_open()
2510 if (signal_pending(current)) { in snd_pcm_oss_open()
2517 if (err < 0) in snd_pcm_oss_open()
2527 if (pcm) in snd_pcm_oss_open()
2540 if (substream == NULL) in snd_pcm_oss_release()
2542 if (snd_BUG_ON(!substream)) in snd_pcm_oss_release()
2545 if (!pcm->card->shutdown) in snd_pcm_oss_release()
2563 if (cmd == OSS_GETVERSION) in snd_pcm_oss_ioctl()
2565 if (cmd == OSS_ALSAEMULVER) in snd_pcm_oss_ioctl()
2567 #if IS_REACHABLE(CONFIG_SND_MIXER_OSS) in snd_pcm_oss_ioctl()
2568 if (((cmd >> 8) & 0xff) == 'M') { /* mixer ioctl - for OSS compatibility */ in snd_pcm_oss_ioctl()
2573 if (substream != NULL) in snd_pcm_oss_ioctl()
2576 if (snd_BUG_ON(idx >= 2)) in snd_pcm_oss_ioctl()
2581 if (((cmd >> 8) & 0xff) != 'P') in snd_pcm_oss_ioctl()
2592 if (get_user(res, p)) in snd_pcm_oss_ioctl()
2594 if ((res = snd_pcm_oss_set_rate(pcm_oss_file, res))<0) in snd_pcm_oss_ioctl()
2599 if (res < 0) in snd_pcm_oss_ioctl()
2603 if (get_user(res, p)) in snd_pcm_oss_ioctl()
2606 if ((res = snd_pcm_oss_set_channels(pcm_oss_file, res)) < 0) in snd_pcm_oss_ioctl()
2611 if (res < 0) in snd_pcm_oss_ioctl()
2615 if (get_user(res, p)) in snd_pcm_oss_ioctl()
2618 if (res < 0) in snd_pcm_oss_ioctl()
2623 if (res < 0) in snd_pcm_oss_ioctl()
2627 if (get_user(res, p)) in snd_pcm_oss_ioctl()
2630 if (res < 0) in snd_pcm_oss_ioctl()
2635 if (res < 0) in snd_pcm_oss_ioctl()
2644 if (get_user(res, p)) in snd_pcm_oss_ioctl()
2647 if (res < 0) in snd_pcm_oss_ioctl()
2651 if (get_user(res, p)) in snd_pcm_oss_ioctl()
2656 if (res < 0) in snd_pcm_oss_ioctl()
2669 if (res < 0) in snd_pcm_oss_ioctl()
2674 if (res < 0) in snd_pcm_oss_ioctl()
2678 if (get_user(res, p)) in snd_pcm_oss_ioctl()
2697 if (snd_pcm_oss_get_caps(pcm_oss_file) & DSP_CAP_DUPLEX) in snd_pcm_oss_ioctl()
2702 if (res < 0) { in snd_pcm_oss_ioctl()
2738 if (substream == NULL) in snd_pcm_oss_read()
2762 if (substream == NULL) in snd_pcm_oss_write()
2776 if (atomic_read(&substream->mmap_count)) in snd_pcm_oss_playback_ready()
2787 if (atomic_read(&substream->mmap_count)) in snd_pcm_oss_capture_ready()
2807 if (psubstream != NULL) { in snd_pcm_oss_poll()
2811 if (runtime->status->state != SNDRV_PCM_STATE_DRAINING && in snd_pcm_oss_poll()
2817 if (csubstream != NULL) { in snd_pcm_oss_poll()
2822 if ((ostate = runtime->status->state) != SNDRV_PCM_STATE_RUNNING || in snd_pcm_oss_poll()
2826 if (ostate != SNDRV_PCM_STATE_RUNNING && runtime->oss.trigger) { in snd_pcm_oss_poll()
2852 if (substream) in snd_pcm_oss_mmap()
2867 if (substream == NULL) in snd_pcm_oss_mmap()
2870 if (!(runtime->info & SNDRV_PCM_INFO_MMAP_VALID)) in snd_pcm_oss_mmap()
2872 if (runtime->info & SNDRV_PCM_INFO_INTERLEAVED) in snd_pcm_oss_mmap()
2877 if (runtime->oss.params) { in snd_pcm_oss_mmap()
2883 if (err < 0) in snd_pcm_oss_mmap()
2887 if (runtime->oss.plugin_first != NULL) in snd_pcm_oss_mmap()
2891 if (area->vm_pgoff != 0) in snd_pcm_oss_mmap()
2895 if (err < 0) in snd_pcm_oss_mmap()
2963 if (!strcmp(task_name, "clear") || !strcmp(task_name, "erase")) { in snd_pcm_oss_proc_write()
2969 if (!strcmp(setup->task_name, task_name)) { in snd_pcm_oss_proc_write()
2979 if (template.period_size & (1 << idx1)) in snd_pcm_oss_proc_write()
2985 if (!strcmp(str, "disable")) { in snd_pcm_oss_proc_write()
2987 } else if (!strcmp(str, "direct")) { in snd_pcm_oss_proc_write()
2989 } else if (!strcmp(str, "block")) { in snd_pcm_oss_proc_write()
2991 } else if (!strcmp(str, "non-block")) { in snd_pcm_oss_proc_write()
2993 } else if (!strcmp(str, "partial-frag")) { in snd_pcm_oss_proc_write()
2995 } else if (!strcmp(str, "no-silence")) { in snd_pcm_oss_proc_write()
2997 } else if (!strcmp(str, "buggy-ptr")) { in snd_pcm_oss_proc_write()
3001 if (setup == NULL) { in snd_pcm_oss_proc_write()
3003 if (! setup) { in snd_pcm_oss_proc_write()
3008 if (pstr->oss.setup_list == NULL) in snd_pcm_oss_proc_write()
3016 if (! template.task_name) { in snd_pcm_oss_proc_write()
3034 if (pstr->substream_count == 0) in snd_pcm_oss_proc_init()
3036 if ((entry = snd_info_create_card_entry(pcm->card, "oss", pstr->proc_root)) != NULL) { in snd_pcm_oss_proc_init()
3042 if (snd_info_register(entry) < 0) { in snd_pcm_oss_proc_init()
3086 if (snd_register_oss_device(SNDRV_OSS_DEVICE_TYPE_PCM, in register_oss_dsp()
3097 if (dsp_map[pcm->card->number] == (int)pcm->device) { in snd_pcm_oss_register_minor()
3113 if (adsp_map[pcm->card->number] == (int)pcm->device) { in snd_pcm_oss_register_minor()
3119 if (pcm->oss.reg) in snd_pcm_oss_register_minor()
3127 if (pcm->oss.reg) { in snd_pcm_oss_disconnect_minor()
3128 if (pcm->oss.reg_mask & 1) { in snd_pcm_oss_disconnect_minor()
3133 if (pcm->oss.reg_mask & 2) { in snd_pcm_oss_disconnect_minor()
3138 if (dsp_map[pcm->card->number] == (int)pcm->device) { in snd_pcm_oss_disconnect_minor()
3169 if (dsp_map[i] < 0 || dsp_map[i] >= SNDRV_PCM_DEVICES) { in alsa_pcm_oss_init()
3174 if (adsp_map[i] < 0 || adsp_map[i] >= SNDRV_PCM_DEVICES) { in alsa_pcm_oss_init()
3180 if ((err = snd_pcm_notify(&snd_pcm_oss_notify, 0)) < 0) in alsa_pcm_oss_init()