Searched refs:runtime (Results 1 - 200 of 897) sorted by relevance

12345

/linux-4.1.27/sound/core/
H A Drawmidi.c90 struct snd_rawmidi_runtime *runtime = substream->runtime; snd_rawmidi_ready() local
91 return runtime->avail >= runtime->avail_min; snd_rawmidi_ready()
97 struct snd_rawmidi_runtime *runtime = substream->runtime; snd_rawmidi_ready_append() local
98 return runtime->avail >= runtime->avail_min && snd_rawmidi_ready_append()
99 (!substream->append || runtime->avail >= count); snd_rawmidi_ready_append()
104 struct snd_rawmidi_runtime *runtime = snd_rawmidi_input_event_work() local
106 if (runtime->event) snd_rawmidi_input_event_work()
107 runtime->event(runtime->substream); snd_rawmidi_input_event_work()
112 struct snd_rawmidi_runtime *runtime; snd_rawmidi_runtime_create() local
114 if ((runtime = kzalloc(sizeof(*runtime), GFP_KERNEL)) == NULL) snd_rawmidi_runtime_create()
116 runtime->substream = substream; snd_rawmidi_runtime_create()
117 spin_lock_init(&runtime->lock); snd_rawmidi_runtime_create()
118 init_waitqueue_head(&runtime->sleep); snd_rawmidi_runtime_create()
119 INIT_WORK(&runtime->event_work, snd_rawmidi_input_event_work); snd_rawmidi_runtime_create()
120 runtime->event = NULL; snd_rawmidi_runtime_create()
121 runtime->buffer_size = PAGE_SIZE; snd_rawmidi_runtime_create()
122 runtime->avail_min = 1; snd_rawmidi_runtime_create()
124 runtime->avail = 0; snd_rawmidi_runtime_create()
126 runtime->avail = runtime->buffer_size; snd_rawmidi_runtime_create()
127 if ((runtime->buffer = kmalloc(runtime->buffer_size, GFP_KERNEL)) == NULL) { snd_rawmidi_runtime_create()
128 kfree(runtime); snd_rawmidi_runtime_create()
131 runtime->appl_ptr = runtime->hw_ptr = 0; snd_rawmidi_runtime_create()
132 substream->runtime = runtime; snd_rawmidi_runtime_create()
138 struct snd_rawmidi_runtime *runtime = substream->runtime; snd_rawmidi_runtime_free() local
140 kfree(runtime->buffer); snd_rawmidi_runtime_free()
141 kfree(runtime); snd_rawmidi_runtime_free()
142 substream->runtime = NULL; snd_rawmidi_runtime_free()
159 cancel_work_sync(&substream->runtime->event_work); snd_rawmidi_input_trigger()
165 struct snd_rawmidi_runtime *runtime = substream->runtime; snd_rawmidi_drop_output() local
168 runtime->drain = 0; snd_rawmidi_drop_output()
169 spin_lock_irqsave(&runtime->lock, flags); snd_rawmidi_drop_output()
170 runtime->appl_ptr = runtime->hw_ptr = 0; snd_rawmidi_drop_output()
171 runtime->avail = runtime->buffer_size; snd_rawmidi_drop_output()
172 spin_unlock_irqrestore(&runtime->lock, flags); snd_rawmidi_drop_output()
181 struct snd_rawmidi_runtime *runtime = substream->runtime; snd_rawmidi_drain_output() local
184 runtime->drain = 1; snd_rawmidi_drain_output()
185 timeout = wait_event_interruptible_timeout(runtime->sleep, snd_rawmidi_drain_output()
186 (runtime->avail >= runtime->buffer_size), snd_rawmidi_drain_output()
190 if (runtime->avail < runtime->buffer_size && !timeout) { snd_rawmidi_drain_output()
193 (long)runtime->avail, (long)runtime->buffer_size); snd_rawmidi_drain_output()
196 runtime->drain = 0; snd_rawmidi_drain_output()
212 struct snd_rawmidi_runtime *runtime = substream->runtime; snd_rawmidi_drain_input() local
215 runtime->drain = 0; snd_rawmidi_drain_input()
216 spin_lock_irqsave(&runtime->lock, flags); snd_rawmidi_drain_input()
217 runtime->appl_ptr = runtime->hw_ptr = 0; snd_rawmidi_drain_input()
218 runtime->avail = 0; snd_rawmidi_drain_input()
219 spin_unlock_irqrestore(&runtime->lock, flags); snd_rawmidi_drain_input()
445 if (rawmidi_file->input && rawmidi_file->input->runtime) snd_rawmidi_open()
446 rawmidi_file->input->runtime->oss = (maj == SOUND_MAJOR); snd_rawmidi_open()
447 if (rawmidi_file->output && rawmidi_file->output->runtime) snd_rawmidi_open()
448 rawmidi_file->output->runtime->oss = (maj == SOUND_MAJOR); snd_rawmidi_open()
487 if (substream->runtime->private_free) close_substream()
488 substream->runtime->private_free(substream); close_substream()
630 struct snd_rawmidi_runtime *runtime = substream->runtime; snd_rawmidi_output_params() local
641 if (params->buffer_size != runtime->buffer_size) { snd_rawmidi_output_params()
642 newbuf = krealloc(runtime->buffer, params->buffer_size, snd_rawmidi_output_params()
646 runtime->buffer = newbuf; snd_rawmidi_output_params()
647 runtime->buffer_size = params->buffer_size; snd_rawmidi_output_params()
648 runtime->avail = runtime->buffer_size; snd_rawmidi_output_params()
650 runtime->avail_min = params->avail_min; snd_rawmidi_output_params()
660 struct snd_rawmidi_runtime *runtime = substream->runtime; snd_rawmidi_input_params() local
669 if (params->buffer_size != runtime->buffer_size) { snd_rawmidi_input_params()
670 newbuf = krealloc(runtime->buffer, params->buffer_size, snd_rawmidi_input_params()
674 runtime->buffer = newbuf; snd_rawmidi_input_params()
675 runtime->buffer_size = params->buffer_size; snd_rawmidi_input_params()
677 runtime->avail_min = params->avail_min; snd_rawmidi_input_params()
685 struct snd_rawmidi_runtime *runtime = substream->runtime; snd_rawmidi_output_status() local
689 spin_lock_irq(&runtime->lock); snd_rawmidi_output_status()
690 status->avail = runtime->avail; snd_rawmidi_output_status()
691 spin_unlock_irq(&runtime->lock); snd_rawmidi_output_status()
698 struct snd_rawmidi_runtime *runtime = substream->runtime; snd_rawmidi_input_status() local
702 spin_lock_irq(&runtime->lock); snd_rawmidi_input_status()
703 status->avail = runtime->avail; snd_rawmidi_input_status()
704 status->xruns = runtime->xruns; snd_rawmidi_input_status()
705 runtime->xruns = 0; snd_rawmidi_input_status()
706 spin_unlock_irq(&runtime->lock); snd_rawmidi_input_status()
879 struct snd_rawmidi_runtime *runtime = substream->runtime; snd_rawmidi_receive() local
883 if (runtime->buffer == NULL) { snd_rawmidi_receive()
888 spin_lock_irqsave(&runtime->lock, flags); snd_rawmidi_receive()
891 if (runtime->avail < runtime->buffer_size) { snd_rawmidi_receive()
892 runtime->buffer[runtime->hw_ptr++] = buffer[0]; snd_rawmidi_receive()
893 runtime->hw_ptr %= runtime->buffer_size; snd_rawmidi_receive()
894 runtime->avail++; snd_rawmidi_receive()
897 runtime->xruns++; snd_rawmidi_receive()
901 count1 = runtime->buffer_size - runtime->hw_ptr; snd_rawmidi_receive()
904 if (count1 > (int)(runtime->buffer_size - runtime->avail)) snd_rawmidi_receive()
905 count1 = runtime->buffer_size - runtime->avail; snd_rawmidi_receive()
906 memcpy(runtime->buffer + runtime->hw_ptr, buffer, count1); snd_rawmidi_receive()
907 runtime->hw_ptr += count1; snd_rawmidi_receive()
908 runtime->hw_ptr %= runtime->buffer_size; snd_rawmidi_receive()
909 runtime->avail += count1; snd_rawmidi_receive()
915 if (count1 > (int)(runtime->buffer_size - runtime->avail)) { snd_rawmidi_receive()
916 count1 = runtime->buffer_size - runtime->avail; snd_rawmidi_receive()
917 runtime->xruns += count - count1; snd_rawmidi_receive()
920 memcpy(runtime->buffer, buffer, count1); snd_rawmidi_receive()
921 runtime->hw_ptr = count1; snd_rawmidi_receive()
922 runtime->avail += count1; snd_rawmidi_receive()
928 if (runtime->event) snd_rawmidi_receive()
929 schedule_work(&runtime->event_work); snd_rawmidi_receive()
931 wake_up(&runtime->sleep); snd_rawmidi_receive()
933 spin_unlock_irqrestore(&runtime->lock, flags); snd_rawmidi_receive()
944 struct snd_rawmidi_runtime *runtime = substream->runtime; snd_rawmidi_kernel_read1() local
947 spin_lock_irqsave(&runtime->lock, flags); snd_rawmidi_kernel_read1()
948 while (count > 0 && runtime->avail) { snd_rawmidi_kernel_read1()
949 count1 = runtime->buffer_size - runtime->appl_ptr; snd_rawmidi_kernel_read1()
952 if (count1 > (int)runtime->avail) snd_rawmidi_kernel_read1()
953 count1 = runtime->avail; snd_rawmidi_kernel_read1()
955 /* update runtime->appl_ptr before unlocking for userbuf */ snd_rawmidi_kernel_read1()
956 appl_ptr = runtime->appl_ptr; snd_rawmidi_kernel_read1()
957 runtime->appl_ptr += count1; snd_rawmidi_kernel_read1()
958 runtime->appl_ptr %= runtime->buffer_size; snd_rawmidi_kernel_read1()
959 runtime->avail -= count1; snd_rawmidi_kernel_read1()
962 memcpy(kernelbuf + result, runtime->buffer + appl_ptr, count1); snd_rawmidi_kernel_read1()
964 spin_unlock_irqrestore(&runtime->lock, flags); snd_rawmidi_kernel_read1()
966 runtime->buffer + appl_ptr, count1)) { snd_rawmidi_kernel_read1()
969 spin_lock_irqsave(&runtime->lock, flags); snd_rawmidi_kernel_read1()
974 spin_unlock_irqrestore(&runtime->lock, flags); snd_rawmidi_kernel_read1()
993 struct snd_rawmidi_runtime *runtime; snd_rawmidi_read() local
999 runtime = substream->runtime; snd_rawmidi_read()
1003 spin_lock_irq(&runtime->lock); snd_rawmidi_read()
1007 spin_unlock_irq(&runtime->lock); snd_rawmidi_read()
1011 add_wait_queue(&runtime->sleep, &wait); snd_rawmidi_read()
1013 spin_unlock_irq(&runtime->lock); snd_rawmidi_read()
1015 remove_wait_queue(&runtime->sleep, &wait); snd_rawmidi_read()
1020 if (!runtime->avail) snd_rawmidi_read()
1022 spin_lock_irq(&runtime->lock); snd_rawmidi_read()
1024 spin_unlock_irq(&runtime->lock); snd_rawmidi_read()
1046 struct snd_rawmidi_runtime *runtime = substream->runtime; snd_rawmidi_transmit_empty() local
1050 if (runtime->buffer == NULL) { snd_rawmidi_transmit_empty()
1055 spin_lock_irqsave(&runtime->lock, flags); snd_rawmidi_transmit_empty()
1056 result = runtime->avail >= runtime->buffer_size; snd_rawmidi_transmit_empty()
1057 spin_unlock_irqrestore(&runtime->lock, flags); snd_rawmidi_transmit_empty()
1074 struct snd_rawmidi_runtime *runtime = substream->runtime; __snd_rawmidi_transmit_peek() local
1076 if (runtime->buffer == NULL) { __snd_rawmidi_transmit_peek()
1082 if (runtime->avail >= runtime->buffer_size) { __snd_rawmidi_transmit_peek()
1087 *buffer = runtime->buffer[runtime->hw_ptr]; __snd_rawmidi_transmit_peek()
1090 count1 = runtime->buffer_size - runtime->hw_ptr; __snd_rawmidi_transmit_peek()
1093 if (count1 > (int)(runtime->buffer_size - runtime->avail)) __snd_rawmidi_transmit_peek()
1094 count1 = runtime->buffer_size - runtime->avail; __snd_rawmidi_transmit_peek()
1095 memcpy(buffer, runtime->buffer + runtime->hw_ptr, count1); __snd_rawmidi_transmit_peek()
1099 if (count > (int)(runtime->buffer_size - runtime->avail - count1)) __snd_rawmidi_transmit_peek()
1100 count = runtime->buffer_size - runtime->avail - count1; __snd_rawmidi_transmit_peek()
1101 memcpy(buffer + count1, runtime->buffer, count); __snd_rawmidi_transmit_peek()
1127 struct snd_rawmidi_runtime *runtime = substream->runtime; snd_rawmidi_transmit_peek() local
1131 spin_lock_irqsave(&runtime->lock, flags); snd_rawmidi_transmit_peek()
1133 spin_unlock_irqrestore(&runtime->lock, flags); snd_rawmidi_transmit_peek()
1147 struct snd_rawmidi_runtime *runtime = substream->runtime; __snd_rawmidi_transmit_ack() local
1149 if (runtime->buffer == NULL) { __snd_rawmidi_transmit_ack()
1154 snd_BUG_ON(runtime->avail + count > runtime->buffer_size); __snd_rawmidi_transmit_ack()
1155 runtime->hw_ptr += count; __snd_rawmidi_transmit_ack()
1156 runtime->hw_ptr %= runtime->buffer_size; __snd_rawmidi_transmit_ack()
1157 runtime->avail += count; __snd_rawmidi_transmit_ack()
1160 if (runtime->drain || snd_rawmidi_ready(substream)) __snd_rawmidi_transmit_ack()
1161 wake_up(&runtime->sleep); __snd_rawmidi_transmit_ack()
1180 struct snd_rawmidi_runtime *runtime = substream->runtime; snd_rawmidi_transmit_ack() local
1184 spin_lock_irqsave(&runtime->lock, flags); snd_rawmidi_transmit_ack()
1186 spin_unlock_irqrestore(&runtime->lock, flags); snd_rawmidi_transmit_ack()
1204 struct snd_rawmidi_runtime *runtime = substream->runtime; snd_rawmidi_transmit() local
1208 spin_lock_irqsave(&runtime->lock, flags); snd_rawmidi_transmit()
1218 spin_unlock_irqrestore(&runtime->lock, flags); snd_rawmidi_transmit()
1230 struct snd_rawmidi_runtime *runtime = substream->runtime; snd_rawmidi_kernel_write1() local
1235 if (snd_BUG_ON(!runtime->buffer)) snd_rawmidi_kernel_write1()
1239 spin_lock_irqsave(&runtime->lock, flags); snd_rawmidi_kernel_write1()
1241 if ((long)runtime->avail < count) { snd_rawmidi_kernel_write1()
1242 spin_unlock_irqrestore(&runtime->lock, flags); snd_rawmidi_kernel_write1()
1246 while (count > 0 && runtime->avail > 0) { snd_rawmidi_kernel_write1()
1247 count1 = runtime->buffer_size - runtime->appl_ptr; snd_rawmidi_kernel_write1()
1250 if (count1 > (long)runtime->avail) snd_rawmidi_kernel_write1()
1251 count1 = runtime->avail; snd_rawmidi_kernel_write1()
1253 /* update runtime->appl_ptr before unlocking for userbuf */ snd_rawmidi_kernel_write1()
1254 appl_ptr = runtime->appl_ptr; snd_rawmidi_kernel_write1()
1255 runtime->appl_ptr += count1; snd_rawmidi_kernel_write1()
1256 runtime->appl_ptr %= runtime->buffer_size; snd_rawmidi_kernel_write1()
1257 runtime->avail -= count1; snd_rawmidi_kernel_write1()
1260 memcpy(runtime->buffer + appl_ptr, snd_rawmidi_kernel_write1()
1263 spin_unlock_irqrestore(&runtime->lock, flags); snd_rawmidi_kernel_write1()
1264 if (copy_from_user(runtime->buffer + appl_ptr, snd_rawmidi_kernel_write1()
1266 spin_lock_irqsave(&runtime->lock, flags); snd_rawmidi_kernel_write1()
1270 spin_lock_irqsave(&runtime->lock, flags); snd_rawmidi_kernel_write1()
1276 count1 = runtime->avail < runtime->buffer_size; snd_rawmidi_kernel_write1()
1277 spin_unlock_irqrestore(&runtime->lock, flags); snd_rawmidi_kernel_write1()
1296 struct snd_rawmidi_runtime *runtime; snd_rawmidi_write() local
1301 runtime = substream->runtime; snd_rawmidi_write()
1303 if (substream->append && count > runtime->buffer_size) snd_rawmidi_write()
1307 spin_lock_irq(&runtime->lock); snd_rawmidi_write()
1311 spin_unlock_irq(&runtime->lock); snd_rawmidi_write()
1315 add_wait_queue(&runtime->sleep, &wait); snd_rawmidi_write()
1317 spin_unlock_irq(&runtime->lock); snd_rawmidi_write()
1319 remove_wait_queue(&runtime->sleep, &wait); snd_rawmidi_write()
1324 if (!runtime->avail && !timeout) snd_rawmidi_write()
1326 spin_lock_irq(&runtime->lock); snd_rawmidi_write()
1328 spin_unlock_irq(&runtime->lock); snd_rawmidi_write()
1339 spin_lock_irq(&runtime->lock); snd_rawmidi_write()
1340 while (runtime->avail != runtime->buffer_size) { snd_rawmidi_write()
1342 unsigned int last_avail = runtime->avail; snd_rawmidi_write()
1344 add_wait_queue(&runtime->sleep, &wait); snd_rawmidi_write()
1346 spin_unlock_irq(&runtime->lock); snd_rawmidi_write()
1348 remove_wait_queue(&runtime->sleep, &wait); snd_rawmidi_write()
1351 if (runtime->avail == last_avail && !timeout) snd_rawmidi_write()
1353 spin_lock_irq(&runtime->lock); snd_rawmidi_write()
1355 spin_unlock_irq(&runtime->lock); snd_rawmidi_write()
1363 struct snd_rawmidi_runtime *runtime; snd_rawmidi_poll() local
1368 runtime = rfile->input->runtime; snd_rawmidi_poll()
1370 poll_wait(file, &runtime->sleep, wait); snd_rawmidi_poll()
1373 runtime = rfile->output->runtime; snd_rawmidi_poll()
1374 poll_wait(file, &runtime->sleep, wait); snd_rawmidi_poll()
1405 struct snd_rawmidi_runtime *runtime; snd_rawmidi_proc_info_read() local
1423 runtime = substream->runtime; snd_rawmidi_proc_info_read()
1428 runtime->oss ? "OSS compatible" : "native", snd_rawmidi_proc_info_read()
1429 (unsigned long) runtime->buffer_size, snd_rawmidi_proc_info_read()
1430 (unsigned long) runtime->avail); snd_rawmidi_proc_info_read()
1447 runtime = substream->runtime; snd_rawmidi_proc_info_read()
1452 (unsigned long) runtime->buffer_size, snd_rawmidi_proc_info_read()
1453 (unsigned long) runtime->avail, snd_rawmidi_proc_info_read()
1454 (unsigned long) runtime->xruns); snd_rawmidi_proc_info_read()
1717 if (s->runtime) snd_rawmidi_dev_disconnect()
1718 wake_up(&s->runtime->sleep); snd_rawmidi_dev_disconnect()
H A Dpcm_lib.c46 * runtime->silence_start: starting pointer to silence area
47 * runtime->silence_filled: size filled with silence
48 * runtime->silence_threshold: threshold from application
49 * runtime->silence_size: maximal size from application
51 * when runtime->silence_size >= runtime->boundary - fill processed area with silence immediately
55 struct snd_pcm_runtime *runtime = substream->runtime; snd_pcm_playback_silence() local
58 if (runtime->silence_size < runtime->boundary) { snd_pcm_playback_silence()
60 if (runtime->silence_start != runtime->control->appl_ptr) { snd_pcm_playback_silence()
61 n = runtime->control->appl_ptr - runtime->silence_start; snd_pcm_playback_silence()
63 n += runtime->boundary; snd_pcm_playback_silence()
64 if ((snd_pcm_uframes_t)n < runtime->silence_filled) snd_pcm_playback_silence()
65 runtime->silence_filled -= n; snd_pcm_playback_silence()
67 runtime->silence_filled = 0; snd_pcm_playback_silence()
68 runtime->silence_start = runtime->control->appl_ptr; snd_pcm_playback_silence()
70 if (runtime->silence_filled >= runtime->buffer_size) snd_pcm_playback_silence()
72 noise_dist = snd_pcm_playback_hw_avail(runtime) + runtime->silence_filled; snd_pcm_playback_silence()
73 if (noise_dist >= (snd_pcm_sframes_t) runtime->silence_threshold) snd_pcm_playback_silence()
75 frames = runtime->silence_threshold - noise_dist; snd_pcm_playback_silence()
76 if (frames > runtime->silence_size) snd_pcm_playback_silence()
77 frames = runtime->silence_size; snd_pcm_playback_silence()
80 snd_pcm_sframes_t avail = snd_pcm_playback_hw_avail(runtime); snd_pcm_playback_silence()
81 if (avail > runtime->buffer_size) snd_pcm_playback_silence()
82 avail = runtime->buffer_size; snd_pcm_playback_silence()
83 runtime->silence_filled = avail > 0 ? avail : 0; snd_pcm_playback_silence()
84 runtime->silence_start = (runtime->status->hw_ptr + snd_pcm_playback_silence()
85 runtime->silence_filled) % snd_pcm_playback_silence()
86 runtime->boundary; snd_pcm_playback_silence()
88 ofs = runtime->status->hw_ptr; snd_pcm_playback_silence()
91 frames += runtime->boundary; snd_pcm_playback_silence()
92 runtime->silence_filled -= frames; snd_pcm_playback_silence()
93 if ((snd_pcm_sframes_t)runtime->silence_filled < 0) { snd_pcm_playback_silence()
94 runtime->silence_filled = 0; snd_pcm_playback_silence()
95 runtime->silence_start = new_hw_ptr; snd_pcm_playback_silence()
97 runtime->silence_start = ofs; snd_pcm_playback_silence()
100 frames = runtime->buffer_size - runtime->silence_filled; snd_pcm_playback_silence()
102 if (snd_BUG_ON(frames > runtime->buffer_size)) snd_pcm_playback_silence()
106 ofs = runtime->silence_start % runtime->buffer_size; snd_pcm_playback_silence()
108 transfer = ofs + frames > runtime->buffer_size ? runtime->buffer_size - ofs : frames; snd_pcm_playback_silence()
109 if (runtime->access == SNDRV_PCM_ACCESS_RW_INTERLEAVED || snd_pcm_playback_silence()
110 runtime->access == SNDRV_PCM_ACCESS_MMAP_INTERLEAVED) { snd_pcm_playback_silence()
116 char *hwbuf = runtime->dma_area + frames_to_bytes(runtime, ofs); snd_pcm_playback_silence()
117 snd_pcm_format_set_silence(runtime->format, hwbuf, transfer * runtime->channels); snd_pcm_playback_silence()
121 unsigned int channels = runtime->channels; snd_pcm_playback_silence()
129 size_t dma_csize = runtime->dma_bytes / channels; snd_pcm_playback_silence()
131 char *hwbuf = runtime->dma_area + (c * dma_csize) + samples_to_bytes(runtime, ofs); snd_pcm_playback_silence()
132 snd_pcm_format_set_silence(runtime->format, hwbuf, transfer); snd_pcm_playback_silence()
136 runtime->silence_filled += transfer; snd_pcm_playback_silence()
174 struct snd_pcm_runtime *runtime = substream->runtime; xrun() local
177 if (runtime->tstamp_mode == SNDRV_PCM_TSTAMP_ENABLE) xrun()
178 snd_pcm_gettime(runtime, (struct timespec *)&runtime->status->tstamp); xrun()
206 struct snd_pcm_runtime *runtime) snd_pcm_update_state()
211 avail = snd_pcm_playback_avail(runtime); snd_pcm_update_state()
213 avail = snd_pcm_capture_avail(runtime); snd_pcm_update_state()
214 if (avail > runtime->avail_max) snd_pcm_update_state()
215 runtime->avail_max = avail; snd_pcm_update_state()
216 if (runtime->status->state == SNDRV_PCM_STATE_DRAINING) { snd_pcm_update_state()
217 if (avail >= runtime->buffer_size) { snd_pcm_update_state()
222 if (avail >= runtime->stop_threshold) { snd_pcm_update_state()
227 if (runtime->twake) { snd_pcm_update_state()
228 if (avail >= runtime->twake) snd_pcm_update_state()
229 wake_up(&runtime->tsleep); snd_pcm_update_state()
230 } else if (avail >= runtime->control->avail_min) snd_pcm_update_state()
231 wake_up(&runtime->sleep); snd_pcm_update_state()
239 struct snd_pcm_runtime *runtime = substream->runtime; update_audio_tstamp() local
243 if (runtime->tstamp_mode != SNDRV_PCM_TSTAMP_ENABLE) update_audio_tstamp()
247 (runtime->audio_tstamp_report.actual_type == update_audio_tstamp()
255 audio_frames = runtime->hw_ptr_wrap + runtime->status->hw_ptr; update_audio_tstamp()
257 if (runtime->audio_tstamp_config.report_delay) { update_audio_tstamp()
259 audio_frames -= runtime->delay; update_audio_tstamp()
261 audio_frames += runtime->delay; update_audio_tstamp()
264 runtime->rate); update_audio_tstamp()
267 runtime->status->audio_tstamp = *audio_tstamp; update_audio_tstamp()
268 runtime->status->tstamp = *curr_tstamp; update_audio_tstamp()
274 snd_pcm_gettime(substream->runtime, (struct timespec *)&driver_tstamp); update_audio_tstamp()
275 runtime->driver_tstamp = driver_tstamp; update_audio_tstamp()
281 struct snd_pcm_runtime *runtime = substream->runtime; snd_pcm_update_hw_ptr0() local
291 old_hw_ptr = runtime->status->hw_ptr; snd_pcm_update_hw_ptr0()
301 if (runtime->tstamp_mode == SNDRV_PCM_TSTAMP_ENABLE) { snd_pcm_update_hw_ptr0()
303 (runtime->audio_tstamp_config.type_requested != SNDRV_PCM_AUDIO_TSTAMP_TYPE_DEFAULT)) { snd_pcm_update_hw_ptr0()
306 &runtime->audio_tstamp_config, snd_pcm_update_hw_ptr0()
307 &runtime->audio_tstamp_report); snd_pcm_update_hw_ptr0()
310 if (runtime->audio_tstamp_report.actual_type == SNDRV_PCM_AUDIO_TSTAMP_TYPE_DEFAULT) snd_pcm_update_hw_ptr0()
311 snd_pcm_gettime(runtime, (struct timespec *)&curr_tstamp); snd_pcm_update_hw_ptr0()
313 snd_pcm_gettime(runtime, (struct timespec *)&curr_tstamp); snd_pcm_update_hw_ptr0()
320 if (pos >= runtime->buffer_size) { snd_pcm_update_hw_ptr0()
326 name, pos, runtime->buffer_size, snd_pcm_update_hw_ptr0()
327 runtime->period_size); snd_pcm_update_hw_ptr0()
331 pos -= pos % runtime->min_align; snd_pcm_update_hw_ptr0()
333 hw_base = runtime->hw_ptr_base; snd_pcm_update_hw_ptr0()
338 delta = runtime->hw_ptr_interrupt + runtime->period_size; snd_pcm_update_hw_ptr0()
341 hdelta = curr_jiffies - runtime->hw_ptr_jiffies; snd_pcm_update_hw_ptr0()
342 if (hdelta > runtime->hw_ptr_buffer_jiffies/2 + 1) { snd_pcm_update_hw_ptr0()
343 hw_base += runtime->buffer_size; snd_pcm_update_hw_ptr0()
344 if (hw_base >= runtime->boundary) { snd_pcm_update_hw_ptr0()
356 hw_base += runtime->buffer_size; snd_pcm_update_hw_ptr0()
357 if (hw_base >= runtime->boundary) { snd_pcm_update_hw_ptr0()
366 delta += runtime->boundary; snd_pcm_update_hw_ptr0()
368 if (runtime->no_period_wakeup) { snd_pcm_update_hw_ptr0()
374 jdelta = curr_jiffies - runtime->hw_ptr_jiffies; snd_pcm_update_hw_ptr0()
375 if (jdelta < runtime->hw_ptr_buffer_jiffies / 2) snd_pcm_update_hw_ptr0()
377 hdelta = jdelta - delta * HZ / runtime->rate; snd_pcm_update_hw_ptr0()
378 xrun_threshold = runtime->hw_ptr_buffer_jiffies / 2 + 1; snd_pcm_update_hw_ptr0()
380 delta += runtime->buffer_size; snd_pcm_update_hw_ptr0()
381 hw_base += runtime->buffer_size; snd_pcm_update_hw_ptr0()
382 if (hw_base >= runtime->boundary) { snd_pcm_update_hw_ptr0()
387 hdelta -= runtime->hw_ptr_buffer_jiffies; snd_pcm_update_hw_ptr0()
393 if (delta >= runtime->buffer_size + runtime->period_size) { snd_pcm_update_hw_ptr0()
409 if (runtime->hw.info & SNDRV_PCM_INFO_BATCH) snd_pcm_update_hw_ptr0()
412 if (hdelta < runtime->delay) snd_pcm_update_hw_ptr0()
414 hdelta -= runtime->delay; snd_pcm_update_hw_ptr0()
415 jdelta = curr_jiffies - runtime->hw_ptr_jiffies; snd_pcm_update_hw_ptr0()
416 if (((hdelta * HZ) / runtime->rate) > jdelta + HZ/100) { snd_pcm_update_hw_ptr0()
418 (((runtime->period_size * HZ) / runtime->rate) snd_pcm_update_hw_ptr0()
426 new_hw_ptr += runtime->period_size; snd_pcm_update_hw_ptr0()
427 if (new_hw_ptr >= runtime->boundary) { snd_pcm_update_hw_ptr0()
428 new_hw_ptr -= runtime->boundary; snd_pcm_update_hw_ptr0()
437 (long)runtime->period_size, jdelta, snd_pcm_update_hw_ptr0()
438 ((hdelta * HZ) / runtime->rate), hw_base, snd_pcm_update_hw_ptr0()
443 hw_base = new_hw_ptr - (new_hw_ptr % runtime->buffer_size); snd_pcm_update_hw_ptr0()
446 if (delta > runtime->period_size + runtime->period_size / 2) { snd_pcm_update_hw_ptr0()
456 if (runtime->status->hw_ptr == new_hw_ptr) { snd_pcm_update_hw_ptr0()
462 runtime->silence_size > 0) snd_pcm_update_hw_ptr0()
466 delta = new_hw_ptr - runtime->hw_ptr_interrupt; snd_pcm_update_hw_ptr0()
468 delta += runtime->boundary; snd_pcm_update_hw_ptr0()
469 delta -= (snd_pcm_uframes_t)delta % runtime->period_size; snd_pcm_update_hw_ptr0()
470 runtime->hw_ptr_interrupt += delta; snd_pcm_update_hw_ptr0()
471 if (runtime->hw_ptr_interrupt >= runtime->boundary) snd_pcm_update_hw_ptr0()
472 runtime->hw_ptr_interrupt -= runtime->boundary; snd_pcm_update_hw_ptr0()
474 runtime->hw_ptr_base = hw_base; snd_pcm_update_hw_ptr0()
475 runtime->status->hw_ptr = new_hw_ptr; snd_pcm_update_hw_ptr0()
476 runtime->hw_ptr_jiffies = curr_jiffies; snd_pcm_update_hw_ptr0()
479 runtime->hw_ptr_wrap += runtime->boundary; snd_pcm_update_hw_ptr0()
484 return snd_pcm_update_state(substream, runtime); snd_pcm_update_hw_ptr0()
521 struct snd_pcm_runtime *runtime = substream->runtime; snd_pcm_set_sync() local
523 runtime->sync.id32[0] = substream->pcm->card->number; snd_pcm_set_sync()
524 runtime->sync.id32[1] = -1; snd_pcm_set_sync()
525 runtime->sync.id32[2] = -1; snd_pcm_set_sync()
526 runtime->sync.id32[3] = -1; snd_pcm_set_sync()
1129 * @runtime: the pcm runtime instance
1138 int snd_pcm_hw_rule_add(struct snd_pcm_runtime *runtime, unsigned int cond, snd_pcm_hw_rule_add() argument
1143 struct snd_pcm_hw_constraints *constrs = &runtime->hw_constraints; snd_pcm_hw_rule_add()
1189 * @runtime: PCM runtime instance
1197 int snd_pcm_hw_constraint_mask(struct snd_pcm_runtime *runtime, snd_pcm_hw_param_t var, snd_pcm_hw_constraint_mask() argument
1200 struct snd_pcm_hw_constraints *constrs = &runtime->hw_constraints; snd_pcm_hw_constraint_mask()
1211 * @runtime: PCM runtime instance
1219 int snd_pcm_hw_constraint_mask64(struct snd_pcm_runtime *runtime, snd_pcm_hw_param_t var, snd_pcm_hw_constraint_mask64() argument
1222 struct snd_pcm_hw_constraints *constrs = &runtime->hw_constraints; snd_pcm_hw_constraint_mask64()
1235 * @runtime: PCM runtime instance
1243 int snd_pcm_hw_constraint_integer(struct snd_pcm_runtime *runtime, snd_pcm_hw_param_t var) snd_pcm_hw_constraint_integer() argument
1245 struct snd_pcm_hw_constraints *constrs = &runtime->hw_constraints; snd_pcm_hw_constraint_integer()
1253 * @runtime: PCM runtime instance
1263 int snd_pcm_hw_constraint_minmax(struct snd_pcm_runtime *runtime, snd_pcm_hw_param_t var, snd_pcm_hw_constraint_minmax() argument
1266 struct snd_pcm_hw_constraints *constrs = &runtime->hw_constraints; snd_pcm_hw_constraint_minmax()
1287 * @runtime: PCM runtime instance
1296 int snd_pcm_hw_constraint_list(struct snd_pcm_runtime *runtime, snd_pcm_hw_constraint_list() argument
1301 return snd_pcm_hw_rule_add(runtime, cond, var, snd_pcm_hw_constraint_list()
1319 * @runtime: PCM runtime instance
1328 int snd_pcm_hw_constraint_ranges(struct snd_pcm_runtime *runtime, snd_pcm_hw_constraint_ranges() argument
1333 return snd_pcm_hw_rule_add(runtime, cond, var, snd_pcm_hw_constraint_ranges()
1356 * @runtime: PCM runtime instance
1363 int snd_pcm_hw_constraint_ratnums(struct snd_pcm_runtime *runtime, snd_pcm_hw_constraint_ratnums() argument
1368 return snd_pcm_hw_rule_add(runtime, cond, var, snd_pcm_hw_constraint_ratnums()
1391 * @runtime: PCM runtime instance
1398 int snd_pcm_hw_constraint_ratdens(struct snd_pcm_runtime *runtime, snd_pcm_hw_constraint_ratdens() argument
1403 return snd_pcm_hw_rule_add(runtime, cond, var, snd_pcm_hw_constraint_ratdens()
1430 * @runtime: PCM runtime instance
1442 int snd_pcm_hw_constraint_msbits(struct snd_pcm_runtime *runtime, snd_pcm_hw_constraint_msbits() argument
1448 return snd_pcm_hw_rule_add(runtime, cond, -1, snd_pcm_hw_constraint_msbits()
1465 * @runtime: PCM runtime instance
1472 int snd_pcm_hw_constraint_step(struct snd_pcm_runtime *runtime, snd_pcm_hw_constraint_step() argument
1477 return snd_pcm_hw_rule_add(runtime, cond, var, snd_pcm_hw_constraint_step()
1498 * @runtime: PCM runtime instance
1504 int snd_pcm_hw_constraint_pow2(struct snd_pcm_runtime *runtime, snd_pcm_hw_constraint_pow2() argument
1508 return snd_pcm_hw_rule_add(runtime, cond, var, snd_pcm_hw_constraint_pow2()
1527 * @runtime: PCM runtime instance
1532 int snd_pcm_hw_rule_noresample(struct snd_pcm_runtime *runtime, snd_pcm_hw_rule_noresample() argument
1535 return snd_pcm_hw_rule_add(runtime, SNDRV_PCM_HW_PARAMS_NORESAMPLE, snd_pcm_hw_rule_noresample()
1761 struct snd_pcm_runtime *runtime = substream->runtime; snd_pcm_lib_ioctl_reset() local
1766 runtime->status->hw_ptr %= runtime->buffer_size; snd_pcm_lib_ioctl_reset()
1768 runtime->status->hw_ptr = 0; snd_pcm_lib_ioctl_reset()
1769 runtime->hw_ptr_wrap = 0; snd_pcm_lib_ioctl_reset()
1779 struct snd_pcm_runtime *runtime = substream->runtime; snd_pcm_lib_ioctl_channel_info() local
1781 if (!(runtime->info & SNDRV_PCM_INFO_MMAP)) { snd_pcm_lib_ioctl_channel_info()
1785 width = snd_pcm_format_physical_width(runtime->format); snd_pcm_lib_ioctl_channel_info()
1789 switch (runtime->access) { snd_pcm_lib_ioctl_channel_info()
1793 info->step = runtime->channels * width; snd_pcm_lib_ioctl_channel_info()
1798 size_t size = runtime->dma_bytes / runtime->channels; snd_pcm_lib_ioctl_channel_info()
1818 params->fifo_size = substream->runtime->hw.fifo_size; snd_pcm_lib_ioctl_fifo_size()
1819 if (!(substream->runtime->hw.info & SNDRV_PCM_INFO_FIFO_IN_FRAMES)) { snd_pcm_lib_ioctl_fifo_size()
1871 struct snd_pcm_runtime *runtime; snd_pcm_period_elapsed() local
1876 runtime = substream->runtime; snd_pcm_period_elapsed()
1878 if (runtime->transfer_ack_begin) snd_pcm_period_elapsed()
1879 runtime->transfer_ack_begin(substream); snd_pcm_period_elapsed()
1890 if (runtime->transfer_ack_end) snd_pcm_period_elapsed()
1891 runtime->transfer_ack_end(substream); snd_pcm_period_elapsed()
1892 kill_fasync(&runtime->fasync, SIGIO, POLL_IN); snd_pcm_period_elapsed()
1906 struct snd_pcm_runtime *runtime = substream->runtime; wait_for_avail() local
1915 add_wait_queue(&runtime->tsleep, &wait); wait_for_avail()
1917 if (runtime->no_period_wakeup) wait_for_avail()
1921 if (runtime->rate) { wait_for_avail()
1922 long t = runtime->period_size * 2 / runtime->rate; wait_for_avail()
1942 avail = snd_pcm_playback_avail(runtime); wait_for_avail()
1944 avail = snd_pcm_capture_avail(runtime); wait_for_avail()
1945 if (avail >= runtime->twake) wait_for_avail()
1953 switch (runtime->status->state) { wait_for_avail()
1984 remove_wait_queue(&runtime->tsleep, &wait); wait_for_avail()
1994 struct snd_pcm_runtime *runtime = substream->runtime; snd_pcm_lib_write_transfer() local
1996 char __user *buf = (char __user *) data + frames_to_bytes(runtime, off); snd_pcm_lib_write_transfer()
2001 char *hwbuf = runtime->dma_area + frames_to_bytes(runtime, hwoff); snd_pcm_lib_write_transfer()
2002 if (copy_from_user(hwbuf, buf, frames_to_bytes(runtime, frames))) snd_pcm_lib_write_transfer()
2018 struct snd_pcm_runtime *runtime = substream->runtime; snd_pcm_lib_write1() local
2028 switch (runtime->status->state) { snd_pcm_lib_write1()
2044 runtime->twake = runtime->control->avail_min ? : 1; snd_pcm_lib_write1()
2045 if (runtime->status->state == SNDRV_PCM_STATE_RUNNING) snd_pcm_lib_write1()
2047 avail = snd_pcm_playback_avail(runtime); snd_pcm_lib_write1()
2056 runtime->twake = min_t(snd_pcm_uframes_t, size, snd_pcm_lib_write1()
2057 runtime->control->avail_min ? : 1); snd_pcm_lib_write1()
2063 cont = runtime->buffer_size - runtime->control->appl_ptr % runtime->buffer_size; snd_pcm_lib_write1()
2067 runtime->twake = 0; snd_pcm_lib_write1()
2071 appl_ptr = runtime->control->appl_ptr; snd_pcm_lib_write1()
2072 appl_ofs = appl_ptr % runtime->buffer_size; snd_pcm_lib_write1()
2078 switch (runtime->status->state) { snd_pcm_lib_write1()
2089 if (appl_ptr >= runtime->boundary) snd_pcm_lib_write1()
2090 appl_ptr -= runtime->boundary; snd_pcm_lib_write1()
2091 runtime->control->appl_ptr = appl_ptr; snd_pcm_lib_write1()
2099 if (runtime->status->state == SNDRV_PCM_STATE_PREPARED && snd_pcm_lib_write1()
2100 snd_pcm_playback_hw_avail(runtime) >= (snd_pcm_sframes_t)runtime->start_threshold) { snd_pcm_lib_write1()
2107 runtime->twake = 0; snd_pcm_lib_write1()
2109 snd_pcm_update_state(substream, runtime); snd_pcm_lib_write1()
2117 struct snd_pcm_runtime *runtime; pcm_sanity_check() local
2120 runtime = substream->runtime; pcm_sanity_check()
2121 if (snd_BUG_ON(!substream->ops->copy && !runtime->dma_area)) pcm_sanity_check()
2123 if (runtime->status->state == SNDRV_PCM_STATE_OPEN) pcm_sanity_check()
2130 struct snd_pcm_runtime *runtime; snd_pcm_lib_write() local
2137 runtime = substream->runtime; snd_pcm_lib_write()
2140 if (runtime->access != SNDRV_PCM_ACCESS_RW_INTERLEAVED && snd_pcm_lib_write()
2141 runtime->channels > 1) snd_pcm_lib_write()
2154 struct snd_pcm_runtime *runtime = substream->runtime; snd_pcm_lib_writev_transfer() local
2157 int channels = runtime->channels; snd_pcm_lib_writev_transfer()
2167 char __user *buf = *bufs + samples_to_bytes(runtime, off); snd_pcm_lib_writev_transfer()
2174 size_t dma_csize = runtime->dma_bytes / channels; snd_pcm_lib_writev_transfer()
2176 char *hwbuf = runtime->dma_area + (c * dma_csize) + samples_to_bytes(runtime, hwoff); snd_pcm_lib_writev_transfer()
2178 snd_pcm_format_set_silence(runtime->format, hwbuf, frames); snd_pcm_lib_writev_transfer()
2180 char __user *buf = *bufs + samples_to_bytes(runtime, off); snd_pcm_lib_writev_transfer()
2181 if (copy_from_user(hwbuf, buf, samples_to_bytes(runtime, frames))) snd_pcm_lib_writev_transfer()
2193 struct snd_pcm_runtime *runtime; snd_pcm_lib_writev() local
2200 runtime = substream->runtime; snd_pcm_lib_writev()
2203 if (runtime->access != SNDRV_PCM_ACCESS_RW_NONINTERLEAVED) snd_pcm_lib_writev()
2216 struct snd_pcm_runtime *runtime = substream->runtime; snd_pcm_lib_read_transfer() local
2218 char __user *buf = (char __user *) data + frames_to_bytes(runtime, off); snd_pcm_lib_read_transfer()
2223 char *hwbuf = runtime->dma_area + frames_to_bytes(runtime, hwoff); snd_pcm_lib_read_transfer()
2224 if (copy_to_user(buf, hwbuf, frames_to_bytes(runtime, frames))) snd_pcm_lib_read_transfer()
2236 struct snd_pcm_runtime *runtime = substream->runtime; snd_pcm_lib_read1() local
2246 switch (runtime->status->state) { snd_pcm_lib_read1()
2248 if (size >= runtime->start_threshold) { snd_pcm_lib_read1()
2269 runtime->twake = runtime->control->avail_min ? : 1; snd_pcm_lib_read1()
2270 if (runtime->status->state == SNDRV_PCM_STATE_RUNNING) snd_pcm_lib_read1()
2272 avail = snd_pcm_capture_avail(runtime); snd_pcm_lib_read1()
2277 if (runtime->status->state == snd_pcm_lib_read1()
2286 runtime->twake = min_t(snd_pcm_uframes_t, size, snd_pcm_lib_read1()
2287 runtime->control->avail_min ? : 1); snd_pcm_lib_read1()
2295 cont = runtime->buffer_size - runtime->control->appl_ptr % runtime->buffer_size; snd_pcm_lib_read1()
2299 runtime->twake = 0; snd_pcm_lib_read1()
2303 appl_ptr = runtime->control->appl_ptr; snd_pcm_lib_read1()
2304 appl_ofs = appl_ptr % runtime->buffer_size; snd_pcm_lib_read1()
2310 switch (runtime->status->state) { snd_pcm_lib_read1()
2321 if (appl_ptr >= runtime->boundary) snd_pcm_lib_read1()
2322 appl_ptr -= runtime->boundary; snd_pcm_lib_read1()
2323 runtime->control->appl_ptr = appl_ptr; snd_pcm_lib_read1()
2333 runtime->twake = 0; snd_pcm_lib_read1()
2335 snd_pcm_update_state(substream, runtime); snd_pcm_lib_read1()
2342 struct snd_pcm_runtime *runtime; snd_pcm_lib_read() local
2349 runtime = substream->runtime; snd_pcm_lib_read()
2351 if (runtime->access != SNDRV_PCM_ACCESS_RW_INTERLEAVED) snd_pcm_lib_read()
2363 struct snd_pcm_runtime *runtime = substream->runtime; snd_pcm_lib_readv_transfer() local
2366 int channels = runtime->channels; snd_pcm_lib_readv_transfer()
2373 buf = *bufs + samples_to_bytes(runtime, off); snd_pcm_lib_readv_transfer()
2378 snd_pcm_uframes_t dma_csize = runtime->dma_bytes / channels; snd_pcm_lib_readv_transfer()
2385 hwbuf = runtime->dma_area + (c * dma_csize) + samples_to_bytes(runtime, hwoff); snd_pcm_lib_readv_transfer()
2386 buf = *bufs + samples_to_bytes(runtime, off); snd_pcm_lib_readv_transfer()
2387 if (copy_to_user(buf, hwbuf, samples_to_bytes(runtime, frames))) snd_pcm_lib_readv_transfer()
2398 struct snd_pcm_runtime *runtime; snd_pcm_lib_readv() local
2405 runtime = substream->runtime; snd_pcm_lib_readv()
2406 if (runtime->status->state == SNDRV_PCM_STATE_OPEN) snd_pcm_lib_readv()
2410 if (runtime->access != SNDRV_PCM_ACCESS_RW_NONINTERLEAVED) snd_pcm_lib_readv()
2503 if (!substream->runtime) pcm_chmap_ctl_get()
2507 if (map->channels == substream->runtime->channels && pcm_chmap_ctl_get()
205 snd_pcm_update_state(struct snd_pcm_substream *substream, struct snd_pcm_runtime *runtime) snd_pcm_update_state() argument
H A Dpcm_native.c199 struct snd_pcm_runtime *runtime; snd_pcm_info() local
215 runtime = substream->runtime; snd_pcm_info()
217 if (runtime) { snd_pcm_info()
218 info->sync = runtime->sync; snd_pcm_info()
244 if (!(substream->runtime->hw.info & SNDRV_PCM_INFO_MMAP)) hw_support_mmap()
287 struct snd_pcm_hw_constraints *constrs = &substream->runtime->hw_constraints; snd_pcm_hw_refine()
433 hw = &substream->runtime->hw; snd_pcm_hw_refine()
478 static int period_to_usecs(struct snd_pcm_runtime *runtime) period_to_usecs() argument
482 if (! runtime->rate) period_to_usecs()
486 usecs = (750000 / runtime->rate) * runtime->period_size; period_to_usecs()
487 usecs += ((750000 % runtime->rate) * runtime->period_size) / period_to_usecs()
488 runtime->rate; period_to_usecs()
496 if (substream->runtime->status->state != SNDRV_PCM_STATE_DISCONNECTED) snd_pcm_set_state()
497 substream->runtime->status->state = state; snd_pcm_set_state()
504 struct snd_pcm_runtime *runtime; snd_pcm_hw_params() local
511 runtime = substream->runtime; snd_pcm_hw_params()
513 switch (runtime->status->state) { snd_pcm_hw_params()
544 runtime->access = params_access(params); snd_pcm_hw_params()
545 runtime->format = params_format(params); snd_pcm_hw_params()
546 runtime->subformat = params_subformat(params); snd_pcm_hw_params()
547 runtime->channels = params_channels(params); snd_pcm_hw_params()
548 runtime->rate = params_rate(params); snd_pcm_hw_params()
549 runtime->period_size = params_period_size(params); snd_pcm_hw_params()
550 runtime->periods = params_periods(params); snd_pcm_hw_params()
551 runtime->buffer_size = params_buffer_size(params); snd_pcm_hw_params()
552 runtime->info = params->info; snd_pcm_hw_params()
553 runtime->rate_num = params->rate_num; snd_pcm_hw_params()
554 runtime->rate_den = params->rate_den; snd_pcm_hw_params()
555 runtime->no_period_wakeup = snd_pcm_hw_params()
559 bits = snd_pcm_format_physical_width(runtime->format); snd_pcm_hw_params()
560 runtime->sample_bits = bits; snd_pcm_hw_params()
561 bits *= runtime->channels; snd_pcm_hw_params()
562 runtime->frame_bits = bits; snd_pcm_hw_params()
568 runtime->byte_align = bits / 8; snd_pcm_hw_params()
569 runtime->min_align = frames; snd_pcm_hw_params()
572 runtime->tstamp_mode = SNDRV_PCM_TSTAMP_NONE; snd_pcm_hw_params()
573 runtime->period_step = 1; snd_pcm_hw_params()
574 runtime->control->avail_min = runtime->period_size; snd_pcm_hw_params()
575 runtime->start_threshold = 1; snd_pcm_hw_params()
576 runtime->stop_threshold = runtime->buffer_size; snd_pcm_hw_params()
577 runtime->silence_threshold = 0; snd_pcm_hw_params()
578 runtime->silence_size = 0; snd_pcm_hw_params()
579 runtime->boundary = runtime->buffer_size; snd_pcm_hw_params()
580 while (runtime->boundary * 2 <= LONG_MAX - runtime->buffer_size) snd_pcm_hw_params()
581 runtime->boundary *= 2; snd_pcm_hw_params()
588 if ((usecs = period_to_usecs(runtime)) >= 0) snd_pcm_hw_params()
624 struct snd_pcm_runtime *runtime; snd_pcm_hw_free() local
629 runtime = substream->runtime; snd_pcm_hw_free()
631 switch (runtime->status->state) { snd_pcm_hw_free()
652 struct snd_pcm_runtime *runtime; snd_pcm_sw_params() local
657 runtime = substream->runtime; snd_pcm_sw_params()
659 if (runtime->status->state == SNDRV_PCM_STATE_OPEN) { snd_pcm_sw_params()
672 if (params->silence_size >= runtime->boundary) { snd_pcm_sw_params()
678 if (params->silence_threshold > runtime->buffer_size) snd_pcm_sw_params()
683 runtime->tstamp_mode = params->tstamp_mode; snd_pcm_sw_params()
685 runtime->tstamp_type = params->tstamp_type; snd_pcm_sw_params()
686 runtime->period_step = params->period_step; snd_pcm_sw_params()
687 runtime->control->avail_min = params->avail_min; snd_pcm_sw_params()
688 runtime->start_threshold = params->start_threshold; snd_pcm_sw_params()
689 runtime->stop_threshold = params->stop_threshold; snd_pcm_sw_params()
690 runtime->silence_threshold = params->silence_threshold; snd_pcm_sw_params()
691 runtime->silence_size = params->silence_size; snd_pcm_sw_params()
692 params->boundary = runtime->boundary; snd_pcm_sw_params()
695 runtime->silence_size > 0) snd_pcm_sw_params()
697 err = snd_pcm_update_state(substream, runtime); snd_pcm_sw_params()
719 struct snd_pcm_runtime *runtime = substream->runtime; snd_pcm_status() local
724 &runtime->audio_tstamp_config); snd_pcm_status()
727 if (runtime->audio_tstamp_config.type_requested == snd_pcm_status()
729 if (runtime->hw.info & SNDRV_PCM_INFO_HAS_WALL_CLOCK) snd_pcm_status()
730 runtime->audio_tstamp_config.type_requested = snd_pcm_status()
733 runtime->audio_tstamp_config.type_requested = snd_pcm_status()
735 runtime->audio_tstamp_report.valid = 0; snd_pcm_status()
737 runtime->audio_tstamp_report.valid = 1; snd_pcm_status()
739 status->state = runtime->status->state; snd_pcm_status()
740 status->suspended_state = runtime->status->suspended_state; snd_pcm_status()
743 status->trigger_tstamp = runtime->trigger_tstamp; snd_pcm_status()
746 if (runtime->tstamp_mode == SNDRV_PCM_TSTAMP_ENABLE) { snd_pcm_status()
747 status->tstamp = runtime->status->tstamp; snd_pcm_status()
748 status->driver_tstamp = runtime->driver_tstamp; snd_pcm_status()
750 runtime->status->audio_tstamp; snd_pcm_status()
751 if (runtime->audio_tstamp_report.valid == 1) snd_pcm_status()
755 &runtime->audio_tstamp_report); snd_pcm_status()
761 if (runtime->tstamp_mode == SNDRV_PCM_TSTAMP_ENABLE) snd_pcm_status()
762 snd_pcm_gettime(runtime, &status->tstamp); snd_pcm_status()
765 status->appl_ptr = runtime->control->appl_ptr; snd_pcm_status()
766 status->hw_ptr = runtime->status->hw_ptr; snd_pcm_status()
768 status->avail = snd_pcm_playback_avail(runtime); snd_pcm_status()
769 if (runtime->status->state == SNDRV_PCM_STATE_RUNNING || snd_pcm_status()
770 runtime->status->state == SNDRV_PCM_STATE_DRAINING) { snd_pcm_status()
771 status->delay = runtime->buffer_size - status->avail; snd_pcm_status()
772 status->delay += runtime->delay; snd_pcm_status()
776 status->avail = snd_pcm_capture_avail(runtime); snd_pcm_status()
777 if (runtime->status->state == SNDRV_PCM_STATE_RUNNING) snd_pcm_status()
778 status->delay = status->avail + runtime->delay; snd_pcm_status()
782 status->avail_max = runtime->avail_max; snd_pcm_status()
783 status->overrange = runtime->overrange; snd_pcm_status()
784 runtime->avail_max = 0; snd_pcm_status()
785 runtime->overrange = 0; snd_pcm_status()
818 struct snd_pcm_runtime *runtime; snd_pcm_channel_info() local
822 runtime = substream->runtime; snd_pcm_channel_info()
824 if (runtime->status->state == SNDRV_PCM_STATE_OPEN) { snd_pcm_channel_info()
829 if (channel >= runtime->channels) snd_pcm_channel_info()
854 struct snd_pcm_runtime *runtime = substream->runtime; snd_pcm_trigger_tstamp() local
855 if (runtime->trigger_master == NULL) snd_pcm_trigger_tstamp()
857 if (runtime->trigger_master == substream) { snd_pcm_trigger_tstamp()
858 if (!runtime->trigger_tstamp_latched) snd_pcm_trigger_tstamp()
859 snd_pcm_gettime(runtime, &runtime->trigger_tstamp); snd_pcm_trigger_tstamp()
861 snd_pcm_trigger_tstamp(runtime->trigger_master); snd_pcm_trigger_tstamp()
862 runtime->trigger_tstamp = runtime->trigger_master->runtime->trigger_tstamp; snd_pcm_trigger_tstamp()
864 runtime->trigger_master = NULL; snd_pcm_trigger_tstamp()
1022 struct snd_pcm_runtime *runtime = substream->runtime; snd_pcm_pre_start() local
1023 if (runtime->status->state != SNDRV_PCM_STATE_PREPARED) snd_pcm_pre_start()
1028 runtime->trigger_tstamp_latched = false; snd_pcm_pre_start()
1029 runtime->trigger_master = substream; snd_pcm_pre_start()
1035 if (substream->runtime->trigger_master != substream) snd_pcm_do_start()
1042 if (substream->runtime->trigger_master == substream) snd_pcm_undo_start()
1048 struct snd_pcm_runtime *runtime = substream->runtime; snd_pcm_post_start() local
1050 runtime->hw_ptr_jiffies = jiffies; snd_pcm_post_start()
1051 runtime->hw_ptr_buffer_jiffies = (runtime->buffer_size * HZ) / snd_pcm_post_start()
1052 runtime->rate; snd_pcm_post_start()
1053 runtime->status->state = state; snd_pcm_post_start()
1055 runtime->silence_size > 0) snd_pcm_post_start()
1059 &runtime->trigger_tstamp); snd_pcm_post_start()
1086 struct snd_pcm_runtime *runtime = substream->runtime; snd_pcm_pre_stop() local
1087 if (runtime->status->state == SNDRV_PCM_STATE_OPEN) snd_pcm_pre_stop()
1089 runtime->trigger_master = substream; snd_pcm_pre_stop()
1095 if (substream->runtime->trigger_master == substream && snd_pcm_do_stop()
1103 struct snd_pcm_runtime *runtime = substream->runtime; snd_pcm_post_stop() local
1104 if (runtime->status->state != state) { snd_pcm_post_stop()
1106 runtime->status->state = state; snd_pcm_post_stop()
1109 &runtime->trigger_tstamp); snd_pcm_post_stop()
1111 wake_up(&runtime->sleep); snd_pcm_post_stop()
1112 wake_up(&runtime->tsleep); snd_pcm_post_stop()
1179 struct snd_pcm_runtime *runtime = substream->runtime; snd_pcm_pre_pause() local
1180 if (!(runtime->info & SNDRV_PCM_INFO_PAUSE)) snd_pcm_pre_pause()
1183 if (runtime->status->state != SNDRV_PCM_STATE_RUNNING) snd_pcm_pre_pause()
1185 } else if (runtime->status->state != SNDRV_PCM_STATE_PAUSED) snd_pcm_pre_pause()
1187 runtime->trigger_master = substream; snd_pcm_pre_pause()
1193 if (substream->runtime->trigger_master != substream) snd_pcm_do_pause()
1203 substream->runtime->hw_ptr_jiffies = jiffies - HZ * 1000; snd_pcm_do_pause()
1211 if (substream->runtime->trigger_master == substream) snd_pcm_undo_pause()
1219 struct snd_pcm_runtime *runtime = substream->runtime; snd_pcm_post_pause() local
1222 runtime->status->state = SNDRV_PCM_STATE_PAUSED; snd_pcm_post_pause()
1226 &runtime->trigger_tstamp); snd_pcm_post_pause()
1227 wake_up(&runtime->sleep); snd_pcm_post_pause()
1228 wake_up(&runtime->tsleep); snd_pcm_post_pause()
1230 runtime->status->state = SNDRV_PCM_STATE_RUNNING; snd_pcm_post_pause()
1234 &runtime->trigger_tstamp); snd_pcm_post_pause()
1258 struct snd_pcm_runtime *runtime = substream->runtime; snd_pcm_pre_suspend() local
1259 if (runtime->status->state == SNDRV_PCM_STATE_SUSPENDED) snd_pcm_pre_suspend()
1261 runtime->trigger_master = substream; snd_pcm_pre_suspend()
1267 struct snd_pcm_runtime *runtime = substream->runtime; snd_pcm_do_suspend() local
1268 if (runtime->trigger_master != substream) snd_pcm_do_suspend()
1278 struct snd_pcm_runtime *runtime = substream->runtime; snd_pcm_post_suspend() local
1280 runtime->status->suspended_state = runtime->status->state; snd_pcm_post_suspend()
1281 runtime->status->state = SNDRV_PCM_STATE_SUSPENDED; snd_pcm_post_suspend()
1284 &runtime->trigger_tstamp); snd_pcm_post_suspend()
1285 wake_up(&runtime->sleep); snd_pcm_post_suspend()
1286 wake_up(&runtime->tsleep); snd_pcm_post_suspend()
1340 if (substream->runtime == NULL) snd_pcm_suspend_all()
1356 struct snd_pcm_runtime *runtime = substream->runtime; snd_pcm_pre_resume() local
1357 if (!(runtime->info & SNDRV_PCM_INFO_RESUME)) snd_pcm_pre_resume()
1359 runtime->trigger_master = substream; snd_pcm_pre_resume()
1365 struct snd_pcm_runtime *runtime = substream->runtime; snd_pcm_do_resume() local
1366 if (runtime->trigger_master != substream) snd_pcm_do_resume()
1369 if (runtime->status->suspended_state != SNDRV_PCM_STATE_RUNNING && snd_pcm_do_resume()
1370 (runtime->status->suspended_state != SNDRV_PCM_STATE_DRAINING || snd_pcm_do_resume()
1378 if (substream->runtime->trigger_master == substream && snd_pcm_undo_resume()
1385 struct snd_pcm_runtime *runtime = substream->runtime; snd_pcm_post_resume() local
1387 runtime->status->state = runtime->status->suspended_state; snd_pcm_post_resume()
1390 &runtime->trigger_tstamp); snd_pcm_post_resume()
1429 struct snd_pcm_runtime *runtime = substream->runtime; snd_pcm_xrun() local
1433 if (runtime->status->state == SNDRV_PCM_STATE_SUSPENDED) { snd_pcm_xrun()
1440 switch (runtime->status->state) { snd_pcm_xrun()
1461 struct snd_pcm_runtime *runtime = substream->runtime; snd_pcm_pre_reset() local
1462 switch (runtime->status->state) { snd_pcm_pre_reset()
1475 struct snd_pcm_runtime *runtime = substream->runtime; snd_pcm_do_reset() local
1479 runtime->hw_ptr_base = 0; snd_pcm_do_reset()
1480 runtime->hw_ptr_interrupt = runtime->status->hw_ptr - snd_pcm_do_reset()
1481 runtime->status->hw_ptr % runtime->period_size; snd_pcm_do_reset()
1482 runtime->silence_start = runtime->status->hw_ptr; snd_pcm_do_reset()
1483 runtime->silence_filled = 0; snd_pcm_do_reset()
1489 struct snd_pcm_runtime *runtime = substream->runtime; snd_pcm_post_reset() local
1490 runtime->control->appl_ptr = runtime->status->hw_ptr; snd_pcm_post_reset()
1492 runtime->silence_size > 0) snd_pcm_post_reset()
1514 struct snd_pcm_runtime *runtime = substream->runtime; snd_pcm_pre_prepare() local
1515 if (runtime->status->state == SNDRV_PCM_STATE_OPEN || snd_pcm_pre_prepare()
1516 runtime->status->state == SNDRV_PCM_STATE_DISCONNECTED) snd_pcm_pre_prepare()
1535 struct snd_pcm_runtime *runtime = substream->runtime; snd_pcm_post_prepare() local
1536 runtime->control->appl_ptr = runtime->status->hw_ptr; snd_pcm_post_prepare()
1579 struct snd_pcm_runtime *runtime = substream->runtime; snd_pcm_pre_drain_init() local
1580 switch (runtime->status->state) { snd_pcm_pre_drain_init()
1586 runtime->trigger_master = substream; snd_pcm_pre_drain_init()
1592 struct snd_pcm_runtime *runtime = substream->runtime; snd_pcm_do_drain_init() local
1594 switch (runtime->status->state) { snd_pcm_do_drain_init()
1601 runtime->status->state = SNDRV_PCM_STATE_SETUP; snd_pcm_do_drain_init()
1605 runtime->status->state = SNDRV_PCM_STATE_DRAINING; snd_pcm_do_drain_init()
1608 runtime->status->state = SNDRV_PCM_STATE_SETUP; snd_pcm_do_drain_init()
1615 if (runtime->status->state == SNDRV_PCM_STATE_RUNNING) { snd_pcm_do_drain_init()
1616 int new_state = snd_pcm_capture_avail(runtime) > 0 ? snd_pcm_do_drain_init()
1623 if (runtime->status->state == SNDRV_PCM_STATE_DRAINING && snd_pcm_do_drain_init()
1624 runtime->trigger_master == substream && snd_pcm_do_drain_init()
1625 (runtime->hw.info & SNDRV_PCM_INFO_DRAIN_TRIGGER)) snd_pcm_do_drain_init()
1655 struct snd_pcm_runtime *runtime; snd_pcm_drain() local
1662 runtime = substream->runtime; snd_pcm_drain()
1664 if (runtime->status->state == SNDRV_PCM_STATE_OPEN) snd_pcm_drain()
1668 if (runtime->status->state == SNDRV_PCM_STATE_SUSPENDED) { snd_pcm_drain()
1685 if (runtime->status->state == SNDRV_PCM_STATE_PAUSED) snd_pcm_drain()
1710 runtime = s->runtime; snd_pcm_group_for_each_entry()
1711 if (runtime->status->state == SNDRV_PCM_STATE_DRAINING) { snd_pcm_group_for_each_entry()
1712 to_check = runtime; snd_pcm_group_for_each_entry()
1723 if (runtime->no_period_wakeup)
1727 if (runtime->rate) {
1728 long t = runtime->period_size * 2 / runtime->rate;
1743 if (substream->runtime->status->state == SNDRV_PCM_STATE_SUSPENDED)
1770 struct snd_pcm_runtime *runtime; snd_pcm_drop() local
1775 runtime = substream->runtime; snd_pcm_drop()
1777 if (runtime->status->state == SNDRV_PCM_STATE_OPEN || snd_pcm_drop()
1778 runtime->status->state == SNDRV_PCM_STATE_DISCONNECTED || snd_pcm_drop()
1779 runtime->status->state == SNDRV_PCM_STATE_SUSPENDED) snd_pcm_drop()
1784 if (runtime->status->state == SNDRV_PCM_STATE_PAUSED) snd_pcm_drop()
1788 /* runtime->control->appl_ptr = runtime->status->hw_ptr; */ snd_pcm_drop()
1833 if (substream->runtime->status->state == SNDRV_PCM_STATE_OPEN || snd_pcm_link()
1834 substream->runtime->status->state != substream1->runtime->status->state || snd_pcm_link()
2023 struct snd_pcm_runtime *runtime = substream->runtime; snd_pcm_hw_constraints_init() local
2024 struct snd_pcm_hw_constraints *constrs = &runtime->hw_constraints; snd_pcm_hw_constraints_init()
2041 err = snd_pcm_hw_rule_add(runtime, 0, SNDRV_PCM_HW_PARAM_FORMAT, snd_pcm_hw_constraints_init()
2046 err = snd_pcm_hw_rule_add(runtime, 0, SNDRV_PCM_HW_PARAM_SAMPLE_BITS, snd_pcm_hw_constraints_init()
2052 err = snd_pcm_hw_rule_add(runtime, 0, SNDRV_PCM_HW_PARAM_SAMPLE_BITS, snd_pcm_hw_constraints_init()
2057 err = snd_pcm_hw_rule_add(runtime, 0, SNDRV_PCM_HW_PARAM_FRAME_BITS, snd_pcm_hw_constraints_init()
2062 err = snd_pcm_hw_rule_add(runtime, 0, SNDRV_PCM_HW_PARAM_FRAME_BITS, snd_pcm_hw_constraints_init()
2067 err = snd_pcm_hw_rule_add(runtime, 0, SNDRV_PCM_HW_PARAM_FRAME_BITS, snd_pcm_hw_constraints_init()
2072 err = snd_pcm_hw_rule_add(runtime, 0, SNDRV_PCM_HW_PARAM_CHANNELS, snd_pcm_hw_constraints_init()
2077 err = snd_pcm_hw_rule_add(runtime, 0, SNDRV_PCM_HW_PARAM_RATE, snd_pcm_hw_constraints_init()
2082 err = snd_pcm_hw_rule_add(runtime, 0, SNDRV_PCM_HW_PARAM_RATE, snd_pcm_hw_constraints_init()
2087 err = snd_pcm_hw_rule_add(runtime, 0, SNDRV_PCM_HW_PARAM_PERIODS, snd_pcm_hw_constraints_init()
2092 err = snd_pcm_hw_rule_add(runtime, 0, SNDRV_PCM_HW_PARAM_PERIOD_SIZE, snd_pcm_hw_constraints_init()
2097 err = snd_pcm_hw_rule_add(runtime, 0, SNDRV_PCM_HW_PARAM_PERIOD_SIZE, snd_pcm_hw_constraints_init()
2102 err = snd_pcm_hw_rule_add(runtime, 0, SNDRV_PCM_HW_PARAM_PERIOD_SIZE, snd_pcm_hw_constraints_init()
2107 err = snd_pcm_hw_rule_add(runtime, 0, SNDRV_PCM_HW_PARAM_BUFFER_SIZE, snd_pcm_hw_constraints_init()
2112 err = snd_pcm_hw_rule_add(runtime, 0, SNDRV_PCM_HW_PARAM_BUFFER_SIZE, snd_pcm_hw_constraints_init()
2117 err = snd_pcm_hw_rule_add(runtime, 0, SNDRV_PCM_HW_PARAM_BUFFER_SIZE, snd_pcm_hw_constraints_init()
2122 err = snd_pcm_hw_rule_add(runtime, 0, SNDRV_PCM_HW_PARAM_PERIOD_BYTES, snd_pcm_hw_constraints_init()
2127 err = snd_pcm_hw_rule_add(runtime, 0, SNDRV_PCM_HW_PARAM_BUFFER_BYTES, snd_pcm_hw_constraints_init()
2132 err = snd_pcm_hw_rule_add(runtime, 0, SNDRV_PCM_HW_PARAM_PERIOD_TIME, snd_pcm_hw_constraints_init()
2137 err = snd_pcm_hw_rule_add(runtime, 0, SNDRV_PCM_HW_PARAM_BUFFER_TIME, snd_pcm_hw_constraints_init()
2147 struct snd_pcm_runtime *runtime = substream->runtime; snd_pcm_hw_constraints_complete() local
2148 struct snd_pcm_hardware *hw = &runtime->hw; snd_pcm_hw_constraints_complete()
2164 err = snd_pcm_hw_constraint_mask(runtime, SNDRV_PCM_HW_PARAM_ACCESS, mask); snd_pcm_hw_constraints_complete()
2168 err = snd_pcm_hw_constraint_mask64(runtime, SNDRV_PCM_HW_PARAM_FORMAT, hw->formats); snd_pcm_hw_constraints_complete()
2172 err = snd_pcm_hw_constraint_mask(runtime, SNDRV_PCM_HW_PARAM_SUBFORMAT, 1 << SNDRV_PCM_SUBFORMAT_STD); snd_pcm_hw_constraints_complete()
2176 err = snd_pcm_hw_constraint_minmax(runtime, SNDRV_PCM_HW_PARAM_CHANNELS, snd_pcm_hw_constraints_complete()
2181 err = snd_pcm_hw_constraint_minmax(runtime, SNDRV_PCM_HW_PARAM_RATE, snd_pcm_hw_constraints_complete()
2186 err = snd_pcm_hw_constraint_minmax(runtime, SNDRV_PCM_HW_PARAM_PERIOD_BYTES, snd_pcm_hw_constraints_complete()
2191 err = snd_pcm_hw_constraint_minmax(runtime, SNDRV_PCM_HW_PARAM_PERIODS, snd_pcm_hw_constraints_complete()
2196 err = snd_pcm_hw_constraint_minmax(runtime, SNDRV_PCM_HW_PARAM_BUFFER_BYTES, snd_pcm_hw_constraints_complete()
2201 err = snd_pcm_hw_rule_add(runtime, 0, SNDRV_PCM_HW_PARAM_BUFFER_BYTES, snd_pcm_hw_constraints_complete()
2208 if (runtime->dma_bytes) { snd_pcm_hw_constraints_complete()
2209 err = snd_pcm_hw_constraint_minmax(runtime, SNDRV_PCM_HW_PARAM_BUFFER_BYTES, 0, runtime->dma_bytes); snd_pcm_hw_constraints_complete()
2215 err = snd_pcm_hw_rule_add(runtime, 0, SNDRV_PCM_HW_PARAM_RATE, snd_pcm_hw_constraints_complete()
2223 snd_pcm_hw_constraint_integer(runtime, SNDRV_PCM_HW_PARAM_PERIOD_SIZE); snd_pcm_hw_constraints_complete()
2435 struct snd_pcm_runtime *runtime = substream->runtime; snd_pcm_playback_rewind() local
2444 switch (runtime->status->state) { snd_pcm_playback_rewind()
2463 hw_avail = snd_pcm_playback_hw_avail(runtime); snd_pcm_playback_rewind()
2470 appl_ptr = runtime->control->appl_ptr - frames; snd_pcm_playback_rewind()
2472 appl_ptr += runtime->boundary; snd_pcm_playback_rewind()
2473 runtime->control->appl_ptr = appl_ptr; snd_pcm_playback_rewind()
2483 struct snd_pcm_runtime *runtime = substream->runtime; snd_pcm_capture_rewind() local
2492 switch (runtime->status->state) { snd_pcm_capture_rewind()
2511 hw_avail = snd_pcm_capture_hw_avail(runtime); snd_pcm_capture_rewind()
2518 appl_ptr = runtime->control->appl_ptr - frames; snd_pcm_capture_rewind()
2520 appl_ptr += runtime->boundary; snd_pcm_capture_rewind()
2521 runtime->control->appl_ptr = appl_ptr; snd_pcm_capture_rewind()
2531 struct snd_pcm_runtime *runtime = substream->runtime; snd_pcm_playback_forward() local
2540 switch (runtime->status->state) { snd_pcm_playback_forward()
2560 avail = snd_pcm_playback_avail(runtime); snd_pcm_playback_forward()
2567 appl_ptr = runtime->control->appl_ptr + frames; snd_pcm_playback_forward()
2568 if (appl_ptr >= (snd_pcm_sframes_t)runtime->boundary) snd_pcm_playback_forward()
2569 appl_ptr -= runtime->boundary; snd_pcm_playback_forward()
2570 runtime->control->appl_ptr = appl_ptr; snd_pcm_playback_forward()
2580 struct snd_pcm_runtime *runtime = substream->runtime; snd_pcm_capture_forward() local
2589 switch (runtime->status->state) { snd_pcm_capture_forward()
2609 avail = snd_pcm_capture_avail(runtime); snd_pcm_capture_forward()
2616 appl_ptr = runtime->control->appl_ptr + frames; snd_pcm_capture_forward()
2617 if (appl_ptr >= (snd_pcm_sframes_t)runtime->boundary) snd_pcm_capture_forward()
2618 appl_ptr -= runtime->boundary; snd_pcm_capture_forward()
2619 runtime->control->appl_ptr = appl_ptr; snd_pcm_capture_forward()
2628 struct snd_pcm_runtime *runtime = substream->runtime; snd_pcm_hwsync() local
2632 switch (runtime->status->state) { snd_pcm_hwsync()
2660 struct snd_pcm_runtime *runtime = substream->runtime; snd_pcm_delay() local
2665 switch (runtime->status->state) { snd_pcm_delay()
2678 n = snd_pcm_playback_hw_avail(runtime); snd_pcm_delay()
2680 n = snd_pcm_capture_avail(runtime); snd_pcm_delay()
2681 n += runtime->delay; snd_pcm_delay()
2701 struct snd_pcm_runtime *runtime = substream->runtime; snd_pcm_sync_ptr() local
2712 status = runtime->status; snd_pcm_sync_ptr()
2713 control = runtime->control; snd_pcm_sync_ptr()
2740 struct snd_pcm_runtime *runtime = substream->runtime; snd_pcm_tstamp() local
2747 runtime->tstamp_type = arg; snd_pcm_tstamp()
2834 struct snd_pcm_runtime *runtime = substream->runtime; snd_pcm_playback_ioctl1() local
2836 if (runtime->status->state == SNDRV_PCM_STATE_OPEN) snd_pcm_playback_ioctl1()
2850 struct snd_pcm_runtime *runtime = substream->runtime; snd_pcm_playback_ioctl1() local
2853 if (runtime->status->state == SNDRV_PCM_STATE_OPEN) snd_pcm_playback_ioctl1()
2855 if (runtime->channels > 128) snd_pcm_playback_ioctl1()
2863 sizeof(void *) * runtime->channels); snd_pcm_playback_ioctl1()
2914 struct snd_pcm_runtime *runtime = substream->runtime; snd_pcm_capture_ioctl1() local
2916 if (runtime->status->state == SNDRV_PCM_STATE_OPEN) snd_pcm_capture_ioctl1()
2930 struct snd_pcm_runtime *runtime = substream->runtime; snd_pcm_capture_ioctl1() local
2933 if (runtime->status->state == SNDRV_PCM_STATE_OPEN) snd_pcm_capture_ioctl1()
2935 if (runtime->channels > 128) snd_pcm_capture_ioctl1()
2943 sizeof(void *) * runtime->channels); snd_pcm_capture_ioctl1()
3040 struct snd_pcm_runtime *runtime; snd_pcm_read() local
3047 runtime = substream->runtime; snd_pcm_read()
3048 if (runtime->status->state == SNDRV_PCM_STATE_OPEN) snd_pcm_read()
3050 if (!frame_aligned(runtime, count)) snd_pcm_read()
3052 count = bytes_to_frames(runtime, count); snd_pcm_read()
3055 result = frames_to_bytes(runtime, result); snd_pcm_read()
3064 struct snd_pcm_runtime *runtime; snd_pcm_write() local
3071 runtime = substream->runtime; snd_pcm_write()
3072 if (runtime->status->state == SNDRV_PCM_STATE_OPEN) snd_pcm_write()
3074 if (!frame_aligned(runtime, count)) snd_pcm_write()
3076 count = bytes_to_frames(runtime, count); snd_pcm_write()
3079 result = frames_to_bytes(runtime, result); snd_pcm_write()
3087 struct snd_pcm_runtime *runtime; snd_pcm_readv() local
3097 runtime = substream->runtime; snd_pcm_readv()
3098 if (runtime->status->state == SNDRV_PCM_STATE_OPEN) snd_pcm_readv()
3102 if (to->nr_segs > 1024 || to->nr_segs != runtime->channels) snd_pcm_readv()
3104 if (!frame_aligned(runtime, to->iov->iov_len)) snd_pcm_readv()
3106 frames = bytes_to_samples(runtime, to->iov->iov_len); snd_pcm_readv()
3114 result = frames_to_bytes(runtime, result); snd_pcm_readv()
3123 struct snd_pcm_runtime *runtime; snd_pcm_writev() local
3133 runtime = substream->runtime; snd_pcm_writev()
3134 if (runtime->status->state == SNDRV_PCM_STATE_OPEN) snd_pcm_writev()
3138 if (from->nr_segs > 128 || from->nr_segs != runtime->channels || snd_pcm_writev()
3139 !frame_aligned(runtime, from->iov->iov_len)) snd_pcm_writev()
3141 frames = bytes_to_samples(runtime, from->iov->iov_len); snd_pcm_writev()
3149 result = frames_to_bytes(runtime, result); snd_pcm_writev()
3158 struct snd_pcm_runtime *runtime; snd_pcm_playback_poll() local
3167 runtime = substream->runtime; snd_pcm_playback_poll()
3169 poll_wait(file, &runtime->sleep, wait); snd_pcm_playback_poll()
3172 avail = snd_pcm_playback_avail(runtime); snd_pcm_playback_poll()
3173 switch (runtime->status->state) { snd_pcm_playback_poll()
3177 if (avail >= runtime->control->avail_min) { snd_pcm_playback_poll()
3197 struct snd_pcm_runtime *runtime; snd_pcm_capture_poll() local
3206 runtime = substream->runtime; snd_pcm_capture_poll()
3208 poll_wait(file, &runtime->sleep, wait); snd_pcm_capture_poll()
3211 avail = snd_pcm_capture_avail(runtime); snd_pcm_capture_poll()
3212 switch (runtime->status->state) { snd_pcm_capture_poll()
3216 if (avail >= runtime->control->avail_min) { snd_pcm_capture_poll()
3252 struct snd_pcm_runtime *runtime; snd_pcm_mmap_status_fault() local
3256 runtime = substream->runtime; snd_pcm_mmap_status_fault()
3257 vmf->page = virt_to_page(runtime->status); snd_pcm_mmap_status_fault()
3289 struct snd_pcm_runtime *runtime; snd_pcm_mmap_control_fault() local
3293 runtime = substream->runtime; snd_pcm_mmap_control_fault()
3294 vmf->page = virt_to_page(runtime->control); snd_pcm_mmap_control_fault()
3337 void *vaddr = substream->runtime->dma_area + ofs; snd_pcm_default_page_ops()
3348 struct snd_pcm_runtime *runtime; snd_pcm_mmap_data_fault() local
3355 runtime = substream->runtime; snd_pcm_mmap_data_fault()
3357 dma_bytes = PAGE_ALIGN(runtime->dma_bytes); snd_pcm_mmap_data_fault()
3411 substream->runtime->dma_area, snd_pcm_lib_default_mmap()
3412 substream->runtime->dma_addr, snd_pcm_lib_default_mmap()
3437 struct snd_pcm_runtime *runtime = substream->runtime;; snd_pcm_lib_mmap_iomem() local
3440 return vm_iomap_memory(area, runtime->dma_addr, runtime->dma_bytes); snd_pcm_lib_mmap_iomem()
3452 struct snd_pcm_runtime *runtime; snd_pcm_mmap_data() local
3465 runtime = substream->runtime; snd_pcm_mmap_data()
3466 if (runtime->status->state == SNDRV_PCM_STATE_OPEN) snd_pcm_mmap_data()
3468 if (!(runtime->info & SNDRV_PCM_INFO_MMAP)) snd_pcm_mmap_data()
3470 if (runtime->access == SNDRV_PCM_ACCESS_RW_INTERLEAVED || snd_pcm_mmap_data()
3471 runtime->access == SNDRV_PCM_ACCESS_RW_NONINTERLEAVED) snd_pcm_mmap_data()
3475 dma_bytes = PAGE_ALIGN(runtime->dma_bytes); snd_pcm_mmap_data()
3525 struct snd_pcm_runtime *runtime; snd_pcm_fasync() local
3531 runtime = substream->runtime; snd_pcm_fasync()
3532 return fasync_helper(fd, file, on, &runtime->fasync); snd_pcm_fasync()
3660 struct snd_pcm_runtime *runtime = substream->runtime; snd_pcm_get_unmapped_area() local
3665 return (unsigned long)runtime->status; snd_pcm_get_unmapped_area()
3667 return (unsigned long)runtime->control; snd_pcm_get_unmapped_area()
3669 return (unsigned long)runtime->dma_area + offset; snd_pcm_get_unmapped_area()
H A Dpcm_timer.c35 struct snd_pcm_runtime *runtime = substream->runtime; snd_pcm_timer_resolution_change() local
38 rate = runtime->rate; snd_pcm_timer_resolution_change()
44 fsize = runtime->period_size; snd_pcm_timer_resolution_change()
58 runtime->rate, runtime->period_size); snd_pcm_timer_resolution_change()
59 runtime->timer_resolution = -1; snd_pcm_timer_resolution_change()
62 runtime->timer_resolution = (mult * fsize / rate) * post; snd_pcm_timer_resolution_change()
70 return substream->runtime ? substream->runtime->timer_resolution : 0; snd_pcm_timer_resolution()
H A Dpcm.c386 struct snd_pcm_runtime *runtime; snd_pcm_substream_proc_hw_params_read() local
389 runtime = substream->runtime; snd_pcm_substream_proc_hw_params_read()
390 if (!runtime) { snd_pcm_substream_proc_hw_params_read()
394 if (runtime->status->state == SNDRV_PCM_STATE_OPEN) { snd_pcm_substream_proc_hw_params_read()
398 snd_iprintf(buffer, "access: %s\n", snd_pcm_access_name(runtime->access)); snd_pcm_substream_proc_hw_params_read()
399 snd_iprintf(buffer, "format: %s\n", snd_pcm_format_name(runtime->format)); snd_pcm_substream_proc_hw_params_read()
400 snd_iprintf(buffer, "subformat: %s\n", snd_pcm_subformat_name(runtime->subformat)); snd_pcm_substream_proc_hw_params_read()
401 snd_iprintf(buffer, "channels: %u\n", runtime->channels); snd_pcm_substream_proc_hw_params_read()
402 snd_iprintf(buffer, "rate: %u (%u/%u)\n", runtime->rate, runtime->rate_num, runtime->rate_den); snd_pcm_substream_proc_hw_params_read()
403 snd_iprintf(buffer, "period_size: %lu\n", runtime->period_size); snd_pcm_substream_proc_hw_params_read()
404 snd_iprintf(buffer, "buffer_size: %lu\n", runtime->buffer_size); snd_pcm_substream_proc_hw_params_read()
407 snd_iprintf(buffer, "OSS format: %s\n", snd_pcm_oss_format_name(runtime->oss.format)); snd_pcm_substream_proc_hw_params_read()
408 snd_iprintf(buffer, "OSS channels: %u\n", runtime->oss.channels); snd_pcm_substream_proc_hw_params_read()
409 snd_iprintf(buffer, "OSS rate: %u\n", runtime->oss.rate); snd_pcm_substream_proc_hw_params_read()
410 snd_iprintf(buffer, "OSS period bytes: %lu\n", (unsigned long)runtime->oss.period_bytes); snd_pcm_substream_proc_hw_params_read()
411 snd_iprintf(buffer, "OSS periods: %u\n", runtime->oss.periods); snd_pcm_substream_proc_hw_params_read()
412 snd_iprintf(buffer, "OSS period frames: %lu\n", (unsigned long)runtime->oss.period_frames); snd_pcm_substream_proc_hw_params_read()
423 struct snd_pcm_runtime *runtime; snd_pcm_substream_proc_sw_params_read() local
426 runtime = substream->runtime; snd_pcm_substream_proc_sw_params_read()
427 if (!runtime) { snd_pcm_substream_proc_sw_params_read()
431 if (runtime->status->state == SNDRV_PCM_STATE_OPEN) { snd_pcm_substream_proc_sw_params_read()
435 snd_iprintf(buffer, "tstamp_mode: %s\n", snd_pcm_tstamp_mode_name(runtime->tstamp_mode)); snd_pcm_substream_proc_sw_params_read()
436 snd_iprintf(buffer, "period_step: %u\n", runtime->period_step); snd_pcm_substream_proc_sw_params_read()
437 snd_iprintf(buffer, "avail_min: %lu\n", runtime->control->avail_min); snd_pcm_substream_proc_sw_params_read()
438 snd_iprintf(buffer, "start_threshold: %lu\n", runtime->start_threshold); snd_pcm_substream_proc_sw_params_read()
439 snd_iprintf(buffer, "stop_threshold: %lu\n", runtime->stop_threshold); snd_pcm_substream_proc_sw_params_read()
440 snd_iprintf(buffer, "silence_threshold: %lu\n", runtime->silence_threshold); snd_pcm_substream_proc_sw_params_read()
441 snd_iprintf(buffer, "silence_size: %lu\n", runtime->silence_size); snd_pcm_substream_proc_sw_params_read()
442 snd_iprintf(buffer, "boundary: %lu\n", runtime->boundary); snd_pcm_substream_proc_sw_params_read()
451 struct snd_pcm_runtime *runtime; snd_pcm_substream_proc_status_read() local
456 runtime = substream->runtime; snd_pcm_substream_proc_status_read()
457 if (!runtime) { snd_pcm_substream_proc_status_read()
477 snd_iprintf(buffer, "hw_ptr : %ld\n", runtime->status->hw_ptr); snd_pcm_substream_proc_status_read()
478 snd_iprintf(buffer, "appl_ptr : %ld\n", runtime->control->appl_ptr); snd_pcm_substream_proc_status_read()
488 struct snd_pcm_runtime *runtime; snd_pcm_xrun_injection_write() local
491 runtime = substream->runtime; snd_pcm_xrun_injection_write()
492 if (runtime && runtime->status->state == SNDRV_PCM_STATE_RUNNING) snd_pcm_xrun_injection_write()
909 struct snd_pcm_runtime *runtime; snd_pcm_attach_substream() local
966 runtime = kzalloc(sizeof(*runtime), GFP_KERNEL); snd_pcm_attach_substream()
967 if (runtime == NULL) snd_pcm_attach_substream()
971 runtime->status = snd_malloc_pages(size, GFP_KERNEL); snd_pcm_attach_substream()
972 if (runtime->status == NULL) { snd_pcm_attach_substream()
973 kfree(runtime); snd_pcm_attach_substream()
976 memset((void*)runtime->status, 0, size); snd_pcm_attach_substream()
979 runtime->control = snd_malloc_pages(size, GFP_KERNEL); snd_pcm_attach_substream()
980 if (runtime->control == NULL) { snd_pcm_attach_substream()
981 snd_free_pages((void*)runtime->status, snd_pcm_attach_substream()
983 kfree(runtime); snd_pcm_attach_substream()
986 memset((void*)runtime->control, 0, size); snd_pcm_attach_substream()
988 init_waitqueue_head(&runtime->sleep); snd_pcm_attach_substream()
989 init_waitqueue_head(&runtime->tsleep); snd_pcm_attach_substream()
991 runtime->status->state = SNDRV_PCM_STATE_OPEN; snd_pcm_attach_substream()
993 substream->runtime = runtime; snd_pcm_attach_substream()
1005 struct snd_pcm_runtime *runtime; snd_pcm_detach_substream() local
1009 runtime = substream->runtime; snd_pcm_detach_substream()
1010 if (runtime->private_free != NULL) snd_pcm_detach_substream()
1011 runtime->private_free(runtime); snd_pcm_detach_substream()
1012 snd_free_pages((void*)runtime->status, snd_pcm_detach_substream()
1014 snd_free_pages((void*)runtime->control, snd_pcm_detach_substream()
1016 kfree(runtime->hw_constraints.rules); snd_pcm_detach_substream()
1018 kfree(runtime->hwptr_log); snd_pcm_detach_substream()
1020 kfree(runtime); snd_pcm_detach_substream()
1021 substream->runtime = NULL; snd_pcm_detach_substream()
1126 if (substream->runtime) { snd_pcm_dev_disconnect()
1127 substream->runtime->status->state = SNDRV_PCM_STATE_DISCONNECTED; snd_pcm_dev_disconnect()
1128 wake_up(&substream->runtime->sleep); snd_pcm_dev_disconnect()
1129 wake_up(&substream->runtime->tsleep); snd_pcm_dev_disconnect()
H A Dcompress_offload.c87 struct snd_compr_runtime *runtime; snd_compr_open() local
125 runtime = kzalloc(sizeof(*runtime), GFP_KERNEL); snd_compr_open()
126 if (!runtime) { snd_compr_open()
131 runtime->state = SNDRV_PCM_STATE_OPEN; snd_compr_open()
132 init_waitqueue_head(&runtime->sleep); snd_compr_open()
133 data->stream.runtime = runtime; snd_compr_open()
139 kfree(runtime); snd_compr_open()
149 struct snd_compr_runtime *runtime = data->stream.runtime; snd_compr_free() local
151 switch (runtime->state) { snd_compr_free()
162 kfree(data->stream.runtime->buffer); snd_compr_free()
163 kfree(data->stream.runtime); snd_compr_free()
177 stream->runtime->total_bytes_transferred = tstamp->copied_total; snd_compr_update_tstamp()
179 stream->runtime->total_bytes_available = tstamp->copied_total; snd_compr_update_tstamp()
190 if (stream->runtime->total_bytes_available == 0 && snd_compr_calc_avail()
191 stream->runtime->state == SNDRV_PCM_STATE_SETUP && snd_compr_calc_avail()
194 return stream->runtime->buffer_size; snd_compr_calc_avail()
197 stream->runtime->total_bytes_available, snd_compr_calc_avail()
198 stream->runtime->total_bytes_transferred); snd_compr_calc_avail()
199 if (stream->runtime->total_bytes_available == snd_compr_calc_avail()
200 stream->runtime->total_bytes_transferred) { snd_compr_calc_avail()
203 return stream->runtime->buffer_size; snd_compr_calc_avail()
210 avail->avail = stream->runtime->total_bytes_available - snd_compr_calc_avail()
211 stream->runtime->total_bytes_transferred; snd_compr_calc_avail()
213 avail->avail = stream->runtime->buffer_size - avail->avail; snd_compr_calc_avail()
246 struct snd_compr_runtime *runtime = stream->runtime; snd_compr_write_data() local
248 u64 app_pointer = div64_u64(runtime->total_bytes_available, snd_compr_write_data()
249 runtime->buffer_size); snd_compr_write_data()
250 app_pointer = runtime->total_bytes_available - snd_compr_write_data()
251 (app_pointer * runtime->buffer_size); snd_compr_write_data()
253 dstn = runtime->buffer + app_pointer; snd_compr_write_data()
256 if (count < runtime->buffer_size - app_pointer) { snd_compr_write_data()
260 copy = runtime->buffer_size - app_pointer; snd_compr_write_data()
263 if (copy_from_user(runtime->buffer, buf + copy, count - copy)) snd_compr_write_data()
286 if (stream->runtime->state != SNDRV_PCM_STATE_SETUP && snd_compr_write()
287 stream->runtime->state != SNDRV_PCM_STATE_RUNNING) { snd_compr_write()
305 stream->runtime->total_bytes_available += retval; snd_compr_write()
309 if (stream->runtime->state == SNDRV_PCM_STATE_SETUP) { snd_compr_write()
310 stream->runtime->state = SNDRV_PCM_STATE_PREPARED; snd_compr_write()
337 switch (stream->runtime->state) { snd_compr_read()
360 stream->runtime->total_bytes_transferred += retval; snd_compr_read()
394 if (stream->runtime->state == SNDRV_PCM_STATE_OPEN) { snd_compr_poll()
398 poll_wait(f, &stream->runtime->sleep, wait); snd_compr_poll()
403 switch (stream->runtime->state) { snd_compr_poll()
409 stream->runtime->state = SNDRV_PCM_STATE_SETUP; snd_compr_poll()
414 if (avail >= stream->runtime->fragment_size) snd_compr_poll()
492 stream->runtime->fragment_size = params->buffer.fragment_size; snd_compr_allocate_buffer()
493 stream->runtime->fragments = params->buffer.fragments; snd_compr_allocate_buffer()
494 stream->runtime->buffer = buffer; snd_compr_allocate_buffer()
495 stream->runtime->buffer_size = buffer_size; snd_compr_allocate_buffer()
522 if (stream->runtime->state == SNDRV_PCM_STATE_OPEN) { snd_compr_set_params()
553 stream->runtime->state = SNDRV_PCM_STATE_SETUP; snd_compr_set_params()
555 stream->runtime->state = SNDRV_PCM_STATE_PREPARED; snd_compr_set_params()
647 if (stream->runtime->state != SNDRV_PCM_STATE_RUNNING) snd_compr_pause()
651 stream->runtime->state = SNDRV_PCM_STATE_PAUSED; snd_compr_pause()
659 if (stream->runtime->state != SNDRV_PCM_STATE_PAUSED) snd_compr_resume()
663 stream->runtime->state = SNDRV_PCM_STATE_RUNNING; snd_compr_resume()
671 if (stream->runtime->state != SNDRV_PCM_STATE_PREPARED) snd_compr_start()
675 stream->runtime->state = SNDRV_PCM_STATE_RUNNING; snd_compr_start()
683 if (stream->runtime->state == SNDRV_PCM_STATE_PREPARED || snd_compr_stop()
684 stream->runtime->state == SNDRV_PCM_STATE_SETUP) snd_compr_stop()
689 stream->runtime->total_bytes_available = 0; snd_compr_stop()
690 stream->runtime->total_bytes_transferred = 0; snd_compr_stop()
707 stream->runtime->state = SNDRV_PCM_STATE_DRAINING; snd_compress_wait_for_drain()
716 ret = wait_event_interruptible(stream->runtime->sleep, snd_compress_wait_for_drain()
717 (stream->runtime->state != SNDRV_PCM_STATE_DRAINING)); snd_compress_wait_for_drain()
724 wake_up(&stream->runtime->sleep); snd_compress_wait_for_drain()
734 if (stream->runtime->state == SNDRV_PCM_STATE_PREPARED || snd_compr_drain()
735 stream->runtime->state == SNDRV_PCM_STATE_SETUP) snd_compr_drain()
741 wake_up(&stream->runtime->sleep); snd_compr_drain()
753 if (stream->runtime->state != SNDRV_PCM_STATE_RUNNING) snd_compr_next_track()
773 if (stream->runtime->state == SNDRV_PCM_STATE_PREPARED || snd_compr_partial_drain()
774 stream->runtime->state == SNDRV_PCM_STATE_SETUP) snd_compr_partial_drain()
783 wake_up(&stream->runtime->sleep); snd_compr_partial_drain()
H A Dpcm_trace.h32 __entry->period_size = (substream)->runtime->period_size;
33 __entry->buffer_size = (substream)->runtime->buffer_size;
34 __entry->old_hw_ptr = (substream)->runtime->status->hw_ptr;
35 __entry->hw_ptr_base = (substream)->runtime->hw_ptr_base;
67 __entry->period_size = (substream)->runtime->period_size;
68 __entry->buffer_size = (substream)->runtime->buffer_size;
69 __entry->old_hw_ptr = (substream)->runtime->status->hw_ptr;
70 __entry->hw_ptr_base = (substream)->runtime->hw_ptr_base;
H A Dpcm_memory.c164 if (substream->runtime) { snd_pcm_lib_preallocate_proc_write()
334 struct snd_pcm_runtime *runtime; snd_pcm_lib_malloc_pages() local
342 runtime = substream->runtime; snd_pcm_lib_malloc_pages()
344 if (runtime->dma_buffer_p) { snd_pcm_lib_malloc_pages()
348 if (runtime->dma_buffer_p->bytes >= size) { snd_pcm_lib_malloc_pages()
349 runtime->dma_bytes = size; snd_pcm_lib_malloc_pages()
370 runtime->dma_bytes = size; snd_pcm_lib_malloc_pages()
386 struct snd_pcm_runtime *runtime; snd_pcm_lib_free_pages() local
390 runtime = substream->runtime; snd_pcm_lib_free_pages()
391 if (runtime->dma_area == NULL) snd_pcm_lib_free_pages()
393 if (runtime->dma_buffer_p != &substream->dma_buffer) { snd_pcm_lib_free_pages()
395 snd_dma_free_pages(runtime->dma_buffer_p); snd_pcm_lib_free_pages()
396 kfree(runtime->dma_buffer_p); snd_pcm_lib_free_pages()
407 struct snd_pcm_runtime *runtime; _snd_pcm_lib_alloc_vmalloc_buffer() local
411 runtime = substream->runtime; _snd_pcm_lib_alloc_vmalloc_buffer()
412 if (runtime->dma_area) { _snd_pcm_lib_alloc_vmalloc_buffer()
413 if (runtime->dma_bytes >= size) _snd_pcm_lib_alloc_vmalloc_buffer()
415 vfree(runtime->dma_area); _snd_pcm_lib_alloc_vmalloc_buffer()
417 runtime->dma_area = __vmalloc(size, gfp_flags, PAGE_KERNEL); _snd_pcm_lib_alloc_vmalloc_buffer()
418 if (!runtime->dma_area) _snd_pcm_lib_alloc_vmalloc_buffer()
420 runtime->dma_bytes = size; _snd_pcm_lib_alloc_vmalloc_buffer()
434 struct snd_pcm_runtime *runtime; snd_pcm_lib_free_vmalloc_buffer() local
438 runtime = substream->runtime; snd_pcm_lib_free_vmalloc_buffer()
439 vfree(runtime->dma_area); snd_pcm_lib_free_vmalloc_buffer()
440 runtime->dma_area = NULL; snd_pcm_lib_free_vmalloc_buffer()
458 return vmalloc_to_page(substream->runtime->dma_area + offset); snd_pcm_lib_get_vmalloc_page()
H A Dpcm_compat.c110 static snd_pcm_uframes_t recalculate_boundary(struct snd_pcm_runtime *runtime) recalculate_boundary() argument
114 if (! runtime->buffer_size) recalculate_boundary()
116 boundary = runtime->buffer_size; recalculate_boundary()
117 while (boundary * 2 <= 0x7fffffffUL - runtime->buffer_size) recalculate_boundary()
146 boundary = recalculate_boundary(substream->runtime); snd_pcm_ioctl_sw_params_compat()
148 params.silence_size = substream->runtime->boundary; snd_pcm_ioctl_sw_params_compat()
325 struct snd_pcm_runtime *runtime; snd_pcm_ioctl_hw_params_compat() local
328 if (! (runtime = substream->runtime)) snd_pcm_ioctl_hw_params_compat()
354 unsigned int new_boundary = recalculate_boundary(runtime); snd_pcm_ioctl_hw_params_compat()
356 runtime->boundary = new_boundary; snd_pcm_ioctl_hw_params_compat()
379 if (! substream->runtime) snd_pcm_ioctl_xferi_compat()
383 if (substream->runtime->status->state == SNDRV_PCM_STATE_OPEN) snd_pcm_ioctl_xferi_compat()
425 if (! substream->runtime) snd_pcm_ioctl_xfern_compat()
430 if ((ch = substream->runtime->channels) > 128) snd_pcm_ioctl_xfern_compat()
490 struct snd_pcm_runtime *runtime = substream->runtime; snd_pcm_ioctl_sync_ptr_compat() local
499 if (snd_BUG_ON(!runtime)) snd_pcm_ioctl_sync_ptr_compat()
511 status = runtime->status; snd_pcm_ioctl_sync_ptr_compat()
512 control = runtime->control; snd_pcm_ioctl_sync_ptr_compat()
513 boundary = recalculate_boundary(runtime); snd_pcm_ioctl_sync_ptr_compat()
578 struct snd_pcm_runtime *runtime = substream->runtime; snd_pcm_ioctl_sync_ptr_x32() local
587 if (snd_BUG_ON(!runtime)) snd_pcm_ioctl_sync_ptr_x32()
599 status = runtime->status; snd_pcm_ioctl_sync_ptr_x32()
600 control = runtime->control; snd_pcm_ioctl_sync_ptr_x32()
601 boundary = recalculate_boundary(runtime); snd_pcm_ioctl_sync_ptr_x32()
H A Dpcm_dmaengine.c41 return substream->runtime->private_data; substream_to_prtd()
155 if (!substream->runtime->no_period_wakeup) dmaengine_pcm_prepare_and_submit()
160 substream->runtime->dma_addr, dmaengine_pcm_prepare_and_submit()
187 struct snd_pcm_runtime *runtime = substream->runtime; snd_dmaengine_pcm_trigger() local
202 if (runtime->info & SNDRV_PCM_INFO_PAUSE) snd_dmaengine_pcm_trigger()
231 return bytes_to_frames(substream->runtime, prtd->pos); snd_dmaengine_pcm_pointer_no_residue()
257 return bytes_to_frames(substream->runtime, pos); snd_dmaengine_pcm_pointer()
291 * this function will use private_data field of the substream's runtime. So it
303 ret = snd_pcm_hw_constraint_integer(substream->runtime, snd_dmaengine_pcm_open()
314 substream->runtime->private_data = prtd; snd_dmaengine_pcm_open()
330 * that this function will use private_data field of the substream's runtime. So
H A Dpcm_misc.c467 * @runtime: the runtime instance
470 * the given runtime->hw.
474 int snd_pcm_limit_hw_rates(struct snd_pcm_runtime *runtime) snd_pcm_limit_hw_rates() argument
478 if (runtime->hw.rates & (1 << i)) { snd_pcm_limit_hw_rates()
479 runtime->hw.rate_min = snd_pcm_known_rates.list[i]; snd_pcm_limit_hw_rates()
484 if (runtime->hw.rates & (1 << i)) { snd_pcm_limit_hw_rates()
485 runtime->hw.rate_max = snd_pcm_known_rates.list[i]; snd_pcm_limit_hw_rates()
/linux-4.1.27/sound/pci/ctxfi/
H A Dctpcm.c107 static void ct_atc_pcm_free_substream(struct snd_pcm_runtime *runtime) ct_atc_pcm_free_substream() argument
109 struct ct_atc_pcm *apcm = runtime->private_data; ct_atc_pcm_free_substream()
115 runtime->private_data = NULL; ct_atc_pcm_free_substream()
122 struct snd_pcm_runtime *runtime = substream->runtime; ct_pcm_playback_open() local
133 runtime->hw = ct_spdif_passthru_playback_hw; ct_pcm_playback_open()
136 runtime->hw = ct_pcm_playback_hw; ct_pcm_playback_open()
138 runtime->hw.channels_max = 8; ct_pcm_playback_open()
141 err = snd_pcm_hw_constraint_integer(runtime, ct_pcm_playback_open()
147 err = snd_pcm_hw_constraint_minmax(runtime, ct_pcm_playback_open()
160 runtime->private_data = apcm; ct_pcm_playback_open()
161 runtime->private_free = ct_atc_pcm_free_substream; ct_pcm_playback_open()
174 /* The ct_atc_pcm object will be freed by runtime->private_free */ ct_pcm_playback_close()
183 struct ct_atc_pcm *apcm = substream->runtime->private_data; ct_pcm_hw_params()
198 struct ct_atc_pcm *apcm = substream->runtime->private_data; ct_pcm_hw_free()
211 struct snd_pcm_runtime *runtime = substream->runtime; ct_pcm_playback_prepare() local
212 struct ct_atc_pcm *apcm = runtime->private_data; ct_pcm_playback_prepare()
232 struct snd_pcm_runtime *runtime = substream->runtime; ct_pcm_playback_trigger() local
233 struct ct_atc_pcm *apcm = runtime->private_data; ct_pcm_playback_trigger()
258 struct snd_pcm_runtime *runtime = substream->runtime; ct_pcm_playback_pointer() local
259 struct ct_atc_pcm *apcm = runtime->private_data; ct_pcm_playback_pointer()
263 position = bytes_to_frames(runtime, position); ct_pcm_playback_pointer()
264 if (position >= runtime->buffer_size) ct_pcm_playback_pointer()
273 struct snd_pcm_runtime *runtime = substream->runtime; ct_pcm_capture_open() local
284 runtime->hw = ct_pcm_capture_hw; ct_pcm_capture_open()
285 runtime->hw.rate_max = atc->rsr * atc->msr; ct_pcm_capture_open()
287 err = snd_pcm_hw_constraint_integer(runtime, ct_pcm_capture_open()
293 err = snd_pcm_hw_constraint_minmax(runtime, ct_pcm_capture_open()
306 runtime->private_data = apcm; ct_pcm_capture_open()
307 runtime->private_free = ct_atc_pcm_free_substream; ct_pcm_capture_open()
314 /* The ct_atc_pcm object will be freed by runtime->private_free */ ct_pcm_capture_close()
323 struct snd_pcm_runtime *runtime = substream->runtime; ct_pcm_capture_prepare() local
324 struct ct_atc_pcm *apcm = runtime->private_data; ct_pcm_capture_prepare()
340 struct snd_pcm_runtime *runtime = substream->runtime; ct_pcm_capture_trigger() local
341 struct ct_atc_pcm *apcm = runtime->private_data; ct_pcm_capture_trigger()
363 struct snd_pcm_runtime *runtime = substream->runtime; ct_pcm_capture_pointer() local
364 struct ct_atc_pcm *apcm = runtime->private_data; ct_pcm_capture_pointer()
368 position = bytes_to_frames(runtime, position); ct_pcm_capture_pointer()
369 if (position >= runtime->buffer_size) ct_pcm_capture_pointer()
H A Dcttimer.c70 struct snd_pcm_runtime *runtime = substream->runtime; ct_systimer_callback() local
72 unsigned int period_size = runtime->period_size; ct_systimer_callback()
73 unsigned int buffer_size = runtime->buffer_size; ct_systimer_callback()
87 * HZ + (runtime->rate - 1)) / runtime->rate + HZ * 5 / 1000; ct_systimer_callback()
102 struct snd_pcm_runtime *runtime = ti->substream->runtime; ct_systimer_start() local
108 jiffies + (runtime->period_size * HZ + ct_systimer_start()
109 (runtime->rate - 1)) / runtime->rate); ct_systimer_start()
206 period_size = ti->substream->runtime->period_size; ct_xfitimer_reprogram()
207 rate = ti->substream->runtime->rate; ct_xfitimer_reprogram()
269 ti->frag_count = ti->substream->runtime->period_size; ct_xfitimer_prepare()
H A Dctatc.c138 struct snd_pcm_runtime *runtime; ct_map_audio_buffer() local
144 runtime = apcm->substream->runtime; ct_map_audio_buffer()
147 apcm->vm_block = vm->map(vm, apcm->substream, runtime->dma_bytes); ct_map_audio_buffer()
252 int n_amixer = apcm->substream->runtime->channels, i = 0; atc_pcm_playback_prepare()
260 desc.multi = apcm->substream->runtime->channels; atc_pcm_playback_prepare()
267 pitch = atc_get_pitch(apcm->substream->runtime->rate, atc_pcm_playback_prepare()
272 src->ops->set_sf(src, convert_format(apcm->substream->runtime->format, atc_pcm_playback_prepare()
469 apcm->substream->runtime->rate); setup_src_node_conf()
473 *n_srcc = apcm->substream->runtime->channels; setup_src_node_conf()
486 apcm->substream->runtime->rate); setup_src_node_conf()
489 *n_srcc = apcm->substream->runtime->channels * 2; setup_src_node_conf()
497 *n_srcc = apcm->substream->runtime->channels; setup_src_node_conf()
526 multi = apcm->substream->runtime->channels; atc_pcm_capture_get_resources()
530 apcm->substream->runtime->rate); atc_pcm_capture_get_resources()
606 apcm->substream->runtime->rate); atc_pcm_capture_get_resources()
625 src_dsc.multi = apcm->substream->runtime->channels; atc_pcm_capture_get_resources()
670 multi = apcm->substream->runtime->channels; atc_pcm_capture_prepare()
693 apcm->substream->runtime->rate); atc_pcm_capture_prepare()
735 multi = apcm->substream->runtime->channels; atc_pcm_capture_start()
745 src->ops->set_sf(src, convert_format(apcm->substream->runtime->format, atc_pcm_capture_start()
794 int n_amixer = apcm->substream->runtime->channels, i; spdif_passthru_playback_get_resources()
801 desc.multi = apcm->substream->runtime->channels; spdif_passthru_playback_get_resources()
803 while (apcm->substream->runtime->rate > (rsr * desc.msr)) spdif_passthru_playback_get_resources()
811 pitch = atc_get_pitch(apcm->substream->runtime->rate, (rsr * desc.msr)); spdif_passthru_playback_get_resources()
815 src->ops->set_sf(src, convert_format(apcm->substream->runtime->format, spdif_passthru_playback_get_resources()
862 unsigned int rate = apcm->substream->runtime->rate; spdif_passthru_playback_setup()
/linux-4.1.27/sound/soc/blackfin/
H A Dbf5xx-i2s-pcm.c88 struct snd_pcm_runtime *runtime = substream->runtime; bf5xx_pcm_prepare() local
89 struct sport_device *sport = runtime->private_data; bf5xx_pcm_prepare()
90 int period_bytes = frames_to_bytes(runtime, runtime->period_size); bf5xx_pcm_prepare()
96 period_bytes = period_bytes / runtime->channels * 8; bf5xx_pcm_prepare()
101 sport_config_tx_dma(sport, runtime->dma_area, bf5xx_pcm_prepare()
102 runtime->periods, period_bytes); bf5xx_pcm_prepare()
105 sport_config_rx_dma(sport, runtime->dma_area, bf5xx_pcm_prepare()
106 runtime->periods, period_bytes); bf5xx_pcm_prepare()
114 struct snd_pcm_runtime *runtime = substream->runtime; bf5xx_pcm_trigger() local
115 struct sport_device *sport = runtime->private_data; bf5xx_pcm_trigger()
144 struct snd_pcm_runtime *runtime = substream->runtime; bf5xx_pcm_pointer() local
145 struct sport_device *sport = runtime->private_data; bf5xx_pcm_pointer()
167 frames = bytes_to_frames(substream->runtime, diff); bf5xx_pcm_pointer()
169 frames = frames * runtime->channels / 8; bf5xx_pcm_pointer()
179 struct snd_pcm_runtime *runtime = substream->runtime; bf5xx_pcm_open() local
190 runtime->hw.buffer_bytes_max /= 4; bf5xx_pcm_open()
192 runtime->hw.info |= SNDRV_PCM_INFO_MMAP; bf5xx_pcm_open()
194 ret = snd_pcm_hw_constraint_integer(runtime, bf5xx_pcm_open()
205 runtime->private_data = sport_handle; bf5xx_pcm_open()
219 struct snd_pcm_runtime *runtime = substream->runtime; bf5xx_pcm_mmap() local
221 vma->vm_start = (unsigned long)runtime->dma_area; bf5xx_pcm_mmap()
232 struct snd_pcm_runtime *runtime = substream->runtime; bf5xx_pcm_copy() local
233 unsigned int sample_size = runtime->sample_bits / 8; bf5xx_pcm_copy()
243 dst = runtime->dma_area; bf5xx_pcm_copy()
247 for (i = 0; i < runtime->channels; i++) { bf5xx_pcm_copy()
255 src = runtime->dma_area; bf5xx_pcm_copy()
260 for (i = 0; i < runtime->channels; i++) { bf5xx_pcm_copy()
271 dst = runtime->dma_area; bf5xx_pcm_copy()
272 dst += frames_to_bytes(runtime, pos); bf5xx_pcm_copy()
274 src = runtime->dma_area; bf5xx_pcm_copy()
275 src += frames_to_bytes(runtime, pos); bf5xx_pcm_copy()
279 memcpy(dst, src, frames_to_bytes(runtime, count)); bf5xx_pcm_copy()
289 struct snd_pcm_runtime *runtime = substream->runtime; bf5xx_pcm_silence() local
290 unsigned int sample_size = runtime->sample_bits / 8; bf5xx_pcm_silence()
291 void *buf = runtime->dma_area; bf5xx_pcm_silence()
301 offset = frames_to_bytes(runtime, pos); bf5xx_pcm_silence()
302 samples = count * runtime->channels; bf5xx_pcm_silence()
305 snd_pcm_format_set_silence(runtime->format, buf + offset, samples); bf5xx_pcm_silence()
H A Dbf5xx-ac97-pcm.c58 struct snd_pcm_runtime *runtime = substream->runtime; bf5xx_mmap_copy() local
59 struct sport_device *sport = runtime->private_data; bf5xx_mmap_copy()
60 unsigned int chan_mask = ac97_chan_mask[runtime->channels - 1]; bf5xx_mmap_copy()
63 sport->tx_pos, (__u16 *)runtime->dma_area + sport->tx_pos * bf5xx_mmap_copy()
64 runtime->channels, count, chan_mask); bf5xx_mmap_copy()
65 sport->tx_pos += runtime->period_size; bf5xx_mmap_copy()
66 if (sport->tx_pos >= runtime->buffer_size) bf5xx_mmap_copy()
67 sport->tx_pos %= runtime->buffer_size; bf5xx_mmap_copy()
71 sport->rx_pos, (__u16 *)runtime->dma_area + sport->rx_pos * bf5xx_mmap_copy()
72 runtime->channels, count); bf5xx_mmap_copy()
73 sport->rx_pos += runtime->period_size; bf5xx_mmap_copy()
74 if (sport->rx_pos >= runtime->buffer_size) bf5xx_mmap_copy()
75 sport->rx_pos %= runtime->buffer_size; bf5xx_mmap_copy()
84 struct snd_pcm_runtime *runtime = pcm->runtime; bf5xx_dma_irq() local
85 struct sport_device *sport = runtime->private_data; bf5xx_dma_irq()
86 bf5xx_mmap_copy(pcm, runtime->period_size); bf5xx_dma_irq()
90 bf5xx_mmap_copy(pcm, runtime->period_size); bf5xx_dma_irq()
132 struct snd_pcm_runtime *runtime = substream->runtime; bf5xx_pcm_hw_free() local
133 struct sport_device *sport = runtime->private_data; bf5xx_pcm_hw_free()
137 if (runtime->dma_area) bf5xx_pcm_hw_free()
138 memset(runtime->dma_area, 0, runtime->buffer_size); bf5xx_pcm_hw_free()
139 memset(sport->tx_dma_buf, 0, runtime->buffer_size * bf5xx_pcm_hw_free()
142 memset(sport->rx_dma_buf, 0, runtime->buffer_size * bf5xx_pcm_hw_free()
151 struct snd_pcm_runtime *runtime = substream->runtime; bf5xx_pcm_prepare() local
152 struct sport_device *sport = runtime->private_data; bf5xx_pcm_prepare()
160 sport_config_tx_dma(sport, sport->tx_dma_buf, runtime->periods, bf5xx_pcm_prepare()
161 runtime->period_size * sizeof(struct ac97_frame)); bf5xx_pcm_prepare()
164 sport_config_rx_dma(sport, sport->rx_dma_buf, runtime->periods, bf5xx_pcm_prepare()
165 runtime->period_size * sizeof(struct ac97_frame)); bf5xx_pcm_prepare()
170 sport_config_tx_dma(sport, runtime->dma_area, runtime->periods, bf5xx_pcm_prepare()
171 runtime->period_size * sizeof(struct ac97_frame)); bf5xx_pcm_prepare()
174 sport_config_rx_dma(sport, runtime->dma_area, runtime->periods, bf5xx_pcm_prepare()
175 runtime->period_size * sizeof(struct ac97_frame)); bf5xx_pcm_prepare()
183 struct snd_pcm_runtime *runtime = substream->runtime; bf5xx_pcm_trigger() local
184 struct sport_device *sport = runtime->private_data; bf5xx_pcm_trigger()
192 bf5xx_mmap_copy(substream, runtime->period_size); bf5xx_pcm_trigger()
222 struct snd_pcm_runtime *runtime = substream->runtime; bf5xx_pcm_pointer() local
223 struct sport_device *sport = runtime->private_data; bf5xx_pcm_pointer()
247 struct snd_pcm_runtime *runtime = substream->runtime; bf5xx_pcm_open() local
253 ret = snd_pcm_hw_constraint_integer(runtime, bf5xx_pcm_open()
259 runtime->private_data = sport_handle; bf5xx_pcm_open()
274 struct snd_pcm_runtime *runtime = substream->runtime; bf5xx_pcm_mmap() local
276 vma->vm_start = (unsigned long)runtime->dma_area; bf5xx_pcm_mmap()
286 struct snd_pcm_runtime *runtime = substream->runtime; bf5xx_pcm_copy() local
287 unsigned int chan_mask = ac97_chan_mask[runtime->channels - 1]; bf5xx_pcm_copy()
292 bf5xx_pcm_to_ac97((struct ac97_frame *)runtime->dma_area + pos, bf5xx_pcm_copy()
295 bf5xx_ac97_to_pcm((struct ac97_frame *)runtime->dma_area + pos, bf5xx_pcm_copy()
/linux-4.1.27/sound/core/oss/
H A Dpcm_oss.c567 struct snd_pcm_runtime *runtime = substream->runtime; snd_pcm_oss_plugin_clear() local
570 plugin = runtime->oss.plugin_first; snd_pcm_oss_plugin_clear()
576 runtime->oss.plugin_first = runtime->oss.plugin_last = NULL; snd_pcm_oss_plugin_clear()
582 struct snd_pcm_runtime *runtime = plugin->plug->runtime; snd_pcm_plugin_insert() local
583 plugin->next = runtime->oss.plugin_first; snd_pcm_plugin_insert()
585 if (runtime->oss.plugin_first) { snd_pcm_plugin_insert()
586 runtime->oss.plugin_first->prev = plugin; snd_pcm_plugin_insert()
587 runtime->oss.plugin_first = plugin; snd_pcm_plugin_insert()
589 runtime->oss.plugin_last = snd_pcm_plugin_insert()
590 runtime->oss.plugin_first = plugin; snd_pcm_plugin_insert()
597 struct snd_pcm_runtime *runtime = plugin->plug->runtime; snd_pcm_plugin_append() local
599 plugin->prev = runtime->oss.plugin_last; snd_pcm_plugin_append()
600 if (runtime->oss.plugin_last) { snd_pcm_plugin_append()
601 runtime->oss.plugin_last->next = plugin; snd_pcm_plugin_append()
602 runtime->oss.plugin_last = plugin; snd_pcm_plugin_append()
604 runtime->oss.plugin_last = snd_pcm_plugin_append()
605 runtime->oss.plugin_first = plugin; snd_pcm_plugin_append()
613 struct snd_pcm_runtime *runtime = substream->runtime; snd_pcm_oss_bytes() local
615 long bytes = frames_to_bytes(runtime, frames); snd_pcm_oss_bytes()
616 if (buffer_size == runtime->oss.buffer_bytes) snd_pcm_oss_bytes()
619 return runtime->oss.buffer_bytes * bytes / buffer_size; snd_pcm_oss_bytes()
622 u64 bsize = (u64)runtime->oss.buffer_bytes * (u64)bytes; snd_pcm_oss_bytes()
630 struct snd_pcm_runtime *runtime = substream->runtime; snd_pcm_alsa_frames() local
632 if (buffer_size == runtime->oss.buffer_bytes) snd_pcm_alsa_frames()
633 return bytes_to_frames(runtime, bytes); snd_pcm_alsa_frames()
634 return bytes_to_frames(runtime, (buffer_size * bytes) / runtime->oss.buffer_bytes); snd_pcm_alsa_frames()
638 snd_pcm_uframes_t get_hw_ptr_period(struct snd_pcm_runtime *runtime) get_hw_ptr_period() argument
640 return runtime->hw_ptr_interrupt; get_hw_ptr_period()
714 struct snd_pcm_runtime *runtime = substream->runtime; snd_pcm_oss_period_size() local
724 if (oss_buffer_size > runtime->oss.mmap_bytes) snd_pcm_oss_period_size()
725 oss_buffer_size = runtime->oss.mmap_bytes; snd_pcm_oss_period_size()
730 else if (runtime->oss.fragshift) { snd_pcm_oss_period_size()
731 oss_period_size = 1 << runtime->oss.fragshift; snd_pcm_oss_period_size()
742 if (runtime->oss.subdivision == 0) { snd_pcm_oss_period_size()
749 sd = runtime->oss.subdivision; snd_pcm_oss_period_size()
775 if (runtime->oss.maxfrags && s > runtime->oss.maxfrags) snd_pcm_oss_period_size()
776 s = runtime->oss.maxfrags; snd_pcm_oss_period_size()
791 runtime->oss.period_bytes = oss_period_size; snd_pcm_oss_period_size()
792 runtime->oss.period_frames = 1; snd_pcm_oss_period_size()
793 runtime->oss.periods = oss_periods; snd_pcm_oss_period_size()
840 struct snd_pcm_runtime *runtime = substream->runtime; snd_pcm_oss_change_params() local
853 if (!(mutex_trylock(&runtime->oss.params_lock))) snd_pcm_oss_change_params()
855 } else if (mutex_lock_interruptible(&runtime->oss.params_lock)) snd_pcm_oss_change_params()
887 choose_rate(substream, sparams, runtime->oss.rate); snd_pcm_oss_change_params()
888 snd_pcm_hw_param_near(substream, sparams, SNDRV_PCM_HW_PARAM_CHANNELS, runtime->oss.channels, NULL); snd_pcm_oss_change_params()
890 format = snd_pcm_oss_format_from(runtime->oss.format); snd_pcm_oss_change_params()
924 (__force int)snd_pcm_oss_format_from(runtime->oss.format), 0); snd_pcm_oss_change_params()
926 runtime->oss.channels, 0); snd_pcm_oss_change_params()
928 runtime->oss.rate, 0); snd_pcm_oss_change_params()
953 if (runtime->oss.plugin_first) { snd_pcm_oss_change_params()
978 n = snd_pcm_plug_slave_size(substream, runtime->oss.period_bytes / oss_frame_size); snd_pcm_oss_change_params()
984 runtime->oss.periods, NULL); snd_pcm_oss_change_params()
996 if (runtime->oss.trigger) { snd_pcm_oss_change_params()
999 sw_params->start_threshold = runtime->boundary; snd_pcm_oss_change_params()
1003 sw_params->stop_threshold = runtime->boundary; snd_pcm_oss_change_params()
1005 sw_params->stop_threshold = runtime->buffer_size; snd_pcm_oss_change_params()
1009 1 : runtime->period_size; snd_pcm_oss_change_params()
1016 frames = runtime->period_size + 16; snd_pcm_oss_change_params()
1017 if (frames > runtime->buffer_size) snd_pcm_oss_change_params()
1018 frames = runtime->buffer_size; snd_pcm_oss_change_params()
1028 runtime->oss.periods = params_periods(sparams); snd_pcm_oss_change_params()
1035 if (runtime->oss.plugin_first) { snd_pcm_oss_change_params()
1043 oss_buffer_size = oss_period_size * runtime->oss.periods; snd_pcm_oss_change_params()
1049 runtime->oss.period_bytes = oss_period_size; snd_pcm_oss_change_params()
1050 runtime->oss.buffer_bytes = oss_buffer_size; snd_pcm_oss_change_params()
1053 runtime->oss.period_bytes, snd_pcm_oss_change_params()
1054 runtime->oss.buffer_bytes); snd_pcm_oss_change_params()
1059 runtime->oss.format = snd_pcm_oss_format_to(params_format(params)); snd_pcm_oss_change_params()
1060 runtime->oss.channels = params_channels(params); snd_pcm_oss_change_params()
1061 runtime->oss.rate = params_rate(params); snd_pcm_oss_change_params()
1063 vfree(runtime->oss.buffer); snd_pcm_oss_change_params()
1064 runtime->oss.buffer = vmalloc(runtime->oss.period_bytes); snd_pcm_oss_change_params()
1065 if (!runtime->oss.buffer) { snd_pcm_oss_change_params()
1070 runtime->oss.params = 0; snd_pcm_oss_change_params()
1071 runtime->oss.prepare = 1; snd_pcm_oss_change_params()
1072 runtime->oss.buffer_used = 0; snd_pcm_oss_change_params()
1073 if (runtime->dma_area) snd_pcm_oss_change_params()
1074 snd_pcm_format_set_silence(runtime->format, runtime->dma_area, bytes_to_samples(runtime, runtime->dma_bytes)); snd_pcm_oss_change_params()
1076 runtime->oss.period_frames = snd_pcm_alsa_frames(substream, oss_period_size); snd_pcm_oss_change_params()
1083 mutex_unlock(&runtime->oss.params_lock); snd_pcm_oss_change_params()
1098 if (substream->runtime->oss.params) { snd_pcm_oss_get_active_substream()
1114 struct snd_pcm_runtime *runtime = substream->runtime; snd_pcm_oss_prepare() local
1122 runtime->oss.prepare = 0; snd_pcm_oss_prepare()
1123 runtime->oss.prev_hw_ptr_period = 0; snd_pcm_oss_prepare()
1124 runtime->oss.period_ptr = 0; snd_pcm_oss_prepare()
1125 runtime->oss.buffer_used = 0; snd_pcm_oss_prepare()
1132 struct snd_pcm_runtime *runtime; snd_pcm_oss_make_ready() local
1137 runtime = substream->runtime; snd_pcm_oss_make_ready()
1138 if (runtime->oss.params) { snd_pcm_oss_make_ready()
1143 if (runtime->oss.prepare) { snd_pcm_oss_make_ready()
1153 struct snd_pcm_runtime *runtime; snd_pcm_oss_capture_position_fixup() local
1161 runtime = substream->runtime; snd_pcm_oss_capture_position_fixup()
1162 if (*delay <= (snd_pcm_sframes_t)runtime->buffer_size) snd_pcm_oss_capture_position_fixup()
1166 frames = (*delay - runtime->buffer_size) + runtime->period_size - 1; snd_pcm_oss_capture_position_fixup()
1167 frames /= runtime->period_size; snd_pcm_oss_capture_position_fixup()
1168 frames *= runtime->period_size; snd_pcm_oss_capture_position_fixup()
1178 struct snd_pcm_runtime *runtime = substream->runtime; snd_pcm_oss_write3() local
1181 if (runtime->status->state == SNDRV_PCM_STATE_XRUN || snd_pcm_oss_write3()
1182 runtime->status->state == SNDRV_PCM_STATE_SUSPENDED) { snd_pcm_oss_write3()
1186 runtime->status->state == SNDRV_PCM_STATE_XRUN ? snd_pcm_oss_write3()
1205 if (runtime->status->state == SNDRV_PCM_STATE_PREPARED) snd_pcm_oss_write3()
1213 struct snd_pcm_runtime *runtime = substream->runtime; snd_pcm_oss_read3() local
1217 if (runtime->status->state == SNDRV_PCM_STATE_XRUN || snd_pcm_oss_read3()
1218 runtime->status->state == SNDRV_PCM_STATE_SUSPENDED) { snd_pcm_oss_read3()
1222 runtime->status->state == SNDRV_PCM_STATE_XRUN ? snd_pcm_oss_read3()
1228 } else if (runtime->status->state == SNDRV_PCM_STATE_SETUP) { snd_pcm_oss_read3()
1245 if (runtime->status->state == SNDRV_PCM_STATE_DRAINING) { snd_pcm_oss_read3()
1260 struct snd_pcm_runtime *runtime = substream->runtime; snd_pcm_oss_writev3() local
1263 if (runtime->status->state == SNDRV_PCM_STATE_XRUN || snd_pcm_oss_writev3()
1264 runtime->status->state == SNDRV_PCM_STATE_SUSPENDED) { snd_pcm_oss_writev3()
1268 runtime->status->state == SNDRV_PCM_STATE_XRUN ? snd_pcm_oss_writev3()
1288 if (runtime->status->state == SNDRV_PCM_STATE_PREPARED) snd_pcm_oss_writev3()
1296 struct snd_pcm_runtime *runtime = substream->runtime; snd_pcm_oss_readv3() local
1299 if (runtime->status->state == SNDRV_PCM_STATE_XRUN || snd_pcm_oss_readv3()
1300 runtime->status->state == SNDRV_PCM_STATE_SUSPENDED) { snd_pcm_oss_readv3()
1304 runtime->status->state == SNDRV_PCM_STATE_XRUN ? snd_pcm_oss_readv3()
1310 } else if (runtime->status->state == SNDRV_PCM_STATE_SETUP) { snd_pcm_oss_readv3()
1331 struct snd_pcm_runtime *runtime = substream->runtime; snd_pcm_oss_write2() local
1334 if (runtime->oss.plugin_first) { snd_pcm_oss_write2()
1336 size_t oss_frame_bytes = (runtime->oss.plugin_first->src_width * runtime->oss.plugin_first->src_format.channels) / 8; snd_pcm_oss_write2()
1338 if (copy_from_user(runtime->oss.buffer, (const char __force __user *)buf, bytes)) snd_pcm_oss_write2()
1340 buf = runtime->oss.buffer; snd_pcm_oss_write2()
1353 frames = bytes_to_frames(runtime, bytes); snd_pcm_oss_write2()
1357 bytes = frames_to_bytes(runtime, frames1); snd_pcm_oss_write2()
1366 struct snd_pcm_runtime *runtime = substream->runtime; snd_pcm_oss_write1() local
1373 mutex_lock(&runtime->oss.params_lock); snd_pcm_oss_write1()
1375 if (bytes < runtime->oss.period_bytes || runtime->oss.buffer_used > 0) { snd_pcm_oss_write1()
1377 if (tmp + runtime->oss.buffer_used > runtime->oss.period_bytes) snd_pcm_oss_write1()
1378 tmp = runtime->oss.period_bytes - runtime->oss.buffer_used; snd_pcm_oss_write1()
1380 if (copy_from_user(runtime->oss.buffer + runtime->oss.buffer_used, buf, tmp)) { snd_pcm_oss_write1()
1385 runtime->oss.buffer_used += tmp; snd_pcm_oss_write1()
1390 runtime->oss.buffer_used == runtime->oss.period_bytes) { snd_pcm_oss_write1()
1391 tmp = snd_pcm_oss_write2(substream, runtime->oss.buffer + runtime->oss.period_ptr, snd_pcm_oss_write1()
1392 runtime->oss.buffer_used - runtime->oss.period_ptr, 1); snd_pcm_oss_write1()
1395 runtime->oss.bytes += tmp; snd_pcm_oss_write1()
1396 runtime->oss.period_ptr += tmp; snd_pcm_oss_write1()
1397 runtime->oss.period_ptr %= runtime->oss.period_bytes; snd_pcm_oss_write1()
1398 if (runtime->oss.period_ptr == 0 || snd_pcm_oss_write1()
1399 runtime->oss.period_ptr == runtime->oss.buffer_used) snd_pcm_oss_write1()
1400 runtime->oss.buffer_used = 0; snd_pcm_oss_write1()
1409 runtime->oss.period_bytes, 0); snd_pcm_oss_write1()
1412 runtime->oss.bytes += tmp; snd_pcm_oss_write1()
1417 tmp != runtime->oss.period_bytes) snd_pcm_oss_write1()
1421 mutex_unlock(&runtime->oss.params_lock); snd_pcm_oss_write1()
1425 mutex_unlock(&runtime->oss.params_lock); snd_pcm_oss_write1()
1431 struct snd_pcm_runtime *runtime = substream->runtime; snd_pcm_oss_read2() local
1435 if (runtime->oss.plugin_first) { snd_pcm_oss_read2()
1437 size_t oss_frame_bytes = (runtime->oss.plugin_last->dst_width * runtime->oss.plugin_last->dst_format.channels) / 8; snd_pcm_oss_read2()
1439 buf = runtime->oss.buffer; snd_pcm_oss_read2()
1453 frames = bytes_to_frames(runtime, bytes); snd_pcm_oss_read2()
1457 bytes = frames_to_bytes(runtime, frames1); snd_pcm_oss_read2()
1466 struct snd_pcm_runtime *runtime = substream->runtime; snd_pcm_oss_read1() local
1473 mutex_lock(&runtime->oss.params_lock); snd_pcm_oss_read1()
1475 if (bytes < runtime->oss.period_bytes || runtime->oss.buffer_used > 0) { snd_pcm_oss_read1()
1476 if (runtime->oss.buffer_used == 0) { snd_pcm_oss_read1()
1477 tmp = snd_pcm_oss_read2(substream, runtime->oss.buffer, runtime->oss.period_bytes, 1); snd_pcm_oss_read1()
1480 runtime->oss.bytes += tmp; snd_pcm_oss_read1()
1481 runtime->oss.period_ptr = tmp; snd_pcm_oss_read1()
1482 runtime->oss.buffer_used = tmp; snd_pcm_oss_read1()
1485 if ((size_t) tmp > runtime->oss.buffer_used) snd_pcm_oss_read1()
1486 tmp = runtime->oss.buffer_used; snd_pcm_oss_read1()
1487 if (copy_to_user(buf, runtime->oss.buffer + (runtime->oss.period_ptr - runtime->oss.buffer_used), tmp)) { snd_pcm_oss_read1()
1494 runtime->oss.buffer_used -= tmp; snd_pcm_oss_read1()
1497 runtime->oss.period_bytes, 0); snd_pcm_oss_read1()
1500 runtime->oss.bytes += tmp; snd_pcm_oss_read1()
1506 mutex_unlock(&runtime->oss.params_lock); snd_pcm_oss_read1()
1510 mutex_unlock(&runtime->oss.params_lock); snd_pcm_oss_read1()
1517 struct snd_pcm_runtime *runtime; snd_pcm_oss_reset() local
1524 runtime = substream->runtime; snd_pcm_oss_reset()
1526 runtime->oss.prepare = 1; snd_pcm_oss_reset()
1527 runtime->oss.buffer_used = 0; snd_pcm_oss_reset()
1528 runtime->oss.prev_hw_ptr_period = 0; snd_pcm_oss_reset()
1529 runtime->oss.period_ptr = 0; snd_pcm_oss_reset()
1552 struct snd_pcm_runtime *runtime; snd_pcm_oss_sync1() local
1558 runtime = substream->runtime; snd_pcm_oss_sync1()
1560 add_wait_queue(&runtime->sleep, &wait); snd_pcm_oss_sync1()
1565 result = snd_pcm_oss_write2(substream, runtime->oss.buffer, size, 1); snd_pcm_oss_sync1()
1567 runtime->oss.buffer_used = 0; snd_pcm_oss_sync1()
1576 state = runtime->status->state; snd_pcm_oss_sync1()
1594 remove_wait_queue(&runtime->sleep, &wait); snd_pcm_oss_sync1()
1603 struct snd_pcm_runtime *runtime; snd_pcm_oss_sync() local
1610 runtime = substream->runtime; snd_pcm_oss_sync()
1615 format = snd_pcm_oss_format_from(runtime->oss.format); snd_pcm_oss_sync()
1617 mutex_lock(&runtime->oss.params_lock); snd_pcm_oss_sync()
1618 if (runtime->oss.buffer_used > 0) { snd_pcm_oss_sync()
1622 size = (8 * (runtime->oss.period_bytes - runtime->oss.buffer_used) + 7) / width; snd_pcm_oss_sync()
1624 runtime->oss.buffer + runtime->oss.buffer_used, snd_pcm_oss_sync()
1626 err = snd_pcm_oss_sync1(substream, runtime->oss.period_bytes); snd_pcm_oss_sync()
1628 mutex_unlock(&runtime->oss.params_lock); snd_pcm_oss_sync()
1631 } else if (runtime->oss.period_ptr > 0) { snd_pcm_oss_sync()
1635 size = runtime->oss.period_bytes - runtime->oss.period_ptr; snd_pcm_oss_sync()
1637 runtime->oss.buffer, snd_pcm_oss_sync()
1641 mutex_unlock(&runtime->oss.params_lock); snd_pcm_oss_sync()
1649 size = runtime->control->appl_ptr % runtime->period_size; snd_pcm_oss_sync()
1651 size = runtime->period_size - size; snd_pcm_oss_sync()
1652 if (runtime->access == SNDRV_PCM_ACCESS_RW_INTERLEAVED) { snd_pcm_oss_sync()
1653 size = (runtime->frame_bits * size) / 8; snd_pcm_oss_sync()
1656 size_t size1 = size < runtime->oss.period_bytes ? size : runtime->oss.period_bytes; snd_pcm_oss_sync()
1659 size1 /= runtime->sample_bits; snd_pcm_oss_sync()
1660 snd_pcm_format_set_silence(runtime->format, snd_pcm_oss_sync()
1661 runtime->oss.buffer, snd_pcm_oss_sync()
1663 size1 /= runtime->channels; /* frames */ snd_pcm_oss_sync()
1665 snd_pcm_lib_write(substream, (void __force __user *)runtime->oss.buffer, size1); snd_pcm_oss_sync()
1668 } else if (runtime->access == SNDRV_PCM_ACCESS_RW_NONINTERLEAVED) { snd_pcm_oss_sync()
1669 void __user *buffers[runtime->channels]; snd_pcm_oss_sync()
1670 memset(buffers, 0, runtime->channels * sizeof(void *)); snd_pcm_oss_sync()
1674 mutex_unlock(&runtime->oss.params_lock); snd_pcm_oss_sync()
1685 runtime->oss.prepare = 1; snd_pcm_oss_sync()
1692 runtime = substream->runtime; snd_pcm_oss_sync()
1696 runtime->oss.buffer_used = 0; snd_pcm_oss_sync()
1697 runtime->oss.prepare = 1; snd_pcm_oss_sync()
1708 struct snd_pcm_runtime *runtime; snd_pcm_oss_set_rate() local
1711 runtime = substream->runtime; snd_pcm_oss_set_rate()
1716 if (runtime->oss.rate != rate) { snd_pcm_oss_set_rate()
1717 runtime->oss.params = 1; snd_pcm_oss_set_rate()
1718 runtime->oss.rate = rate; snd_pcm_oss_set_rate()
1731 return substream->runtime->oss.rate; snd_pcm_oss_get_rate()
1743 struct snd_pcm_runtime *runtime; snd_pcm_oss_set_channels() local
1746 runtime = substream->runtime; snd_pcm_oss_set_channels()
1747 if (runtime->oss.channels != channels) { snd_pcm_oss_set_channels()
1748 runtime->oss.params = 1; snd_pcm_oss_set_channels()
1749 runtime->oss.channels = channels; snd_pcm_oss_set_channels()
1762 return substream->runtime->oss.channels; snd_pcm_oss_get_channels()
1772 return substream->runtime->oss.period_bytes; snd_pcm_oss_get_block_size()
1830 struct snd_pcm_runtime *runtime; snd_pcm_oss_set_format() local
1833 runtime = substream->runtime; snd_pcm_oss_set_format()
1834 if (runtime->oss.format != format) { snd_pcm_oss_set_format()
1835 runtime->oss.params = 1; snd_pcm_oss_set_format()
1836 runtime->oss.format = format; snd_pcm_oss_set_format()
1850 return substream->runtime->oss.format; snd_pcm_oss_get_format()
1855 struct snd_pcm_runtime *runtime; snd_pcm_oss_set_subdivide1() local
1859 runtime = substream->runtime; snd_pcm_oss_set_subdivide1()
1861 subdivide = runtime->oss.subdivision; snd_pcm_oss_set_subdivide1()
1866 if (runtime->oss.subdivision || runtime->oss.fragshift) snd_pcm_oss_set_subdivide1()
1871 runtime->oss.subdivision = subdivide; snd_pcm_oss_set_subdivide1()
1872 runtime->oss.params = 1; snd_pcm_oss_set_subdivide1()
1892 struct snd_pcm_runtime *runtime; snd_pcm_oss_set_fragment1() local
1896 runtime = substream->runtime; snd_pcm_oss_set_fragment1()
1897 if (runtime->oss.subdivision || runtime->oss.fragshift) snd_pcm_oss_set_fragment1()
1899 runtime->oss.fragshift = val & 0xffff; snd_pcm_oss_set_fragment1()
1900 runtime->oss.maxfrags = (val >> 16) & 0xffff; snd_pcm_oss_set_fragment1()
1901 if (runtime->oss.fragshift < 4) /* < 16 */ snd_pcm_oss_set_fragment1()
1902 runtime->oss.fragshift = 4; snd_pcm_oss_set_fragment1()
1903 if (runtime->oss.maxfrags < 2) snd_pcm_oss_set_fragment1()
1904 runtime->oss.maxfrags = 2; snd_pcm_oss_set_fragment1()
1905 runtime->oss.params = 1; snd_pcm_oss_set_fragment1()
1947 struct snd_pcm_runtime *runtime = substream->runtime; snd_pcm_oss_get_caps1() local
1948 if (runtime->info & (SNDRV_PCM_INFO_BLOCK_TRANSFER|SNDRV_PCM_INFO_BATCH)) snd_pcm_oss_get_caps1()
1971 struct snd_pcm_runtime *runtime = substream->runtime; snd_pcm_oss_simulate_fill() local
1973 appl_ptr = hw_ptr + runtime->buffer_size; snd_pcm_oss_simulate_fill()
1974 appl_ptr %= runtime->boundary; snd_pcm_oss_simulate_fill()
1975 runtime->control->appl_ptr = appl_ptr; snd_pcm_oss_simulate_fill()
1980 struct snd_pcm_runtime *runtime; snd_pcm_oss_set_trigger() local
2000 runtime = psubstream->runtime; snd_pcm_oss_set_trigger()
2002 if (runtime->oss.trigger) snd_pcm_oss_set_trigger()
2006 get_hw_ptr_period(runtime)); snd_pcm_oss_set_trigger()
2007 runtime->oss.trigger = 1; snd_pcm_oss_set_trigger()
2008 runtime->start_threshold = 1; snd_pcm_oss_set_trigger()
2011 if (!runtime->oss.trigger) snd_pcm_oss_set_trigger()
2013 runtime->oss.trigger = 0; snd_pcm_oss_set_trigger()
2014 runtime->start_threshold = runtime->boundary; snd_pcm_oss_set_trigger()
2016 runtime->oss.prepare = 1; snd_pcm_oss_set_trigger()
2024 runtime = csubstream->runtime; snd_pcm_oss_set_trigger()
2026 if (runtime->oss.trigger) snd_pcm_oss_set_trigger()
2028 runtime->oss.trigger = 1; snd_pcm_oss_set_trigger()
2029 runtime->start_threshold = 1; snd_pcm_oss_set_trigger()
2032 if (!runtime->oss.trigger) snd_pcm_oss_set_trigger()
2034 runtime->oss.trigger = 0; snd_pcm_oss_set_trigger()
2035 runtime->start_threshold = runtime->boundary; snd_pcm_oss_set_trigger()
2037 runtime->oss.prepare = 1; snd_pcm_oss_set_trigger()
2054 if (psubstream && psubstream->runtime && psubstream->runtime->oss.trigger) snd_pcm_oss_get_trigger()
2056 if (csubstream && csubstream->runtime && csubstream->runtime->oss.trigger) snd_pcm_oss_get_trigger()
2064 struct snd_pcm_runtime *runtime; snd_pcm_oss_get_odelay() local
2073 runtime = substream->runtime; snd_pcm_oss_get_odelay()
2074 if (runtime->oss.params || runtime->oss.prepare) snd_pcm_oss_get_odelay()
2087 struct snd_pcm_runtime *runtime; snd_pcm_oss_get_ptr() local
2100 runtime = substream->runtime; snd_pcm_oss_get_ptr()
2101 if (runtime->oss.params || runtime->oss.prepare) { snd_pcm_oss_get_ptr()
2114 fixup = runtime->oss.buffer_used; snd_pcm_oss_get_ptr()
2118 fixup = -runtime->oss.buffer_used; snd_pcm_oss_get_ptr()
2122 info.ptr = snd_pcm_oss_bytes(substream, runtime->status->hw_ptr % runtime->buffer_size); snd_pcm_oss_get_ptr()
2125 delay = get_hw_ptr_period(runtime); snd_pcm_oss_get_ptr()
2126 n = delay - runtime->oss.prev_hw_ptr_period; snd_pcm_oss_get_ptr()
2128 n += runtime->boundary; snd_pcm_oss_get_ptr()
2129 info.blocks = n / runtime->period_size; snd_pcm_oss_get_ptr()
2130 runtime->oss.prev_hw_ptr_period = delay; snd_pcm_oss_get_ptr()
2133 info.bytes = snd_pcm_oss_bytes(substream, runtime->status->hw_ptr) & INT_MAX; snd_pcm_oss_get_ptr()
2138 info.blocks = (runtime->oss.buffer_bytes - delay - fixup) / runtime->oss.period_bytes; snd_pcm_oss_get_ptr()
2140 info.blocks = (delay + fixup) / runtime->oss.period_bytes; snd_pcm_oss_get_ptr()
2141 info.bytes = (runtime->oss.bytes - delay) & INT_MAX; snd_pcm_oss_get_ptr()
2144 info.blocks = delay / runtime->oss.period_bytes; snd_pcm_oss_get_ptr()
2145 info.bytes = (runtime->oss.bytes + delay) & INT_MAX; snd_pcm_oss_get_ptr()
2156 struct snd_pcm_runtime *runtime; snd_pcm_oss_get_space() local
2167 runtime = substream->runtime; snd_pcm_oss_get_space()
2169 if (runtime->oss.params && snd_pcm_oss_get_space()
2173 info.fragsize = runtime->oss.period_bytes; snd_pcm_oss_get_space()
2174 info.fragstotal = runtime->periods; snd_pcm_oss_get_space()
2175 if (runtime->oss.prepare) { snd_pcm_oss_get_space()
2177 info.bytes = runtime->oss.period_bytes * runtime->oss.periods; snd_pcm_oss_get_space()
2178 info.fragments = runtime->oss.periods; snd_pcm_oss_get_space()
2187 avail = runtime->buffer_size; snd_pcm_oss_get_space()
2191 avail = runtime->buffer_size - avail; snd_pcm_oss_get_space()
2192 fixup = -runtime->oss.buffer_used; snd_pcm_oss_get_space()
2196 fixup = runtime->oss.buffer_used; snd_pcm_oss_get_space()
2201 info.fragments = info.bytes / runtime->oss.period_bytes; snd_pcm_oss_get_space()
2253 struct snd_pcm_runtime *runtime; snd_pcm_oss_release_substream() local
2254 runtime = substream->runtime; snd_pcm_oss_release_substream()
2255 vfree(runtime->oss.buffer); snd_pcm_oss_release_substream()
2256 runtime->oss.buffer = NULL; snd_pcm_oss_release_substream()
2267 struct snd_pcm_runtime *runtime; snd_pcm_oss_init_substream() local
2275 runtime = substream->runtime; snd_pcm_oss_init_substream()
2276 runtime->oss.params = 1; snd_pcm_oss_init_substream()
2277 runtime->oss.trigger = 1; snd_pcm_oss_init_substream()
2278 runtime->oss.rate = 8000; snd_pcm_oss_init_substream()
2279 mutex_init(&runtime->oss.params_lock); snd_pcm_oss_init_substream()
2282 runtime->oss.format = AFMT_U8; snd_pcm_oss_init_substream()
2285 runtime->oss.format = AFMT_S16_LE; snd_pcm_oss_init_substream()
2288 runtime->oss.format = AFMT_MU_LAW; snd_pcm_oss_init_substream()
2290 runtime->oss.channels = 1; snd_pcm_oss_init_substream()
2291 runtime->oss.fragshift = 0; snd_pcm_oss_init_substream()
2292 runtime->oss.maxfrags = 0; snd_pcm_oss_init_substream()
2293 runtime->oss.subdivision = 0; snd_pcm_oss_init_substream()
2704 struct snd_pcm_runtime *runtime = substream->runtime; snd_pcm_oss_playback_ready() local
2706 return runtime->oss.prev_hw_ptr_period != snd_pcm_oss_playback_ready()
2707 get_hw_ptr_period(runtime); snd_pcm_oss_playback_ready()
2709 return snd_pcm_playback_avail(runtime) >= snd_pcm_oss_playback_ready()
2710 runtime->oss.period_frames; snd_pcm_oss_playback_ready()
2715 struct snd_pcm_runtime *runtime = substream->runtime; snd_pcm_oss_capture_ready() local
2717 return runtime->oss.prev_hw_ptr_period != snd_pcm_oss_capture_ready()
2718 get_hw_ptr_period(runtime); snd_pcm_oss_capture_ready()
2720 return snd_pcm_capture_avail(runtime) >= snd_pcm_oss_capture_ready()
2721 runtime->oss.period_frames; snd_pcm_oss_capture_ready()
2737 struct snd_pcm_runtime *runtime = psubstream->runtime; snd_pcm_oss_poll() local
2738 poll_wait(file, &runtime->sleep, wait); snd_pcm_oss_poll()
2740 if (runtime->status->state != SNDRV_PCM_STATE_DRAINING && snd_pcm_oss_poll()
2741 (runtime->status->state != SNDRV_PCM_STATE_RUNNING || snd_pcm_oss_poll()
2747 struct snd_pcm_runtime *runtime = csubstream->runtime; snd_pcm_oss_poll() local
2749 poll_wait(file, &runtime->sleep, wait); snd_pcm_oss_poll()
2751 if ((ostate = runtime->status->state) != SNDRV_PCM_STATE_RUNNING || snd_pcm_oss_poll()
2755 if (ostate != SNDRV_PCM_STATE_RUNNING && runtime->oss.trigger) { snd_pcm_oss_poll()
2759 runtime->oss.trigger = 0; snd_pcm_oss_poll()
2771 struct snd_pcm_runtime *runtime; snd_pcm_oss_mmap() local
2798 runtime = substream->runtime; snd_pcm_oss_mmap()
2799 if (!(runtime->info & SNDRV_PCM_INFO_MMAP_VALID)) snd_pcm_oss_mmap()
2801 if (runtime->info & SNDRV_PCM_INFO_INTERLEAVED) snd_pcm_oss_mmap()
2802 runtime->access = SNDRV_PCM_ACCESS_MMAP_INTERLEAVED; snd_pcm_oss_mmap()
2806 if (runtime->oss.params) { snd_pcm_oss_mmap()
2816 if (runtime->oss.plugin_first != NULL) snd_pcm_oss_mmap()
2826 runtime->oss.mmap_bytes = area->vm_end - area->vm_start; snd_pcm_oss_mmap()
2827 runtime->silence_threshold = 0; snd_pcm_oss_mmap()
2828 runtime->silence_size = 0; snd_pcm_oss_mmap()
2831 runtime->oss.mmap_bytes); snd_pcm_oss_mmap()
2834 runtime->stop_threshold = runtime->boundary; snd_pcm_oss_mmap()
/linux-4.1.27/security/integrity/ima/
H A DMakefile2 # Makefile for building Trusted Computing Group's(TCG) runtime Integrity
/linux-4.1.27/sound/soc/nuc900/
H A Dnuc900-pcm.c50 struct snd_pcm_runtime *runtime = substream->runtime; nuc900_update_dma_register() local
51 struct nuc900_audio *nuc900_audio = runtime->private_data; nuc900_update_dma_register()
62 AUDIO_WRITE(mmio_addr, runtime->dma_addr); nuc900_update_dma_register()
63 AUDIO_WRITE(mmio_len, runtime->dma_bytes); nuc900_update_dma_register()
68 struct snd_pcm_runtime *runtime = substream->runtime; nuc900_dma_start() local
69 struct nuc900_audio *nuc900_audio = runtime->private_data; nuc900_dma_start()
79 struct snd_pcm_runtime *runtime = substream->runtime; nuc900_dma_stop() local
80 struct nuc900_audio *nuc900_audio = runtime->private_data; nuc900_dma_stop()
91 struct nuc900_audio *nuc900_audio = substream->runtime->private_data; nuc900_dma_interrupt()
147 struct snd_pcm_runtime *runtime = substream->runtime; nuc900_dma_prepare() local
148 struct nuc900_audio *nuc900_audio = runtime->private_data; nuc900_dma_prepare()
158 switch (runtime->channels) { nuc900_dma_prepare()
209 struct snd_pcm_runtime *runtime = substream->runtime; nuc900_dma_getposition() local
210 struct nuc900_audio *nuc900_audio = runtime->private_data; nuc900_dma_getposition()
223 struct snd_pcm_runtime *runtime = substream->runtime; nuc900_dma_pointer() local
230 res = dst - runtime->dma_addr; nuc900_dma_pointer()
232 res = src - runtime->dma_addr; nuc900_dma_pointer()
234 return bytes_to_frames(substream->runtime, res); nuc900_dma_pointer()
239 struct snd_pcm_runtime *runtime = substream->runtime; nuc900_dma_open() local
250 runtime->private_data = nuc900_audio; nuc900_dma_open()
257 struct snd_pcm_runtime *runtime = substream->runtime; nuc900_dma_close() local
258 struct nuc900_audio *nuc900_audio = runtime->private_data; nuc900_dma_close()
268 struct snd_pcm_runtime *runtime = substream->runtime; nuc900_dma_mmap() local
271 runtime->dma_area, nuc900_dma_mmap()
272 runtime->dma_addr, nuc900_dma_mmap()
273 runtime->dma_bytes); nuc900_dma_mmap()
/linux-4.1.27/drivers/media/pci/cx18/
H A Dcx18-alsa-pcm.c77 struct snd_pcm_runtime *runtime; cx18_alsa_announce_pcm_data() local
92 runtime = substream->runtime; cx18_alsa_announce_pcm_data()
93 if (runtime == NULL) { cx18_alsa_announce_pcm_data()
94 dprintk("runtime was NULL\n"); cx18_alsa_announce_pcm_data()
98 stride = runtime->frame_bits >> 3; cx18_alsa_announce_pcm_data()
110 if (runtime->dma_area == NULL) { cx18_alsa_announce_pcm_data()
116 if (oldptr + length >= runtime->buffer_size) { cx18_alsa_announce_pcm_data()
118 runtime->buffer_size - oldptr; cx18_alsa_announce_pcm_data()
119 memcpy(runtime->dma_area + oldptr * stride, pcm_data, cx18_alsa_announce_pcm_data()
121 memcpy(runtime->dma_area, pcm_data + cnt * stride, cx18_alsa_announce_pcm_data()
124 memcpy(runtime->dma_area + oldptr * stride, pcm_data, cx18_alsa_announce_pcm_data()
131 runtime->buffer_size) cx18_alsa_announce_pcm_data()
133 runtime->buffer_size; cx18_alsa_announce_pcm_data()
137 runtime->period_size) { cx18_alsa_announce_pcm_data()
139 runtime->period_size; cx18_alsa_announce_pcm_data()
152 struct snd_pcm_runtime *runtime = substream->runtime; snd_cx18_pcm_capture_open() local
182 runtime->hw = snd_cx18_hw_capture; snd_cx18_pcm_capture_open()
183 snd_pcm_hw_constraint_integer(runtime, SNDRV_PCM_HW_PARAM_PERIODS); snd_cx18_pcm_capture_open()
185 runtime->private_data = cx; snd_cx18_pcm_capture_open()
234 struct snd_pcm_runtime *runtime = subs->runtime; snd_pcm_alloc_vmalloc_buffer() local
237 if (runtime->dma_area) { snd_pcm_alloc_vmalloc_buffer()
238 if (runtime->dma_bytes > size) snd_pcm_alloc_vmalloc_buffer()
241 vfree(runtime->dma_area); snd_pcm_alloc_vmalloc_buffer()
243 runtime->dma_area = vmalloc(size); snd_pcm_alloc_vmalloc_buffer()
244 if (!runtime->dma_area) snd_pcm_alloc_vmalloc_buffer()
247 runtime->dma_bytes = size; snd_pcm_alloc_vmalloc_buffer()
267 if (substream->runtime->dma_area) { snd_cx18_pcm_hw_free()
269 vfree(substream->runtime->dma_area); snd_cx18_pcm_hw_free()
270 substream->runtime->dma_area = NULL; snd_cx18_pcm_hw_free()
309 void *pageptr = subs->runtime->dma_area + offset; snd_pcm_get_vmalloc_page()
/linux-4.1.27/drivers/media/pci/ivtv/
H A Divtv-alsa-pcm.c78 struct snd_pcm_runtime *runtime; ivtv_alsa_announce_pcm_data() local
93 runtime = substream->runtime; ivtv_alsa_announce_pcm_data()
94 if (runtime == NULL) { ivtv_alsa_announce_pcm_data()
95 dprintk("runtime was NULL\n"); ivtv_alsa_announce_pcm_data()
99 stride = runtime->frame_bits >> 3; ivtv_alsa_announce_pcm_data()
111 if (runtime->dma_area == NULL) { ivtv_alsa_announce_pcm_data()
117 if (oldptr + length >= runtime->buffer_size) { ivtv_alsa_announce_pcm_data()
119 runtime->buffer_size - oldptr; ivtv_alsa_announce_pcm_data()
120 memcpy(runtime->dma_area + oldptr * stride, pcm_data, ivtv_alsa_announce_pcm_data()
122 memcpy(runtime->dma_area, pcm_data + cnt * stride, ivtv_alsa_announce_pcm_data()
125 memcpy(runtime->dma_area + oldptr * stride, pcm_data, ivtv_alsa_announce_pcm_data()
132 runtime->buffer_size) ivtv_alsa_announce_pcm_data()
134 runtime->buffer_size; ivtv_alsa_announce_pcm_data()
138 runtime->period_size) { ivtv_alsa_announce_pcm_data()
140 runtime->period_size; ivtv_alsa_announce_pcm_data()
153 struct snd_pcm_runtime *runtime = substream->runtime; snd_ivtv_pcm_capture_open() local
189 runtime->hw = snd_ivtv_hw_capture; snd_ivtv_pcm_capture_open()
190 snd_pcm_hw_constraint_integer(runtime, SNDRV_PCM_HW_PARAM_PERIODS); snd_ivtv_pcm_capture_open()
192 runtime->private_data = itv; snd_ivtv_pcm_capture_open()
241 struct snd_pcm_runtime *runtime = subs->runtime; snd_pcm_alloc_vmalloc_buffer() local
244 if (runtime->dma_area) { snd_pcm_alloc_vmalloc_buffer()
245 if (runtime->dma_bytes > size) snd_pcm_alloc_vmalloc_buffer()
248 vfree(runtime->dma_area); snd_pcm_alloc_vmalloc_buffer()
250 runtime->dma_area = vmalloc(size); snd_pcm_alloc_vmalloc_buffer()
251 if (!runtime->dma_area) snd_pcm_alloc_vmalloc_buffer()
254 runtime->dma_bytes = size; snd_pcm_alloc_vmalloc_buffer()
274 if (substream->runtime->dma_area) { snd_ivtv_pcm_hw_free()
276 vfree(substream->runtime->dma_area); snd_ivtv_pcm_hw_free()
277 substream->runtime->dma_area = NULL; snd_ivtv_pcm_hw_free()
316 void *pageptr = subs->runtime->dma_area + offset; snd_pcm_get_vmalloc_page()
/linux-4.1.27/sound/pci/emu10k1/
H A Dp16v.c166 static void snd_p16v_pcm_free_substream(struct snd_pcm_runtime *runtime) snd_p16v_pcm_free_substream() argument
168 struct snd_emu10k1_pcm *epcm = runtime->private_data; snd_p16v_pcm_free_substream()
179 struct snd_pcm_runtime *runtime = substream->runtime; snd_p16v_pcm_open_playback_channel() local
193 runtime->private_data = epcm; snd_p16v_pcm_open_playback_channel()
194 runtime->private_free = snd_p16v_pcm_free_substream; snd_p16v_pcm_open_playback_channel()
196 runtime->hw = snd_p16v_playback_hw; snd_p16v_pcm_open_playback_channel()
211 if ((err = snd_pcm_hw_constraint_integer(runtime, SNDRV_PCM_HW_PARAM_PERIODS)) < 0) snd_p16v_pcm_open_playback_channel()
214 runtime->sync.id32[0] = substream->pcm->card->number; snd_p16v_pcm_open_playback_channel()
215 runtime->sync.id32[1] = 'P'; snd_p16v_pcm_open_playback_channel()
216 runtime->sync.id32[2] = 16; snd_p16v_pcm_open_playback_channel()
217 runtime->sync.id32[3] = 'V'; snd_p16v_pcm_open_playback_channel()
227 struct snd_pcm_runtime *runtime = substream->runtime; snd_p16v_pcm_open_capture_channel() local
241 runtime->private_data = epcm; snd_p16v_pcm_open_capture_channel()
242 runtime->private_free = snd_p16v_pcm_free_substream; snd_p16v_pcm_open_capture_channel()
244 runtime->hw = snd_p16v_capture_hw; snd_p16v_pcm_open_capture_channel()
259 if ((err = snd_pcm_hw_constraint_integer(runtime, SNDRV_PCM_HW_PARAM_PERIODS)) < 0) snd_p16v_pcm_open_capture_channel()
270 //struct snd_pcm_runtime *runtime = substream->runtime; snd_p16v_pcm_close_playback()
271 //struct snd_emu10k1_pcm *epcm = runtime->private_data; snd_p16v_pcm_close_playback()
281 //struct snd_pcm_runtime *runtime = substream->runtime; snd_p16v_pcm_close_capture()
282 //struct snd_emu10k1_pcm *epcm = runtime->private_data; snd_p16v_pcm_close_capture()
341 struct snd_pcm_runtime *runtime = substream->runtime; snd_p16v_pcm_prepare_playback() local
344 u32 period_size_bytes = frames_to_bytes(runtime, runtime->period_size); snd_p16v_pcm_prepare_playback()
353 channel, runtime->rate, runtime->format, runtime->channels, snd_p16v_pcm_prepare_playback()
354 runtime->buffer_size, runtime->period_size, snd_p16v_pcm_prepare_playback()
355 runtime->periods, frames_to_bytes(runtime, 1)); snd_p16v_pcm_prepare_playback()
358 runtime->dma_addr, runtime->dma_area, table_base); snd_p16v_pcm_prepare_playback()
365 switch (runtime->rate) { snd_p16v_pcm_prepare_playback()
381 for(i = 0; i < runtime->periods; i++) { snd_p16v_pcm_prepare_playback()
382 table_base[i*2]=runtime->dma_addr+(i*period_size_bytes); snd_p16v_pcm_prepare_playback()
387 snd_emu10k1_ptr20_write(emu, PLAYBACK_LIST_SIZE, channel, (runtime->periods - 1) << 19); snd_p16v_pcm_prepare_playback()
389 snd_emu10k1_ptr20_write(emu, PLAYBACK_DMA_ADDR, channel, runtime->dma_addr); snd_p16v_pcm_prepare_playback()
390 //snd_emu10k1_ptr20_write(emu, PLAYBACK_PERIOD_SIZE, channel, frames_to_bytes(runtime, runtime->period_size)<<16); // buffer size in bytes snd_p16v_pcm_prepare_playback()
403 struct snd_pcm_runtime *runtime = substream->runtime; snd_p16v_pcm_prepare_capture() local
411 channel, runtime->rate, runtime->format, runtime->channels, snd_p16v_pcm_prepare_capture()
412 runtime->buffer_size, runtime->period_size, snd_p16v_pcm_prepare_capture()
413 frames_to_bytes(runtime, 1)); snd_p16v_pcm_prepare_capture()
416 switch (runtime->rate) { snd_p16v_pcm_prepare_capture()
433 snd_emu10k1_ptr20_write(emu, CAPTURE_DMA_ADDR, channel, runtime->dma_addr); snd_p16v_pcm_prepare_capture()
434 snd_emu10k1_ptr20_write(emu, CAPTURE_BUFFER_SIZE, channel, frames_to_bytes(runtime, runtime->buffer_size) << 16); // buffer size in bytes snd_p16v_pcm_prepare_capture()
469 struct snd_pcm_runtime *runtime; snd_p16v_pcm_trigger_playback() local
491 runtime = s->runtime; snd_pcm_group_for_each_entry()
492 epcm = runtime->private_data; snd_pcm_group_for_each_entry()
523 struct snd_pcm_runtime *runtime = substream->runtime; snd_p16v_pcm_trigger_capture() local
524 struct snd_emu10k1_pcm *epcm = runtime->private_data; snd_p16v_pcm_trigger_capture()
553 struct snd_pcm_runtime *runtime = substream->runtime; snd_p16v_pcm_pointer_playback() local
554 struct snd_emu10k1_pcm *epcm = runtime->private_data; snd_p16v_pcm_pointer_playback()
564 ptr2 = bytes_to_frames(runtime, ptr1); snd_p16v_pcm_pointer_playback()
565 ptr2+= (ptr4 >> 3) * runtime->period_size; snd_p16v_pcm_pointer_playback()
567 if (ptr >= runtime->buffer_size) snd_p16v_pcm_pointer_playback()
568 ptr -= runtime->buffer_size; snd_p16v_pcm_pointer_playback()
578 struct snd_pcm_runtime *runtime = substream->runtime; snd_p16v_pcm_pointer_capture() local
579 struct snd_emu10k1_pcm *epcm = runtime->private_data; snd_p16v_pcm_pointer_capture()
587 ptr2 = bytes_to_frames(runtime, ptr1); snd_p16v_pcm_pointer_capture()
589 if (ptr >= runtime->buffer_size) { snd_p16v_pcm_pointer_capture()
590 ptr -= runtime->buffer_size; snd_p16v_pcm_pointer_capture()
596 ptr1, ptr2, ptr, (int)runtime->buffer_size, snd_p16v_pcm_pointer_capture()
597 (int)runtime->period_size, (int)runtime->frame_bits, snd_p16v_pcm_pointer_capture()
598 (int)runtime->rate); snd_p16v_pcm_pointer_capture()
H A Demupcm.c49 epcm->substream->runtime->hw->pointer(emu, epcm->substream), snd_emu10k1_pcm_interrupt()
61 if (emu->pcm_capture_substream->runtime->mode == SNDRV_PCM_MODE_FRAME) snd_emu10k1_pcm_ac97adc_interrupt()
73 if (emu->pcm_capture_mic_substream->runtime->mode == SNDRV_PCM_MODE_FRAME) snd_emu10k1_pcm_ac97mic_interrupt()
85 if (emu->pcm_capture_efx_substream->runtime->mode == SNDRV_PCM_MODE_FRAME) snd_emu10k1_pcm_efx_interrupt()
95 struct snd_pcm_runtime *runtime = substream->runtime; snd_emu10k1_efx_playback_pointer() local
96 struct snd_emu10k1_pcm *epcm = runtime->private_data; snd_emu10k1_efx_playback_pointer()
102 ptr += runtime->buffer_size; snd_emu10k1_efx_playback_pointer()
104 ptr %= runtime->buffer_size; snd_emu10k1_efx_playback_pointer()
290 struct snd_pcm_runtime *runtime = substream->runtime; snd_emu10k1_pcm_init_voice() local
300 stereo = runtime->channels == 2; snd_emu10k1_pcm_init_voice()
301 w_16 = snd_pcm_format_width(runtime->format) == 16; snd_emu10k1_pcm_init_voice()
370 pitch_target = emu10k1_calc_pitch_target(runtime->rate); snd_emu10k1_pcm_init_voice()
412 struct snd_pcm_runtime *runtime = substream->runtime; snd_emu10k1_playback_hw_params() local
413 struct snd_emu10k1_pcm *epcm = runtime->private_data; snd_emu10k1_playback_hw_params()
439 struct snd_pcm_runtime *runtime = substream->runtime; snd_emu10k1_playback_hw_free() local
442 if (runtime->private_data == NULL) snd_emu10k1_playback_hw_free()
444 epcm = runtime->private_data; snd_emu10k1_playback_hw_free()
469 struct snd_pcm_runtime *runtime = substream->runtime; snd_emu10k1_efx_playback_hw_free() local
473 if (runtime->private_data == NULL) snd_emu10k1_efx_playback_hw_free()
475 epcm = runtime->private_data; snd_emu10k1_efx_playback_hw_free()
498 struct snd_pcm_runtime *runtime = substream->runtime; snd_emu10k1_playback_prepare() local
499 struct snd_emu10k1_pcm *epcm = runtime->private_data; snd_emu10k1_playback_prepare()
504 if (runtime->channels == 2) { snd_emu10k1_playback_prepare()
526 struct snd_pcm_runtime *runtime = substream->runtime; snd_emu10k1_efx_playback_prepare() local
527 struct snd_emu10k1_pcm *epcm = runtime->private_data; snd_emu10k1_efx_playback_prepare()
593 struct snd_pcm_runtime *runtime = substream->runtime; snd_emu10k1_capture_prepare() local
594 struct snd_emu10k1_pcm *epcm = runtime->private_data; snd_emu10k1_capture_prepare()
613 snd_emu10k1_ptr_write(emu, epcm->capture_ba_reg, 0, runtime->dma_addr); snd_emu10k1_capture_prepare()
628 if (runtime->channels > 1) snd_emu10k1_capture_prepare()
631 snd_emu10k1_audigy_capture_rate_reg(runtime->rate) : snd_emu10k1_capture_prepare()
632 snd_emu10k1_capture_rate_reg(runtime->rate); snd_emu10k1_capture_prepare()
639 struct snd_pcm_runtime *runtime; snd_emu10k1_playback_invalidate_cache() local
644 runtime = evoice->epcm->substream->runtime; snd_emu10k1_playback_invalidate_cache()
646 stereo = (!extra && runtime->channels == 2); snd_emu10k1_playback_invalidate_cache()
647 sample = snd_pcm_format_width(runtime->format) == 16 ? 0 : 0x80808080; snd_emu10k1_playback_invalidate_cache()
677 struct snd_pcm_runtime *runtime; snd_emu10k1_playback_prepare_voice() local
684 runtime = substream->runtime; snd_emu10k1_playback_prepare_voice()
688 tmp = runtime->channels == 2 ? (master ? 1 : 2) : 0; snd_emu10k1_playback_prepare_voice()
700 struct snd_pcm_runtime *runtime; snd_emu10k1_playback_trigger_voice() local
706 runtime = substream->runtime; snd_emu10k1_playback_trigger_voice()
709 pitch = snd_emu10k1_rate_to_pitch(runtime->rate) >> 8; snd_emu10k1_playback_trigger_voice()
713 pitch_target = emu10k1_calc_pitch_target(runtime->rate); snd_emu10k1_playback_trigger_voice()
741 struct snd_pcm_runtime *runtime) snd_emu10k1_playback_mangle_extra()
747 period_pos = runtime->status->hw_ptr - runtime->hw_ptr_interrupt; snd_emu10k1_playback_mangle_extra()
748 period_pos %= runtime->period_size; snd_emu10k1_playback_mangle_extra()
759 struct snd_pcm_runtime *runtime = substream->runtime; snd_emu10k1_playback_trigger() local
760 struct snd_emu10k1_pcm *epcm = runtime->private_data; snd_emu10k1_playback_trigger()
778 snd_emu10k1_playback_mangle_extra(emu, epcm, substream, runtime); snd_emu10k1_playback_trigger()
808 struct snd_pcm_runtime *runtime = substream->runtime; snd_emu10k1_capture_trigger() local
809 struct snd_emu10k1_pcm *epcm = runtime->private_data; snd_emu10k1_capture_trigger()
876 struct snd_pcm_runtime *runtime = substream->runtime; snd_emu10k1_playback_pointer() local
877 struct snd_emu10k1_pcm *epcm = runtime->private_data; snd_emu10k1_playback_pointer()
884 ptr += runtime->buffer_size; snd_emu10k1_playback_pointer()
886 ptr %= runtime->buffer_size; snd_emu10k1_playback_pointer()
889 ptr += runtime->buffer_size - epcm->ccca_start_addr; snd_emu10k1_playback_pointer()
892 if (ptr >= runtime->buffer_size) snd_emu10k1_playback_pointer()
893 ptr -= runtime->buffer_size; snd_emu10k1_playback_pointer()
899 (long)ptr, (long)runtime->buffer_size, snd_emu10k1_playback_pointer()
900 (long)runtime->period_size); snd_emu10k1_playback_pointer()
910 struct snd_pcm_runtime *runtime = substream->runtime; snd_emu10k1_efx_playback_trigger() local
911 struct snd_emu10k1_pcm *epcm = runtime->private_data; snd_emu10k1_efx_playback_trigger()
960 struct snd_pcm_runtime *runtime = substream->runtime; snd_emu10k1_capture_pointer() local
961 struct snd_emu10k1_pcm *epcm = runtime->private_data; snd_emu10k1_capture_pointer()
971 return bytes_to_frames(runtime, ptr); snd_emu10k1_capture_pointer()
1077 static void snd_emu10k1_pcm_free_substream(struct snd_pcm_runtime *runtime) snd_emu10k1_pcm_free_substream() argument
1079 kfree(runtime->private_data); snd_emu10k1_pcm_free_substream()
1101 struct snd_pcm_runtime *runtime = substream->runtime; snd_emu10k1_efx_playback_open() local
1113 runtime->private_data = epcm; snd_emu10k1_efx_playback_open()
1114 runtime->private_free = snd_emu10k1_pcm_free_substream; snd_emu10k1_efx_playback_open()
1115 runtime->hw = snd_emu10k1_efx_playback; snd_emu10k1_efx_playback_open()
1134 struct snd_pcm_runtime *runtime = substream->runtime; snd_emu10k1_playback_open() local
1143 runtime->private_data = epcm; snd_emu10k1_playback_open()
1144 runtime->private_free = snd_emu10k1_pcm_free_substream; snd_emu10k1_playback_open()
1145 runtime->hw = snd_emu10k1_playback; snd_emu10k1_playback_open()
1146 if ((err = snd_pcm_hw_constraint_integer(runtime, SNDRV_PCM_HW_PARAM_PERIODS)) < 0) { snd_emu10k1_playback_open()
1150 if ((err = snd_pcm_hw_constraint_minmax(runtime, SNDRV_PCM_HW_PARAM_BUFFER_BYTES, 256, UINT_MAX)) < 0) { snd_emu10k1_playback_open()
1158 err = snd_pcm_hw_rule_noresample(runtime, sample_rate); snd_emu10k1_playback_open()
1188 struct snd_pcm_runtime *runtime = substream->runtime; snd_emu10k1_capture_open() local
1202 runtime->private_data = epcm; snd_emu10k1_capture_open()
1203 runtime->private_free = snd_emu10k1_pcm_free_substream; snd_emu10k1_capture_open()
1204 runtime->hw = snd_emu10k1_capture; snd_emu10k1_capture_open()
1207 snd_pcm_hw_constraint_list(runtime, 0, SNDRV_PCM_HW_PARAM_PERIOD_BYTES, &hw_constraints_capture_period_sizes); snd_emu10k1_capture_open()
1208 snd_pcm_hw_constraint_list(runtime, 0, SNDRV_PCM_HW_PARAM_RATE, &hw_constraints_capture_rates); snd_emu10k1_capture_open()
1225 struct snd_pcm_runtime *runtime = substream->runtime; snd_emu10k1_capture_mic_open() local
1238 substream->runtime->private_data = epcm; snd_emu10k1_capture_mic_open()
1239 substream->runtime->private_free = snd_emu10k1_pcm_free_substream; snd_emu10k1_capture_mic_open()
1240 runtime->hw = snd_emu10k1_capture; snd_emu10k1_capture_mic_open()
1241 runtime->hw.rates = SNDRV_PCM_RATE_8000; snd_emu10k1_capture_mic_open()
1242 runtime->hw.rate_min = runtime->hw.rate_max = 8000; snd_emu10k1_capture_mic_open()
1243 runtime->hw.channels_min = 1; snd_emu10k1_capture_mic_open()
1246 snd_pcm_hw_constraint_list(runtime, 0, SNDRV_PCM_HW_PARAM_PERIOD_BYTES, &hw_constraints_capture_period_sizes); snd_emu10k1_capture_mic_open()
1263 struct snd_pcm_runtime *runtime = substream->runtime; snd_emu10k1_capture_efx_open() local
1278 substream->runtime->private_data = epcm; snd_emu10k1_capture_efx_open()
1279 substream->runtime->private_free = snd_emu10k1_pcm_free_substream; snd_emu10k1_capture_efx_open()
1280 runtime->hw = snd_emu10k1_capture_efx; snd_emu10k1_capture_efx_open()
1281 runtime->hw.rates = SNDRV_PCM_RATE_48000; snd_emu10k1_capture_efx_open()
1282 runtime->hw.rate_min = runtime->hw.rate_max = 48000; snd_emu10k1_capture_efx_open()
1310 runtime->hw.rates = SNDRV_PCM_RATE_44100; snd_emu10k1_capture_efx_open()
1311 runtime->hw.rate_min = runtime->hw.rate_max = 44100; snd_emu10k1_capture_efx_open()
1312 runtime->hw.channels_min = snd_emu10k1_capture_efx_open()
1313 runtime->hw.channels_max = 16; snd_emu10k1_capture_efx_open()
1317 runtime->hw.rates = SNDRV_PCM_RATE_48000; snd_emu10k1_capture_efx_open()
1318 runtime->hw.rate_min = runtime->hw.rate_max = 48000; snd_emu10k1_capture_efx_open()
1319 runtime->hw.channels_min = snd_emu10k1_capture_efx_open()
1320 runtime->hw.channels_max = 16; snd_emu10k1_capture_efx_open()
1326 runtime->hw.rates = SNDRV_PCM_RATE_96000; snd_emu10k1_capture_efx_open()
1327 runtime->hw.rate_min = runtime->hw.rate_max = 96000; snd_emu10k1_capture_efx_open()
1328 runtime->hw.channels_min = runtime->hw.channels_max = 4; snd_emu10k1_capture_efx_open()
1332 runtime->hw.rates = SNDRV_PCM_RATE_192000; snd_emu10k1_capture_efx_open()
1333 runtime->hw.rate_min = runtime->hw.rate_max = 192000; snd_emu10k1_capture_efx_open()
1334 runtime->hw.channels_min = runtime->hw.channels_max = 2; snd_emu10k1_capture_efx_open()
1336 runtime->hw.formats = SNDRV_PCM_FMTBIT_S32_LE; snd_emu10k1_capture_efx_open()
1341 runtime->hw.channels_min = runtime->hw.channels_max = 0; snd_emu10k1_capture_efx_open()
1344 runtime->hw.channels_min++; snd_emu10k1_capture_efx_open()
1345 runtime->hw.channels_max++; snd_emu10k1_capture_efx_open()
1354 snd_pcm_hw_constraint_list(runtime, 0, SNDRV_PCM_HW_PARAM_PERIOD_BYTES, &hw_constraints_capture_period_sizes); snd_emu10k1_capture_efx_open()
1607 unsigned short *src = (unsigned short *)(substream->runtime->dma_area + rec->sw_data); fx8010_pb_trans_copy()
1660 struct snd_pcm_runtime *runtime = substream->runtime; snd_emu10k1_fx8010_playback_prepare() local
1667 emu->fx8010.etram_pages, runtime->dma_area, snd_emu10k1_fx8010_playback_prepare()
1668 runtime->buffer_size, runtime->buffer_size << 2); snd_emu10k1_fx8010_playback_prepare()
1677 snd_emu10k1_ptr_write(emu, emu->gpr_base + pcm->gpr_size, 0, runtime->buffer_size); snd_emu10k1_fx8010_playback_prepare()
1679 snd_emu10k1_ptr_write(emu, emu->gpr_base + pcm->gpr_count, 0, runtime->period_size); snd_emu10k1_fx8010_playback_prepare()
1680 snd_emu10k1_ptr_write(emu, emu->gpr_base + pcm->gpr_tmpcount, 0, runtime->period_size); snd_emu10k1_fx8010_playback_prepare()
1682 snd_emu10k1_ptr_write(emu, TANKMEMADDRREGBASE + 0x80 + pcm->etram[i], 0, (TANKMEMADDRREG_READ|TANKMEMADDRREG_ALIGN) + i * (runtime->buffer_size / pcm->channels)); snd_emu10k1_fx8010_playback_prepare()
1767 struct snd_pcm_runtime *runtime = substream->runtime; snd_emu10k1_fx8010_playback_open() local
1770 runtime->hw = snd_emu10k1_fx8010_playback; snd_emu10k1_fx8010_playback_open()
1771 runtime->hw.channels_min = runtime->hw.channels_max = pcm->channels; snd_emu10k1_fx8010_playback_open()
1772 runtime->hw.period_bytes_max = (pcm->buffer_size * 2) / 2; snd_emu10k1_fx8010_playback_open()
738 snd_emu10k1_playback_mangle_extra(struct snd_emu10k1 *emu, struct snd_emu10k1_pcm *epcm, struct snd_pcm_substream *substream, struct snd_pcm_runtime *runtime) snd_emu10k1_playback_mangle_extra() argument
H A Demu10k1x.c358 static void snd_emu10k1x_pcm_free_substream(struct snd_pcm_runtime *runtime) snd_emu10k1x_pcm_free_substream() argument
360 kfree(runtime->private_data); snd_emu10k1x_pcm_free_substream()
386 struct snd_pcm_runtime *runtime = substream->runtime; snd_emu10k1x_playback_open() local
389 if ((err = snd_pcm_hw_constraint_integer(runtime, SNDRV_PCM_HW_PARAM_PERIODS)) < 0) { snd_emu10k1x_playback_open()
392 if ((err = snd_pcm_hw_constraint_step(runtime, 0, SNDRV_PCM_HW_PARAM_PERIOD_BYTES, 64)) < 0) snd_emu10k1x_playback_open()
401 runtime->private_data = epcm; snd_emu10k1x_playback_open()
402 runtime->private_free = snd_emu10k1x_pcm_free_substream; snd_emu10k1x_playback_open()
404 runtime->hw = snd_emu10k1x_playback_hw; snd_emu10k1x_playback_open()
419 struct snd_pcm_runtime *runtime = substream->runtime; snd_emu10k1x_pcm_hw_params() local
420 struct emu10k1x_pcm *epcm = runtime->private_data; snd_emu10k1x_pcm_hw_params()
435 struct snd_pcm_runtime *runtime = substream->runtime; snd_emu10k1x_pcm_hw_free() local
438 if (runtime->private_data == NULL) snd_emu10k1x_pcm_hw_free()
441 epcm = runtime->private_data; snd_emu10k1x_pcm_hw_free()
456 struct snd_pcm_runtime *runtime = substream->runtime; snd_emu10k1x_pcm_prepare() local
457 struct emu10k1x_pcm *epcm = runtime->private_data; snd_emu10k1x_pcm_prepare()
460 u32 period_size_bytes = frames_to_bytes(runtime, runtime->period_size); snd_emu10k1x_pcm_prepare()
463 for(i = 0; i < runtime->periods; i++) { snd_emu10k1x_pcm_prepare()
464 *table_base++=runtime->dma_addr+(i*period_size_bytes); snd_emu10k1x_pcm_prepare()
469 snd_emu10k1x_ptr_write(emu, PLAYBACK_LIST_SIZE, voice, (runtime->periods - 1) << 19); snd_emu10k1x_pcm_prepare()
474 snd_emu10k1x_ptr_write(emu, PLAYBACK_DMA_ADDR, voice, runtime->dma_addr); snd_emu10k1x_pcm_prepare()
476 snd_emu10k1x_ptr_write(emu, PLAYBACK_PERIOD_SIZE, voice, frames_to_bytes(runtime, runtime->period_size)<<16); snd_emu10k1x_pcm_prepare()
486 struct snd_pcm_runtime *runtime = substream->runtime; snd_emu10k1x_pcm_trigger() local
487 struct emu10k1x_pcm *epcm = runtime->private_data; snd_emu10k1x_pcm_trigger()
499 if(runtime->periods == 2) snd_emu10k1x_pcm_trigger()
523 struct snd_pcm_runtime *runtime = substream->runtime; snd_emu10k1x_pcm_pointer() local
524 struct emu10k1x_pcm *epcm = runtime->private_data; snd_emu10k1x_pcm_pointer()
535 if(ptr4 == 0 && ptr1 == frames_to_bytes(runtime, runtime->buffer_size)) snd_emu10k1x_pcm_pointer()
540 ptr2 = bytes_to_frames(runtime, ptr1); snd_emu10k1x_pcm_pointer()
541 ptr2 += (ptr4 >> 3) * runtime->period_size; snd_emu10k1x_pcm_pointer()
544 if (ptr >= runtime->buffer_size) snd_emu10k1x_pcm_pointer()
545 ptr -= runtime->buffer_size; snd_emu10k1x_pcm_pointer()
567 struct snd_pcm_runtime *runtime = substream->runtime; snd_emu10k1x_pcm_open_capture() local
570 if ((err = snd_pcm_hw_constraint_integer(runtime, SNDRV_PCM_HW_PARAM_PERIODS)) < 0) snd_emu10k1x_pcm_open_capture()
572 if ((err = snd_pcm_hw_constraint_step(runtime, 0, SNDRV_PCM_HW_PARAM_PERIOD_BYTES, 64)) < 0) snd_emu10k1x_pcm_open_capture()
582 runtime->private_data = epcm; snd_emu10k1x_pcm_open_capture()
583 runtime->private_free = snd_emu10k1x_pcm_free_substream; snd_emu10k1x_pcm_open_capture()
585 runtime->hw = snd_emu10k1x_capture_hw; snd_emu10k1x_pcm_open_capture()
600 struct snd_pcm_runtime *runtime = substream->runtime; snd_emu10k1x_pcm_hw_params_capture() local
601 struct emu10k1x_pcm *epcm = runtime->private_data; snd_emu10k1x_pcm_hw_params_capture()
618 struct snd_pcm_runtime *runtime = substream->runtime; snd_emu10k1x_pcm_hw_free_capture() local
622 if (runtime->private_data == NULL) snd_emu10k1x_pcm_hw_free_capture()
624 epcm = runtime->private_data; snd_emu10k1x_pcm_hw_free_capture()
639 struct snd_pcm_runtime *runtime = substream->runtime; snd_emu10k1x_pcm_prepare_capture() local
641 snd_emu10k1x_ptr_write(emu, CAPTURE_DMA_ADDR, 0, runtime->dma_addr); snd_emu10k1x_pcm_prepare_capture()
642 snd_emu10k1x_ptr_write(emu, CAPTURE_BUFFER_SIZE, 0, frames_to_bytes(runtime, runtime->buffer_size)<<16); // buffer size in bytes snd_emu10k1x_pcm_prepare_capture()
654 struct snd_pcm_runtime *runtime = substream->runtime; snd_emu10k1x_pcm_trigger_capture() local
655 struct emu10k1x_pcm *epcm = runtime->private_data; snd_emu10k1x_pcm_trigger_capture()
683 struct snd_pcm_runtime *runtime = substream->runtime; snd_emu10k1x_pcm_pointer_capture() local
684 struct emu10k1x_pcm *epcm = runtime->private_data; snd_emu10k1x_pcm_pointer_capture()
690 ptr = bytes_to_frames(runtime, snd_emu10k1x_ptr_read(emu, CAPTURE_POINTER, 0)); snd_emu10k1x_pcm_pointer_capture()
691 if (ptr >= runtime->buffer_size) snd_emu10k1x_pcm_pointer_capture()
692 ptr -= runtime->buffer_size; snd_emu10k1x_pcm_pointer_capture()
H A Dmemory.c303 struct snd_pcm_runtime *runtime = substream->runtime; snd_emu10k1_alloc_pages() local
310 if (snd_BUG_ON(runtime->dma_bytes <= 0 || snd_emu10k1_alloc_pages()
311 runtime->dma_bytes >= (emu->address_mode ? MAXPAGES1 : MAXPAGES0) * EMUPAGESIZE)) snd_emu10k1_alloc_pages()
317 idx = runtime->period_size >= runtime->buffer_size ? snd_emu10k1_alloc_pages()
320 blk = search_empty(emu, runtime->dma_bytes + idx); snd_emu10k1_alloc_pages()
332 if (ofs >= runtime->dma_bytes) snd_emu10k1_alloc_pages()
/linux-4.1.27/sound/isa/sb/
H A Dsb8_main.c108 struct snd_pcm_runtime *runtime = substream->runtime; snd_sb8_playback_prepare() local
111 unsigned char stereo = runtime->channels > 1; snd_sb8_playback_prepare()
114 rate = runtime->rate; snd_sb8_playback_prepare()
117 if (runtime->format == SNDRV_PCM_FORMAT_S16_LE) { snd_sb8_playback_prepare()
126 if (runtime->channels > 1) { snd_sb8_playback_prepare()
172 runtime->dma_area[0] = 0x80; snd_sb8_playback_prepare()
173 snd_dma_program(dma, runtime->dma_addr, 1, DMA_MODE_WRITE); snd_sb8_playback_prepare()
181 snd_sbdsp_command(chip, 256 - runtime->rate_den / 2); snd_sb8_playback_prepare()
190 snd_sbdsp_command(chip, 256 - runtime->rate_den); snd_sb8_playback_prepare()
201 snd_dma_program(dma, runtime->dma_addr, snd_sb8_playback_prepare()
225 struct snd_pcm_runtime *runtime = substream->runtime; snd_sb8_playback_trigger() local
227 if (runtime->channels > 1) { snd_sb8_playback_trigger()
258 struct snd_pcm_runtime *runtime = substream->runtime; snd_sb8_capture_prepare() local
261 unsigned char stereo = runtime->channels > 1; snd_sb8_capture_prepare()
264 rate = runtime->rate; snd_sb8_capture_prepare()
267 if (runtime->format == SNDRV_PCM_FORMAT_S16_LE) { snd_sb8_capture_prepare()
276 if (runtime->channels > 1) { snd_sb8_capture_prepare()
318 snd_sbdsp_command(chip, 256 - runtime->rate_den / 2); snd_sb8_capture_prepare()
327 snd_sbdsp_command(chip, 256 - runtime->rate_den); snd_sb8_capture_prepare()
338 snd_dma_program(dma, runtime->dma_addr, snd_sb8_capture_prepare()
362 struct snd_pcm_runtime *runtime = substream->runtime; snd_sb8_capture_trigger() local
364 if (runtime->channels > 1) { snd_sb8_capture_trigger()
384 struct snd_pcm_runtime *runtime; snd_sb8dsp_interrupt() local
394 runtime = substream->runtime; snd_sb8dsp_interrupt()
405 runtime = substream->runtime; snd_sb8dsp_interrupt()
427 return bytes_to_frames(substream->runtime, ptr); snd_sb8_playback_pointer()
443 return bytes_to_frames(substream->runtime, ptr); snd_sb8_capture_pointer()
495 struct snd_pcm_runtime *runtime = substream->runtime; snd_sb8_open() local
507 runtime->hw = snd_sb8_playback; snd_sb8_open()
510 runtime->hw = snd_sb8_capture; snd_sb8_open()
515 runtime->hw.formats |= SNDRV_PCM_FMTBIT_S16_LE; snd_sb8_open()
516 runtime->hw.rates |= SNDRV_PCM_RATE_8000_48000; snd_sb8_open()
517 runtime->hw.rate_min = 4000; snd_sb8_open()
518 runtime->hw.rate_max = 50000; snd_sb8_open()
519 runtime->hw.channels_max = 2; snd_sb8_open()
522 runtime->hw.rate_max = 44100; snd_sb8_open()
523 runtime->hw.channels_max = 2; snd_sb8_open()
524 snd_pcm_hw_rule_add(runtime, 0, SNDRV_PCM_HW_PARAM_RATE, snd_sb8_open()
528 snd_pcm_hw_rule_add(runtime, 0, SNDRV_PCM_HW_PARAM_CHANNELS, snd_sb8_open()
534 runtime->hw.rate_max = 44100; snd_sb8_open()
536 runtime->hw.rate_max = 15000; snd_sb8_open()
541 snd_pcm_hw_constraint_ratnums(runtime, 0, SNDRV_PCM_HW_PARAM_RATE, snd_sb8_open()
544 snd_pcm_hw_constraint_step(runtime, 0, snd_sb8_open()
546 snd_pcm_hw_constraint_step(runtime, 0, snd_sb8_open()
548 runtime->hw.buffer_bytes_max = 128 * 1024 * 1024; snd_sb8_open()
549 runtime->hw.period_bytes_max = 128 * 1024 * 1024; snd_sb8_open()
H A Dsb16_main.c53 static void snd_sb16_csp_playback_prepare(struct snd_sb *chip, struct snd_pcm_runtime *runtime) snd_sb16_csp_playback_prepare() argument
61 ((1U << runtime->format) == csp->acc_format)) { snd_sb16_csp_playback_prepare()
62 /* Supported runtime PCM format for playback */ snd_sb16_csp_playback_prepare()
69 if ((1 << runtime->format) & (SNDRV_PCM_FMTBIT_S8 | SNDRV_PCM_FMTBIT_U8 | snd_sb16_csp_playback_prepare()
80 if (csp->ops.csp_autoload(csp, runtime->format, SNDRV_SB_CSP_MODE_DSP_WRITE)) { snd_sb16_csp_playback_prepare()
88 (runtime->channels > 1) ? snd_sb16_csp_playback_prepare()
101 static void snd_sb16_csp_capture_prepare(struct snd_sb *chip, struct snd_pcm_runtime *runtime) snd_sb16_csp_capture_prepare() argument
109 ((1U << runtime->format) == csp->acc_format)) { snd_sb16_csp_capture_prepare()
110 /* Supported runtime PCM format for capture */ snd_sb16_csp_capture_prepare()
118 if (csp->ops.csp_autoload(csp, runtime->format, SNDRV_SB_CSP_MODE_DSP_READ)) { snd_sb16_csp_capture_prepare()
126 (runtime->channels > 1) ? snd_sb16_csp_capture_prepare()
152 static void snd_sb16_csp_playback_open(struct snd_sb *chip, struct snd_pcm_runtime *runtime) snd_sb16_csp_playback_open() argument
161 runtime->hw.formats |= csp->acc_format; snd_sb16_csp_playback_open()
165 runtime->hw.formats |= SNDRV_PCM_FMTBIT_MU_LAW | SNDRV_PCM_FMTBIT_A_LAW | snd_sb16_csp_playback_open()
183 static void snd_sb16_csp_capture_open(struct snd_sb *chip, struct snd_pcm_runtime *runtime) snd_sb16_csp_capture_open() argument
192 runtime->hw.formats |= csp->acc_format; snd_sb16_csp_capture_open()
196 runtime->hw.formats |= SNDRV_PCM_FMTBIT_MU_LAW | SNDRV_PCM_FMTBIT_A_LAW | snd_sb16_csp_capture_open()
214 #define snd_sb16_csp_playback_prepare(chip, runtime) /*nop*/
215 #define snd_sb16_csp_capture_prepare(chip, runtime) /*nop*/
217 #define snd_sb16_csp_playback_open(chip, runtime) /*nop*/
219 #define snd_sb16_csp_capture_open(chip, runtime) /*nop*/
263 struct snd_pcm_runtime *runtime = substream->runtime; snd_sb16_playback_prepare() local
267 snd_sb16_csp_playback_prepare(chip, runtime); snd_sb16_playback_prepare()
268 if (snd_pcm_format_unsigned(runtime->format) > 0) { snd_sb16_playback_prepare()
269 format = runtime->channels > 1 ? SB_DSP4_MODE_UNS_STEREO : SB_DSP4_MODE_UNS_MONO; snd_sb16_playback_prepare()
271 format = runtime->channels > 1 ? SB_DSP4_MODE_SIGN_STEREO : SB_DSP4_MODE_SIGN_MONO; snd_sb16_playback_prepare()
274 snd_sb16_setup_rate(chip, runtime->rate, SNDRV_PCM_STREAM_PLAYBACK); snd_sb16_playback_prepare()
277 snd_dma_program(dma, runtime->dma_addr, size, DMA_MODE_WRITE | DMA_AUTOINIT); snd_sb16_playback_prepare()
333 struct snd_pcm_runtime *runtime = substream->runtime; snd_sb16_capture_prepare() local
337 snd_sb16_csp_capture_prepare(chip, runtime); snd_sb16_capture_prepare()
338 if (snd_pcm_format_unsigned(runtime->format) > 0) { snd_sb16_capture_prepare()
339 format = runtime->channels > 1 ? SB_DSP4_MODE_UNS_STEREO : SB_DSP4_MODE_UNS_MONO; snd_sb16_capture_prepare()
341 format = runtime->channels > 1 ? SB_DSP4_MODE_SIGN_STEREO : SB_DSP4_MODE_SIGN_MONO; snd_sb16_capture_prepare()
343 snd_sb16_setup_rate(chip, runtime->rate, SNDRV_PCM_STREAM_CAPTURE); snd_sb16_capture_prepare()
346 snd_dma_program(dma, runtime->dma_addr, size, DMA_MODE_READ | DMA_AUTOINIT); snd_sb16_capture_prepare()
458 return bytes_to_frames(substream->runtime, ptr); snd_sb16_playback_pointer()
469 return bytes_to_frames(substream->runtime, ptr); snd_sb16_capture_pointer()
520 struct snd_pcm_runtime *runtime = substream->runtime; snd_sb16_playback_open() local
527 runtime->hw = snd_sb16_playback; snd_sb16_playback_open()
535 runtime->hw.formats = SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_U16_LE; snd_sb16_playback_open()
538 runtime->hw.buffer_bytes_max = snd_sb16_playback_open()
539 runtime->hw.period_bytes_max = 64 * 1024; snd_sb16_playback_open()
541 snd_sb16_csp_playback_open(chip, runtime); snd_sb16_playback_open()
551 runtime->hw.formats = SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_U16_LE; snd_sb16_playback_open()
554 runtime->hw.formats = SNDRV_PCM_FMTBIT_U8 | SNDRV_PCM_FMTBIT_S8; snd_sb16_playback_open()
556 runtime->hw.buffer_bytes_max = snd_sb16_playback_open()
557 runtime->hw.period_bytes_max = 64 * 1024; snd_sb16_playback_open()
565 runtime->hw.rate_max = 48000; snd_sb16_playback_open()
567 runtime->hw.buffer_bytes_max = 32 * 1024; snd_sb16_playback_open()
568 runtime->hw.periods_min = 2; snd_sb16_playback_open()
569 runtime->hw.rate_min = 44100; snd_sb16_playback_open()
572 runtime->hw.rate_min = runtime->hw.rate_max = chip->locked_rate; snd_sb16_playback_open()
595 struct snd_pcm_runtime *runtime = substream->runtime; snd_sb16_capture_open() local
602 runtime->hw = snd_sb16_capture; snd_sb16_capture_open()
610 runtime->hw.formats = SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_U16_LE; snd_sb16_capture_open()
613 runtime->hw.buffer_bytes_max = snd_sb16_capture_open()
614 runtime->hw.period_bytes_max = 64 * 1024; snd_sb16_capture_open()
616 snd_sb16_csp_capture_open(chip, runtime); snd_sb16_capture_open()
626 runtime->hw.formats = SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_U16_LE; snd_sb16_capture_open()
629 runtime->hw.formats = SNDRV_PCM_FMTBIT_U8 | SNDRV_PCM_FMTBIT_S8; snd_sb16_capture_open()
631 runtime->hw.buffer_bytes_max = snd_sb16_capture_open()
632 runtime->hw.period_bytes_max = 64 * 1024; snd_sb16_capture_open()
640 runtime->hw.rate_max = 48000; snd_sb16_capture_open()
642 runtime->hw.buffer_bytes_max = 32 * 1024; snd_sb16_capture_open()
643 runtime->hw.periods_min = 2; snd_sb16_capture_open()
644 runtime->hw.rate_min = 44100; snd_sb16_capture_open()
647 runtime->hw.rate_min = runtime->hw.rate_max = chip->locked_rate; snd_sb16_capture_open()
H A Demu8000_pcm.c231 struct snd_pcm_runtime *runtime = subs->runtime; emu8k_pcm_open() local
239 runtime->private_data = rec; emu8k_pcm_open()
244 runtime->hw = emu8k_pcm_hw; emu8k_pcm_open()
245 runtime->hw.buffer_bytes_max = emu->mem_size - LOOP_BLANK_SIZE * 3; emu8k_pcm_open()
246 runtime->hw.period_bytes_max = runtime->hw.buffer_bytes_max / 2; emu8k_pcm_open()
249 snd_pcm_hw_constraint_minmax(runtime, SNDRV_PCM_HW_PARAM_PERIOD_TIME, emu8k_pcm_open()
257 struct snd_emu8k_pcm *rec = subs->runtime->private_data; emu8k_pcm_close()
259 subs->runtime->private_data = NULL; emu8k_pcm_close()
386 struct snd_emu8k_pcm *rec = subs->runtime->private_data; emu8k_pcm_trigger()
447 struct snd_emu8k_pcm *rec = subs->runtime->private_data; emu8k_pcm_copy()
484 struct snd_emu8k_pcm *rec = subs->runtime->private_data; emu8k_pcm_silence()
513 struct snd_emu8k_pcm *rec = subs->runtime->private_data; emu8k_pcm_copy()
545 struct snd_emu8k_pcm *rec = subs->runtime->private_data; emu8k_pcm_silence()
571 struct snd_emu8k_pcm *rec = subs->runtime->private_data; emu8k_pcm_hw_params()
595 struct snd_emu8k_pcm *rec = subs->runtime->private_data; emu8k_pcm_hw_free()
613 struct snd_emu8k_pcm *rec = subs->runtime->private_data; emu8k_pcm_prepare()
615 rec->pitch = 0xe000 + calc_rate_offset(subs->runtime->rate); emu8k_pcm_prepare()
619 rec->buf_size = subs->runtime->buffer_size; emu8k_pcm_prepare()
620 rec->period_size = subs->runtime->period_size; emu8k_pcm_prepare()
621 rec->voices = subs->runtime->channels; emu8k_pcm_prepare()
659 struct snd_emu8k_pcm *rec = subs->runtime->private_data; emu8k_pcm_pointer()
/linux-4.1.27/arch/mips/bcm63xx/
H A Ddev-enet.c48 .start = -1, /* filled at runtime */
49 .end = -1, /* filled at runtime */
53 .start = -1, /* filled at runtime */
54 .end = -1, /* filled at runtime */
58 .start = -1, /* filled at runtime */
59 .end = -1, /* filled at runtime */
75 .start = -1, /* filled at runtime */
76 .end = -1, /* filled at runtime */
80 .start = -1, /* filled at runtime */
84 .start = -1, /* filled at runtime */
88 .start = -1, /* filled at runtime */
107 .start = -1, /* filled at runtime */
108 .end = -1, /* filled at runtime */
112 .start = -1, /* filled at runtime */
116 .start = -1, /* filled at runtime */
120 .start = -1, /* filled at runtime */
139 /* start & end filled at runtime */
143 /* start filled at runtime */
147 /* start filled at runtime */
H A Ddev-hsspi.c19 .start = -1, /* filled at runtime */
20 .end = -1, /* filled at runtime */
24 .start = -1, /* filled at runtime */
H A Ddev-uart.c16 /* start & end filled at runtime */
20 /* start filled at runtime */
27 /* start & end filled at runtime */
31 /* start filled at runtime */
H A Ddev-dsp.c22 .start = -1, /* filled at runtime */
23 .end = -1, /* filled at runtime */
27 .start = -1, /* filled at runtime */
H A Ddev-rng.c16 .start = -1, /* filled at runtime */
17 .end = -1, /* filled at runtime */
H A Ddev-wdt.c16 .start = -1, /* filled at runtime */
17 .end = -1, /* filled at runtime */
H A Ddev-spi.c46 .start = -1, /* filled at runtime */
47 .end = -1, /* filled at runtime */
51 .start = -1, /* filled at runtime */
H A Ddev-flash.c43 .start = 0, /* filled at runtime */
44 .end = 0, /* filled at runtime */
H A Ddev-pcmcia.c22 /* start & end filled at runtime */
45 /* start filled at runtime */
/linux-4.1.27/sound/arm/
H A Dpxa2xx-pcm-lib.c42 struct snd_pcm_runtime *runtime = substream->runtime; __pxa2xx_pcm_hw_params() local
43 struct pxa2xx_runtime_data *rtd = runtime->private_data; __pxa2xx_pcm_hw_params()
79 runtime->dma_bytes = totsize; __pxa2xx_pcm_hw_params()
83 dma_buff_phys = runtime->dma_addr; __pxa2xx_pcm_hw_params()
108 struct pxa2xx_runtime_data *rtd = substream->runtime->private_data; __pxa2xx_pcm_hw_free()
122 struct pxa2xx_runtime_data *prtd = substream->runtime->private_data; pxa2xx_pcm_trigger()
156 struct snd_pcm_runtime *runtime = substream->runtime; pxa2xx_pcm_pointer() local
157 struct pxa2xx_runtime_data *prtd = runtime->private_data; pxa2xx_pcm_pointer()
161 snd_pcm_uframes_t x = bytes_to_frames(runtime, ptr - runtime->dma_addr); pxa2xx_pcm_pointer()
163 if (x == runtime->buffer_size) pxa2xx_pcm_pointer()
171 struct pxa2xx_runtime_data *prtd = substream->runtime->private_data; __pxa2xx_pcm_prepare()
210 struct snd_pcm_runtime *runtime = substream->runtime; __pxa2xx_pcm_open() local
214 runtime->hw = pxa2xx_pcm_hardware; __pxa2xx_pcm_open()
221 ret = snd_pcm_hw_constraint_step(runtime, 0, __pxa2xx_pcm_open()
226 ret = snd_pcm_hw_constraint_step(runtime, 0, __pxa2xx_pcm_open()
231 ret = snd_pcm_hw_constraint_integer(runtime, __pxa2xx_pcm_open()
247 runtime->private_data = rtd; __pxa2xx_pcm_open()
259 struct snd_pcm_runtime *runtime = substream->runtime; __pxa2xx_pcm_close() local
260 struct pxa2xx_runtime_data *rtd = runtime->private_data; __pxa2xx_pcm_close()
272 struct snd_pcm_runtime *runtime = substream->runtime; pxa2xx_pcm_mmap() local
274 runtime->dma_area, pxa2xx_pcm_mmap()
275 runtime->dma_addr, pxa2xx_pcm_mmap()
276 runtime->dma_bytes); pxa2xx_pcm_mmap()
H A Dpxa2xx-ac97.c67 struct snd_pcm_runtime *runtime = substream->runtime; pxa2xx_ac97_pcm_startup() local
71 runtime->hw.channels_min = 2; pxa2xx_ac97_pcm_startup()
72 runtime->hw.channels_max = 2; pxa2xx_ac97_pcm_startup()
76 runtime->hw.rates = pxa2xx_ac97_ac97->rates[r]; pxa2xx_ac97_pcm_startup()
77 snd_pcm_limit_hw_rates(runtime); pxa2xx_ac97_pcm_startup()
97 struct snd_pcm_runtime *runtime = substream->runtime; pxa2xx_ac97_pcm_prepare() local
100 return snd_ac97_set_rate(pxa2xx_ac97_ac97, reg, runtime->rate); pxa2xx_ac97_pcm_prepare()
H A Dpxa2xx-pcm.c37 struct snd_pcm_runtime *runtime = substream->runtime; pxa2xx_pcm_open() local
45 rtd = runtime->private_data; pxa2xx_pcm_open()
69 struct pxa2xx_runtime_data *rtd = substream->runtime->private_data; pxa2xx_pcm_close()
H A Daaci.c404 struct snd_pcm_runtime *runtime = substream->runtime; aaci_pcm_open() local
416 runtime->private_data = aacirun; aaci_pcm_open()
417 runtime->hw = aaci_hw_info; aaci_pcm_open()
418 runtime->hw.rates = aacirun->pcm->rates; aaci_pcm_open()
419 snd_pcm_limit_hw_rates(runtime); aaci_pcm_open()
422 runtime->hw.channels_max = 6; aaci_pcm_open()
425 ret = snd_pcm_hw_rule_add(substream->runtime, 0, aaci_pcm_open()
433 snd_ac97_pcm_double_rate_rules(runtime); aaci_pcm_open()
441 runtime->hw.fifo_size = aaci->fifo_depth * 2; aaci_pcm_open()
462 struct aaci_runtime *aacirun = substream->runtime->private_data; aaci_pcm_close()
478 struct aaci_runtime *aacirun = substream->runtime->private_data; aaci_pcm_hw_free()
507 struct aaci_runtime *aacirun = substream->runtime->private_data; aaci_pcm_hw_params()
548 struct snd_pcm_runtime *runtime = substream->runtime; aaci_pcm_prepare() local
549 struct aaci_runtime *aacirun = runtime->private_data; aaci_pcm_prepare()
552 aacirun->start = runtime->dma_area; aaci_pcm_prepare()
562 struct snd_pcm_runtime *runtime = substream->runtime; aaci_pcm_pointer() local
563 struct aaci_runtime *aacirun = runtime->private_data; aaci_pcm_pointer()
566 return bytes_to_frames(runtime, bytes); aaci_pcm_pointer()
600 struct aaci_runtime *aacirun = substream->runtime->private_data; aaci_pcm_playback_trigger()
685 struct aaci_runtime *aacirun = substream->runtime->private_data; aaci_pcm_capture_trigger()
725 struct snd_pcm_runtime *runtime = substream->runtime; aaci_pcm_capture_prepare() local
732 aaci_ac97_write(aaci->ac97, AC97_PCM_LR_ADC_RATE, runtime->rate); aaci_pcm_capture_prepare()
733 aaci_ac97_write(aaci->ac97, AC97_PCM_MIC_ADC_RATE, runtime->rate); aaci_pcm_capture_prepare()
/linux-4.1.27/sound/soc/fsl/
H A Dimx-pcm-fiq.c80 struct snd_pcm_runtime *runtime = substream->runtime; snd_imx_pcm_hw_params() local
81 struct imx_pcm_runtime_data *iprtd = runtime->private_data; snd_imx_pcm_hw_params()
95 struct snd_pcm_runtime *runtime = substream->runtime; snd_imx_pcm_prepare() local
96 struct imx_pcm_runtime_data *iprtd = runtime->private_data; snd_imx_pcm_prepare()
114 struct snd_pcm_runtime *runtime = substream->runtime; snd_imx_pcm_trigger() local
115 struct imx_pcm_runtime_data *iprtd = runtime->private_data; snd_imx_pcm_trigger()
151 struct snd_pcm_runtime *runtime = substream->runtime; snd_imx_pcm_pointer() local
152 struct imx_pcm_runtime_data *iprtd = runtime->private_data; snd_imx_pcm_pointer()
154 return bytes_to_frames(substream->runtime, iprtd->offset); snd_imx_pcm_pointer()
175 struct snd_pcm_runtime *runtime = substream->runtime; snd_imx_open() local
182 runtime->private_data = iprtd; snd_imx_open()
191 ret = snd_pcm_hw_constraint_integer(substream->runtime, snd_imx_open()
204 struct snd_pcm_runtime *runtime = substream->runtime; snd_imx_close() local
205 struct imx_pcm_runtime_data *iprtd = runtime->private_data; snd_imx_close()
217 struct snd_pcm_runtime *runtime = substream->runtime; snd_imx_pcm_mmap() local
221 runtime->dma_area, runtime->dma_addr, runtime->dma_bytes); snd_imx_pcm_mmap()
224 runtime->dma_area, snd_imx_pcm_mmap()
225 runtime->dma_addr, snd_imx_pcm_mmap()
226 runtime->dma_bytes); snd_imx_pcm_mmap()
H A Dfsl_asrc_dma.c51 struct snd_pcm_runtime *runtime = substream->runtime; fsl_asrc_dma_complete() local
52 struct fsl_asrc_pair *pair = runtime->private_data; fsl_asrc_dma_complete()
65 struct snd_pcm_runtime *runtime = substream->runtime; fsl_asrc_dma_prepare_and_submit() local
66 struct fsl_asrc_pair *pair = runtime->private_data; fsl_asrc_dma_prepare_and_submit()
71 if (!substream->runtime->no_period_wakeup) fsl_asrc_dma_prepare_and_submit()
76 pair->dma_chan[!dir], runtime->dma_addr, fsl_asrc_dma_prepare_and_submit()
105 struct snd_pcm_runtime *runtime = substream->runtime; fsl_asrc_dma_trigger() local
106 struct fsl_asrc_pair *pair = runtime->private_data; fsl_asrc_dma_trigger()
140 struct snd_pcm_runtime *runtime = substream->runtime; fsl_asrc_dma_hw_params() local
141 struct fsl_asrc_pair *pair = runtime->private_data; fsl_asrc_dma_hw_params()
256 struct snd_pcm_runtime *runtime = substream->runtime; fsl_asrc_dma_hw_free() local
257 struct fsl_asrc_pair *pair = runtime->private_data; fsl_asrc_dma_hw_free()
276 struct snd_pcm_runtime *runtime = substream->runtime; fsl_asrc_dma_startup() local
289 runtime->private_data = pair; fsl_asrc_dma_startup()
291 snd_pcm_hw_constraint_integer(substream->runtime, fsl_asrc_dma_startup()
300 struct snd_pcm_runtime *runtime = substream->runtime; fsl_asrc_dma_shutdown() local
301 struct fsl_asrc_pair *pair = runtime->private_data; fsl_asrc_dma_shutdown()
319 struct snd_pcm_runtime *runtime = substream->runtime; fsl_asrc_dma_pcm_pointer() local
320 struct fsl_asrc_pair *pair = runtime->private_data; fsl_asrc_dma_pcm_pointer()
322 return bytes_to_frames(substream->runtime, pair->pos); fsl_asrc_dma_pcm_pointer()
H A Dmpc5200_dma.c66 bd->data[0] = s->runtime->dma_addr + (s->period_next * s->period_bytes); psc_dma_bcom_enqueue_next_buffer()
70 s->period_next = (s->period_next + 1) % s->runtime->periods; psc_dma_bcom_enqueue_next_buffer()
84 s->period_current = (s->period_current+1) % s->runtime->periods; psc_dma_bcom_irq()
115 struct snd_pcm_runtime *runtime = substream->runtime; psc_dma_trigger() local
125 substream->pstr->stream, runtime->frame_bits, psc_dma_trigger()
126 (int)runtime->period_size, runtime->periods); psc_dma_trigger()
127 s->period_bytes = frames_to_bytes(runtime, psc_dma_trigger()
128 runtime->period_size); psc_dma_trigger()
133 s->runtime = runtime; psc_dma_trigger()
145 for (i = 0; i < runtime->periods; i++) psc_dma_trigger()
213 struct snd_pcm_runtime *runtime = substream->runtime; psc_dma_open() local
228 rc = snd_pcm_hw_constraint_integer(runtime, psc_dma_open()
278 return bytes_to_frames(substream->runtime, count); psc_dma_pointer()
H A Dfsl_dma.c387 struct snd_pcm_runtime *runtime = substream->runtime; fsl_dma_open() local
406 ret = snd_pcm_hw_constraint_integer(runtime, fsl_dma_open()
452 runtime->private_data = dma_private; fsl_dma_open()
540 struct snd_pcm_runtime *runtime = substream->runtime; fsl_dma_hw_params() local
541 struct fsl_dma_private *dma_private = runtime->private_data; fsl_dma_hw_params()
703 struct snd_pcm_runtime *runtime = substream->runtime; fsl_dma_pointer() local
704 struct fsl_dma_private *dma_private = runtime->private_data; fsl_dma_pointer()
745 frames = bytes_to_frames(runtime, position - dma_private->dma_buf_phys); fsl_dma_pointer()
751 if (frames == runtime->buffer_size) fsl_dma_pointer()
767 struct snd_pcm_runtime *runtime = substream->runtime; fsl_dma_hw_free() local
768 struct fsl_dma_private *dma_private = runtime->private_data; fsl_dma_hw_free()
800 struct snd_pcm_runtime *runtime = substream->runtime; fsl_dma_close() local
801 struct fsl_dma_private *dma_private = runtime->private_data; fsl_dma_close()
814 substream->runtime->private_data = NULL; fsl_dma_close()
/linux-4.1.27/sound/soc/samsung/
H A Didma.c73 struct snd_pcm_runtime *runtime = substream->runtime; idma_enqueue() local
74 struct idma_ctrl *prtd = substream->runtime->private_data; idma_enqueue()
95 val |= (((runtime->dma_bytes >> 2) & idma_enqueue()
109 struct idma_ctrl *prtd = substream->runtime->private_data; idma_setcallbk()
141 struct idma_ctrl *prtd = substream->runtime->private_data; idma_done()
150 struct snd_pcm_runtime *runtime = substream->runtime; idma_hw_params() local
151 struct idma_ctrl *prtd = substream->runtime->private_data; idma_hw_params()
161 runtime->dma_bytes = params_buffer_bytes(params); idma_hw_params()
163 prtd->start = prtd->pos = runtime->dma_addr; idma_hw_params()
166 prtd->end = runtime->dma_addr + runtime->dma_bytes; idma_hw_params()
182 struct idma_ctrl *prtd = substream->runtime->private_data; idma_prepare()
195 struct idma_ctrl *prtd = substream->runtime->private_data; idma_trigger()
228 struct snd_pcm_runtime *runtime = substream->runtime; idma_pointer() local
229 struct idma_ctrl *prtd = runtime->private_data; idma_pointer()
240 return bytes_to_frames(substream->runtime, res); idma_pointer()
246 struct snd_pcm_runtime *runtime = substream->runtime; idma_mmap() local
255 (runtime->dma_addr + offset) >> PAGE_SHIFT, idma_mmap()
290 struct snd_pcm_runtime *runtime = substream->runtime; idma_open() local
309 runtime->private_data = prtd; idma_open()
316 struct snd_pcm_runtime *runtime = substream->runtime; idma_close() local
317 struct idma_ctrl *prtd = runtime->private_data; idma_close()
H A Dh1940_uda1380.c67 struct snd_pcm_runtime *runtime = substream->runtime; h1940_startup() local
69 return snd_pcm_hw_constraint_list(runtime, 0, h1940_startup()
H A Drx1950_uda1380.c136 struct snd_pcm_runtime *runtime = substream->runtime; rx1950_startup() local
138 return snd_pcm_hw_constraint_list(runtime, 0, rx1950_startup()
/linux-4.1.27/drivers/gpu/drm/nouveau/
H A Dnouveau_vga.c89 bool runtime = false; nouveau_vga_init() local
98 runtime = true; nouveau_vga_init()
100 runtime = true; nouveau_vga_init()
101 vga_switcheroo_register_client(dev->pdev, &nouveau_switcheroo_ops, runtime); nouveau_vga_init()
103 if (runtime && nouveau_is_v1_dsm() && !nouveau_is_optimus()) nouveau_vga_init()
111 bool runtime = false; nouveau_vga_fini() local
114 runtime = true; nouveau_vga_fini()
116 runtime = true; nouveau_vga_fini()
119 if (runtime && nouveau_is_v1_dsm() && !nouveau_is_optimus()) nouveau_vga_fini()
H A Dnouveau_display.h66 int nouveau_display_suspend(struct drm_device *dev, bool runtime);
67 void nouveau_display_resume(struct drm_device *dev, bool runtime);
/linux-4.1.27/sound/firewire/oxfw/
H A Doxfw-pcm.c124 struct snd_pcm_runtime *runtime = substream->runtime; init_hw_params() local
129 runtime->hw.info = SNDRV_PCM_INFO_BATCH | init_hw_params()
137 runtime->hw.formats = AMDTP_IN_PCM_FORMAT_BITS; init_hw_params()
141 runtime->hw.formats = AMDTP_OUT_PCM_FORMAT_BITS; init_hw_params()
146 limit_channels_and_rates(&runtime->hw, formats); init_hw_params()
147 limit_period_and_buffer(&runtime->hw); init_hw_params()
149 err = snd_pcm_hw_rule_add(runtime, 0, SNDRV_PCM_HW_PARAM_CHANNELS, init_hw_params()
155 err = snd_pcm_hw_rule_add(runtime, 0, SNDRV_PCM_HW_PARAM_RATE, init_hw_params()
161 err = amdtp_stream_add_pcm_hw_constraints(stream, runtime); init_hw_params()
182 substream->runtime->hw.channels_min = formation.pcm; limit_to_current_params()
183 substream->runtime->hw.channels_max = formation.pcm; limit_to_current_params()
184 substream->runtime->hw.rate_min = formation.rate; limit_to_current_params()
185 substream->runtime->hw.rate_max = formation.rate; limit_to_current_params()
236 if (substream->runtime->status->state == SNDRV_PCM_STATE_OPEN) { pcm_capture_hw_params()
252 if (substream->runtime->status->state == SNDRV_PCM_STATE_OPEN) { pcm_playback_hw_params()
270 if (substream->runtime->status->state != SNDRV_PCM_STATE_OPEN) pcm_capture_hw_free()
285 if (substream->runtime->status->state != SNDRV_PCM_STATE_OPEN) pcm_playback_hw_free()
298 struct snd_pcm_runtime *runtime = substream->runtime; pcm_capture_prepare() local
303 runtime->rate, runtime->channels); pcm_capture_prepare()
315 struct snd_pcm_runtime *runtime = substream->runtime; pcm_playback_prepare() local
320 runtime->rate, runtime->channels); pcm_playback_prepare()
/linux-4.1.27/drivers/media/usb/tm6000/
H A Dtm6000-alsa.c111 vfree(substream->runtime->dma_area); dsp_buffer_free()
112 substream->runtime->dma_area = NULL; dsp_buffer_free()
113 substream->runtime->dma_bytes = 0; dsp_buffer_free()
122 if (substream->runtime->dma_area) { dsp_buffer_alloc()
123 if (substream->runtime->dma_bytes > size) dsp_buffer_alloc()
129 substream->runtime->dma_area = vmalloc(size); dsp_buffer_alloc()
130 if (!substream->runtime->dma_area) dsp_buffer_alloc()
133 substream->runtime->dma_bytes = size; dsp_buffer_alloc()
174 struct snd_pcm_runtime *runtime = substream->runtime; snd_tm6000_pcm_open() local
177 err = snd_pcm_hw_constraint_pow2(runtime, 0, snd_tm6000_pcm_open()
184 runtime->hw = snd_tm6000_digital_hw; snd_tm6000_pcm_open()
185 snd_pcm_hw_constraint_integer(runtime, SNDRV_PCM_HW_PARAM_PERIODS); snd_tm6000_pcm_open()
213 struct snd_pcm_runtime *runtime; tm6000_fillbuf() local
226 runtime = substream->runtime; tm6000_fillbuf()
227 if (!runtime || !runtime->dma_area) { tm6000_fillbuf()
228 dprintk(1, "runtime was NULL\n"); tm6000_fillbuf()
233 stride = runtime->frame_bits >> 3; tm6000_fillbuf()
247 runtime->dma_area, buf_pos, tm6000_fillbuf()
248 (unsigned int)runtime->buffer_size, stride); tm6000_fillbuf()
250 if (buf_pos + length >= runtime->buffer_size) { tm6000_fillbuf()
251 unsigned int cnt = runtime->buffer_size - buf_pos; tm6000_fillbuf()
252 memcpy(runtime->dma_area + buf_pos * stride, buf, cnt * stride); tm6000_fillbuf()
253 memcpy(runtime->dma_area, buf + cnt * stride, tm6000_fillbuf()
256 memcpy(runtime->dma_area + buf_pos * stride, buf, tm6000_fillbuf()
262 if (chip->buf_pos >= runtime->buffer_size) tm6000_fillbuf()
263 chip->buf_pos -= runtime->buffer_size; tm6000_fillbuf()
266 if (chip->period_pos >= runtime->period_size) { tm6000_fillbuf()
267 chip->period_pos -= runtime->period_size; tm6000_fillbuf()
383 void *pageptr = subs->runtime->dma_area + offset; snd_pcm_get_vmalloc_page()
/linux-4.1.27/sound/firewire/fireworks/
H A Dfireworks_pcm.c149 struct snd_pcm_runtime *runtime = substream->runtime; pcm_init_hw_params() local
154 runtime->hw.info = SNDRV_PCM_INFO_BATCH | pcm_init_hw_params()
162 runtime->hw.formats = AMDTP_IN_PCM_FORMAT_BITS; pcm_init_hw_params()
166 runtime->hw.formats = AMDTP_OUT_PCM_FORMAT_BITS; pcm_init_hw_params()
172 runtime->hw.rates = efw->supported_sampling_rate, pcm_init_hw_params()
173 snd_pcm_limit_hw_rates(runtime); pcm_init_hw_params()
175 limit_channels(&runtime->hw, pcm_channels); pcm_init_hw_params()
176 limit_period_and_buffer(&runtime->hw); pcm_init_hw_params()
178 err = snd_pcm_hw_rule_add(runtime, 0, SNDRV_PCM_HW_PARAM_CHANNELS, pcm_init_hw_params()
184 err = snd_pcm_hw_rule_add(runtime, 0, SNDRV_PCM_HW_PARAM_RATE, pcm_init_hw_params()
190 err = amdtp_stream_add_pcm_hw_constraints(s, runtime); pcm_init_hw_params()
224 substream->runtime->hw.rate_min = sampling_rate; pcm_open()
225 substream->runtime->hw.rate_max = sampling_rate; pcm_open()
248 if (substream->runtime->status->state == SNDRV_PCM_STATE_OPEN) pcm_capture_hw_params()
260 if (substream->runtime->status->state == SNDRV_PCM_STATE_OPEN) pcm_playback_hw_params()
272 if (substream->runtime->status->state != SNDRV_PCM_STATE_OPEN) pcm_capture_hw_free()
283 if (substream->runtime->status->state != SNDRV_PCM_STATE_OPEN) pcm_playback_hw_free()
294 struct snd_pcm_runtime *runtime = substream->runtime; pcm_capture_prepare() local
297 err = snd_efw_stream_start_duplex(efw, runtime->rate); pcm_capture_prepare()
306 struct snd_pcm_runtime *runtime = substream->runtime; pcm_playback_prepare() local
309 err = snd_efw_stream_start_duplex(efw, runtime->rate); pcm_playback_prepare()
/linux-4.1.27/drivers/media/usb/go7007/
H A Dsnd-go7007.c76 struct snd_pcm_runtime *runtime = gosnd->substream->runtime; parse_audio_stream_data() local
77 int frames = bytes_to_frames(runtime, length); parse_audio_stream_data()
81 if (gosnd->hw_ptr >= runtime->buffer_size) parse_audio_stream_data()
82 gosnd->hw_ptr -= runtime->buffer_size; parse_audio_stream_data()
85 if (gosnd->w_idx + length > runtime->dma_bytes) { parse_audio_stream_data()
86 int cpy = runtime->dma_bytes - gosnd->w_idx; parse_audio_stream_data()
88 memcpy(runtime->dma_area + gosnd->w_idx, buf, cpy); parse_audio_stream_data()
93 memcpy(runtime->dma_area + gosnd->w_idx, buf, length); parse_audio_stream_data()
96 if (gosnd->avail < runtime->period_size) { parse_audio_stream_data()
100 gosnd->avail -= runtime->period_size; parse_audio_stream_data()
113 if (substream->runtime->dma_bytes > 0) go7007_snd_hw_params()
114 vfree(substream->runtime->dma_area); go7007_snd_hw_params()
115 substream->runtime->dma_bytes = 0; go7007_snd_hw_params()
116 substream->runtime->dma_area = vmalloc(bytes); go7007_snd_hw_params()
117 if (substream->runtime->dma_area == NULL) go7007_snd_hw_params()
119 substream->runtime->dma_bytes = bytes; go7007_snd_hw_params()
129 if (substream->runtime->dma_bytes > 0) go7007_snd_hw_free()
130 vfree(substream->runtime->dma_area); go7007_snd_hw_free()
131 substream->runtime->dma_bytes = 0; go7007_snd_hw_free()
145 substream->runtime->hw = go7007_snd_capture_hw; go7007_snd_capture_open()
198 return vmalloc_to_page(substream->runtime->dma_area + offset); go7007_snd_pcm_page()
/linux-4.1.27/sound/firewire/bebob/
H A Dbebob_pcm.c112 struct snd_pcm_runtime *runtime = substream->runtime; pcm_init_hw_params() local
117 runtime->hw.info = SNDRV_PCM_INFO_BATCH | pcm_init_hw_params()
125 runtime->hw.formats = AMDTP_IN_PCM_FORMAT_BITS; pcm_init_hw_params()
129 runtime->hw.formats = AMDTP_OUT_PCM_FORMAT_BITS; pcm_init_hw_params()
134 limit_channels_and_rates(&runtime->hw, formations); pcm_init_hw_params()
135 limit_period_and_buffer(&runtime->hw); pcm_init_hw_params()
137 err = snd_pcm_hw_rule_add(runtime, 0, SNDRV_PCM_HW_PARAM_CHANNELS, pcm_init_hw_params()
143 err = snd_pcm_hw_rule_add(runtime, 0, SNDRV_PCM_HW_PARAM_RATE, pcm_init_hw_params()
149 err = amdtp_stream_add_pcm_hw_constraints(s, runtime); pcm_init_hw_params()
189 substream->runtime->hw.rate_min = sampling_rate; pcm_open()
190 substream->runtime->hw.rate_max = sampling_rate; pcm_open()
215 if (substream->runtime->status->state == SNDRV_PCM_STATE_OPEN) pcm_capture_hw_params()
228 if (substream->runtime->status->state == SNDRV_PCM_STATE_OPEN) pcm_playback_hw_params()
241 if (substream->runtime->status->state != SNDRV_PCM_STATE_OPEN) pcm_capture_hw_free()
253 if (substream->runtime->status->state != SNDRV_PCM_STATE_OPEN) pcm_playback_hw_free()
265 struct snd_pcm_runtime *runtime = substream->runtime; pcm_capture_prepare() local
268 err = snd_bebob_stream_start_duplex(bebob, runtime->rate); pcm_capture_prepare()
278 struct snd_pcm_runtime *runtime = substream->runtime; pcm_playback_prepare() local
281 err = snd_bebob_stream_start_duplex(bebob, runtime->rate); pcm_playback_prepare()
/linux-4.1.27/include/sound/
H A Dpcm-indirect.h51 struct snd_pcm_runtime *runtime = substream->runtime; snd_pcm_indirect_playback_transfer() local
52 snd_pcm_uframes_t appl_ptr = runtime->control->appl_ptr; snd_pcm_indirect_playback_transfer()
57 if (diff < -(snd_pcm_sframes_t) (runtime->boundary / 2)) snd_pcm_indirect_playback_transfer()
58 diff += runtime->boundary; snd_pcm_indirect_playback_transfer()
59 rec->sw_ready += (int)frames_to_bytes(runtime, diff); snd_pcm_indirect_playback_transfer()
105 return bytes_to_frames(substream->runtime, rec->sw_io); snd_pcm_indirect_playback_pointer()
117 struct snd_pcm_runtime *runtime = substream->runtime; snd_pcm_indirect_capture_transfer() local
118 snd_pcm_uframes_t appl_ptr = runtime->control->appl_ptr; snd_pcm_indirect_capture_transfer()
122 if (diff < -(snd_pcm_sframes_t) (runtime->boundary / 2)) snd_pcm_indirect_capture_transfer()
123 diff += runtime->boundary; snd_pcm_indirect_capture_transfer()
124 rec->sw_ready -= frames_to_bytes(runtime, diff); snd_pcm_indirect_capture_transfer()
174 return bytes_to_frames(substream->runtime, rec->sw_io); snd_pcm_indirect_capture_pointer()
H A Dpcm.h400 void (*private_free)(struct snd_pcm_runtime *runtime);
458 /* -- runtime information -- */
459 struct snd_pcm_runtime *runtime; member in struct:snd_pcm_substream
663 return (substream->runtime->status->state == SNDRV_PCM_STATE_RUNNING || snd_pcm_running()
664 (substream->runtime->status->state == SNDRV_PCM_STATE_DRAINING && snd_pcm_running()
670 * @runtime: PCM runtime instance
673 static inline ssize_t bytes_to_samples(struct snd_pcm_runtime *runtime, ssize_t size) bytes_to_samples() argument
675 return size * 8 / runtime->sample_bits; bytes_to_samples()
680 * @runtime: PCM runtime instance
683 static inline snd_pcm_sframes_t bytes_to_frames(struct snd_pcm_runtime *runtime, ssize_t size) bytes_to_frames() argument
685 return size * 8 / runtime->frame_bits; bytes_to_frames()
690 * @runtime: PCM runtime instance
693 static inline ssize_t samples_to_bytes(struct snd_pcm_runtime *runtime, ssize_t size) samples_to_bytes() argument
695 return size * runtime->sample_bits / 8; samples_to_bytes()
700 * @runtime: PCM runtime instance
703 static inline ssize_t frames_to_bytes(struct snd_pcm_runtime *runtime, snd_pcm_sframes_t size) frames_to_bytes() argument
705 return size * runtime->frame_bits / 8; frames_to_bytes()
710 * @runtime: PCM runtime instance
713 static inline int frame_aligned(struct snd_pcm_runtime *runtime, ssize_t bytes) frame_aligned() argument
715 return bytes % runtime->byte_align == 0; frame_aligned()
724 struct snd_pcm_runtime *runtime = substream->runtime; snd_pcm_lib_buffer_bytes() local
725 return frames_to_bytes(runtime, runtime->buffer_size); snd_pcm_lib_buffer_bytes()
734 struct snd_pcm_runtime *runtime = substream->runtime; snd_pcm_lib_period_bytes() local
735 return frames_to_bytes(runtime, runtime->period_size); snd_pcm_lib_period_bytes()
740 * @runtime: PCM runtime instance
744 static inline snd_pcm_uframes_t snd_pcm_playback_avail(struct snd_pcm_runtime *runtime) snd_pcm_playback_avail() argument
746 snd_pcm_sframes_t avail = runtime->status->hw_ptr + runtime->buffer_size - runtime->control->appl_ptr; snd_pcm_playback_avail()
748 avail += runtime->boundary; snd_pcm_playback_avail()
749 else if ((snd_pcm_uframes_t) avail >= runtime->boundary) snd_pcm_playback_avail()
750 avail -= runtime->boundary; snd_pcm_playback_avail()
756 * @runtime: PCM runtime instance
760 static inline snd_pcm_uframes_t snd_pcm_capture_avail(struct snd_pcm_runtime *runtime) snd_pcm_capture_avail() argument
762 snd_pcm_sframes_t avail = runtime->status->hw_ptr - runtime->control->appl_ptr; snd_pcm_capture_avail()
764 avail += runtime->boundary; snd_pcm_capture_avail()
770 * @runtime: PCM runtime instance
772 static inline snd_pcm_sframes_t snd_pcm_playback_hw_avail(struct snd_pcm_runtime *runtime) snd_pcm_playback_hw_avail() argument
774 return runtime->buffer_size - snd_pcm_playback_avail(runtime); snd_pcm_playback_hw_avail()
779 * @runtime: PCM runtime instance
781 static inline snd_pcm_sframes_t snd_pcm_capture_hw_avail(struct snd_pcm_runtime *runtime) snd_pcm_capture_hw_avail() argument
783 return runtime->buffer_size - snd_pcm_capture_avail(runtime); snd_pcm_capture_hw_avail()
796 struct snd_pcm_runtime *runtime = substream->runtime; snd_pcm_playback_ready() local
797 return snd_pcm_playback_avail(runtime) >= runtime->control->avail_min; snd_pcm_playback_ready()
810 struct snd_pcm_runtime *runtime = substream->runtime; snd_pcm_capture_ready() local
811 return snd_pcm_capture_avail(runtime) >= runtime->control->avail_min; snd_pcm_capture_ready()
825 struct snd_pcm_runtime *runtime = substream->runtime; snd_pcm_playback_data() local
827 if (runtime->stop_threshold >= runtime->boundary) snd_pcm_playback_data()
829 return snd_pcm_playback_avail(runtime) < runtime->buffer_size; snd_pcm_playback_data()
842 struct snd_pcm_runtime *runtime = substream->runtime; snd_pcm_playback_empty() local
843 return snd_pcm_playback_avail(runtime) >= runtime->buffer_size; snd_pcm_playback_empty()
856 struct snd_pcm_runtime *runtime = substream->runtime; snd_pcm_capture_empty() local
857 return snd_pcm_capture_avail(runtime) == 0; snd_pcm_capture_empty()
877 substream->runtime->trigger_master = master; snd_pcm_trigger_done()
994 int snd_pcm_hw_constraint_mask(struct snd_pcm_runtime *runtime, snd_pcm_hw_param_t var,
996 int snd_pcm_hw_constraint_mask64(struct snd_pcm_runtime *runtime, snd_pcm_hw_param_t var,
998 int snd_pcm_hw_constraint_minmax(struct snd_pcm_runtime *runtime, snd_pcm_hw_param_t var,
1000 int snd_pcm_hw_constraint_integer(struct snd_pcm_runtime *runtime, snd_pcm_hw_param_t var);
1001 int snd_pcm_hw_constraint_list(struct snd_pcm_runtime *runtime,
1005 int snd_pcm_hw_constraint_ranges(struct snd_pcm_runtime *runtime,
1009 int snd_pcm_hw_constraint_ratnums(struct snd_pcm_runtime *runtime,
1013 int snd_pcm_hw_constraint_ratdens(struct snd_pcm_runtime *runtime,
1017 int snd_pcm_hw_constraint_msbits(struct snd_pcm_runtime *runtime,
1021 int snd_pcm_hw_constraint_step(struct snd_pcm_runtime *runtime,
1025 int snd_pcm_hw_constraint_pow2(struct snd_pcm_runtime *runtime,
1028 int snd_pcm_hw_rule_noresample(struct snd_pcm_runtime *runtime,
1030 int snd_pcm_hw_rule_add(struct snd_pcm_runtime *runtime,
1068 struct snd_pcm_runtime *runtime);
1084 int snd_pcm_limit_hw_rates(struct snd_pcm_runtime *runtime);
1091 * snd_pcm_set_runtime_buffer - Set the PCM runtime buffer
1095 * Copy the buffer information to runtime->dma_buffer when @bufp is non-NULL.
1101 struct snd_pcm_runtime *runtime = substream->runtime; snd_pcm_set_runtime_buffer() local
1103 runtime->dma_buffer_p = bufp; snd_pcm_set_runtime_buffer()
1104 runtime->dma_area = bufp->area; snd_pcm_set_runtime_buffer()
1105 runtime->dma_addr = bufp->addr; snd_pcm_set_runtime_buffer()
1106 runtime->dma_bytes = bufp->bytes; snd_pcm_set_runtime_buffer()
1108 runtime->dma_buffer_p = NULL; snd_pcm_set_runtime_buffer()
1109 runtime->dma_area = NULL; snd_pcm_set_runtime_buffer()
1110 runtime->dma_addr = 0; snd_pcm_set_runtime_buffer()
1111 runtime->dma_bytes = 0; snd_pcm_set_runtime_buffer()
1125 * @runtime: PCM runtime instance
1128 static inline void snd_pcm_gettime(struct snd_pcm_runtime *runtime, snd_pcm_gettime() argument
1131 switch (runtime->tstamp_type) { snd_pcm_gettime()
1201 #define snd_pcm_get_dma_buf(substream) ((substream)->runtime->dma_buffer_p)
1311 #define PCM_RUNTIME_CHECK(sub) snd_BUG_ON(!(sub) || !(sub)->runtime)
H A Dwm9090.h21 * hardware setup with incorrect runtime configuration
H A Dsoc-dpcm.h69 * This links together a FE and BE DAI at runtime and stores the link
92 * Dynamic PCM runtime data.
99 struct snd_pcm_runtime *runtime; member in struct:snd_soc_dpcm_runtime
128 /* get the BE runtime state */
132 /* set the BE runtime state */
H A Dcompress_driver.h38 * struct snd_compr_runtime: runtime stream description
69 * @runtime: pointer to runtime structure
79 struct snd_compr_runtime *runtime; member in struct:snd_compr_stream
173 wake_up(&stream->runtime->sleep); snd_compr_fragment_elapsed()
181 stream->runtime->state = SNDRV_PCM_STATE_SETUP; snd_compr_drain_notify()
182 wake_up(&stream->runtime->sleep); snd_compr_drain_notify()
/linux-4.1.27/sound/isa/gus/
H A Dgus_pcm.c80 struct snd_pcm_runtime *runtime = substream->runtime; snd_gf1_pcm_block_change() local
81 struct gus_pcm_private *pcmp = runtime->private_data; snd_gf1_pcm_block_change()
91 if (snd_pcm_format_unsigned(runtime->format)) snd_gf1_pcm_block_change()
93 if (snd_pcm_format_width(runtime->format) == 16) snd_gf1_pcm_block_change()
96 block.buffer = runtime->dma_area + offset; snd_gf1_pcm_block_change()
97 block.buf_addr = runtime->dma_addr + offset; snd_gf1_pcm_block_change()
108 struct snd_pcm_runtime *runtime = substream->runtime; snd_gf1_pcm_trigger_up() local
109 struct gus_pcm_private *pcmp = runtime->private_data; snd_gf1_pcm_trigger_up()
127 rate = snd_gf1_translate_freq(gus, runtime->rate << 4); snd_gf1_pcm_trigger_up()
129 voice_ctrl = snd_pcm_format_width(runtime->format) == 16 ? 0x24 : 0x20; snd_gf1_pcm_trigger_up()
137 begin = pcmp->memory + voice * (pcmp->dma_size / runtime->channels); snd_gf1_pcm_trigger_up()
138 curr = begin + (pcmp->bpos * pcmp->block_size) / runtime->channels; snd_gf1_pcm_trigger_up()
139 end = curr + (pcmp->block_size / runtime->channels); snd_gf1_pcm_trigger_up()
140 end -= snd_pcm_format_width(runtime->format) == 16 ? 2 : 1; snd_gf1_pcm_trigger_up()
146 pan = runtime->channels == 2 ? (!voice ? 1 : 14) : 8; snd_gf1_pcm_trigger_up()
190 struct snd_pcm_runtime *runtime; snd_gf1_pcm_interrupt_wave() local
207 runtime = pcmp->substream->runtime; snd_gf1_pcm_interrupt_wave()
229 end = pcmp->memory + (((pcmp->bpos + 1) * pcmp->block_size) / runtime->channels); snd_gf1_pcm_interrupt_wave()
231 step = pcmp->dma_size / runtime->channels; snd_gf1_pcm_interrupt_wave()
258 if ((runtime->flags & SNDRV_PCM_FLG_MMAP) && snd_gf1_pcm_interrupt_wave()
259 *runtime->state == SNDRV_PCM_STATE_RUNNING) { snd_gf1_pcm_interrupt_wave()
261 if (runtime->channels > 1) { snd_gf1_pcm_interrupt_wave()
362 struct snd_pcm_runtime *runtime = substream->runtime; snd_gf1_pcm_playback_copy() local
363 struct gus_pcm_private *pcmp = runtime->private_data; snd_gf1_pcm_playback_copy()
366 bpos = samples_to_bytes(runtime, pos) + (voice * (pcmp->dma_size / 2)); snd_gf1_pcm_playback_copy()
367 len = samples_to_bytes(runtime, count); snd_gf1_pcm_playback_copy()
372 if (copy_from_user(runtime->dma_area + bpos, src, len)) snd_gf1_pcm_playback_copy()
380 w16 = (snd_pcm_format_width(runtime->format) == 16); snd_gf1_pcm_playback_copy()
381 invert = snd_pcm_format_unsigned(runtime->format); snd_gf1_pcm_playback_copy()
382 if ((err = snd_gf1_pcm_poke_block(gus, runtime->dma_area + bpos, pcmp->memory + bpos, len, w16, invert)) < 0) snd_gf1_pcm_playback_copy()
393 struct snd_pcm_runtime *runtime = substream->runtime; snd_gf1_pcm_playback_silence() local
394 struct gus_pcm_private *pcmp = runtime->private_data; snd_gf1_pcm_playback_silence()
397 bpos = samples_to_bytes(runtime, pos) + (voice * (pcmp->dma_size / 2)); snd_gf1_pcm_playback_silence()
398 len = samples_to_bytes(runtime, count); snd_gf1_pcm_playback_silence()
403 snd_pcm_format_set_silence(runtime->format, runtime->dma_area + bpos, count); snd_gf1_pcm_playback_silence()
410 w16 = (snd_pcm_format_width(runtime->format) == 16); snd_gf1_pcm_playback_silence()
411 invert = snd_pcm_format_unsigned(runtime->format); snd_gf1_pcm_playback_silence()
412 if ((err = snd_gf1_pcm_poke_block(gus, runtime->dma_area + bpos, pcmp->memory + bpos, len, w16, invert)) < 0) snd_gf1_pcm_playback_silence()
422 struct snd_pcm_runtime *runtime = substream->runtime; snd_gf1_pcm_playback_hw_params() local
423 struct gus_pcm_private *pcmp = runtime->private_data; snd_gf1_pcm_playback_hw_params()
437 runtime->dma_bytes, 1, 32, snd_gf1_pcm_playback_hw_params()
469 struct snd_pcm_runtime *runtime = substream->runtime; snd_gf1_pcm_playback_hw_free() local
470 struct gus_pcm_private *pcmp = runtime->private_data; snd_gf1_pcm_playback_hw_free()
490 struct snd_pcm_runtime *runtime = substream->runtime; snd_gf1_pcm_playback_prepare() local
491 struct gus_pcm_private *pcmp = runtime->private_data; snd_gf1_pcm_playback_prepare()
504 struct snd_pcm_runtime *runtime = substream->runtime; snd_gf1_pcm_playback_trigger() local
505 struct gus_pcm_private *pcmp = runtime->private_data; snd_gf1_pcm_playback_trigger()
529 struct snd_pcm_runtime *runtime = substream->runtime; snd_gf1_pcm_playback_pointer() local
530 struct gus_pcm_private *pcmp = runtime->private_data; snd_gf1_pcm_playback_pointer()
540 if (substream->runtime->channels > 1) snd_gf1_pcm_playback_pointer()
542 pos = bytes_to_frames(runtime, pos); snd_gf1_pcm_playback_pointer()
586 struct snd_pcm_runtime *runtime = substream->runtime; snd_gf1_pcm_capture_prepare() local
588 snd_gf1_i_write8(gus, SNDRV_GF1_GB_RECORD_RATE, runtime->rate_den - 2); snd_gf1_pcm_capture_prepare()
591 snd_dma_program(gus->gf1.dma2, runtime->dma_addr, gus->c_period_size, DMA_MODE_READ); snd_gf1_pcm_capture_prepare()
620 pos = bytes_to_frames(substream->runtime, (gus->c_pos + pos) % gus->c_dma_size); snd_gf1_pcm_capture_pointer()
672 static void snd_gf1_pcm_playback_free(struct snd_pcm_runtime *runtime) snd_gf1_pcm_playback_free() argument
674 kfree(runtime->private_data); snd_gf1_pcm_playback_free()
681 struct snd_pcm_runtime *runtime = substream->runtime; snd_gf1_pcm_playback_open() local
692 runtime->private_data = pcmp; snd_gf1_pcm_playback_open()
693 runtime->private_free = snd_gf1_pcm_playback_free; snd_gf1_pcm_playback_open()
703 runtime->hw = snd_gf1_pcm_playback; snd_gf1_pcm_playback_open()
704 snd_pcm_limit_isa_dma_size(gus->gf1.dma1, &runtime->hw.buffer_bytes_max); snd_gf1_pcm_playback_open()
705 snd_pcm_limit_isa_dma_size(gus->gf1.dma1, &runtime->hw.period_bytes_max); snd_gf1_pcm_playback_open()
706 snd_pcm_hw_constraint_step(runtime, 0, SNDRV_PCM_HW_PARAM_PERIOD_BYTES, 64); snd_gf1_pcm_playback_open()
713 struct snd_pcm_runtime *runtime = substream->runtime; snd_gf1_pcm_playback_close() local
714 struct gus_pcm_private *pcmp = runtime->private_data; snd_gf1_pcm_playback_close()
725 struct snd_pcm_runtime *runtime = substream->runtime; snd_gf1_pcm_capture_open() local
730 substream->runtime->hw = snd_gf1_pcm_capture; snd_gf1_pcm_capture_open()
731 snd_pcm_limit_isa_dma_size(gus->gf1.dma2, &runtime->hw.buffer_bytes_max); snd_gf1_pcm_capture_open()
732 snd_pcm_limit_isa_dma_size(gus->gf1.dma2, &runtime->hw.period_bytes_max); snd_gf1_pcm_capture_open()
733 snd_pcm_hw_constraint_ratnums(runtime, 0, SNDRV_PCM_HW_PARAM_RATE, snd_gf1_pcm_capture_open()
/linux-4.1.27/sound/drivers/
H A Daloop.c200 struct snd_pcm_runtime *runtime, *cruntime; loopback_check_format() local
210 runtime = cable->streams[SNDRV_PCM_STREAM_PLAYBACK]-> loopback_check_format()
211 substream->runtime; loopback_check_format()
213 substream->runtime; loopback_check_format()
214 check = runtime->format != cruntime->format || loopback_check_format()
215 runtime->rate != cruntime->rate || loopback_check_format()
216 runtime->channels != cruntime->channels; loopback_check_format()
225 runtime = cable->streams[SNDRV_PCM_STREAM_PLAYBACK]-> loopback_check_format()
226 substream->runtime; loopback_check_format()
229 if (setup->format != runtime->format) { loopback_check_format()
232 setup->format = runtime->format; loopback_check_format()
234 if (setup->rate != runtime->rate) { loopback_check_format()
237 setup->rate = runtime->rate; loopback_check_format()
239 if (setup->channels != runtime->channels) { loopback_check_format()
242 setup->channels = runtime->channels; loopback_check_format()
257 struct snd_pcm_runtime *runtime = substream->runtime; loopback_trigger() local
258 struct loopback_pcm *dpcm = runtime->private_data; loopback_trigger()
309 struct snd_pcm_runtime *runtime) params_change_substream()
315 dst_runtime = dpcm->substream->runtime; params_change_substream()
323 struct snd_pcm_runtime *runtime = substream->runtime; params_change() local
324 struct loopback_pcm *dpcm = runtime->private_data; params_change()
327 cable->hw.formats = pcm_format_to_bits(runtime->format); params_change()
328 cable->hw.rate_min = runtime->rate; params_change()
329 cable->hw.rate_max = runtime->rate; params_change()
330 cable->hw.channels_min = runtime->channels; params_change()
331 cable->hw.channels_max = runtime->channels; params_change()
333 runtime); params_change()
335 runtime); params_change()
340 struct snd_pcm_runtime *runtime = substream->runtime; loopback_prepare() local
341 struct loopback_pcm *dpcm = runtime->private_data; loopback_prepare()
345 salign = (snd_pcm_format_width(runtime->format) * loopback_prepare()
346 runtime->channels) / 8; loopback_prepare()
347 bps = salign * runtime->rate; loopback_prepare()
352 dpcm->pcm_buffer_size = frames_to_bytes(runtime, runtime->buffer_size); loopback_prepare()
356 snd_pcm_format_set_silence(runtime->format, runtime->dma_area, loopback_prepare()
357 runtime->buffer_size * runtime->channels); loopback_prepare()
364 dpcm->pcm_period_size = frames_to_bytes(runtime, runtime->period_size); loopback_prepare()
379 struct snd_pcm_runtime *runtime = dpcm->substream->runtime; clear_capture_buf() local
380 char *dst = runtime->dma_area; clear_capture_buf()
392 snd_pcm_format_set_silence(runtime->format, dst + dst_off, clear_capture_buf()
393 bytes_to_frames(runtime, size) * clear_capture_buf()
394 runtime->channels); clear_capture_buf()
407 struct snd_pcm_runtime *runtime = play->substream->runtime; copy_play_buf() local
408 char *src = runtime->dma_area; copy_play_buf()
409 char *dst = capt->substream->runtime->dma_area; copy_play_buf()
416 if (runtime->status->state == SNDRV_PCM_STATE_DRAINING && copy_play_buf()
417 snd_pcm_playback_hw_avail(runtime) < runtime->buffer_size) { copy_play_buf()
419 appl_ptr = appl_ptr1 = runtime->control->appl_ptr; copy_play_buf()
420 appl_ptr1 -= appl_ptr1 % runtime->buffer_size; copy_play_buf()
423 appl_ptr1 -= runtime->buffer_size; copy_play_buf()
553 struct snd_pcm_runtime *runtime = substream->runtime; loopback_pointer() local
554 struct loopback_pcm *dpcm = runtime->private_data; loopback_pointer()
561 return bytes_to_frames(runtime, pos); loopback_pointer()
587 static void loopback_runtime_free(struct snd_pcm_runtime *runtime) loopback_runtime_free() argument
589 struct loopback_pcm *dpcm = runtime->private_data; loopback_runtime_free()
602 struct snd_pcm_runtime *runtime = substream->runtime; loopback_hw_free() local
603 struct loopback_pcm *dpcm = runtime->private_data; loopback_hw_free()
663 struct snd_pcm_runtime *runtime = substream->runtime; loopback_open() local
696 snd_pcm_hw_constraint_integer(runtime, SNDRV_PCM_HW_PARAM_PERIODS); loopback_open()
698 /* use dynamic rules based on actual runtime->hw values */ loopback_open()
701 err = snd_pcm_hw_rule_add(runtime, 0, loopback_open()
703 rule_format, &runtime->hw, loopback_open()
707 err = snd_pcm_hw_rule_add(runtime, 0, loopback_open()
709 rule_rate, &runtime->hw, loopback_open()
713 err = snd_pcm_hw_rule_add(runtime, 0, loopback_open()
715 rule_channels, &runtime->hw, loopback_open()
720 runtime->private_data = dpcm; loopback_open()
721 runtime->private_free = loopback_runtime_free; loopback_open()
723 runtime->hw = loopback_pcm_hardware; loopback_open()
725 runtime->hw = cable->hw; loopback_open()
734 struct loopback_pcm *dpcm = substream->runtime->private_data; loopback_close()
308 params_change_substream(struct loopback_pcm *dpcm, struct snd_pcm_runtime *runtime) params_change_substream() argument
H A Dpcm-indirect2.c43 struct snd_pcm_runtime *runtime = substream->runtime; snd_pcm_indirect2_stat() local
57 snd_printk(KERN_DEBUG "STAT: bytes2hw: %u Bytes => (by runtime->rate) " snd_pcm_indirect2_stat()
59 rec->bytes2hw, rec->bytes2hw / 2 / 2 / runtime->rate); snd_pcm_indirect2_stat()
67 runtime->rate, snd_pcm_indirect2_stat()
238 return bytes_to_frames(substream->runtime, rec->sw_io); snd_pcm_indirect2_pointer()
250 struct snd_pcm_runtime *runtime = substream->runtime; snd_pcm_indirect2_playback_transfer() local
251 snd_pcm_uframes_t appl_ptr = runtime->control->appl_ptr; snd_pcm_indirect2_playback_transfer()
253 /* runtime->control->appl_ptr: position where ALSA will write next time snd_pcm_indirect2_playback_transfer()
264 if (diff < -(snd_pcm_sframes_t) (runtime->boundary / 2)) snd_pcm_indirect2_playback_transfer()
265 diff += runtime->boundary; snd_pcm_indirect2_playback_transfer()
270 rec->sw_ready += (int)frames_to_bytes(runtime, diff); snd_pcm_indirect2_playback_transfer()
418 struct snd_pcm_runtime *runtime = substream->runtime; snd_pcm_indirect2_capture_transfer() local
419 snd_pcm_uframes_t appl_ptr = runtime->control->appl_ptr; snd_pcm_indirect2_capture_transfer()
426 if (diff < -(snd_pcm_sframes_t) (runtime->boundary / 2)) snd_pcm_indirect2_capture_transfer()
427 diff += runtime->boundary; snd_pcm_indirect2_capture_transfer()
428 rec->sw_ready -= frames_to_bytes(runtime, diff); snd_pcm_indirect2_capture_transfer()
H A Ddummy.c113 (*(const struct dummy_timer_ops **)(substream)->runtime->private_data)
117 int (*playback_constraints)(struct snd_pcm_runtime *runtime);
118 int (*capture_constraints)(struct snd_pcm_runtime *runtime);
149 static int emu10k1_playback_constraints(struct snd_pcm_runtime *runtime) emu10k1_playback_constraints() argument
152 err = snd_pcm_hw_constraint_integer(runtime, SNDRV_PCM_HW_PARAM_PERIODS); emu10k1_playback_constraints()
155 err = snd_pcm_hw_constraint_minmax(runtime, SNDRV_PCM_HW_PARAM_BUFFER_BYTES, 256, UINT_MAX); emu10k1_playback_constraints()
277 struct dummy_systimer_pcm *dpcm = substream->runtime->private_data; dummy_systimer_start()
287 struct dummy_systimer_pcm *dpcm = substream->runtime->private_data; dummy_systimer_stop()
296 struct snd_pcm_runtime *runtime = substream->runtime; dummy_systimer_prepare() local
297 struct dummy_systimer_pcm *dpcm = runtime->private_data; dummy_systimer_prepare()
300 dpcm->rate = runtime->rate; dummy_systimer_prepare()
301 dpcm->frac_buffer_size = runtime->buffer_size * HZ; dummy_systimer_prepare()
302 dpcm->frac_period_size = runtime->period_size * HZ; dummy_systimer_prepare()
328 struct dummy_systimer_pcm *dpcm = substream->runtime->private_data; dummy_systimer_pointer()
345 substream->runtime->private_data = dpcm; dummy_systimer_create()
355 kfree(substream->runtime->private_data); dummy_systimer_free()
404 struct dummy_hrtimer_pcm *dpcm = substream->runtime->private_data; dummy_hrtimer_start()
414 struct dummy_hrtimer_pcm *dpcm = substream->runtime->private_data; dummy_hrtimer_stop()
429 struct snd_pcm_runtime *runtime = substream->runtime; dummy_hrtimer_pointer() local
430 struct dummy_hrtimer_pcm *dpcm = runtime->private_data; dummy_hrtimer_pointer()
436 delta = div_u64(delta * runtime->rate + 999999, 1000000); dummy_hrtimer_pointer()
437 div_u64_rem(delta, runtime->buffer_size, &pos); dummy_hrtimer_pointer()
443 struct snd_pcm_runtime *runtime = substream->runtime; dummy_hrtimer_prepare() local
444 struct dummy_hrtimer_pcm *dpcm = runtime->private_data; dummy_hrtimer_prepare()
450 period = runtime->period_size; dummy_hrtimer_prepare()
451 rate = runtime->rate; dummy_hrtimer_prepare()
467 substream->runtime->private_data = dpcm; dummy_hrtimer_create()
479 struct dummy_hrtimer_pcm *dpcm = substream->runtime->private_data; dummy_hrtimer_free()
545 /* runtime->dma_bytes has to be set manually to allow mmap */ dummy_pcm_hw_params()
546 substream->runtime->dma_bytes = params_buffer_bytes(hw_params); dummy_pcm_hw_params()
564 struct snd_pcm_runtime *runtime = substream->runtime; dummy_pcm_open() local
579 runtime->hw = dummy->pcm_hw; dummy_pcm_open()
581 runtime->hw.info &= ~SNDRV_PCM_INFO_INTERLEAVED; dummy_pcm_open()
582 runtime->hw.info |= SNDRV_PCM_INFO_NONINTERLEAVED; dummy_pcm_open()
585 runtime->hw.info &= ~(SNDRV_PCM_INFO_MMAP | dummy_pcm_open()
593 err = model->playback_constraints(substream->runtime); dummy_pcm_open()
596 err = model->capture_constraints(substream->runtime); dummy_pcm_open()
H A Dml403-ac97cr.c447 src = (u16 *)(substream->runtime->dma_area + rec->sw_data); snd_ml403_ac97cr_playback_ind2_copy()
504 dst = (u16 *)(substream->runtime->dma_area + rec->sw_data); snd_ml403_ac97cr_capture_ind2_copy()
624 struct snd_pcm_runtime *runtime; snd_ml403_ac97cr_pcm_playback_prepare() local
627 runtime = substream->runtime; snd_ml403_ac97cr_pcm_playback_prepare()
635 runtime->rate); snd_ml403_ac97cr_pcm_playback_prepare()
636 PDEBUG(WORK_INFO, "prepare(): rate=%d\n", runtime->rate); snd_ml403_ac97cr_pcm_playback_prepare()
658 struct snd_pcm_runtime *runtime; snd_ml403_ac97cr_pcm_capture_prepare() local
661 runtime = substream->runtime; snd_ml403_ac97cr_pcm_capture_prepare()
669 runtime->rate); snd_ml403_ac97cr_pcm_capture_prepare()
670 PDEBUG(WORK_INFO, "prepare(capture): rate=%d\n", runtime->rate); snd_ml403_ac97cr_pcm_capture_prepare()
707 struct snd_pcm_runtime *runtime; snd_ml403_ac97cr_playback_open() local
710 runtime = substream->runtime; snd_ml403_ac97cr_playback_open()
714 runtime->hw = snd_ml403_ac97cr_playback; snd_ml403_ac97cr_playback_open()
716 snd_pcm_hw_constraint_step(runtime, 0, snd_ml403_ac97cr_playback_open()
725 struct snd_pcm_runtime *runtime; snd_ml403_ac97cr_capture_open() local
728 runtime = substream->runtime; snd_ml403_ac97cr_capture_open()
732 runtime->hw = snd_ml403_ac97cr_capture; snd_ml403_ac97cr_capture_open()
734 snd_pcm_hw_constraint_step(runtime, 0, snd_ml403_ac97cr_capture_open()
/linux-4.1.27/sound/drivers/vx/
H A Dvx_pcm.c60 static void vx_pcm_read_per_bytes(struct vx_core *chip, struct snd_pcm_runtime *runtime, vx_pcm_read_per_bytes() argument
64 unsigned char *buf = (unsigned char *)(runtime->dma_area + offset); vx_pcm_read_per_bytes()
68 buf = (unsigned char *)runtime->dma_area; vx_pcm_read_per_bytes()
73 buf = (unsigned char *)runtime->dma_area; vx_pcm_read_per_bytes()
78 buf = (unsigned char *)runtime->dma_area; vx_pcm_read_per_bytes()
162 * @runtime: pcm runtime instance to be referred
167 struct snd_pcm_runtime *runtime) vx_set_format()
171 if (runtime->channels == 1) vx_set_format()
173 if (snd_pcm_format_little_endian(runtime->format)) vx_set_format()
175 if (runtime->rate < 32000 && runtime->rate > 11025) vx_set_format()
177 else if (runtime->rate <= 11025) vx_set_format()
180 switch (snd_pcm_format_physical_width(runtime->format)) { vx_set_format()
528 struct snd_pcm_runtime *runtime = subs->runtime; vx_pcm_playback_open() local
556 runtime->hw = vx_pcm_playback_hw; vx_pcm_playback_open()
557 runtime->hw.period_bytes_min = chip->ibl.size; vx_pcm_playback_open()
558 runtime->private_data = pipe; vx_pcm_playback_open()
561 snd_pcm_hw_constraint_step(runtime, 0, SNDRV_PCM_HW_PARAM_BUFFER_BYTES, 4); vx_pcm_playback_open()
562 snd_pcm_hw_constraint_step(runtime, 0, SNDRV_PCM_HW_PARAM_PERIOD_BYTES, 4); vx_pcm_playback_open()
575 if (! subs->runtime->private_data) vx_pcm_playback_close()
578 pipe = subs->runtime->private_data; vx_pcm_playback_close()
625 struct snd_pcm_runtime *runtime, vx_pcm_playback_transfer_chunk()
647 vx_pseudo_dma_write(chip, runtime, pipe, size); vx_pcm_playback_transfer_chunk()
663 struct snd_pcm_runtime *runtime, vx_update_pipe_position()
680 if (pipe->position >= (int)runtime->buffer_size) vx_update_pipe_position()
681 pipe->position %= runtime->buffer_size; vx_update_pipe_position()
695 struct snd_pcm_runtime *runtime = subs->runtime; vx_pcm_playback_transfer() local
700 if ((err = vx_pcm_playback_transfer_chunk(chip, runtime, pipe, vx_pcm_playback_transfer()
715 struct snd_pcm_runtime *runtime = subs->runtime; vx_pcm_playback_update() local
718 if ((err = vx_update_pipe_position(chip, runtime, pipe)) < 0) vx_pcm_playback_update()
720 if (pipe->transferred >= (int)runtime->period_size) { vx_pcm_playback_update()
721 pipe->transferred %= runtime->period_size; vx_pcm_playback_update()
733 struct vx_pipe *pipe = subs->runtime->private_data; vx_pcm_trigger()
785 struct snd_pcm_runtime *runtime = subs->runtime; vx_pcm_playback_pointer() local
786 struct vx_pipe *pipe = runtime->private_data; vx_pcm_playback_pointer()
814 struct snd_pcm_runtime *runtime = subs->runtime; vx_pcm_prepare() local
815 struct vx_pipe *pipe = runtime->private_data; vx_pcm_prepare()
841 if (chip->pcm_running && chip->freq != runtime->rate) { vx_pcm_prepare()
843 "from the current %d\n", runtime->rate, chip->freq); vx_pcm_prepare()
846 vx_set_clock(chip, runtime->rate); vx_pcm_prepare()
848 if ((err = vx_set_format(chip, pipe, runtime)) < 0) vx_pcm_prepare()
857 pipe->buffer_bytes = frames_to_bytes(runtime, runtime->buffer_size); vx_pcm_prepare()
858 pipe->period_bytes = frames_to_bytes(runtime, runtime->period_size); vx_pcm_prepare()
862 vx_update_pipe_position(chip, runtime, pipe); vx_pcm_prepare()
919 struct snd_pcm_runtime *runtime = subs->runtime; vx_pcm_capture_open() local
962 runtime->hw = vx_pcm_capture_hw; vx_pcm_capture_open()
963 runtime->hw.period_bytes_min = chip->ibl.size; vx_pcm_capture_open()
964 runtime->private_data = pipe; vx_pcm_capture_open()
967 snd_pcm_hw_constraint_step(runtime, 0, SNDRV_PCM_HW_PARAM_BUFFER_BYTES, 4); vx_pcm_capture_open()
968 snd_pcm_hw_constraint_step(runtime, 0, SNDRV_PCM_HW_PARAM_PERIOD_BYTES, 4); vx_pcm_capture_open()
982 if (! subs->runtime->private_data) vx_pcm_capture_close()
984 pipe = subs->runtime->private_data; vx_pcm_capture_close()
1016 struct snd_pcm_runtime *runtime = subs->runtime; vx_pcm_capture_update() local
1021 size = runtime->buffer_size - snd_pcm_capture_avail(runtime); vx_pcm_capture_update()
1024 size = frames_to_bytes(runtime, size); vx_pcm_capture_update()
1044 vx_pcm_read_per_bytes(chip, runtime, pipe); vx_pcm_capture_update()
1051 vx_pseudo_dma_read(chip, runtime, pipe, space); vx_pcm_capture_update()
1058 vx_pcm_read_per_bytes(chip, runtime, pipe); vx_pcm_capture_update()
1066 vx_pcm_read_per_bytes(chip, runtime, pipe); vx_pcm_capture_update()
1088 struct snd_pcm_runtime *runtime = subs->runtime; vx_pcm_capture_pointer() local
1089 struct vx_pipe *pipe = runtime->private_data; vx_pcm_capture_pointer()
1090 return bytes_to_frames(runtime, pipe->hw_ptr); vx_pcm_capture_pointer()
166 vx_set_format(struct vx_core *chip, struct vx_pipe *pipe, struct snd_pcm_runtime *runtime) vx_set_format() argument
624 vx_pcm_playback_transfer_chunk(struct vx_core *chip, struct snd_pcm_runtime *runtime, struct vx_pipe *pipe, int size) vx_pcm_playback_transfer_chunk() argument
662 vx_update_pipe_position(struct vx_core *chip, struct snd_pcm_runtime *runtime, struct vx_pipe *pipe) vx_update_pipe_position() argument
/linux-4.1.27/sound/pci/au88x0/
H A Dau88x0_pcm.c141 struct snd_pcm_runtime *runtime = substream->runtime; snd_vortex_pcm_open() local
146 snd_pcm_hw_constraint_integer(runtime, snd_vortex_pcm_open()
151 snd_pcm_hw_constraint_pow2(runtime, 0, snd_vortex_pcm_open()
155 snd_pcm_hw_constraint_step(runtime, 0, snd_vortex_pcm_open()
161 runtime->hw = snd_vortex_playback_hw_a3d; snd_vortex_pcm_open()
165 runtime->hw = snd_vortex_playback_hw_spdif; snd_vortex_pcm_open()
168 runtime->hw.rates = SNDRV_PCM_RATE_32000; snd_vortex_pcm_open()
171 runtime->hw.rates = SNDRV_PCM_RATE_44100; snd_vortex_pcm_open()
174 runtime->hw.rates = SNDRV_PCM_RATE_48000; snd_vortex_pcm_open()
180 runtime->hw = snd_vortex_playback_hw_adb; snd_vortex_pcm_open()
185 runtime->hw.channels_max = 4; snd_vortex_pcm_open()
186 snd_pcm_hw_constraint_list(runtime, 0, snd_vortex_pcm_open()
191 substream->runtime->private_data = NULL; snd_vortex_pcm_open()
195 runtime->hw = snd_vortex_playback_hw_wt; snd_vortex_pcm_open()
196 substream->runtime->private_data = NULL; snd_vortex_pcm_open()
206 stream_t *stream = (stream_t *) substream->runtime->private_data; snd_vortex_pcm_close()
213 substream->runtime->private_data = NULL; snd_vortex_pcm_close()
223 stream_t *stream = (stream_t *) (substream->runtime->private_data); snd_vortex_pcm_hw_params()
257 stream = substream->runtime->private_data = &chip->dma_adb[dma]; snd_vortex_pcm_hw_params()
275 stream = substream->runtime->private_data = snd_vortex_pcm_hw_params()
292 stream_t *stream = (stream_t *) (substream->runtime->private_data); snd_vortex_pcm_hw_free()
316 substream->runtime->private_data = NULL; snd_vortex_pcm_hw_free()
326 struct snd_pcm_runtime *runtime = substream->runtime; snd_vortex_pcm_prepare() local
327 stream_t *stream = (stream_t *) substream->runtime->private_data; snd_vortex_pcm_prepare()
335 fmt = vortex_alsafmt_aspfmt(runtime->format, chip); snd_vortex_pcm_prepare()
339 runtime->channels == 1 ? 0 : 1, 0); snd_vortex_pcm_prepare()
342 vortex_adb_setsrc(chip, dma, runtime->rate, dir); snd_vortex_pcm_prepare()
359 stream_t *stream = (stream_t *) substream->runtime->private_data; snd_vortex_pcm_trigger()
422 stream_t *stream = (stream_t *) substream->runtime->private_data; snd_vortex_pcm_pointer()
435 return (bytes_to_frames(substream->runtime, current_ptr)); snd_vortex_pcm_pointer()
/linux-4.1.27/sound/firewire/dice/
H A Ddice-pcm.c83 struct snd_pcm_runtime *runtime, limit_channels_and_rates()
86 struct snd_pcm_hardware *hw = &runtime->hw; limit_channels_and_rates()
104 snd_pcm_limit_hw_rates(runtime); limit_channels_and_rates()
122 struct snd_pcm_runtime *runtime = substream->runtime; init_hw_info() local
123 struct snd_pcm_hardware *hw = &runtime->hw; init_hw_info()
145 limit_channels_and_rates(dice, runtime, pcm_channels); init_hw_info()
148 err = snd_pcm_hw_rule_add(runtime, 0, SNDRV_PCM_HW_PARAM_RATE, init_hw_info()
153 err = snd_pcm_hw_rule_add(runtime, 0, SNDRV_PCM_HW_PARAM_CHANNELS, init_hw_info()
159 err = amdtp_stream_add_pcm_hw_constraints(stream, runtime); init_hw_info()
208 substream->runtime->hw.rate_min = rate; pcm_open()
209 substream->runtime->hw.rate_max = rate; pcm_open()
234 if (substream->runtime->status->state == SNDRV_PCM_STATE_OPEN) { capture_hw_params()
251 if (substream->runtime->status->state == SNDRV_PCM_STATE_OPEN) { playback_hw_params()
270 if (substream->runtime->status->state != SNDRV_PCM_STATE_OPEN) capture_hw_free()
286 if (substream->runtime->status->state != SNDRV_PCM_STATE_OPEN) playback_hw_free()
302 err = snd_dice_stream_start_duplex(dice, substream->runtime->rate); capture_prepare()
315 err = snd_dice_stream_start_duplex(dice, substream->runtime->rate); playback_prepare()
82 limit_channels_and_rates(struct snd_dice *dice, struct snd_pcm_runtime *runtime, unsigned int *pcm_channels) limit_channels_and_rates() argument
/linux-4.1.27/sound/pcmcia/pdaudiocf/
H A Dpdaudiocf_pcm.c50 struct snd_pcm_runtime *runtime = subs->runtime; pdacf_pcm_trigger() local
84 if ((chip->ak4117->rcs0 & AK4117_UNLCK) || runtime->rate != rate) { pdacf_pcm_trigger()
123 struct snd_pcm_runtime *runtime = subs->runtime; pdacf_pcm_prepare() local
129 chip->pcm_channels = runtime->channels; pdacf_pcm_prepare()
131 chip->pcm_little = snd_pcm_format_little_endian(runtime->format) > 0; pdacf_pcm_prepare()
133 chip->pcm_swab = snd_pcm_format_big_endian(runtime->format) > 0; pdacf_pcm_prepare()
138 if (snd_pcm_format_unsigned(runtime->format)) pdacf_pcm_prepare()
146 switch (runtime->format) { pdacf_pcm_prepare()
156 switch (runtime->format) { pdacf_pcm_prepare()
184 chip->pcm_size = runtime->buffer_size; pdacf_pcm_prepare()
185 chip->pcm_period = runtime->period_size; pdacf_pcm_prepare()
186 chip->pcm_area = runtime->dma_area; pdacf_pcm_prepare()
229 struct snd_pcm_runtime *runtime = subs->runtime; pdacf_pcm_capture_open() local
235 runtime->hw = pdacf_pcm_capture_hw; pdacf_pcm_capture_open()
236 runtime->private_data = chip; pdacf_pcm_capture_open()
/linux-4.1.27/sound/pci/cs5535audio/
H A Dcs5535audio_pcm.c96 struct snd_pcm_runtime *runtime = substream->runtime; snd_cs5535audio_playback_open() local
98 runtime->hw = snd_cs5535audio_playback; snd_cs5535audio_playback_open()
99 runtime->hw.rates = cs5535au->ac97->rates[AC97_RATES_FRONT_DAC]; snd_cs5535audio_playback_open()
100 snd_pcm_limit_hw_rates(runtime); snd_cs5535audio_playback_open()
102 runtime->private_data = &(cs5535au->dmas[CS5535AUDIO_DMA_PLAYBACK]); snd_cs5535audio_playback_open()
103 if ((err = snd_pcm_hw_constraint_integer(runtime, snd_cs5535audio_playback_open()
145 addr = (u32) substream->runtime->dma_addr; cs5535audio_build_dma_packets()
249 struct cs5535audio_dma *dma = substream->runtime->private_data; snd_cs5535audio_hw_params()
256 dma->buf_addr = substream->runtime->dma_addr; snd_cs5535audio_hw_params()
271 struct cs5535audio_dma *dma = substream->runtime->private_data; snd_cs5535audio_hw_free()
290 substream->runtime->rate); snd_cs5535audio_playback_prepare()
296 struct cs5535audio_dma *dma = substream->runtime->private_data; snd_cs5535audio_trigger()
335 dma = substream->runtime->private_data; snd_cs5535audio_pcm_pointer()
348 return bytes_to_frames(substream->runtime, curdma); snd_cs5535audio_pcm_pointer()
355 struct snd_pcm_runtime *runtime = substream->runtime; snd_cs5535audio_capture_open() local
357 runtime->hw = snd_cs5535audio_capture; snd_cs5535audio_capture_open()
358 runtime->hw.rates = cs5535au->ac97->rates[AC97_RATES_ADC]; snd_cs5535audio_capture_open()
359 snd_pcm_limit_hw_rates(runtime); snd_cs5535audio_capture_open()
361 runtime->private_data = &(cs5535au->dmas[CS5535AUDIO_DMA_CAPTURE]); snd_cs5535audio_capture_open()
362 if ((err = snd_pcm_hw_constraint_integer(runtime, snd_cs5535audio_capture_open()
380 substream->runtime->rate); snd_cs5535audio_capture_prepare()
/linux-4.1.27/sound/usb/
H A Dpcm.c82 subs = (struct snd_usb_substream *)substream->runtime->private_data; snd_usb_pcm_pointer()
87 substream->runtime->delay = snd_usb_pcm_delay(subs, snd_usb_pcm_pointer()
88 substream->runtime->rate); snd_usb_pcm_pointer()
90 return hwptr_done / (substream->runtime->frame_bits >> 3); snd_usb_pcm_pointer()
688 struct snd_usb_substream *subs = substream->runtime->private_data; snd_usb_hw_params()
734 struct snd_usb_substream *subs = substream->runtime->private_data; snd_usb_hw_free()
755 struct snd_pcm_runtime *runtime = substream->runtime; snd_usb_pcm_prepare() local
756 struct snd_usb_substream *subs = runtime->private_data; snd_usb_pcm_prepare()
798 /* some unit conversions in runtime */ snd_usb_pcm_prepare()
800 bytes_to_frames(runtime, subs->data_endpoint->maxpacksize); snd_usb_pcm_prepare()
802 bytes_to_frames(runtime, subs->data_endpoint->curpacksize); snd_usb_pcm_prepare()
809 runtime->delay = 0; snd_usb_pcm_prepare()
1056 static int snd_usb_pcm_check_knot(struct snd_pcm_runtime *runtime, snd_usb_pcm_check_knot() argument
1089 err = snd_pcm_hw_constraint_list(runtime, 0, SNDRV_PCM_HW_PARAM_RATE, snd_usb_pcm_check_knot()
1099 * set up the runtime hardware information.
1102 static int setup_hw_info(struct snd_pcm_runtime *runtime, struct snd_usb_substream *subs) setup_hw_info() argument
1109 runtime->hw.formats = subs->formats; setup_hw_info()
1111 runtime->hw.rate_min = 0x7fffffff; setup_hw_info()
1112 runtime->hw.rate_max = 0; setup_hw_info()
1113 runtime->hw.channels_min = 256; setup_hw_info()
1114 runtime->hw.channels_max = 0; setup_hw_info()
1115 runtime->hw.rates = 0; setup_hw_info()
1119 runtime->hw.rates |= fp->rates; setup_hw_info()
1120 if (runtime->hw.rate_min > fp->rate_min) setup_hw_info()
1121 runtime->hw.rate_min = fp->rate_min; setup_hw_info()
1122 if (runtime->hw.rate_max < fp->rate_max) setup_hw_info()
1123 runtime->hw.rate_max = fp->rate_max; setup_hw_info()
1124 if (runtime->hw.channels_min > fp->channels) setup_hw_info()
1125 runtime->hw.channels_min = fp->channels; setup_hw_info()
1126 if (runtime->hw.channels_max < fp->channels) setup_hw_info()
1127 runtime->hw.channels_max = fp->channels; setup_hw_info()
1130 runtime->hw.period_bytes_min = runtime->hw.period_bytes_max = setup_hw_info()
1147 snd_pcm_hw_constraint_minmax(runtime, SNDRV_PCM_HW_PARAM_PERIOD_TIME, setup_hw_info()
1150 if ((err = snd_pcm_hw_rule_add(runtime, 0, SNDRV_PCM_HW_PARAM_RATE, setup_hw_info()
1157 if ((err = snd_pcm_hw_rule_add(runtime, 0, SNDRV_PCM_HW_PARAM_CHANNELS, setup_hw_info()
1164 if ((err = snd_pcm_hw_rule_add(runtime, 0, SNDRV_PCM_HW_PARAM_FORMAT, setup_hw_info()
1172 err = snd_pcm_hw_rule_add(runtime, 0, setup_hw_info()
1182 if ((err = snd_usb_pcm_check_knot(runtime, subs)) < 0) setup_hw_info()
1194 struct snd_pcm_runtime *runtime = substream->runtime; snd_usb_pcm_open() local
1199 runtime->hw = snd_usb_hardware; snd_usb_pcm_open()
1200 runtime->private_data = subs; snd_usb_pcm_open()
1202 /* runtime PM is also done there */ snd_usb_pcm_open()
1209 return setup_hw_info(runtime, subs); snd_usb_pcm_open()
1240 struct snd_pcm_runtime *runtime = subs->pcm_substream->runtime; retire_capture_urb() local
1250 stride = runtime->frame_bits >> 3; retire_capture_urb()
1263 if (bytes % (runtime->sample_bits >> 3) != 0) { retire_capture_urb()
1274 if (subs->hwptr_done >= runtime->buffer_size * stride) retire_capture_urb()
1275 subs->hwptr_done -= runtime->buffer_size * stride; retire_capture_urb()
1278 if (subs->transfer_done >= runtime->period_size) { retire_capture_urb()
1279 subs->transfer_done -= runtime->period_size; retire_capture_urb()
1285 runtime->delay = subs->last_delay = 0; retire_capture_urb()
1293 if (oldptr + bytes > runtime->buffer_size * stride) { retire_capture_urb()
1295 runtime->buffer_size * stride - oldptr; retire_capture_urb()
1296 memcpy(runtime->dma_area + oldptr, cp, bytes1); retire_capture_urb()
1297 memcpy(runtime->dma_area, cp + bytes1, bytes - bytes1); retire_capture_urb()
1299 memcpy(runtime->dma_area + oldptr, cp, bytes); retire_capture_urb()
1310 struct snd_pcm_runtime *runtime = subs->pcm_substream->runtime; fill_playback_urb_dsd_dop() local
1311 unsigned int stride = runtime->frame_bits >> 3; fill_playback_urb_dsd_dop()
1314 unsigned int wrap = runtime->buffer_size * stride; fill_playback_urb_dsd_dop()
1316 u8 *src = runtime->dma_area; fill_playback_urb_dsd_dop()
1342 if (++subs->dsd_dop.channel % runtime->channels == 0) { fill_playback_urb_dsd_dop()
1365 struct snd_pcm_runtime *runtime = subs->pcm_substream->runtime; prepare_playback_urb() local
1372 stride = runtime->frame_bits >> 3; prepare_playback_urb()
1390 if (subs->transfer_done >= runtime->period_size) { prepare_playback_urb()
1391 subs->transfer_done -= runtime->period_size; prepare_playback_urb()
1432 % (runtime->buffer_size * stride); prepare_playback_urb()
1433 buf[i] = bitrev8(runtime->dma_area[idx]); prepare_playback_urb()
1439 if (subs->hwptr_done + bytes > runtime->buffer_size * stride) { prepare_playback_urb()
1442 runtime->buffer_size * stride - subs->hwptr_done; prepare_playback_urb()
1444 runtime->dma_area + subs->hwptr_done, bytes1); prepare_playback_urb()
1446 runtime->dma_area, bytes - bytes1); prepare_playback_urb()
1449 runtime->dma_area + subs->hwptr_done, bytes); prepare_playback_urb()
1455 if (subs->hwptr_done >= runtime->buffer_size * stride) prepare_playback_urb()
1456 subs->hwptr_done -= runtime->buffer_size * stride; prepare_playback_urb()
1459 runtime->delay = subs->last_delay; prepare_playback_urb()
1460 runtime->delay += frames; prepare_playback_urb()
1461 subs->last_delay = runtime->delay; prepare_playback_urb()
1471 snd_pcm_gettime(runtime, &runtime->trigger_tstamp); prepare_playback_urb()
1489 struct snd_pcm_runtime *runtime = subs->pcm_substream->runtime; retire_playback_urb() local
1504 est_delay = snd_usb_pcm_delay(subs, runtime->rate); retire_playback_urb()
1510 runtime->delay = subs->last_delay; retire_playback_urb()
1517 if (abs(est_delay - subs->last_delay) * 1000 > runtime->rate * 2) retire_playback_urb()
1557 struct snd_usb_substream *subs = substream->runtime->private_data; snd_usb_substream_playback_trigger()
1586 struct snd_usb_substream *subs = substream->runtime->private_data; snd_usb_substream_capture_trigger()
/linux-4.1.27/sound/atmel/
H A Dac97c.c113 struct snd_pcm_runtime *runtime = substream->runtime; atmel_ac97c_prepare_dma() local
120 if (runtime->dma_addr & 1 || runtime->buffer_size & 1) { atmel_ac97c_prepare_dma()
130 buffer_len = frames_to_bytes(runtime, runtime->buffer_size); atmel_ac97c_prepare_dma()
131 period_len = frames_to_bytes(runtime, runtime->period_size); atmel_ac97c_prepare_dma()
133 cdesc = dw_dma_cyclic_prep(chan, runtime->dma_addr, buffer_len, atmel_ac97c_prepare_dma()
178 struct snd_pcm_runtime *runtime = substream->runtime; atmel_ac97c_playback_open() local
182 runtime->hw = atmel_ac97c_hw; atmel_ac97c_playback_open()
184 runtime->hw.rate_min = chip->cur_rate; atmel_ac97c_playback_open()
185 runtime->hw.rate_max = chip->cur_rate; atmel_ac97c_playback_open()
188 runtime->hw.formats = pcm_format_to_bits(chip->cur_format); atmel_ac97c_playback_open()
197 struct snd_pcm_runtime *runtime = substream->runtime; atmel_ac97c_capture_open() local
201 runtime->hw = atmel_ac97c_hw; atmel_ac97c_capture_open()
203 runtime->hw.rate_min = chip->cur_rate; atmel_ac97c_capture_open()
204 runtime->hw.rate_max = chip->cur_rate; atmel_ac97c_capture_open()
207 runtime->hw.formats = pcm_format_to_bits(chip->cur_format); atmel_ac97c_capture_open()
320 struct snd_pcm_runtime *runtime = substream->runtime; atmel_ac97c_playback_prepare() local
321 int block_size = frames_to_bytes(runtime, runtime->period_size); atmel_ac97c_playback_prepare()
329 switch (runtime->channels) { atmel_ac97c_playback_prepare()
350 switch (runtime->format) { atmel_ac97c_playback_prepare()
376 if (runtime->rate != 48000) { atmel_ac97c_playback_prepare()
387 runtime->rate); atmel_ac97c_playback_prepare()
390 runtime->rate); atmel_ac97c_playback_prepare()
398 writel(runtime->dma_addr, chip->regs + ATMEL_PDC_TPR); atmel_ac97c_playback_prepare()
400 writel(runtime->dma_addr + block_size, atmel_ac97c_playback_prepare()
411 struct snd_pcm_runtime *runtime = substream->runtime; atmel_ac97c_capture_prepare() local
412 int block_size = frames_to_bytes(runtime, runtime->period_size); atmel_ac97c_capture_prepare()
420 switch (runtime->channels) { atmel_ac97c_capture_prepare()
441 switch (runtime->format) { atmel_ac97c_capture_prepare()
467 if (runtime->rate != 48000) { atmel_ac97c_capture_prepare()
478 runtime->rate); atmel_ac97c_capture_prepare()
481 runtime->rate); atmel_ac97c_capture_prepare()
489 writel(runtime->dma_addr, chip->regs + ATMEL_PDC_RPR); atmel_ac97c_capture_prepare()
491 writel(runtime->dma_addr + block_size, atmel_ac97c_capture_prepare()
592 struct snd_pcm_runtime *runtime = substream->runtime; atmel_ac97c_playback_pointer() local
600 bytes -= runtime->dma_addr; atmel_ac97c_playback_pointer()
602 frames = bytes_to_frames(runtime, bytes); atmel_ac97c_playback_pointer()
603 if (frames >= runtime->buffer_size) atmel_ac97c_playback_pointer()
604 frames -= runtime->buffer_size; atmel_ac97c_playback_pointer()
612 struct snd_pcm_runtime *runtime = substream->runtime; atmel_ac97c_capture_pointer() local
620 bytes -= runtime->dma_addr; atmel_ac97c_capture_pointer()
622 frames = bytes_to_frames(runtime, bytes); atmel_ac97c_capture_pointer()
623 if (frames >= runtime->buffer_size) atmel_ac97c_capture_pointer()
624 frames -= runtime->buffer_size; atmel_ac97c_capture_pointer()
660 struct snd_pcm_runtime *runtime; atmel_ac97c_interrupt() local
671 runtime = chip->playback_substream->runtime; atmel_ac97c_interrupt()
672 block_size = frames_to_bytes(runtime, atmel_ac97c_interrupt()
673 runtime->period_size); atmel_ac97c_interrupt()
676 if (chip->playback_period == runtime->periods) atmel_ac97c_interrupt()
679 if (next_period == runtime->periods) atmel_ac97c_interrupt()
684 writel(runtime->dma_addr + offset, atmel_ac97c_interrupt()
693 runtime = chip->capture_substream->runtime; atmel_ac97c_interrupt()
694 block_size = frames_to_bytes(runtime, atmel_ac97c_interrupt()
695 runtime->period_size); atmel_ac97c_interrupt()
698 if (chip->capture_period == runtime->periods) atmel_ac97c_interrupt()
701 if (next_period == runtime->periods) atmel_ac97c_interrupt()
706 writel(runtime->dma_addr + offset, atmel_ac97c_interrupt()
H A Dabdac.c123 struct snd_pcm_runtime *runtime = substream->runtime; atmel_abdac_prepare_dma() local
130 if (runtime->dma_addr & 1 || runtime->buffer_size & 1) { atmel_abdac_prepare_dma()
135 buffer_len = frames_to_bytes(runtime, runtime->buffer_size); atmel_abdac_prepare_dma()
136 period_len = frames_to_bytes(runtime, runtime->period_size); atmel_abdac_prepare_dma()
138 cdesc = dw_dma_cyclic_prep(chan, runtime->dma_addr, buffer_len, atmel_abdac_prepare_dma()
182 substream->runtime->hw = atmel_abdac_hw; atmel_abdac_open()
184 return snd_pcm_hw_constraint_list(substream->runtime, 0, atmel_abdac_open()
226 retval = clk_set_rate(dac->sample_clk, 256 * substream->runtime->rate); atmel_abdac_prepare()
271 struct snd_pcm_runtime *runtime = substream->runtime; atmel_abdac_pointer() local
276 bytes -= runtime->dma_addr; atmel_abdac_pointer()
278 frames = bytes_to_frames(runtime, bytes); atmel_abdac_pointer()
279 if (frames >= runtime->buffer_size) atmel_abdac_pointer()
280 frames -= runtime->buffer_size; atmel_abdac_pointer()
/linux-4.1.27/sound/usb/line6/
H A Dplayback.c204 struct snd_pcm_runtime *runtime = submit_audio_out_urb() local
205 get_substream(line6pcm, SNDRV_PCM_STREAM_PLAYBACK)->runtime; submit_audio_out_urb()
207 if (line6pcm->out.pos + urb_frames > runtime->buffer_size) { submit_audio_out_urb()
214 len = runtime->buffer_size - line6pcm->out.pos; submit_audio_out_urb()
218 runtime->dma_area + submit_audio_out_urb()
222 len * bytes_per_frame, runtime->dma_area, submit_audio_out_urb()
229 runtime->dma_area + submit_audio_out_urb()
235 if (line6pcm->out.pos >= runtime->buffer_size) submit_audio_out_urb()
236 line6pcm->out.pos -= runtime->buffer_size; submit_audio_out_urb()
329 struct snd_pcm_runtime *runtime = substream->runtime; audio_out_callback() local
334 if (line6pcm->out.pos_done >= runtime->buffer_size) audio_out_callback()
335 line6pcm->out.pos_done -= runtime->buffer_size; audio_out_callback()
369 struct snd_pcm_runtime *runtime = substream->runtime; snd_line6_playback_open() local
372 err = snd_pcm_hw_constraint_ratdens(runtime, 0, SNDRV_PCM_HW_PARAM_RATE, snd_line6_playback_open()
377 runtime->hw = line6pcm->properties->playback_hw; snd_line6_playback_open()
H A Dcapture.c92 struct snd_pcm_runtime *runtime = substream->runtime; line6_capture_copy() local
96 if (runtime == NULL) line6_capture_copy()
99 if (line6pcm->in.pos_done + frames > runtime->buffer_size) { line6_capture_copy()
106 len = runtime->buffer_size - line6pcm->in.pos_done; line6_capture_copy()
109 memcpy(runtime->dma_area + line6_capture_copy()
112 memcpy(runtime->dma_area, fbuf + len * bytes_per_frame, line6_capture_copy()
121 memcpy(runtime->dma_area + line6_capture_copy()
126 if (line6pcm->in.pos_done >= runtime->buffer_size) line6_capture_copy()
127 line6pcm->in.pos_done -= runtime->buffer_size; line6_capture_copy()
214 struct snd_pcm_runtime *runtime = substream->runtime; snd_line6_capture_open() local
217 err = snd_pcm_hw_constraint_ratdens(runtime, 0, snd_line6_capture_open()
223 runtime->hw = line6pcm->properties->capture_hw; snd_line6_capture_open()
/linux-4.1.27/sound/soc/atmel/
H A Datmel-pcm-pdc.c166 struct atmel_runtime_data *prtd = substream->runtime->private_data; atmel_pcm_dma_irq()
215 struct snd_pcm_runtime *runtime = substream->runtime; atmel_pcm_hw_params() local
216 struct atmel_runtime_data *prtd = runtime->private_data; atmel_pcm_hw_params()
223 runtime->dma_bytes = params_buffer_bytes(params); atmel_pcm_hw_params()
228 prtd->dma_buffer = runtime->dma_addr; atmel_pcm_hw_params()
229 prtd->dma_buffer_end = runtime->dma_addr + runtime->dma_bytes; atmel_pcm_hw_params()
236 runtime->dma_bytes, atmel_pcm_hw_params()
243 struct atmel_runtime_data *prtd = substream->runtime->private_data; atmel_pcm_hw_free()
257 struct atmel_runtime_data *prtd = substream->runtime->private_data; atmel_pcm_prepare()
270 struct snd_pcm_runtime *rtd = substream->runtime; atmel_pcm_trigger()
336 struct snd_pcm_runtime *runtime = substream->runtime; atmel_pcm_pointer() local
337 struct atmel_runtime_data *prtd = runtime->private_data; atmel_pcm_pointer()
343 x = bytes_to_frames(runtime, ptr - prtd->dma_buffer); atmel_pcm_pointer()
345 if (x == runtime->buffer_size) atmel_pcm_pointer()
353 struct snd_pcm_runtime *runtime = substream->runtime; atmel_pcm_open() local
360 ret = snd_pcm_hw_constraint_integer(runtime, atmel_pcm_open()
370 runtime->private_data = prtd; atmel_pcm_open()
378 struct atmel_runtime_data *prtd = substream->runtime->private_data; atmel_pcm_close()
/linux-4.1.27/arch/mips/include/asm/mach-pmcs-msp71xx/
H A Dcpu-feature-overrides.h13 /* #define cpu_has_dsp2 ??? - do runtime detection */
/linux-4.1.27/arch/arm64/include/asm/
H A Defi.h20 __f = efi.systab->runtime->f; \
33 __f = efi.systab->runtime->f; \
54 * On ARM systems, virtually remapped UEFI runtime services are set up in two
57 * the virt_addr fields and calls the SetVirtualAddressMap() [SVAM] runtime
/linux-4.1.27/sound/soc/kirkwood/
H A Dkirkwood-dma.c108 struct snd_pcm_runtime *runtime = substream->runtime; kirkwood_dma_open() local
116 err = snd_pcm_hw_constraint_minmax(runtime, kirkwood_dma_open()
123 err = snd_pcm_hw_constraint_step(runtime, 0, kirkwood_dma_open()
129 err = snd_pcm_hw_constraint_step(substream->runtime, 0, kirkwood_dma_open()
186 struct snd_pcm_runtime *runtime = substream->runtime; kirkwood_dma_hw_params() local
189 runtime->dma_bytes = params_buffer_bytes(params); kirkwood_dma_hw_params()
202 struct snd_pcm_runtime *runtime = substream->runtime; kirkwood_dma_prepare() local
207 size = frames_to_bytes(runtime, runtime->buffer_size); kirkwood_dma_prepare()
213 writel(runtime->dma_addr, priv->io + KIRKWOOD_PLAY_BUF_ADDR); kirkwood_dma_prepare()
217 writel(runtime->dma_addr, priv->io + KIRKWOOD_REC_BUF_ADDR); kirkwood_dma_prepare()
232 count = bytes_to_frames(substream->runtime, kirkwood_dma_pointer()
235 count = bytes_to_frames(substream->runtime, kirkwood_dma_pointer()
/linux-4.1.27/sound/sh/
H A Daica.c239 struct snd_pcm_runtime *runtime; aica_dma_transfer() local
245 runtime = substream->runtime; aica_dma_transfer()
249 (unsigned long) (runtime->dma_area + aica_dma_transfer()
277 struct snd_pcm_runtime *runtime; run_spu_dma() local
281 runtime = dreamcastcard->substream->runtime; run_spu_dma()
284 frames_to_bytes(runtime, runtime->buffer_size); run_spu_dma()
285 if (runtime->channels > 1) run_spu_dma()
287 aica_dma_transfer(runtime->channels, buffer_size, run_spu_dma()
291 buffer_size / (AICA_PERIOD_SIZE * runtime->channels); run_spu_dma()
294 aica_dma_transfer(runtime->channels, run_spu_dma()
295 AICA_PERIOD_SIZE * runtime->channels, run_spu_dma()
309 struct snd_pcm_runtime *runtime; aica_period_elapsed() local
313 runtime = substream->runtime; aica_period_elapsed()
317 frames_to_bytes(runtime, aica_period_elapsed()
326 if (runtime->channels > 1) aica_period_elapsed()
336 struct snd_pcm_runtime *runtime; spu_begin_dma() local
337 runtime = substream->runtime; spu_begin_dma()
354 struct snd_pcm_runtime *runtime; snd_aicapcm_pcm_open() local
371 runtime = substream->runtime; snd_aicapcm_pcm_open()
372 runtime->hw = snd_pcm_aica_playback_hw; snd_aicapcm_pcm_open()
413 if ((substream->runtime)->format == SNDRV_PCM_FORMAT_S16_LE) snd_aicapcm_pcm_prepare()
415 dreamcastcard->channel->freq = substream->runtime->rate; snd_aicapcm_pcm_prepare()
H A Dsh_dac_audio.c117 struct snd_pcm_runtime *runtime = substream->runtime; snd_sh_dac_pcm_open() local
119 runtime->hw = snd_sh_dac_pcm_hw; snd_sh_dac_pcm_open()
158 struct snd_pcm_runtime *runtime = chip->substream->runtime; snd_sh_dac_pcm_prepare() local
160 chip->buffer_size = runtime->buffer_size; snd_sh_dac_pcm_prepare()
192 struct snd_pcm_runtime *runtime = substream->runtime; snd_sh_dac_pcm_copy() local
193 ssize_t b_count = frames_to_bytes(runtime , count); snd_sh_dac_pcm_copy()
194 ssize_t b_pos = frames_to_bytes(runtime , pos); snd_sh_dac_pcm_copy()
219 struct snd_pcm_runtime *runtime = substream->runtime; snd_sh_dac_pcm_silence() local
220 ssize_t b_count = frames_to_bytes(runtime , count); snd_sh_dac_pcm_silence()
221 ssize_t b_pos = frames_to_bytes(runtime , pos); snd_sh_dac_pcm_silence()
317 struct snd_pcm_runtime *runtime = chip->substream->runtime; sh_dac_audio_timer() local
318 ssize_t b_ps = frames_to_bytes(runtime, runtime->period_size); sh_dac_audio_timer()
/linux-4.1.27/drivers/media/usb/cx231xx/
H A Dcx231xx-audio.c105 struct snd_pcm_runtime *runtime; cx231xx_audio_isocirq() local
129 runtime = substream->runtime; cx231xx_audio_isocirq()
130 stride = runtime->frame_bits >> 3; cx231xx_audio_isocirq()
142 if (oldptr + length >= runtime->buffer_size) { cx231xx_audio_isocirq()
145 cnt = runtime->buffer_size - oldptr; cx231xx_audio_isocirq()
146 memcpy(runtime->dma_area + oldptr * stride, cp, cx231xx_audio_isocirq()
148 memcpy(runtime->dma_area, cp + cnt * stride, cx231xx_audio_isocirq()
151 memcpy(runtime->dma_area + oldptr * stride, cp, cx231xx_audio_isocirq()
159 runtime->buffer_size) cx231xx_audio_isocirq()
161 runtime->buffer_size; cx231xx_audio_isocirq()
165 runtime->period_size) { cx231xx_audio_isocirq()
167 runtime->period_size; cx231xx_audio_isocirq()
195 struct snd_pcm_runtime *runtime; cx231xx_audio_bulkirq() local
219 runtime = substream->runtime; cx231xx_audio_bulkirq()
220 stride = runtime->frame_bits >> 3; cx231xx_audio_bulkirq()
228 if (oldptr + length >= runtime->buffer_size) { cx231xx_audio_bulkirq()
231 cnt = runtime->buffer_size - oldptr; cx231xx_audio_bulkirq()
232 memcpy(runtime->dma_area + oldptr * stride, cp, cx231xx_audio_bulkirq()
234 memcpy(runtime->dma_area, cp + cnt * stride, cx231xx_audio_bulkirq()
237 memcpy(runtime->dma_area + oldptr * stride, cp, cx231xx_audio_bulkirq()
245 runtime->buffer_size) cx231xx_audio_bulkirq()
247 runtime->buffer_size; cx231xx_audio_bulkirq()
251 runtime->period_size) { cx231xx_audio_bulkirq()
253 runtime->period_size; cx231xx_audio_bulkirq()
393 struct snd_pcm_runtime *runtime = subs->runtime; snd_pcm_alloc_vmalloc_buffer() local
397 if (runtime->dma_area) { snd_pcm_alloc_vmalloc_buffer()
398 if (runtime->dma_bytes > size) snd_pcm_alloc_vmalloc_buffer()
401 vfree(runtime->dma_area); snd_pcm_alloc_vmalloc_buffer()
403 runtime->dma_area = vmalloc(size); snd_pcm_alloc_vmalloc_buffer()
404 if (!runtime->dma_area) snd_pcm_alloc_vmalloc_buffer()
407 runtime->dma_bytes = size; snd_pcm_alloc_vmalloc_buffer()
436 struct snd_pcm_runtime *runtime = substream->runtime; snd_cx231xx_capture_open() local
463 runtime->hw = snd_cx231xx_hw_capture; snd_cx231xx_capture_open()
472 snd_pcm_hw_constraint_integer(runtime, SNDRV_PCM_HW_PARAM_PERIODS); snd_cx231xx_capture_open()
474 runtime->private_data = dev; snd_cx231xx_capture_open()
630 void *pageptr = subs->runtime->dma_area + offset; snd_pcm_get_vmalloc_page()
/linux-4.1.27/sound/mips/
H A Dsgio2audio.c369 struct snd_pcm_runtime *runtime = chip->channel[ch].substream->runtime; snd_sgio2audio_dma_pull_frag() local
375 dst_base = runtime->dma_area; snd_sgio2audio_dma_pull_frag()
377 dst_mask = frames_to_bytes(runtime, runtime->buffer_size) - 1; snd_sgio2audio_dma_pull_frag()
381 ret = chip->channel[ch].size >= runtime->period_size; snd_sgio2audio_dma_pull_frag()
382 chip->channel[ch].size %= runtime->period_size; snd_sgio2audio_dma_pull_frag()
417 struct snd_pcm_runtime *runtime = chip->channel[ch].substream->runtime; snd_sgio2audio_dma_push_frag() local
423 src_base = runtime->dma_area; snd_sgio2audio_dma_push_frag()
425 src_mask = frames_to_bytes(runtime, runtime->buffer_size) - 1; snd_sgio2audio_dma_push_frag()
429 ret = chip->channel[ch].size >= runtime->period_size; snd_sgio2audio_dma_push_frag()
430 chip->channel[ch].size %= runtime->period_size; snd_sgio2audio_dma_push_frag()
457 struct snd_sgio2audio_chan *chan = substream->runtime->private_data; snd_sgio2audio_dma_start()
477 struct snd_sgio2audio_chan *chan = substream->runtime->private_data; snd_sgio2audio_dma_stop()
557 struct snd_pcm_runtime *runtime = substream->runtime; snd_sgio2audio_playback1_open() local
559 runtime->hw = snd_sgio2audio_pcm_hw; snd_sgio2audio_playback1_open()
560 runtime->private_data = &chip->channel[1]; snd_sgio2audio_playback1_open()
567 struct snd_pcm_runtime *runtime = substream->runtime; snd_sgio2audio_playback2_open() local
569 runtime->hw = snd_sgio2audio_pcm_hw; snd_sgio2audio_playback2_open()
570 runtime->private_data = &chip->channel[2]; snd_sgio2audio_playback2_open()
578 struct snd_pcm_runtime *runtime = substream->runtime; snd_sgio2audio_capture_open() local
580 runtime->hw = snd_sgio2audio_pcm_hw; snd_sgio2audio_capture_open()
581 runtime->private_data = &chip->channel[0]; snd_sgio2audio_capture_open()
588 struct snd_pcm_runtime *runtime = substream->runtime; snd_sgio2audio_pcm_close() local
590 runtime->private_data = NULL; snd_sgio2audio_pcm_close()
613 struct snd_pcm_runtime *runtime = substream->runtime; snd_sgio2audio_pcm_prepare() local
614 struct snd_sgio2audio_chan *chan = substream->runtime->private_data; snd_sgio2audio_pcm_prepare()
631 runtime->rate, snd_sgio2audio_pcm_prepare()
633 runtime->channels); snd_sgio2audio_pcm_prepare()
637 runtime->rate, snd_sgio2audio_pcm_prepare()
639 runtime->channels); snd_sgio2audio_pcm_prepare()
670 struct snd_sgio2audio_chan *chan = substream->runtime->private_data; snd_sgio2audio_pcm_pointer()
673 return bytes_to_frames(substream->runtime, snd_sgio2audio_pcm_pointer()
H A Dau1x00.c157 struct snd_pcm_runtime *runtime = substream->runtime; au1000_setup_dma_link() local
162 dma_start = virt_to_phys(runtime->dma_area); au1000_setup_dma_link()
296 substream->runtime->hw = snd_au1000_hw; snd_au1000_playback_open()
297 return (snd_pcm_hw_constraint_list(substream->runtime, 0, snd_au1000_playback_open()
309 substream->runtime->hw = snd_au1000_hw; snd_au1000_capture_open()
310 return (snd_pcm_hw_constraint_list(substream->runtime, 0, snd_au1000_capture_open()
360 struct snd_pcm_runtime *runtime = substream->runtime; snd_au1000_playback_prepare() local
362 if (runtime->channels == 1) snd_au1000_playback_prepare()
366 snd_ac97_set_rate(au1000->ac97, AC97_PCM_FRONT_DAC_RATE, runtime->rate); snd_au1000_playback_prepare()
374 struct snd_pcm_runtime *runtime = substream->runtime; snd_au1000_capture_prepare() local
376 if (runtime->channels == 1) snd_au1000_capture_prepare()
380 snd_ac97_set_rate(au1000->ac97, AC97_PCM_LR_ADC_RATE, runtime->rate); snd_au1000_capture_prepare()
410 struct snd_pcm_runtime *runtime = substream->runtime; snd_au1000_pointer() local
419 return bytes_to_frames(runtime,location); snd_au1000_pointer()
H A Dhal2.c532 struct snd_pcm_runtime *runtime = substream->runtime; hal2_playback_open() local
536 runtime->hw = hal2_pcm_hw; hal2_playback_open()
555 struct snd_pcm_runtime *runtime = substream->runtime; hal2_playback_prepare() local
558 dac->voices = runtime->channels; hal2_playback_prepare()
559 dac->sample_rate = hal2_compute_rate(dac, runtime->rate); hal2_playback_prepare()
604 memcpy(buf, substream->runtime->dma_area + rec->sw_data, bytes); hal2_playback_transfer()
623 struct snd_pcm_runtime *runtime = substream->runtime; hal2_capture_open() local
628 runtime->hw = hal2_pcm_hw; hal2_capture_open()
647 struct snd_pcm_runtime *runtime = substream->runtime; hal2_capture_prepare() local
650 adc->voices = runtime->channels; hal2_capture_prepare()
651 adc->sample_rate = hal2_compute_rate(adc, runtime->rate); hal2_capture_prepare()
698 memcpy(substream->runtime->dma_area + rec->sw_data, buf, bytes); hal2_capture_transfer()
/linux-4.1.27/drivers/media/usb/usbtv/
H A Dusbtv-audio.c54 struct snd_pcm_runtime *runtime = substream->runtime; snd_usbtv_pcm_open() local
57 runtime->hw = snd_usbtv_digital_hw; snd_usbtv_pcm_open()
112 struct snd_pcm_runtime *runtime = substream->runtime; usbtv_audio_urb_received() local
134 frame_bytes = runtime->frame_bits >> 3; usbtv_audio_urb_received()
144 if (buffer_pos + chunk_length >= runtime->buffer_size) { usbtv_audio_urb_received()
145 size_t cnt = (runtime->buffer_size - buffer_pos) * usbtv_audio_urb_received()
147 memcpy(runtime->dma_area + buffer_pos * frame_bytes, usbtv_audio_urb_received()
149 memcpy(runtime->dma_area, urb_current + cnt, usbtv_audio_urb_received()
152 memcpy(runtime->dma_area + buffer_pos * frame_bytes, usbtv_audio_urb_received()
159 if (buffer_pos >= runtime->buffer_size) usbtv_audio_urb_received()
160 buffer_pos -= runtime->buffer_size; usbtv_audio_urb_received()
162 if (period_pos >= runtime->period_size) { usbtv_audio_urb_received()
163 period_pos -= runtime->period_size; usbtv_audio_urb_received()
/linux-4.1.27/sound/soc/intel/atom/
H A Dsst-mfld-platform-compress.c54 struct snd_compr_runtime *runtime = cstream->runtime; sst_platform_compr_open() local
76 runtime->private_data = stream; sst_platform_compr_open()
88 stream = cstream->runtime->private_data; sst_platform_compr_free()
113 stream = cstream->runtime->private_data; sst_platform_compr_set_params()
156 virt_to_phys(cstream->runtime->buffer); sst_platform_compr_set_params()
158 cstream->runtime->buffer_size; sst_platform_compr_set_params()
160 str_params.aparams.frag_size = cstream->runtime->fragment_size; sst_platform_compr_set_params()
179 struct sst_runtime_stream *stream = cstream->runtime->private_data; sst_platform_compr_trigger()
210 stream = cstream->runtime->private_data; sst_platform_compr_pointer()
213 (u32)cstream->runtime->buffer_size; sst_platform_compr_pointer()
223 stream = cstream->runtime->private_data; sst_platform_compr_ack()
234 cstream->runtime->private_data; sst_platform_compr_get_caps()
243 cstream->runtime->private_data; sst_platform_compr_get_codec_caps()
252 cstream->runtime->private_data; sst_platform_compr_set_metadata()
H A Dsst-mfld-platform-pcm.c140 channels = substream->runtime->channels; sst_fill_alloc_params()
141 period_size = substream->runtime->period_size; sst_fill_alloc_params()
142 periodbytes = samples_to_bytes(substream->runtime, period_size); sst_fill_alloc_params()
153 param->uc.pcm_params.num_chan = (u8) substream->runtime->channels; sst_fill_pcm_params()
154 param->uc.pcm_params.pcm_wd_sz = substream->runtime->sample_bits; sst_fill_pcm_params()
155 param->uc.pcm_params.sfreq = substream->runtime->rate; sst_fill_pcm_params()
234 substream->runtime->private_data; sst_platform_alloc_stream()
244 substream->runtime->dma_area = substream->dma_buffer.area; sst_platform_alloc_stream()
270 if (!substream || !substream->runtime) sst_period_elapsed()
272 stream = substream->runtime->private_data; sst_period_elapsed()
284 substream->runtime->private_data; sst_platform_init_stream()
293 stream->stream_info.sfreq = substream->runtime->rate; sst_platform_init_stream()
315 struct snd_pcm_runtime *runtime = substream->runtime; sst_media_open() local
338 runtime->private_data = stream; sst_media_open()
345 snd_pcm_hw_constraint_step(substream->runtime, 0, sst_media_open()
348 return snd_pcm_hw_constraint_integer(runtime, sst_media_open()
362 stream = substream->runtime->private_data; sst_media_close()
378 substream->runtime->private_data; get_current_pipe_id()
395 stream = substream->runtime->private_data; sst_media_prepare()
411 substream->runtime->hw.info = SNDRV_PCM_INFO_BLOCK_TRANSFER; sst_media_prepare()
420 memset(substream->runtime->dma_area, 0, params_buffer_bytes(params)); sst_media_hw_params()
561 struct snd_pcm_runtime *runtime; sst_platform_open() local
566 runtime = substream->runtime; sst_platform_open()
567 runtime->hw = sst_platform_pcm_hw; sst_platform_open()
582 stream = substream->runtime->private_data; sst_platform_pcm_trigger()
627 stream = substream->runtime->private_data; sst_platform_pcm_pointer()
637 substream->runtime->delay = str_info->pcm_delay; sst_platform_pcm_pointer()
/linux-4.1.27/sound/soc/txx9/
H A Dtxx9aclc.c55 struct snd_pcm_runtime *runtime = substream->runtime; txx9aclc_pcm_hw_params() local
56 struct txx9aclc_dmadata *dmadata = runtime->private_data; txx9aclc_pcm_hw_params()
64 "runtime->dma_area = %#lx dma_addr = %#lx dma_bytes = %zd " txx9aclc_pcm_hw_params()
65 "runtime->min_align %ld\n", txx9aclc_pcm_hw_params()
66 (unsigned long)runtime->dma_area, txx9aclc_pcm_hw_params()
67 (unsigned long)runtime->dma_addr, runtime->dma_bytes, txx9aclc_pcm_hw_params()
68 runtime->min_align); txx9aclc_pcm_hw_params()
86 struct snd_pcm_runtime *runtime = substream->runtime; txx9aclc_pcm_prepare() local
87 struct txx9aclc_dmadata *dmadata = runtime->private_data; txx9aclc_pcm_prepare()
89 dmadata->dma_addr = runtime->dma_addr; txx9aclc_pcm_prepare()
208 struct txx9aclc_dmadata *dmadata = substream->runtime->private_data; txx9aclc_pcm_trigger()
241 struct txx9aclc_dmadata *dmadata = substream->runtime->private_data; txx9aclc_pcm_pointer()
243 return bytes_to_frames(substream->runtime, dmadata->pos); txx9aclc_pcm_pointer()
256 ret = snd_pcm_hw_constraint_integer(substream->runtime, txx9aclc_pcm_open()
260 substream->runtime->private_data = dmadata; txx9aclc_pcm_open()
266 struct txx9aclc_dmadata *dmadata = substream->runtime->private_data; txx9aclc_pcm_close()
/linux-4.1.27/sound/usb/usx2y/
H A Dusbusx2yaudio.c74 struct snd_pcm_runtime *runtime = subs->pcm_substream->runtime; usX2Y_urb_capt_retire() local
94 if ((hwptr_done + len) > runtime->buffer_size) { usX2Y_urb_capt_retire()
95 int cnt = runtime->buffer_size - hwptr_done; usX2Y_urb_capt_retire()
97 memcpy(runtime->dma_area + hwptr_done * usX2Y->stride, cp, blen); usX2Y_urb_capt_retire()
98 memcpy(runtime->dma_area, cp + blen, len * usX2Y->stride - blen); usX2Y_urb_capt_retire()
100 memcpy(runtime->dma_area + hwptr_done * usX2Y->stride, cp, usX2Y_urb_capt_retire()
104 if ((hwptr_done += len) >= runtime->buffer_size) usX2Y_urb_capt_retire()
105 hwptr_done -= runtime->buffer_size; usX2Y_urb_capt_retire()
111 if (subs->transfer_done >= runtime->period_size) { usX2Y_urb_capt_retire()
112 subs->transfer_done -= runtime->period_size; usX2Y_urb_capt_retire()
133 struct snd_pcm_runtime *runtime = subs->pcm_substream->runtime; usX2Y_urb_play_prepare() local
152 if (subs->hwptr + count > runtime->buffer_size) { usX2Y_urb_play_prepare()
157 len = runtime->buffer_size - subs->hwptr; usX2Y_urb_play_prepare()
159 memcpy(subs->tmpbuf, runtime->dma_area + usX2Y_urb_play_prepare()
162 runtime->dma_area, (count - len) * usX2Y->stride); usX2Y_urb_play_prepare()
164 subs->hwptr -= runtime->buffer_size; usX2Y_urb_play_prepare()
167 urb->transfer_buffer = runtime->dma_area + subs->hwptr * usX2Y->stride; usX2Y_urb_play_prepare()
168 if ((subs->hwptr += count) >= runtime->buffer_size) usX2Y_urb_play_prepare()
169 subs->hwptr -= runtime->buffer_size; usX2Y_urb_play_prepare()
184 struct snd_pcm_runtime *runtime = subs->pcm_substream->runtime; usX2Y_urb_play_retire() local
189 if (subs->hwptr_done >= runtime->buffer_size) usX2Y_urb_play_retire()
190 subs->hwptr_done -= runtime->buffer_size; usX2Y_urb_play_retire()
191 if (subs->transfer_done >= runtime->period_size) { usX2Y_urb_play_retire()
192 subs->transfer_done -= runtime->period_size; usX2Y_urb_play_retire()
525 struct snd_usX2Y_substream *subs = substream->runtime->private_data; snd_usX2Y_pcm_pointer()
533 struct snd_usX2Y_substream *subs = substream->runtime->private_data; snd_usX2Y_pcm_trigger()
766 !test_substream->runtime) snd_usX2Y_pcm_hw_params()
768 if ((test_substream->runtime->format && snd_usX2Y_pcm_hw_params()
769 test_substream->runtime->format != format) || snd_usX2Y_pcm_hw_params()
770 (test_substream->runtime->rate && snd_usX2Y_pcm_hw_params()
771 test_substream->runtime->rate != rate)) { snd_usX2Y_pcm_hw_params()
795 struct snd_pcm_runtime *runtime = substream->runtime; snd_usX2Y_pcm_hw_free() local
796 struct snd_usX2Y_substream *subs = runtime->private_data; snd_usX2Y_pcm_hw_free()
805 !cap_subs->pcm_substream->runtime || snd_usX2Y_pcm_hw_free()
806 !cap_subs->pcm_substream->runtime->status || snd_usX2Y_pcm_hw_free()
807 cap_subs->pcm_substream->runtime->status->state < SNDRV_PCM_STATE_PREPARED) { snd_usX2Y_pcm_hw_free()
828 struct snd_pcm_runtime *runtime = substream->runtime; snd_usX2Y_pcm_prepare() local
829 struct snd_usX2Y_substream *subs = runtime->private_data; snd_usX2Y_pcm_prepare()
840 if (usX2Y->format != runtime->format) snd_usX2Y_pcm_prepare()
841 if ((err = usX2Y_format_set(usX2Y, runtime->format)) < 0) snd_usX2Y_pcm_prepare()
843 if (usX2Y->rate != runtime->rate) snd_usX2Y_pcm_prepare()
844 if ((err = usX2Y_rate_set(usX2Y, runtime->rate)) < 0) snd_usX2Y_pcm_prepare()
885 struct snd_pcm_runtime *runtime = substream->runtime; snd_usX2Y_pcm_open() local
890 runtime->hw = snd_usX2Y_2c; snd_usX2Y_pcm_open()
891 runtime->private_data = subs; snd_usX2Y_pcm_open()
893 snd_pcm_hw_constraint_minmax(runtime, SNDRV_PCM_HW_PARAM_PERIOD_TIME, 1000, 200000); snd_usX2Y_pcm_open()
901 struct snd_pcm_runtime *runtime = substream->runtime; snd_usX2Y_pcm_close() local
902 struct snd_usX2Y_substream *subs = runtime->private_data; snd_usX2Y_pcm_close()
H A Dusx2yhwdeppcm.c65 struct snd_pcm_runtime *runtime = subs->pcm_substream->runtime; usX2Y_usbpcm_urb_capt_retire() local
82 if ((hwptr_done += lens) >= runtime->buffer_size) usX2Y_usbpcm_urb_capt_retire()
83 hwptr_done -= runtime->buffer_size; usX2Y_usbpcm_urb_capt_retire()
87 if (subs->transfer_done >= runtime->period_size) { usX2Y_usbpcm_urb_capt_retire()
88 subs->transfer_done -= runtime->period_size; usX2Y_usbpcm_urb_capt_retire()
94 static inline int usX2Y_iso_frames_per_buffer(struct snd_pcm_runtime *runtime, usX2Y_iso_frames_per_buffer() argument
97 return (runtime->buffer_size * 1000) / usX2Y->rate + 1; //FIXME: so far only correct period_size == 2^x ? usX2Y_iso_frames_per_buffer()
116 struct snd_pcm_runtime *runtime = subs->pcm_substream->runtime; usX2Y_hwdep_urb_play_prepare() local
120 usX2Y_iso_frames_per_buffer(runtime, usX2Y); usX2Y_hwdep_urb_play_prepare()
358 struct snd_pcm_runtime *runtime = substream->runtime; snd_usX2Y_usbpcm_hw_free() local
359 struct snd_usX2Y_substream *subs = runtime->private_data, snd_usX2Y_usbpcm_hw_free()
369 !cap_subs->pcm_substream->runtime || snd_usX2Y_usbpcm_hw_free()
370 !cap_subs->pcm_substream->runtime->status || snd_usX2Y_usbpcm_hw_free()
371 cap_subs->pcm_substream->runtime->status->state < SNDRV_PCM_STATE_PREPARED) { snd_usX2Y_usbpcm_hw_free()
483 struct snd_pcm_runtime *runtime = substream->runtime; snd_usX2Y_usbpcm_prepare() local
484 struct snd_usX2Y_substream *subs = runtime->private_data; snd_usX2Y_usbpcm_prepare()
501 if (usX2Y->format != runtime->format) snd_usX2Y_usbpcm_prepare()
502 if ((err = usX2Y_format_set(usX2Y, runtime->format)) < 0) snd_usX2Y_usbpcm_prepare()
504 if (usX2Y->rate != runtime->rate) snd_usX2Y_usbpcm_prepare()
505 if ((err = usX2Y_rate_set(usX2Y, runtime->rate)) < 0) snd_usX2Y_usbpcm_prepare()
516 while (usX2Y_iso_frames_per_buffer(runtime, usX2Y) > snd_usX2Y_usbpcm_prepare()
520 usX2Y_iso_frames_per_buffer(runtime, usX2Y), snd_usX2Y_usbpcm_prepare()
531 usX2Y_iso_frames_per_buffer(runtime, usX2Y), snd_usX2Y_usbpcm_prepare()
566 struct snd_pcm_runtime *runtime = substream->runtime; snd_usX2Y_usbpcm_open() local
571 runtime->hw = SNDRV_PCM_STREAM_PLAYBACK == substream->stream ? snd_usX2Y_2c : snd_usX2Y_usbpcm_open()
573 runtime->private_data = subs; snd_usX2Y_usbpcm_open()
575 snd_pcm_hw_constraint_minmax(runtime, SNDRV_PCM_HW_PARAM_PERIOD_TIME, 1000, 200000); snd_usX2Y_usbpcm_open()
582 struct snd_pcm_runtime *runtime = substream->runtime; snd_usX2Y_usbpcm_close() local
583 struct snd_usX2Y_substream *subs = runtime->private_data; snd_usX2Y_usbpcm_close()
/linux-4.1.27/sound/firewire/
H A Disight.c90 struct snd_pcm_runtime *runtime = isight->pcm->runtime; isight_update_pointers() local
97 if (ptr >= runtime->buffer_size) isight_update_pointers()
98 ptr -= runtime->buffer_size; isight_update_pointers()
102 if (isight->period_counter >= runtime->period_size) { isight_update_pointers()
103 isight->period_counter -= runtime->period_size; isight_update_pointers()
111 struct snd_pcm_runtime *runtime; isight_samples() local
117 runtime = isight->pcm->runtime; isight_samples()
118 if (isight->buffer_pointer + count <= runtime->buffer_size) { isight_samples()
119 memcpy(runtime->dma_area + isight->buffer_pointer * 4, isight_samples()
122 count1 = runtime->buffer_size - isight->buffer_pointer; isight_samples()
123 memcpy(runtime->dma_area + isight->buffer_pointer * 4, isight_samples()
126 memcpy(runtime->dma_area, samples, (count - count1) * 4); isight_samples()
140 struct snd_pcm_runtime *runtime; isight_dropped_samples() local
147 runtime = isight->pcm->runtime; isight_dropped_samples()
149 if (dropped < runtime->buffer_size) { isight_dropped_samples()
150 if (isight->buffer_pointer + dropped <= runtime->buffer_size) { isight_dropped_samples()
151 memset(runtime->dma_area + isight->buffer_pointer * 4, isight_dropped_samples()
154 count1 = runtime->buffer_size - isight->buffer_pointer; isight_dropped_samples()
155 memset(runtime->dma_area + isight->buffer_pointer * 4, isight_dropped_samples()
157 memset(runtime->dma_area, 0, (dropped - count1) * 4); isight_dropped_samples()
268 substream->runtime->hw = hardware; isight_open()
H A Damdtp.c133 * @runtime: the PCM substream runtime
136 struct snd_pcm_runtime *runtime) amdtp_stream_add_pcm_hw_constraints()
141 err = snd_pcm_hw_constraint_msbits(runtime, 0, 32, 24); amdtp_stream_add_pcm_hw_constraints()
155 err = snd_pcm_hw_constraint_minmax(runtime, amdtp_stream_add_pcm_hw_constraints()
174 err = snd_pcm_hw_constraint_step(runtime, 0, amdtp_stream_add_pcm_hw_constraints()
178 err = snd_pcm_hw_constraint_step(runtime, 0, amdtp_stream_add_pcm_hw_constraints()
401 struct snd_pcm_runtime *runtime = pcm->runtime; amdtp_write_s32() local
406 src = (void *)runtime->dma_area + amdtp_write_s32()
407 frames_to_bytes(runtime, s->pcm_buffer_pointer); amdtp_write_s32()
408 remaining_frames = runtime->buffer_size - s->pcm_buffer_pointer; amdtp_write_s32()
418 src = (void *)runtime->dma_area; amdtp_write_s32()
426 struct snd_pcm_runtime *runtime = pcm->runtime; amdtp_write_s16() local
431 src = (void *)runtime->dma_area + amdtp_write_s16()
432 frames_to_bytes(runtime, s->pcm_buffer_pointer); amdtp_write_s16()
433 remaining_frames = runtime->buffer_size - s->pcm_buffer_pointer; amdtp_write_s16()
443 src = (void *)runtime->dma_area; amdtp_write_s16()
451 struct snd_pcm_runtime *runtime = pcm->runtime; amdtp_read_s32() local
456 dst = (void *)runtime->dma_area + amdtp_read_s32()
457 frames_to_bytes(runtime, s->pcm_buffer_pointer); amdtp_read_s32()
458 remaining_frames = runtime->buffer_size - s->pcm_buffer_pointer; amdtp_read_s32()
467 dst = (void *)runtime->dma_area; amdtp_read_s32()
574 if (ptr >= pcm->runtime->buffer_size) update_pcm_pointers()
575 ptr -= pcm->runtime->buffer_size; update_pcm_pointers()
579 if (s->pcm_period_pointer >= pcm->runtime->period_size) { update_pcm_pointers()
580 s->pcm_period_pointer -= pcm->runtime->period_size; update_pcm_pointers()
135 amdtp_stream_add_pcm_hw_constraints(struct amdtp_stream *s, struct snd_pcm_runtime *runtime) amdtp_stream_add_pcm_hw_constraints() argument
/linux-4.1.27/sound/soc/intel/common/
H A Dsst-firmware.c418 struct sst_module_runtime *runtime, *rtmp; sst_fw_unload() local
428 /* remove runtime modules */ sst_fw_unload()
429 list_for_each_entry_safe(runtime, rtmp, &module->runtime_list, list) { sst_fw_unload()
431 block_list_remove(dsp, &runtime->block_list); sst_fw_unload()
432 list_del(&runtime->list); sst_fw_unload()
433 kfree(runtime); sst_fw_unload()
530 struct sst_module_runtime *runtime; sst_module_runtime_new() local
532 runtime = kzalloc(sizeof(*runtime), GFP_KERNEL); sst_module_runtime_new()
533 if (runtime == NULL) sst_module_runtime_new()
536 runtime->id = id; sst_module_runtime_new()
537 runtime->dsp = dsp; sst_module_runtime_new()
538 runtime->module = module; sst_module_runtime_new()
539 INIT_LIST_HEAD(&runtime->block_list); sst_module_runtime_new()
542 list_add(&runtime->list, &module->runtime_list); sst_module_runtime_new()
545 return runtime; sst_module_runtime_new()
549 void sst_module_runtime_free(struct sst_module_runtime *runtime) sst_module_runtime_free() argument
551 struct sst_dsp *dsp = runtime->dsp; sst_module_runtime_free()
554 list_del(&runtime->list); sst_module_runtime_free()
557 kfree(runtime); sst_module_runtime_free()
857 int sst_module_runtime_alloc_blocks(struct sst_module_runtime *runtime, sst_module_runtime_alloc_blocks() argument
860 struct sst_dsp *dsp = runtime->dsp; sst_module_runtime_alloc_blocks()
861 struct sst_module *module = runtime->module; sst_module_runtime_alloc_blocks()
883 ret = block_alloc_fixed(dsp, &ba, &runtime->block_list); sst_module_runtime_alloc_blocks()
890 ret = block_alloc(dsp, &ba, &runtime->block_list); sst_module_runtime_alloc_blocks()
894 "error: no free blocks for runtime module size 0x%x\n", sst_module_runtime_alloc_blocks()
899 runtime->persistent_offset = ba.offset; sst_module_runtime_alloc_blocks()
902 ret = block_list_prepare(dsp, &runtime->block_list); sst_module_runtime_alloc_blocks()
904 dev_err(dsp->dev, "error: runtime block prepare failed\n"); sst_module_runtime_alloc_blocks()
918 int sst_module_runtime_free_blocks(struct sst_module_runtime *runtime) sst_module_runtime_free_blocks() argument
920 struct sst_dsp *dsp = runtime->dsp; sst_module_runtime_free_blocks()
923 block_list_remove(dsp, &runtime->block_list); sst_module_runtime_free_blocks()
929 int sst_module_runtime_save(struct sst_module_runtime *runtime, sst_module_runtime_save() argument
932 struct sst_dsp *dsp = runtime->dsp; sst_module_runtime_save()
933 struct sst_module *module = runtime->module; sst_module_runtime_save()
936 dev_dbg(dsp->dev, "saving runtime %d memory at 0x%x size 0x%x\n", sst_module_runtime_save()
937 runtime->id, runtime->persistent_offset, sst_module_runtime_save()
957 dsp->addr.lpe_base + runtime->persistent_offset, sst_module_runtime_save()
966 runtime->persistent_offset, sst_module_runtime_save()
975 int sst_module_runtime_restore(struct sst_module_runtime *runtime, sst_module_runtime_restore() argument
978 struct sst_dsp *dsp = runtime->dsp; sst_module_runtime_restore()
979 struct sst_module *module = runtime->module; sst_module_runtime_restore()
982 dev_dbg(dsp->dev, "restoring runtime %d memory at 0x%x size 0x%x\n", sst_module_runtime_restore()
983 runtime->id, runtime->persistent_offset, sst_module_runtime_restore()
1000 dsp->addr.lpe_base + runtime->persistent_offset, sst_module_runtime_restore()
1008 sst_memcpy32(dsp->addr.lpe + runtime->persistent_offset, sst_module_runtime_restore()
1173 struct sst_module_runtime *runtime; sst_module_runtime_get_from_id() local
1178 list_for_each_entry(runtime, &module->runtime_list, list) { sst_module_runtime_get_from_id()
1179 if (runtime->id == id) { sst_module_runtime_get_from_id()
1181 return runtime; sst_module_runtime_get_from_id()
H A Dsst-dsp-priv.h166 * Runtime Module Context - The runtime context must be manually stored by the
207 /* runtime */
215 struct list_head runtime_list; /* list of runtime module objects*/
261 /* runtime */
338 /* Create/Free firmware module runtime instances */
341 void sst_module_runtime_free(struct sst_module_runtime *runtime);
344 int sst_module_runtime_alloc_blocks(struct sst_module_runtime *runtime,
346 int sst_module_runtime_free_blocks(struct sst_module_runtime *runtime);
347 int sst_module_runtime_save(struct sst_module_runtime *runtime,
349 int sst_module_runtime_restore(struct sst_module_runtime *runtime,
/linux-4.1.27/sound/pci/ca0106/
H A Dca0106_main.c490 static void snd_ca0106_pcm_free_substream(struct snd_pcm_runtime *runtime) snd_ca0106_pcm_free_substream() argument
492 kfree(runtime->private_data); snd_ca0106_pcm_free_substream()
566 struct snd_pcm_runtime *runtime = substream->runtime; snd_ca0106_pcm_open_playback_channel() local
577 runtime->private_data = epcm; snd_ca0106_pcm_open_playback_channel()
578 runtime->private_free = snd_ca0106_pcm_free_substream; snd_ca0106_pcm_open_playback_channel()
580 runtime->hw = snd_ca0106_playback_hw; snd_ca0106_pcm_open_playback_channel()
592 if ((err = snd_pcm_hw_constraint_integer(runtime, SNDRV_PCM_HW_PARAM_PERIODS)) < 0) snd_ca0106_pcm_open_playback_channel()
594 if ((err = snd_pcm_hw_constraint_step(runtime, 0, SNDRV_PCM_HW_PARAM_PERIOD_BYTES, 64)) < 0) snd_ca0106_pcm_open_playback_channel()
614 struct snd_pcm_runtime *runtime = substream->runtime; snd_ca0106_pcm_close_playback() local
615 struct snd_ca0106_pcm *epcm = runtime->private_data; snd_ca0106_pcm_close_playback()
659 struct snd_pcm_runtime *runtime = substream->runtime; snd_ca0106_pcm_open_capture_channel() local
672 runtime->private_data = epcm; snd_ca0106_pcm_open_capture_channel()
673 runtime->private_free = snd_ca0106_pcm_free_substream; snd_ca0106_pcm_open_capture_channel()
675 runtime->hw = snd_ca0106_capture_hw; snd_ca0106_pcm_open_capture_channel()
687 if ((err = snd_pcm_hw_constraint_integer(runtime, SNDRV_PCM_HW_PARAM_PERIODS)) < 0) snd_ca0106_pcm_open_capture_channel()
689 //snd_pcm_hw_constraint_list(runtime, 0, SNDRV_PCM_HW_PARAM_PERIOD_SIZE, &hw_constraints_capture_period_sizes); snd_ca0106_pcm_open_capture_channel()
690 if ((err = snd_pcm_hw_constraint_step(runtime, 0, SNDRV_PCM_HW_PARAM_PERIOD_BYTES, 64)) < 0) snd_ca0106_pcm_open_capture_channel()
699 struct snd_pcm_runtime *runtime = substream->runtime; snd_ca0106_pcm_close_capture() local
700 struct snd_ca0106_pcm *epcm = runtime->private_data; snd_ca0106_pcm_close_capture()
758 struct snd_pcm_runtime *runtime = substream->runtime; snd_ca0106_pcm_prepare_playback() local
759 struct snd_ca0106_pcm *epcm = runtime->private_data; snd_ca0106_pcm_prepare_playback()
762 u32 period_size_bytes = frames_to_bytes(runtime, runtime->period_size); snd_ca0106_pcm_prepare_playback()
780 channel, runtime->rate, runtime->format, snd_ca0106_pcm_prepare_playback()
781 runtime->channels, runtime->buffer_size, snd_ca0106_pcm_prepare_playback()
782 runtime->period_size, runtime->periods, snd_ca0106_pcm_prepare_playback()
783 frames_to_bytes(runtime, 1)); snd_ca0106_pcm_prepare_playback()
786 runtime->dma_addr, runtime->dma_area, table_base); snd_ca0106_pcm_prepare_playback()
794 switch (runtime->rate) { snd_ca0106_pcm_prepare_playback()
818 switch (runtime->format) { snd_ca0106_pcm_prepare_playback()
840 for(i=0; i < runtime->periods; i++) { snd_ca0106_pcm_prepare_playback()
841 table_base[i*2] = runtime->dma_addr + (i * period_size_bytes); snd_ca0106_pcm_prepare_playback()
846 snd_ca0106_ptr_write(emu, PLAYBACK_LIST_SIZE, channel, (runtime->periods - 1) << 19); snd_ca0106_pcm_prepare_playback()
848 snd_ca0106_ptr_write(emu, PLAYBACK_DMA_ADDR, channel, runtime->dma_addr); snd_ca0106_pcm_prepare_playback()
849 snd_ca0106_ptr_write(emu, PLAYBACK_PERIOD_SIZE, channel, frames_to_bytes(runtime, runtime->period_size)<<16); // buffer size in bytes snd_ca0106_pcm_prepare_playback()
871 struct snd_pcm_runtime *runtime = substream->runtime; snd_ca0106_pcm_prepare_capture() local
872 struct snd_ca0106_pcm *epcm = runtime->private_data; snd_ca0106_pcm_prepare_capture()
887 channel, runtime->rate, runtime->format, snd_ca0106_pcm_prepare_capture()
888 runtime->channels, runtime->buffer_size, snd_ca0106_pcm_prepare_capture()
889 runtime->period_size, runtime->periods, snd_ca0106_pcm_prepare_capture()
890 frames_to_bytes(runtime, 1)); snd_ca0106_pcm_prepare_capture()
893 runtime->dma_addr, runtime->dma_area, table_base); snd_ca0106_pcm_prepare_capture()
899 switch (runtime->rate) { snd_ca0106_pcm_prepare_capture()
920 switch (runtime->format) { snd_ca0106_pcm_prepare_capture()
946 channel, runtime->rate, runtime->format, runtime->channels, snd_ca0106_pcm_prepare_capture()
947 runtime->buffer_size, runtime->period_size, snd_ca0106_pcm_prepare_capture()
948 frames_to_bytes(runtime, 1)); snd_ca0106_pcm_prepare_capture()
951 snd_ca0106_ptr_write(emu, CAPTURE_DMA_ADDR, channel, runtime->dma_addr); snd_ca0106_pcm_prepare_capture()
952 snd_ca0106_ptr_write(emu, CAPTURE_BUFFER_SIZE, channel, frames_to_bytes(runtime, runtime->buffer_size)<<16); // buffer size in bytes snd_ca0106_pcm_prepare_capture()
963 struct snd_pcm_runtime *runtime; snd_ca0106_pcm_trigger_playback() local
988 runtime = s->runtime; snd_pcm_group_for_each_entry()
989 epcm = runtime->private_data; snd_pcm_group_for_each_entry()
1030 struct snd_pcm_runtime *runtime = substream->runtime; snd_ca0106_pcm_trigger_capture() local
1031 struct snd_ca0106_pcm *epcm = runtime->private_data; snd_ca0106_pcm_trigger_capture()
1058 struct snd_pcm_runtime *runtime = substream->runtime; snd_ca0106_pcm_pointer_playback() local
1059 struct snd_ca0106_pcm *epcm = runtime->private_data; snd_ca0106_pcm_pointer_playback()
1070 ptr = (ptr >> 3) * runtime->period_size; snd_ca0106_pcm_pointer_playback()
1071 ptr += bytes_to_frames(runtime, snd_ca0106_pcm_pointer_playback()
1073 if (ptr >= runtime->buffer_size) snd_ca0106_pcm_pointer_playback()
1074 ptr -= runtime->buffer_size; snd_ca0106_pcm_pointer_playback()
1088 struct snd_pcm_runtime *runtime = substream->runtime; snd_ca0106_pcm_pointer_capture() local
1089 struct snd_ca0106_pcm *epcm = runtime->private_data; snd_ca0106_pcm_pointer_capture()
1097 ptr2 = bytes_to_frames(runtime, ptr1); snd_ca0106_pcm_pointer_capture()
1099 if (ptr >= runtime->buffer_size) snd_ca0106_pcm_pointer_capture()
1100 ptr -= runtime->buffer_size; snd_ca0106_pcm_pointer_capture()
1104 ptr1, ptr2, ptr, (int)runtime->buffer_size, snd_ca0106_pcm_pointer_capture()
1105 (int)runtime->period_size, (int)runtime->frame_bits, snd_ca0106_pcm_pointer_capture()
1106 (int)runtime->rate); snd_ca0106_pcm_pointer_capture()
/linux-4.1.27/sound/pci/oxygen/
H A Doxygen_pcm.c129 return (unsigned int)(uintptr_t)substream->runtime->private_data; oxygen_substream_channel()
136 struct snd_pcm_runtime *runtime = substream->runtime; oxygen_open() local
139 runtime->private_data = (void *)(uintptr_t)channel; oxygen_open()
142 runtime->hw = oxygen_ac97_hardware; oxygen_open()
144 runtime->hw = *oxygen_hardware[channel]; oxygen_open()
148 runtime->hw.rates &= ~(SNDRV_PCM_RATE_32000 | oxygen_open()
150 runtime->hw.rate_min = 44100; oxygen_open()
155 runtime->hw.fifo_size = 0; oxygen_open()
158 runtime->hw.channels_max = chip->model.dac_channels_pcm; oxygen_open()
162 chip->model.pcm_hardware_filter(channel, &runtime->hw); oxygen_open()
163 err = snd_pcm_hw_constraint_step(runtime, 0, oxygen_open()
167 err = snd_pcm_hw_constraint_step(runtime, 0, oxygen_open()
171 if (runtime->hw.formats & SNDRV_PCM_FMTBIT_S32_LE) { oxygen_open()
172 err = snd_pcm_hw_constraint_msbits(runtime, 0, 32, 24); oxygen_open()
176 if (runtime->hw.channels_max > 2) { oxygen_open()
177 err = snd_pcm_hw_constraint_step(runtime, 0, oxygen_open()
327 (u32)substream->runtime->dma_addr); oxygen_hw_params()
568 if (substream->runtime->no_period_wakeup) oxygen_prepare()
625 struct snd_pcm_runtime *runtime = substream->runtime; oxygen_pointer() local
631 return bytes_to_frames(runtime, curr_addr - (u32)runtime->dma_addr); oxygen_pointer()
/linux-4.1.27/arch/x86/platform/efi/
H A Defi.c16 * Borislav Petkov <bp@suse.de> - runtime services VA mapping
25 * Implemented EFI runtime services and virtual mode calls. --davidm
270 efi_systab.runtime = data ? efi_systab_init()
271 (void *)(unsigned long)data->runtime : efi_systab_init()
272 (void *)(unsigned long)systab64->runtime; efi_systab_init()
273 tmp |= data ? data->runtime : systab64->runtime; efi_systab_init()
309 efi_systab.runtime = (void *)(unsigned long)systab32->runtime; efi_systab_init()
338 efi_runtime_services_32_t *runtime; efi_runtime_init32() local
340 runtime = early_memremap((unsigned long)efi.systab->runtime, efi_runtime_init32()
342 if (!runtime) { efi_runtime_init32()
343 pr_err("Could not map the runtime service table!\n"); efi_runtime_init32()
349 * EFI runtime service. All other runtime services will be called efi_runtime_init32()
354 (unsigned long)runtime->set_virtual_address_map; efi_runtime_init32()
355 early_memunmap(runtime, sizeof(efi_runtime_services_32_t)); efi_runtime_init32()
362 efi_runtime_services_64_t *runtime; efi_runtime_init64() local
364 runtime = early_memremap((unsigned long)efi.systab->runtime, efi_runtime_init64()
366 if (!runtime) { efi_runtime_init64()
367 pr_err("Could not map the runtime service table!\n"); efi_runtime_init64()
373 * EFI runtime service. All other runtime services will be called efi_runtime_init64()
378 (unsigned long)runtime->set_virtual_address_map; efi_runtime_init64()
379 early_memunmap(runtime, sizeof(efi_runtime_services_64_t)); efi_runtime_init64()
389 * Check out the runtime services table. We need to map efi_runtime_init()
390 * the runtime services table so that we can grab the physical efi_runtime_init()
391 * address of several of the EFI runtime functions, needed to efi_runtime_init()
394 * When EFI_PARAVIRT is in force then we could not map runtime efi_runtime_init()
396 * However, runtime services are available through proxy functions efi_runtime_init()
464 efi.runtime = (unsigned long)efi.systab->runtime; efi_init()
489 * Note: We currently don't support runtime services on an EFI efi_init()
494 pr_info("No EFI runtime due to 32/64-bit mismatch with kernel\n"); efi_init()
531 /* Make EFI runtime service code area executable */ runtime_code_page_mkexec()
656 pr_err("Error saving runtime map, efi runtime on kexec non-functional!!\n"); save_runtime_map()
746 * Map the efi memory ranges of the runtime services and update new_mmap with
797 * We don't do virtual mode, since we don't do runtime services, on kexec_enter_virtual_mode()
824 * pointers in the runtime service table to the new virtual addresses. kexec_enter_virtual_mode()
843 * This function will switch the EFI runtime services to virtual mode.
845 * has the runtime attribute bit set in its memory descriptor into the
851 * method enabled the runtime services to be called without having to
855 * so that we're in a different address space when calling a runtime
859 * Specially for kexec boot, efi runtime maps in previous kernel should
860 * be passed in via setup_data. In that case runtime ranges will be mapped
875 pr_err("Error reallocating memory, EFI runtime non-functional!\n"); __efi_enter_virtual_mode()
915 * pointers in the runtime service table to the new virtual addresses. __efi_enter_virtual_mode()
H A Defi_32.c16 * Implemented EFI runtime services and virtual mode calls. --davidm
35 * To make EFI call EFI runtime service in physical addressing mode we need
36 * prolog/epilog before/after the invocation to claim the EFI runtime service
H A Defi_stub_32.S19 * at the end no matter how many we use, because we can not assure EFI runtime
80 * 6. After EFI runtime service returns, control will return to
H A Defi_thunk_64.S4 * Support for invoking 32-bit EFI runtime services from a 64-bit
10 * intact (GDT, IDT, etc) and simply invoke the the 32-bit EFI runtime
/linux-4.1.27/sound/pci/trident/
H A Dtrident_main.c765 struct snd_pcm_runtime *runtime = substream->runtime; snd_trident_control_mode() local
771 if (snd_pcm_format_width(runtime->format) == 16) snd_trident_control_mode()
773 if (snd_pcm_format_signed(runtime->format)) snd_trident_control_mode()
775 if (runtime->channels > 1) snd_trident_control_mode()
823 struct snd_pcm_runtime *runtime = substream->runtime; snd_trident_allocate_pcm_mem() local
824 struct snd_trident_voice *voice = runtime->private_data; snd_trident_allocate_pcm_mem()
857 struct snd_pcm_runtime *runtime = substream->runtime; snd_trident_allocate_evoice() local
858 struct snd_trident_voice *voice = runtime->private_data; snd_trident_allocate_evoice()
918 struct snd_pcm_runtime *runtime = substream->runtime; snd_trident_hw_free() local
919 struct snd_trident_voice *voice = runtime->private_data; snd_trident_hw_free()
950 struct snd_pcm_runtime *runtime = substream->runtime; snd_trident_playback_prepare() local
951 struct snd_trident_voice *voice = runtime->private_data; snd_trident_playback_prepare()
958 voice->Delta = snd_trident_convert_rate(runtime->rate); snd_trident_playback_prepare()
959 voice->spurious_threshold = snd_trident_spurious_threshold(runtime->rate, runtime->period_size); snd_trident_playback_prepare()
965 voice->LBA = runtime->dma_addr; snd_trident_playback_prepare()
968 voice->ESO = runtime->buffer_size - 1; /* in samples */ snd_trident_playback_prepare()
994 evoice->ESO = (runtime->period_size * 2) + 4 - 1; /* in samples */ snd_trident_playback_prepare()
1012 evoice->isync_mark = runtime->period_size; snd_trident_playback_prepare()
1013 evoice->ESO = (runtime->period_size * 2) - 1; snd_trident_playback_prepare()
1053 struct snd_pcm_runtime *runtime = substream->runtime; snd_trident_capture_prepare() local
1054 struct snd_trident_voice *voice = runtime->private_data; snd_trident_capture_prepare()
1066 voice->LBA = runtime->dma_addr; snd_trident_capture_prepare()
1078 val = (((unsigned int) 48000L << 12) + (runtime->rate/2)) / runtime->rate; snd_trident_capture_prepare()
1082 if (snd_pcm_format_width(runtime->format) == 16) { snd_trident_capture_prepare()
1094 if (snd_pcm_format_width(runtime->format) == 16) snd_trident_capture_prepare()
1096 if (snd_pcm_format_signed(runtime->format)) snd_trident_capture_prepare()
1098 if (runtime->channels > 1) snd_trident_capture_prepare()
1103 voice->Delta = snd_trident_convert_rate(runtime->rate); snd_trident_capture_prepare()
1104 voice->spurious_threshold = snd_trident_spurious_threshold(runtime->rate, runtime->period_size); snd_trident_capture_prepare()
1106 voice->isync_mark = runtime->period_size; snd_trident_capture_prepare()
1107 voice->isync_max = runtime->buffer_size; snd_trident_capture_prepare()
1111 voice->ESO = voice->isync_ESO = (runtime->period_size * 2) + 6 - 1; snd_trident_capture_prepare()
1167 struct snd_pcm_runtime *runtime = substream->runtime; snd_trident_si7018_capture_hw_free() local
1168 struct snd_trident_voice *voice = runtime->private_data; snd_trident_si7018_capture_hw_free()
1193 struct snd_pcm_runtime *runtime = substream->runtime; snd_trident_si7018_capture_prepare() local
1194 struct snd_trident_voice *voice = runtime->private_data; snd_trident_si7018_capture_prepare()
1199 voice->LBA = runtime->dma_addr; snd_trident_si7018_capture_prepare()
1200 voice->Delta = snd_trident_convert_adc_rate(runtime->rate); snd_trident_si7018_capture_prepare()
1201 voice->spurious_threshold = snd_trident_spurious_threshold(runtime->rate, runtime->period_size); snd_trident_si7018_capture_prepare()
1205 voice->ESO = runtime->buffer_size - 1; /* in samples */ snd_trident_si7018_capture_prepare()
1225 evoice->Delta = snd_trident_convert_rate(runtime->rate); snd_trident_si7018_capture_prepare()
1229 evoice->ESO = (runtime->period_size * 2) + 20 - 1; /* in samples, 20 means correction */ snd_trident_si7018_capture_prepare()
1242 evoice->isync_mark = runtime->period_size; snd_trident_si7018_capture_prepare()
1243 evoice->ESO = (runtime->period_size * 2) - 1; snd_trident_si7018_capture_prepare()
1264 struct snd_pcm_runtime *runtime = substream->runtime; snd_trident_foldback_prepare() local
1265 struct snd_trident_voice *voice = runtime->private_data; snd_trident_foldback_prepare()
1274 voice->LBA = runtime->dma_addr; snd_trident_foldback_prepare()
1277 voice->ESO = runtime->buffer_size - 1; /* in samples */ snd_trident_foldback_prepare()
1281 voice->spurious_threshold = snd_trident_spurious_threshold(48000, runtime->period_size); snd_trident_foldback_prepare()
1306 evoice->ESO = (runtime->period_size * 2) + 4 - 1; /* in samples */ snd_trident_foldback_prepare()
1319 evoice->isync_mark = runtime->period_size; snd_trident_foldback_prepare()
1320 evoice->ESO = (runtime->period_size * 2) - 1; snd_trident_foldback_prepare()
1407 struct snd_pcm_runtime *runtime = substream->runtime; snd_trident_spdif_prepare() local
1408 struct snd_trident_voice *voice = runtime->private_data; snd_trident_spdif_prepare()
1419 voice->Delta = snd_trident_convert_rate(runtime->rate); snd_trident_spdif_prepare()
1420 voice->spurious_threshold = snd_trident_spurious_threshold(runtime->rate, runtime->period_size); snd_trident_spdif_prepare()
1423 LBAO = runtime->dma_addr; snd_trident_spdif_prepare()
1431 voice->isync_mark = runtime->period_size; snd_trident_spdif_prepare()
1432 voice->isync_max = runtime->buffer_size; snd_trident_spdif_prepare()
1435 RESO = runtime->buffer_size - 1; snd_trident_spdif_prepare()
1436 voice->ESO = voice->isync_ESO = (runtime->period_size * 2) + 6 - 1; snd_trident_spdif_prepare()
1470 voice->spurious_threshold = snd_trident_spurious_threshold(48000, runtime->period_size); snd_trident_spdif_prepare()
1476 voice->LBA = runtime->dma_addr; snd_trident_spdif_prepare()
1479 voice->ESO = runtime->buffer_size - 1; /* in samples */ snd_trident_spdif_prepare()
1500 evoice->ESO = (runtime->period_size * 2) + 4 - 1; /* in samples */ snd_trident_spdif_prepare()
1513 evoice->isync_mark = runtime->period_size; snd_trident_spdif_prepare()
1514 evoice->ESO = (runtime->period_size * 2) - 1; snd_trident_spdif_prepare()
1572 voice = s->runtime->private_data; snd_pcm_group_for_each_entry()
1645 struct snd_pcm_runtime *runtime = substream->runtime; snd_trident_playback_pointer() local
1646 struct snd_trident_voice *voice = runtime->private_data; snd_trident_playback_pointer()
1664 if (cso >= runtime->buffer_size) snd_trident_playback_pointer()
1684 struct snd_pcm_runtime *runtime = substream->runtime; snd_trident_capture_pointer() local
1685 struct snd_trident_voice *voice = runtime->private_data; snd_trident_capture_pointer()
1692 if (runtime->channels > 1) snd_trident_capture_pointer()
1695 result = runtime->buffer_size - result; snd_trident_capture_pointer()
1714 struct snd_pcm_runtime *runtime = substream->runtime; snd_trident_spdif_pointer() local
1715 struct snd_trident_voice *voice = runtime->private_data; snd_trident_spdif_pointer()
1845 static void snd_trident_pcm_free_substream(struct snd_pcm_runtime *runtime) snd_trident_pcm_free_substream() argument
1847 struct snd_trident_voice *voice = runtime->private_data; snd_trident_pcm_free_substream()
1859 struct snd_pcm_runtime *runtime = substream->runtime; snd_trident_playback_open() local
1867 runtime->private_data = voice; snd_trident_playback_open()
1868 runtime->private_free = snd_trident_pcm_free_substream; snd_trident_playback_open()
1869 runtime->hw = snd_trident_playback; snd_trident_playback_open()
1871 snd_pcm_hw_constraint_minmax(runtime, SNDRV_PCM_HW_PARAM_BUFFER_SIZE, 0, 64*1024); snd_trident_playback_open()
1887 struct snd_pcm_runtime *runtime = substream->runtime; snd_trident_playback_close() local
1888 struct snd_trident_voice *voice = runtime->private_data; snd_trident_playback_close()
1909 struct snd_pcm_runtime *runtime = substream->runtime; snd_trident_spdif_open() local
1920 runtime->private_data = voice; snd_trident_spdif_open()
1921 runtime->private_free = snd_trident_pcm_free_substream; snd_trident_spdif_open()
1923 runtime->hw = snd_trident_spdif; snd_trident_spdif_open()
1925 runtime->hw = snd_trident_spdif_7018; snd_trident_spdif_open()
1932 snd_pcm_hw_constraint_minmax(runtime, SNDRV_PCM_HW_PARAM_BUFFER_SIZE, 0, 64*1024); snd_trident_spdif_open()
1988 struct snd_pcm_runtime *runtime = substream->runtime; snd_trident_capture_open() local
1995 runtime->private_data = voice; snd_trident_capture_open()
1996 runtime->private_free = snd_trident_pcm_free_substream; snd_trident_capture_open()
1997 runtime->hw = snd_trident_capture; snd_trident_capture_open()
1999 snd_pcm_hw_constraint_minmax(runtime, SNDRV_PCM_HW_PARAM_BUFFER_SIZE, 0, 64*1024); snd_trident_capture_open()
2032 struct snd_pcm_runtime *runtime = substream->runtime; snd_trident_foldback_open() local
2039 runtime->private_data = voice; snd_trident_foldback_open()
2040 runtime->private_free = snd_trident_pcm_free_substream; snd_trident_foldback_open()
2041 runtime->hw = snd_trident_foldback; snd_trident_foldback_open()
2042 snd_pcm_hw_constraint_minmax(runtime, SNDRV_PCM_HW_PARAM_BUFFER_SIZE, 0, 64*1024); snd_trident_foldback_open()
2059 struct snd_pcm_runtime *runtime = substream->runtime; snd_trident_foldback_close() local
2060 voice = runtime->private_data; snd_trident_foldback_close()
H A Dtrident_memory.c194 struct snd_pcm_runtime *runtime = substream->runtime; snd_trident_alloc_sg_pages() local
197 if (snd_BUG_ON(runtime->dma_bytes <= 0 || snd_trident_alloc_sg_pages()
198 runtime->dma_bytes > SNDRV_TRIDENT_MAX_PAGES * snd_trident_alloc_sg_pages()
208 blk = search_empty(hdr, runtime->dma_bytes); snd_trident_alloc_sg_pages()
242 struct snd_pcm_runtime *runtime = substream->runtime; snd_trident_alloc_cont_pages() local
246 if (snd_BUG_ON(runtime->dma_bytes <= 0 || snd_trident_alloc_cont_pages()
247 runtime->dma_bytes > SNDRV_TRIDENT_MAX_PAGES * snd_trident_alloc_cont_pages()
255 blk = search_empty(hdr, runtime->dma_bytes); snd_trident_alloc_cont_pages()
262 addr = runtime->dma_addr; snd_trident_alloc_cont_pages()
263 ptr = (unsigned long)runtime->dma_area; snd_trident_alloc_cont_pages()
/linux-4.1.27/sound/soc/omap/
H A Domap-pcm.c78 struct snd_pcm_runtime *runtime = substream->runtime; omap_pcm_hw_params() local
93 runtime->dma_bytes = params_buffer_bytes(params); omap_pcm_hw_params()
157 struct snd_pcm_runtime *runtime = substream->runtime; omap_pcm_mmap() local
160 runtime->dma_area, omap_pcm_mmap()
161 runtime->dma_addr, omap_pcm_mmap()
162 runtime->dma_bytes); omap_pcm_mmap()
/linux-4.1.27/arch/powerpc/kernel/
H A Dreloc_64.S24 0: mflr r12 /* r12 has runtime addr of label 0 */
27 add r11,r11,r12 /* r11 has runtime addr of .dynamic section */
29 add r9,r9,r12 /* r9 has runtime addr of .rela.dyn section */
31 add r10,r10,r12 /* r10 has runtime addr of _stext */
H A Dreloc_32.S37 bl 0f /* Find our current runtime address */
42 add r11, r11, r12 /* runtime address of .dynamic section */
44 add r9, r9, r12 /* runtime address of .rela.dyn section */
46 add r10, r10, r12 /* runtime address of _stext section */
48 add r13, r13, r12 /* runtime address of .dynsym section */
/linux-4.1.27/arch/avr32/mach-at32ap/include/mach/
H A Dcpu.h15 * chip at runtime, but I'm not sure if it's really worth it.
/linux-4.1.27/sound/soc/ux500/
H A Dmop500_ab8500.h19 int mop500_ab8500_machine_init(struct snd_soc_pcm_runtime *runtime);
H A Dux500_msp_dai.c309 struct snd_pcm_runtime *runtime = substream->runtime; setup_msp_config() local
323 msp_config->frame_freq = runtime->rate; setup_msp_config()
331 runtime->rate, runtime->channels); setup_msp_config()
370 ret = setup_pcm_framing(dai, runtime->rate, prot_desc); setup_msp_config()
466 struct snd_pcm_runtime *runtime = substream->runtime; ux500_msp_dai_prepare() local
470 dai->id, snd_pcm_stream_str(substream), runtime->rate); ux500_msp_dai_prepare()
503 struct snd_pcm_runtime *runtime = substream->runtime; ux500_msp_dai_hw_params() local
511 snd_pcm_hw_constraint_minmax(runtime, ux500_msp_dai_hw_params()
525 snd_pcm_hw_constraint_minmax(runtime, ux500_msp_dai_hw_params()
/linux-4.1.27/tools/testing/selftests/size/
H A Dget_size.c6 * Selftest for runtime system size
84 print("not ok 1 get runtime memory use\n"); _start()
90 print_k_value("ok 1 get runtime memory use # size = ", used, _start()
93 print("# System runtime memory report (units in Kilobytes):\n"); _start()
/linux-4.1.27/sound/pci/
H A Dsis7019.c451 struct snd_pcm_runtime *runtime = substream->runtime; sis_alloc_timing_voice() local
452 struct voice *voice = runtime->private_data; sis_alloc_timing_voice()
486 struct snd_pcm_runtime *runtime = substream->runtime; sis_playback_open() local
494 runtime->private_data = voice; sis_playback_open()
495 runtime->hw = sis_playback_hw_info; sis_playback_open()
496 snd_pcm_hw_constraint_minmax(runtime, SNDRV_PCM_HW_PARAM_PERIOD_SIZE, sis_playback_open()
498 snd_pcm_hw_constraint_minmax(runtime, SNDRV_PCM_HW_PARAM_BUFFER_SIZE, sis_playback_open()
507 struct snd_pcm_runtime *runtime = substream->runtime; sis_substream_close() local
508 struct voice *voice = runtime->private_data; sis_substream_close()
528 struct snd_pcm_runtime *runtime = substream->runtime; sis_pcm_playback_prepare() local
529 struct voice *voice = runtime->private_data; sis_pcm_playback_prepare()
539 if (snd_pcm_format_width(runtime->format) == 8) sis_pcm_playback_prepare()
541 if (!snd_pcm_format_signed(runtime->format)) sis_pcm_playback_prepare()
543 if (runtime->channels == 1) sis_pcm_playback_prepare()
549 dma_addr = runtime->dma_addr; sis_pcm_playback_prepare()
550 leo = runtime->buffer_size - 1; sis_pcm_playback_prepare()
554 if (runtime->period_size == (runtime->buffer_size / 2)) { sis_pcm_playback_prepare()
556 } else if (runtime->period_size != runtime->buffer_size) { sis_pcm_playback_prepare()
558 voice->sso = runtime->period_size - 1; sis_pcm_playback_prepare()
559 voice->period_size = runtime->period_size; sis_pcm_playback_prepare()
560 voice->buffer_size = runtime->buffer_size; sis_pcm_playback_prepare()
564 sso_eso |= (runtime->period_size - 1) << 16; sis_pcm_playback_prepare()
567 delta = sis_rate_to_delta(runtime->rate); sis_pcm_playback_prepare()
628 voice = s->runtime->private_data; snd_pcm_group_for_each_entry()
663 struct snd_pcm_runtime *runtime = substream->runtime; sis_pcm_pointer() local
664 struct voice *voice = runtime->private_data; sis_pcm_pointer()
675 struct snd_pcm_runtime *runtime = substream->runtime; sis_capture_open() local
693 runtime->private_data = voice; sis_capture_open()
694 runtime->hw = sis_capture_hw_info; sis_capture_open()
695 runtime->hw.rates = sis->ac97[0]->rates[AC97_RATES_ADC]; sis_capture_open()
696 snd_pcm_limit_hw_rates(runtime); sis_capture_open()
697 snd_pcm_hw_constraint_minmax(runtime, SNDRV_PCM_HW_PARAM_PERIOD_SIZE, sis_capture_open()
699 snd_pcm_hw_constraint_minmax(runtime, SNDRV_PCM_HW_PARAM_BUFFER_SIZE, sis_capture_open()
731 struct snd_pcm_runtime *runtime = substream->runtime; sis_prepare_timing_voice() local
742 buffer_size = 4096 / runtime->channels; sis_prepare_timing_voice()
743 buffer_size /= snd_pcm_format_size(runtime->format, 1); sis_prepare_timing_voice()
758 vperiod = runtime->period_size + 12; sis_prepare_timing_voice()
777 period_size = runtime->period_size; sis_prepare_timing_voice()
787 timing->sync_cso = runtime->period_size; sis_prepare_timing_voice()
788 timing->sync_period_size = runtime->period_size; sis_prepare_timing_voice()
789 timing->sync_buffer_size = runtime->buffer_size; sis_prepare_timing_voice()
800 if (snd_pcm_format_width(runtime->format) == 8) sis_prepare_timing_voice()
802 if (runtime->channels == 1) sis_prepare_timing_voice()
810 delta = sis_rate_to_delta(runtime->rate); sis_prepare_timing_voice()
832 struct snd_pcm_runtime *runtime = substream->runtime; sis_pcm_capture_prepare() local
833 struct voice *voice = runtime->private_data; sis_pcm_capture_prepare()
842 if (snd_pcm_format_width(runtime->format) == 8) sis_pcm_capture_prepare()
844 if (!snd_pcm_format_signed(runtime->format)) sis_pcm_capture_prepare()
846 if (runtime->channels == 1) sis_pcm_capture_prepare()
849 dma_addr = runtime->dma_addr; sis_pcm_capture_prepare()
850 leo = runtime->buffer_size - 1; sis_pcm_capture_prepare()
861 if (runtime->period_size != runtime->buffer_size) sis_pcm_capture_prepare()
H A Drme32.c656 struct snd_pcm_runtime *runtime = substream->runtime; snd_rme32_playback_hw_params() local
663 runtime->dma_area = (void __force *)(rme32->iobase + snd_rme32_playback_hw_params()
665 runtime->dma_addr = rme32->port + RME32_IO_DATA_BUFFER; snd_rme32_playback_hw_params()
666 runtime->dma_bytes = RME32_BUFFER_SIZE; snd_rme32_playback_hw_params()
711 struct snd_pcm_runtime *runtime = substream->runtime; snd_rme32_capture_hw_params() local
718 runtime->dma_area = (void __force *)rme32->iobase + snd_rme32_capture_hw_params()
720 runtime->dma_addr = rme32->port + RME32_IO_DATA_BUFFER; snd_rme32_capture_hw_params()
721 runtime->dma_bytes = RME32_BUFFER_SIZE; snd_rme32_capture_hw_params()
742 if ((isadat && runtime->hw.channels_min == 2) || snd_rme32_capture_hw_params()
743 (!isadat && runtime->hw.channels_min == 8)) { snd_rme32_capture_hw_params()
831 static void snd_rme32_set_buffer_constraint(struct rme32 *rme32, struct snd_pcm_runtime *runtime) snd_rme32_set_buffer_constraint() argument
834 snd_pcm_hw_constraint_minmax(runtime, snd_rme32_set_buffer_constraint()
837 snd_pcm_hw_constraint_list(runtime, 0, snd_rme32_set_buffer_constraint()
847 struct snd_pcm_runtime *runtime = substream->runtime; snd_rme32_playback_spdif_open() local
862 runtime->hw = snd_rme32_spdif_fd_info; snd_rme32_playback_spdif_open()
864 runtime->hw = snd_rme32_spdif_info; snd_rme32_playback_spdif_open()
866 runtime->hw.rates |= SNDRV_PCM_RATE_64000 | SNDRV_PCM_RATE_88200 | SNDRV_PCM_RATE_96000; snd_rme32_playback_spdif_open()
867 runtime->hw.rate_max = 96000; snd_rme32_playback_spdif_open()
872 runtime->hw.rates = snd_pcm_rate_to_rate_bit(rate); snd_rme32_playback_spdif_open()
873 runtime->hw.rate_min = rate; snd_rme32_playback_spdif_open()
874 runtime->hw.rate_max = rate; snd_rme32_playback_spdif_open()
877 snd_rme32_set_buffer_constraint(rme32, runtime); snd_rme32_playback_spdif_open()
890 struct snd_pcm_runtime *runtime = substream->runtime; snd_rme32_capture_spdif_open() local
903 runtime->hw = snd_rme32_spdif_fd_info; snd_rme32_capture_spdif_open()
905 runtime->hw = snd_rme32_spdif_info; snd_rme32_capture_spdif_open()
907 runtime->hw.rates |= SNDRV_PCM_RATE_88200 | SNDRV_PCM_RATE_96000; snd_rme32_capture_spdif_open()
908 runtime->hw.rate_max = 96000; snd_rme32_capture_spdif_open()
914 runtime->hw.rates = snd_pcm_rate_to_rate_bit(rate); snd_rme32_capture_spdif_open()
915 runtime->hw.rate_min = rate; snd_rme32_capture_spdif_open()
916 runtime->hw.rate_max = rate; snd_rme32_capture_spdif_open()
919 snd_rme32_set_buffer_constraint(rme32, runtime); snd_rme32_capture_spdif_open()
929 struct snd_pcm_runtime *runtime = substream->runtime; snd_rme32_playback_adat_open() local
944 runtime->hw = snd_rme32_adat_fd_info; snd_rme32_playback_adat_open()
946 runtime->hw = snd_rme32_adat_info; snd_rme32_playback_adat_open()
950 runtime->hw.rates = snd_pcm_rate_to_rate_bit(rate); snd_rme32_playback_adat_open()
951 runtime->hw.rate_min = rate; snd_rme32_playback_adat_open()
952 runtime->hw.rate_max = rate; snd_rme32_playback_adat_open()
955 snd_rme32_set_buffer_constraint(rme32, runtime); snd_rme32_playback_adat_open()
964 struct snd_pcm_runtime *runtime = substream->runtime; snd_rme32_capture_adat_open() local
967 runtime->hw = snd_rme32_adat_fd_info; snd_rme32_capture_adat_open()
969 runtime->hw = snd_rme32_adat_info; snd_rme32_capture_adat_open()
974 runtime->hw.rates = snd_pcm_rate_to_rate_bit(rate); snd_rme32_capture_adat_open()
975 runtime->hw.rate_min = rate; snd_rme32_capture_adat_open()
976 runtime->hw.rate_max = rate; snd_rme32_capture_adat_open()
989 snd_rme32_set_buffer_constraint(rme32, runtime); snd_rme32_capture_adat_open()
1145 substream->runtime->dma_area + rec->sw_data, bytes); snd_rme32_pb_trans_copy()
1169 memcpy_fromio(substream->runtime->dma_area + rec->sw_data, snd_rme32_cp_trans_copy()
H A Dals300.c211 data = chip->playback_substream->runtime->private_data; snd_als300_interrupt()
219 data = chip->capture_substream->runtime->private_data; snd_als300_interrupt()
245 data = chip->playback_substream->runtime->private_data; snd_als300plus_interrupt()
254 data = chip->capture_substream->runtime->private_data; snd_als300plus_interrupt()
372 struct snd_pcm_runtime *runtime = substream->runtime; snd_als300_playback_open() local
379 runtime->hw = snd_als300_playback_hw; snd_als300_playback_open()
380 runtime->private_data = data; snd_als300_playback_open()
391 data = substream->runtime->private_data; snd_als300_playback_close()
401 struct snd_pcm_runtime *runtime = substream->runtime; snd_als300_capture_open() local
408 runtime->hw = snd_als300_capture_hw; snd_als300_capture_open()
409 runtime->private_data = data; snd_als300_capture_open()
420 data = substream->runtime->private_data; snd_als300_capture_close()
443 struct snd_pcm_runtime *runtime = substream->runtime; snd_als300_playback_prepare() local
461 runtime->dma_addr); snd_als300_playback_prepare()
463 runtime->dma_addr + buffer_bytes - 1); snd_als300_playback_prepare()
472 struct snd_pcm_runtime *runtime = substream->runtime; snd_als300_capture_prepare() local
490 runtime->dma_addr); snd_als300_capture_prepare()
492 runtime->dma_addr + buffer_bytes - 1); snd_als300_capture_prepare()
505 data = substream->runtime->private_data; snd_als300_trigger()
548 data = substream->runtime->private_data; snd_als300_pointer()
563 return bytes_to_frames(substream->runtime, current_ptr); snd_als300_pointer()
H A Dcmipci.c787 struct snd_pcm_runtime *runtime = substream->runtime; snd_cmipci_pcm_prepare() local
791 if (snd_pcm_format_width(runtime->format) >= 16) { snd_cmipci_pcm_prepare()
793 if (snd_pcm_format_width(runtime->format) > 16) snd_cmipci_pcm_prepare()
796 if (runtime->channels > 1) snd_cmipci_pcm_prepare()
798 if (rec->is_dac && set_dac_channels(cm, rec, runtime->channels) < 0) { snd_cmipci_pcm_prepare()
803 rec->offset = runtime->dma_addr; snd_cmipci_pcm_prepare()
805 rec->dma_size = runtime->buffer_size << rec->shift; snd_cmipci_pcm_prepare()
806 period_size = runtime->period_size << rec->shift; snd_cmipci_pcm_prepare()
807 if (runtime->channels > 2) { snd_cmipci_pcm_prepare()
809 rec->dma_size = (rec->dma_size * runtime->channels) / 2; snd_cmipci_pcm_prepare()
810 period_size = (period_size * runtime->channels) / 2; snd_cmipci_pcm_prepare()
835 if (runtime->rate > 48000) snd_cmipci_pcm_prepare()
836 switch (runtime->rate) { snd_cmipci_pcm_prepare()
843 freq = snd_cmipci_rate_freq(runtime->rate); snd_cmipci_pcm_prepare()
872 if (runtime->rate > 44100) snd_cmipci_pcm_prepare()
962 ptr = bytes_to_frames(substream->runtime, ptr); snd_cmipci_pcm_pointer()
964 if (substream->runtime->channels > 2) snd_cmipci_pcm_pointer()
965 ptr = (ptr * 2) / substream->runtime->channels; snd_cmipci_pcm_pointer()
1235 if (snd_pcm_format_width(subs->runtime->format) > 16) { setup_ac3()
1254 rate = subs->runtime->rate; setup_spdif_playback()
1299 int rate = substream->runtime->rate; snd_cmipci_playback_prepare()
1303 substream->runtime->format == SNDRV_PCM_FORMAT_S16_LE && snd_cmipci_playback_prepare()
1304 substream->runtime->channels == 2); snd_cmipci_playback_prepare()
1337 struct snd_pcm_runtime *runtime = rec->substream->runtime; snd_cmipci_silence_hack() local
1340 if (rec->needs_silencing && runtime && runtime->dma_area) { snd_cmipci_silence_hack()
1342 memset(runtime->dma_area, 0, PAGE_SIZE); snd_cmipci_silence_hack()
1348 if (runtime->channels > 2) snd_cmipci_silence_hack()
1412 if (substream->runtime->rate > 48000) snd_cmipci_capture_spdif_prepare()
1417 if (snd_pcm_format_width(substream->runtime->format) > 16) snd_cmipci_capture_spdif_prepare()
1667 struct snd_pcm_runtime *runtime = substream->runtime; snd_cmipci_playback_open() local
1672 runtime->hw = snd_cmipci_playback; snd_cmipci_playback_open()
1674 runtime->hw.rates |= SNDRV_PCM_RATE_88200 | snd_cmipci_playback_open()
1676 runtime->hw.rate_max = 96000; snd_cmipci_playback_open()
1678 err = snd_pcm_hw_constraint_list(runtime, 0, snd_cmipci_playback_open()
1682 runtime->hw.rates |= SNDRV_PCM_RATE_KNOT; snd_cmipci_playback_open()
1683 runtime->hw.rate_max = 128000; snd_cmipci_playback_open()
1685 snd_pcm_hw_constraint_minmax(runtime, SNDRV_PCM_HW_PARAM_BUFFER_SIZE, 0, 0x10000); snd_cmipci_playback_open()
1693 struct snd_pcm_runtime *runtime = substream->runtime; snd_cmipci_capture_open() local
1698 runtime->hw = snd_cmipci_capture; snd_cmipci_capture_open()
1700 runtime->hw.rate_min = 41000; snd_cmipci_capture_open()
1701 runtime->hw.rates = SNDRV_PCM_RATE_44100 | SNDRV_PCM_RATE_48000; snd_cmipci_capture_open()
1703 err = snd_pcm_hw_constraint_list(runtime, 0, snd_cmipci_capture_open()
1707 runtime->hw.rates |= SNDRV_PCM_RATE_KNOT; snd_cmipci_capture_open()
1708 runtime->hw.rate_max = 128000; snd_cmipci_capture_open()
1710 snd_pcm_hw_constraint_minmax(runtime, SNDRV_PCM_HW_PARAM_BUFFER_SIZE, 0, 0x10000); snd_cmipci_capture_open()
1717 struct snd_pcm_runtime *runtime = substream->runtime; snd_cmipci_playback2_open() local
1722 runtime->hw = snd_cmipci_playback2; snd_cmipci_playback2_open()
1726 runtime->hw.channels_max = cm->max_channels; snd_cmipci_playback2_open()
1728 snd_pcm_hw_constraint_list(runtime, 0, SNDRV_PCM_HW_PARAM_CHANNELS, &hw_constraints_channels_4); snd_cmipci_playback2_open()
1730 snd_pcm_hw_constraint_list(runtime, 0, SNDRV_PCM_HW_PARAM_CHANNELS, &hw_constraints_channels_6); snd_cmipci_playback2_open()
1732 snd_pcm_hw_constraint_list(runtime, 0, SNDRV_PCM_HW_PARAM_CHANNELS, &hw_constraints_channels_8); snd_cmipci_playback2_open()
1737 runtime->hw.rates |= SNDRV_PCM_RATE_88200 | snd_cmipci_playback2_open()
1739 runtime->hw.rate_max = 96000; snd_cmipci_playback2_open()
1741 err = snd_pcm_hw_constraint_list(runtime, 0, snd_cmipci_playback2_open()
1745 runtime->hw.rates |= SNDRV_PCM_RATE_KNOT; snd_cmipci_playback2_open()
1746 runtime->hw.rate_max = 128000; snd_cmipci_playback2_open()
1748 snd_pcm_hw_constraint_minmax(runtime, SNDRV_PCM_HW_PARAM_BUFFER_SIZE, 0, 0x10000); snd_cmipci_playback2_open()
1755 struct snd_pcm_runtime *runtime = substream->runtime; snd_cmipci_playback_spdif_open() local
1761 runtime->hw = snd_cmipci_playback_spdif; snd_cmipci_playback_spdif_open()
1763 runtime->hw.formats |= SNDRV_PCM_FMTBIT_S32_LE; snd_cmipci_playback_spdif_open()
1764 snd_pcm_hw_constraint_msbits(runtime, 0, 32, 24); snd_cmipci_playback_spdif_open()
1767 runtime->hw.rates |= SNDRV_PCM_RATE_88200 | snd_cmipci_playback_spdif_open()
1769 runtime->hw.rate_max = 96000; snd_cmipci_playback_spdif_open()
1772 runtime->hw = snd_cmipci_playback_iec958_subframe; snd_cmipci_playback_spdif_open()
1774 snd_pcm_hw_constraint_minmax(runtime, SNDRV_PCM_HW_PARAM_BUFFER_SIZE, 0, 0x40000); snd_cmipci_playback_spdif_open()
1782 struct snd_pcm_runtime *runtime = substream->runtime; snd_cmipci_capture_spdif_open() local
1787 runtime->hw = snd_cmipci_capture_spdif; snd_cmipci_capture_spdif_open()
1789 runtime->hw.rates |= SNDRV_PCM_RATE_88200 | snd_cmipci_capture_spdif_open()
1791 runtime->hw.rate_max = 96000; snd_cmipci_capture_spdif_open()
1793 snd_pcm_hw_constraint_minmax(runtime, SNDRV_PCM_HW_PARAM_BUFFER_SIZE, 0, 0x40000); snd_cmipci_capture_spdif_open()
H A Des1938.c465 struct snd_pcm_runtime *runtime = substream->runtime; snd_es1938_rate_set() local
466 if (runtime->rate_num == clocks[0].num) snd_es1938_rate_set()
467 bits = 128 - runtime->rate_den; snd_es1938_rate_set()
469 bits = 256 - runtime->rate_den; snd_es1938_rate_set()
472 div0 = 256 - 7160000*20/(8*82*runtime->rate); snd_es1938_rate_set()
626 struct snd_pcm_runtime *runtime = substream->runtime; snd_es1938_capture_prepare() local
632 chip->dma1_start = runtime->dma_addr; snd_es1938_capture_prepare()
634 mono = (runtime->channels > 1) ? 0 : 1; snd_es1938_capture_prepare()
635 is8 = snd_pcm_format_width(runtime->format) == 16 ? 0 : 1; snd_es1938_capture_prepare()
636 u = snd_pcm_format_unsigned(runtime->format); snd_es1938_capture_prepare()
674 struct snd_pcm_runtime *runtime = substream->runtime; snd_es1938_playback1_prepare() local
680 chip->dma2_start = runtime->dma_addr; snd_es1938_playback1_prepare()
682 mono = (runtime->channels > 1) ? 0 : 1; snd_es1938_playback1_prepare()
683 is8 = snd_pcm_format_width(runtime->format) == 16 ? 0 : 1; snd_es1938_playback1_prepare()
684 u = snd_pcm_format_unsigned(runtime->format); snd_es1938_playback1_prepare()
711 struct snd_pcm_runtime *runtime = substream->runtime; snd_es1938_playback2_prepare() local
717 chip->dma1_start = runtime->dma_addr; snd_es1938_playback2_prepare()
719 mono = (runtime->channels > 1) ? 0 : 1; snd_es1938_playback2_prepare()
720 is8 = snd_pcm_format_width(runtime->format) == 16 ? 0 : 1; snd_es1938_playback2_prepare()
721 u = snd_pcm_format_unsigned(runtime->format); snd_es1938_playback2_prepare()
847 struct snd_pcm_runtime *runtime = substream->runtime; snd_es1938_capture_copy() local
854 if (copy_to_user(dst, runtime->dma_area + pos + 1, count)) snd_es1938_capture_copy()
857 if (copy_to_user(dst, runtime->dma_area + pos + 1, count - 1)) snd_es1938_capture_copy()
859 if (put_user(runtime->dma_area[0], ((unsigned char __user *)dst) + count - 1)) snd_es1938_capture_copy()
932 struct snd_pcm_runtime *runtime = substream->runtime; snd_es1938_capture_open() local
937 runtime->hw = snd_es1938_capture; snd_es1938_capture_open()
938 snd_pcm_hw_constraint_ratnums(runtime, 0, SNDRV_PCM_HW_PARAM_RATE, snd_es1938_capture_open()
940 snd_pcm_hw_constraint_minmax(runtime, SNDRV_PCM_HW_PARAM_BUFFER_BYTES, 0, 0xff00); snd_es1938_capture_open()
947 struct snd_pcm_runtime *runtime = substream->runtime; snd_es1938_playback_open() local
962 runtime->hw = snd_es1938_playback; snd_es1938_playback_open()
963 snd_pcm_hw_constraint_ratnums(runtime, 0, SNDRV_PCM_HW_PARAM_RATE, snd_es1938_playback_open()
965 snd_pcm_hw_constraint_minmax(runtime, SNDRV_PCM_HW_PARAM_BUFFER_BYTES, 0, 0xff00); snd_es1938_playback_open()
H A Dvia82xx.c735 struct viadev *viadev = substream->runtime->private_data; snd_via82xx_pcm_trigger()
840 struct viadev *viadev = substream->runtime->private_data; snd_via686_pcm_pointer()
862 return bytes_to_frames(substream->runtime, res); snd_via686_pcm_pointer()
871 struct viadev *viadev = substream->runtime->private_data; snd_via8233_pcm_pointer()
921 return bytes_to_frames(substream->runtime, res); snd_via8233_pcm_pointer()
933 struct viadev *viadev = substream->runtime->private_data; snd_via82xx_hw_params()
955 struct viadev *viadev = substream->runtime->private_data; snd_via82xx_hw_free()
978 struct snd_pcm_runtime *runtime) via686_setup_format()
984 (runtime->format == SNDRV_PCM_FORMAT_S16_LE ? VIA_REG_TYPE_16BIT : 0) | via686_setup_format()
985 (runtime->channels > 1 ? VIA_REG_TYPE_STEREO : 0) | via686_setup_format()
994 struct viadev *viadev = substream->runtime->private_data; snd_via686_playback_prepare()
995 struct snd_pcm_runtime *runtime = substream->runtime; snd_via686_playback_prepare() local
997 snd_ac97_set_rate(chip->ac97, AC97_PCM_FRONT_DAC_RATE, runtime->rate); snd_via686_playback_prepare()
998 snd_ac97_set_rate(chip->ac97, AC97_SPDIF, runtime->rate); snd_via686_playback_prepare()
999 via686_setup_format(chip, viadev, runtime); snd_via686_playback_prepare()
1006 struct viadev *viadev = substream->runtime->private_data; snd_via686_capture_prepare()
1007 struct snd_pcm_runtime *runtime = substream->runtime; snd_via686_capture_prepare() local
1009 snd_ac97_set_rate(chip->ac97, AC97_PCM_LR_ADC_RATE, runtime->rate); snd_via686_capture_prepare()
1010 via686_setup_format(chip, viadev, runtime); snd_via686_capture_prepare()
1040 struct viadev *viadev = substream->runtime->private_data; snd_via8233_playback_prepare()
1041 struct snd_pcm_runtime *runtime = substream->runtime; snd_via8233_playback_prepare() local
1042 int ac97_rate = chip->dxs_src ? 48000 : runtime->rate; snd_via8233_playback_prepare()
1050 chip->no_vra ? 48000 : runtime->rate); snd_via8233_playback_prepare()
1052 snd_ac97_set_rate(chip->ac97, AC97_SPDIF, runtime->rate); snd_via8233_playback_prepare()
1054 if (runtime->rate == 48000) snd_via8233_playback_prepare()
1057 rbits = (0x100000 / 48000) * runtime->rate + snd_via8233_playback_prepare()
1058 ((0x100000 % 48000) * runtime->rate) / 48000; snd_via8233_playback_prepare()
1066 outl((runtime->format == SNDRV_PCM_FORMAT_S16_LE ? VIA8233_REG_TYPE_16BIT : 0) | /* format */ snd_via8233_playback_prepare()
1067 (runtime->channels > 1 ? VIA8233_REG_TYPE_STEREO : 0) | /* stereo */ snd_via8233_playback_prepare()
1082 struct viadev *viadev = substream->runtime->private_data; snd_via8233_multi_prepare()
1083 struct snd_pcm_runtime *runtime = substream->runtime; snd_via8233_multi_prepare() local
1087 if (via_lock_rate(&chip->rates[0], runtime->rate) < 0) snd_via8233_multi_prepare()
1089 snd_ac97_set_rate(chip->ac97, AC97_PCM_FRONT_DAC_RATE, runtime->rate); snd_via8233_multi_prepare()
1090 snd_ac97_set_rate(chip->ac97, AC97_PCM_SURR_DAC_RATE, runtime->rate); snd_via8233_multi_prepare()
1091 snd_ac97_set_rate(chip->ac97, AC97_PCM_LFE_DAC_RATE, runtime->rate); snd_via8233_multi_prepare()
1092 snd_ac97_set_rate(chip->ac97, AC97_SPDIF, runtime->rate); snd_via8233_multi_prepare()
1096 fmt = (runtime->format == SNDRV_PCM_FORMAT_S16_LE) ? snd_via8233_multi_prepare()
1098 fmt |= runtime->channels << 4; snd_via8233_multi_prepare()
1108 switch (runtime->channels) { snd_via8233_multi_prepare()
1131 struct viadev *viadev = substream->runtime->private_data; snd_via8233_capture_prepare()
1132 struct snd_pcm_runtime *runtime = substream->runtime; snd_via8233_capture_prepare() local
1134 if (via_lock_rate(&chip->rates[1], runtime->rate) < 0) snd_via8233_capture_prepare()
1136 snd_ac97_set_rate(chip->ac97, AC97_PCM_LR_ADC_RATE, runtime->rate); snd_via8233_capture_prepare()
1140 outl((runtime->format == SNDRV_PCM_FORMAT_S16_LE ? VIA8233_REG_TYPE_16BIT : 0) | snd_via8233_capture_prepare()
1141 (runtime->channels > 1 ? VIA8233_REG_TYPE_STEREO : 0) | snd_via8233_capture_prepare()
1181 struct snd_pcm_runtime *runtime = substream->runtime; snd_via82xx_pcm_open() local
1186 runtime->hw = snd_via82xx_hw; snd_via82xx_pcm_open()
1194 runtime->hw.rates = chip->ac97->rates[AC97_RATES_SPDIF]; snd_via82xx_pcm_open()
1195 snd_pcm_limit_hw_rates(runtime); snd_via82xx_pcm_open()
1198 runtime->hw.rates = SNDRV_PCM_RATE_48000; snd_via82xx_pcm_open()
1199 runtime->hw.rate_min = runtime->hw.rate_max = 48000; snd_via82xx_pcm_open()
1202 runtime->hw.rates = (SNDRV_PCM_RATE_CONTINUOUS | snd_via82xx_pcm_open()
1204 runtime->hw.rate_min = 8000; snd_via82xx_pcm_open()
1205 runtime->hw.rate_max = 48000; snd_via82xx_pcm_open()
1209 runtime->hw.rates = chip->ac97->rates[idx]; snd_via82xx_pcm_open()
1210 snd_pcm_limit_hw_rates(runtime); snd_via82xx_pcm_open()
1213 runtime->hw.rates = SNDRV_PCM_RATE_KNOT; snd_via82xx_pcm_open()
1214 runtime->hw.rate_max = runtime->hw.rate_min = ratep->rate; snd_via82xx_pcm_open()
1220 if ((err = snd_pcm_hw_constraint_integer(runtime, SNDRV_PCM_HW_PARAM_PERIODS)) < 0) snd_via82xx_pcm_open()
1224 err = snd_pcm_hw_rule_noresample(runtime, 48000); snd_via82xx_pcm_open()
1229 runtime->private_data = viadev; snd_via82xx_pcm_open()
1300 substream->runtime->hw.channels_max = 6; snd_via8233_multi_open()
1302 snd_pcm_hw_constraint_list(substream->runtime, 0, snd_via8233_multi_open()
1325 struct viadev *viadev = substream->runtime->private_data; snd_via82xx_pcm_close()
1354 struct viadev *viadev = substream->runtime->private_data; snd_via8233_playback_close()
977 via686_setup_format(struct via82xx *chip, struct viadev *viadev, struct snd_pcm_runtime *runtime) via686_setup_format() argument
H A Dfm801.c448 struct snd_pcm_runtime *runtime = substream->runtime; snd_fm801_playback_prepare() local
456 if (snd_pcm_format_width(runtime->format) == 16) snd_fm801_playback_prepare()
458 if (runtime->channels > 1) { snd_fm801_playback_prepare()
460 if (runtime->channels == 4) snd_fm801_playback_prepare()
462 else if (runtime->channels == 6) snd_fm801_playback_prepare()
465 chip->ply_ctrl |= snd_fm801_rate_bits(runtime->rate) << FM801_RATE_SHIFT; snd_fm801_playback_prepare()
469 chip->ply_buffer = runtime->dma_addr; snd_fm801_playback_prepare()
481 struct snd_pcm_runtime *runtime = substream->runtime; snd_fm801_capture_prepare() local
488 if (snd_pcm_format_width(runtime->format) == 16) snd_fm801_capture_prepare()
490 if (runtime->channels > 1) snd_fm801_capture_prepare()
492 chip->cap_ctrl |= snd_fm801_rate_bits(runtime->rate) << FM801_RATE_SHIFT; snd_fm801_capture_prepare()
496 chip->cap_buffer = runtime->dma_addr; snd_fm801_capture_prepare()
519 return bytes_to_frames(substream->runtime, ptr); snd_fm801_playback_pointer()
536 return bytes_to_frames(substream->runtime, ptr); snd_fm801_capture_pointer()
630 struct snd_pcm_runtime *runtime = substream->runtime; snd_fm801_playback_open() local
634 runtime->hw = snd_fm801_playback; snd_fm801_playback_open()
635 snd_pcm_hw_constraint_list(runtime, 0, SNDRV_PCM_HW_PARAM_RATE, snd_fm801_playback_open()
638 runtime->hw.channels_max = 6; snd_fm801_playback_open()
639 snd_pcm_hw_constraint_list(runtime, 0, snd_fm801_playback_open()
643 if ((err = snd_pcm_hw_constraint_integer(runtime, SNDRV_PCM_HW_PARAM_PERIODS)) < 0) snd_fm801_playback_open()
651 struct snd_pcm_runtime *runtime = substream->runtime; snd_fm801_capture_open() local
655 runtime->hw = snd_fm801_capture; snd_fm801_capture_open()
656 snd_pcm_hw_constraint_list(runtime, 0, SNDRV_PCM_HW_PARAM_RATE, snd_fm801_capture_open()
658 if ((err = snd_pcm_hw_constraint_integer(runtime, SNDRV_PCM_HW_PARAM_PERIODS)) < 0) snd_fm801_capture_open()
H A Drme96.c982 struct snd_pcm_runtime *runtime = substream->runtime; snd_rme96_playback_hw_params() local
986 runtime->dma_area = (void __force *)(rme96->iobase + snd_rme96_playback_hw_params()
988 runtime->dma_addr = rme96->port + RME96_IO_PLAY_BUFFER; snd_rme96_playback_hw_params()
989 runtime->dma_bytes = RME96_BUFFER_SIZE; snd_rme96_playback_hw_params()
1045 struct snd_pcm_runtime *runtime = substream->runtime; snd_rme96_capture_hw_params() local
1048 runtime->dma_area = (void __force *)(rme96->iobase + snd_rme96_capture_hw_params()
1050 runtime->dma_addr = rme96->port + RME96_IO_REC_BUFFER; snd_rme96_capture_hw_params()
1051 runtime->dma_bytes = RME96_BUFFER_SIZE; snd_rme96_capture_hw_params()
1070 if ((isadat && runtime->hw.channels_min == 2) || snd_rme96_capture_hw_params()
1071 (!isadat && runtime->hw.channels_min == 8)) snd_rme96_capture_hw_params()
1162 struct snd_pcm_runtime *runtime) rme96_set_buffer_size_constraint()
1166 snd_pcm_hw_constraint_minmax(runtime, SNDRV_PCM_HW_PARAM_BUFFER_BYTES, rme96_set_buffer_size_constraint()
1170 snd_pcm_hw_constraint_minmax(runtime, rme96_set_buffer_size_constraint()
1174 snd_pcm_hw_constraint_list(runtime, 0, rme96_set_buffer_size_constraint()
1184 struct snd_pcm_runtime *runtime = substream->runtime; snd_rme96_playback_spdif_open() local
1197 runtime->hw = snd_rme96_playback_spdif_info; snd_rme96_playback_spdif_open()
1203 runtime->hw.rates = snd_pcm_rate_to_rate_bit(rate); snd_rme96_playback_spdif_open()
1204 runtime->hw.rate_min = rate; snd_rme96_playback_spdif_open()
1205 runtime->hw.rate_max = rate; snd_rme96_playback_spdif_open()
1207 rme96_set_buffer_size_constraint(rme96, runtime); snd_rme96_playback_spdif_open()
1221 struct snd_pcm_runtime *runtime = substream->runtime; snd_rme96_capture_spdif_open() local
1224 runtime->hw = snd_rme96_capture_spdif_info; snd_rme96_capture_spdif_open()
1231 runtime->hw.rates = snd_pcm_rate_to_rate_bit(rate); snd_rme96_capture_spdif_open()
1232 runtime->hw.rate_min = rate; snd_rme96_capture_spdif_open()
1233 runtime->hw.rate_max = rate; snd_rme96_capture_spdif_open()
1244 rme96_set_buffer_size_constraint(rme96, runtime); snd_rme96_capture_spdif_open()
1253 struct snd_pcm_runtime *runtime = substream->runtime; snd_rme96_playback_adat_open() local
1266 runtime->hw = snd_rme96_playback_adat_info; snd_rme96_playback_adat_open()
1272 runtime->hw.rates = snd_pcm_rate_to_rate_bit(rate); snd_rme96_playback_adat_open()
1273 runtime->hw.rate_min = rate; snd_rme96_playback_adat_open()
1274 runtime->hw.rate_max = rate; snd_rme96_playback_adat_open()
1276 rme96_set_buffer_size_constraint(rme96, runtime); snd_rme96_playback_adat_open()
1285 struct snd_pcm_runtime *runtime = substream->runtime; snd_rme96_capture_adat_open() local
1288 runtime->hw = snd_rme96_capture_adat_info; snd_rme96_capture_adat_open()
1298 runtime->hw.rates = snd_pcm_rate_to_rate_bit(rate); snd_rme96_capture_adat_open()
1299 runtime->hw.rate_min = rate; snd_rme96_capture_adat_open()
1300 runtime->hw.rate_max = rate; snd_rme96_capture_adat_open()
1311 rme96_set_buffer_size_constraint(rme96, runtime); snd_rme96_capture_adat_open()
1161 rme96_set_buffer_size_constraint(struct rme96 *rme96, struct snd_pcm_runtime *runtime) rme96_set_buffer_size_constraint() argument
H A Dens1370.c888 struct snd_pcm_runtime *runtime = substream->runtime; snd_ensoniq_playback1_prepare() local
893 if (snd_pcm_format_width(runtime->format) == 16) snd_ensoniq_playback1_prepare()
895 if (runtime->channels > 1) snd_ensoniq_playback1_prepare()
901 if (runtime->rate == 48000) snd_ensoniq_playback1_prepare()
908 outl(runtime->dma_addr, ES_REG(ensoniq, DAC1_FRAME)); snd_ensoniq_playback1_prepare()
917 switch (runtime->rate) { snd_ensoniq_playback1_prepare()
928 snd_es1371_dac1_rate(ensoniq, runtime->rate); snd_ensoniq_playback1_prepare()
936 struct snd_pcm_runtime *runtime = substream->runtime; snd_ensoniq_playback2_prepare() local
941 if (snd_pcm_format_width(runtime->format) == 16) snd_ensoniq_playback2_prepare()
943 if (runtime->channels > 1) snd_ensoniq_playback2_prepare()
949 outl(runtime->dma_addr, ES_REG(ensoniq, DAC2_FRAME)); snd_ensoniq_playback2_prepare()
961 ensoniq->ctrl |= ES_1370_PCLKDIVO(ES_1370_SRTODIV(runtime->rate)); snd_ensoniq_playback2_prepare()
968 snd_es1371_dac2_rate(ensoniq, runtime->rate); snd_ensoniq_playback2_prepare()
976 struct snd_pcm_runtime *runtime = substream->runtime; snd_ensoniq_capture_prepare() local
981 if (snd_pcm_format_width(runtime->format) == 16) snd_ensoniq_capture_prepare()
983 if (runtime->channels > 1) snd_ensoniq_capture_prepare()
989 outl(runtime->dma_addr, ES_REG(ensoniq, ADC_FRAME)); snd_ensoniq_capture_prepare()
999 ensoniq->ctrl |= ES_1370_PCLKDIVO(ES_1370_SRTODIV(runtime->rate)); snd_ensoniq_capture_prepare()
1006 snd_es1371_adc_rate(ensoniq, runtime->rate); snd_ensoniq_capture_prepare()
1020 ptr = bytes_to_frames(substream->runtime, ptr); snd_ensoniq_playback1_pointer()
1037 ptr = bytes_to_frames(substream->runtime, ptr); snd_ensoniq_playback2_pointer()
1054 ptr = bytes_to_frames(substream->runtime, ptr); snd_ensoniq_capture_pointer()
1131 struct snd_pcm_runtime *runtime = substream->runtime; snd_ensoniq_playback1_open() local
1135 runtime->hw = snd_ensoniq_playback1; snd_ensoniq_playback1_open()
1142 snd_pcm_hw_constraint_list(runtime, 0, SNDRV_PCM_HW_PARAM_RATE, snd_ensoniq_playback1_open()
1145 snd_pcm_hw_constraint_ratdens(runtime, 0, SNDRV_PCM_HW_PARAM_RATE, snd_ensoniq_playback1_open()
1154 struct snd_pcm_runtime *runtime = substream->runtime; snd_ensoniq_playback2_open() local
1158 runtime->hw = snd_ensoniq_playback2; snd_ensoniq_playback2_open()
1165 snd_pcm_hw_constraint_ratnums(runtime, 0, SNDRV_PCM_HW_PARAM_RATE, snd_ensoniq_playback2_open()
1168 snd_pcm_hw_constraint_ratdens(runtime, 0, SNDRV_PCM_HW_PARAM_RATE, snd_ensoniq_playback2_open()
1177 struct snd_pcm_runtime *runtime = substream->runtime; snd_ensoniq_capture_open() local
1181 runtime->hw = snd_ensoniq_capture; snd_ensoniq_capture_open()
1184 snd_pcm_hw_constraint_ratnums(runtime, 0, SNDRV_PCM_HW_PARAM_RATE, snd_ensoniq_capture_open()
1187 snd_pcm_hw_constraint_ratnums(runtime, 0, SNDRV_PCM_HW_PARAM_RATE, snd_ensoniq_capture_open()
H A Dintel8x0.c353 #define get_ichdev(substream) (substream->runtime->private_data)
945 struct snd_pcm_runtime *runtime = substream->runtime; snd_intel8x0_hw_params() local
950 fill_nocache(runtime->dma_area, runtime->dma_bytes, 0); /* clear */ snd_intel8x0_hw_params()
957 if (runtime->dma_area && ! ichdev->page_attr_changed) { snd_intel8x0_hw_params()
958 fill_nocache(runtime->dma_area, runtime->dma_bytes, 1); snd_intel8x0_hw_params()
989 fill_nocache(substream->runtime->dma_area, substream->runtime->dma_bytes, 0); snd_intel8x0_hw_free()
996 struct snd_pcm_runtime *runtime) snd_intel8x0_setup_pcm_out()
999 int dbl = runtime->rate > 48000; snd_intel8x0_setup_pcm_out()
1006 if (runtime->channels == 4 || dbl) snd_intel8x0_setup_pcm_out()
1008 else if (runtime->channels == 6) snd_intel8x0_setup_pcm_out()
1015 if (runtime->channels == 4 || dbl) snd_intel8x0_setup_pcm_out()
1017 else if (runtime->channels == 6) snd_intel8x0_setup_pcm_out()
1024 if (runtime->channels == 4 || dbl) snd_intel8x0_setup_pcm_out()
1026 else if (runtime->channels == 6) snd_intel8x0_setup_pcm_out()
1028 else if (runtime->channels == 8) snd_intel8x0_setup_pcm_out()
1041 if (runtime->sample_bits > 16) snd_intel8x0_setup_pcm_out()
1053 struct snd_pcm_runtime *runtime = substream->runtime; snd_intel8x0_pcm_prepare() local
1056 ichdev->physbuf = runtime->dma_addr; snd_intel8x0_pcm_prepare()
1060 snd_intel8x0_setup_pcm_out(chip, runtime); snd_intel8x0_pcm_prepare()
1062 ichdev->pos_shift = (runtime->sample_bits > 16) ? 2 : 1; snd_intel8x0_pcm_prepare()
1119 return bytes_to_frames(substream->runtime, ptr); snd_intel8x0_pcm_pointer()
1176 struct snd_pcm_runtime *runtime = substream->runtime; snd_intel8x0_pcm_open() local
1180 runtime->hw = snd_intel8x0_stream; snd_intel8x0_pcm_open()
1181 runtime->hw.rates = ichdev->pcm->rates; snd_intel8x0_pcm_open()
1182 snd_pcm_limit_hw_rates(runtime); snd_intel8x0_pcm_open()
1184 runtime->hw.buffer_bytes_max = 64*1024; snd_intel8x0_pcm_open()
1185 runtime->hw.period_bytes_max = 64*1024; snd_intel8x0_pcm_open()
1187 if ((err = snd_pcm_hw_constraint_integer(runtime, SNDRV_PCM_HW_PARAM_PERIODS)) < 0) snd_intel8x0_pcm_open()
1189 runtime->private_data = ichdev; snd_intel8x0_pcm_open()
1196 struct snd_pcm_runtime *runtime = substream->runtime; snd_intel8x0_playback_open() local
1204 runtime->hw.channels_max = 8; snd_intel8x0_playback_open()
1205 snd_pcm_hw_constraint_list(runtime, 0, snd_intel8x0_playback_open()
1209 runtime->hw.channels_max = 6; snd_intel8x0_playback_open()
1210 snd_pcm_hw_constraint_list(runtime, 0, SNDRV_PCM_HW_PARAM_CHANNELS, snd_intel8x0_playback_open()
1213 runtime->hw.channels_max = 4; snd_intel8x0_playback_open()
1214 snd_pcm_hw_constraint_list(runtime, 0, SNDRV_PCM_HW_PARAM_CHANNELS, snd_intel8x0_playback_open()
1218 snd_ac97_pcm_double_rate_rules(runtime); snd_intel8x0_playback_open()
1221 runtime->hw.formats |= SNDRV_PCM_FMTBIT_S32_LE; snd_intel8x0_playback_open()
1222 snd_pcm_hw_constraint_msbits(runtime, 0, 32, 20); snd_intel8x0_playback_open()
2669 struct snd_pcm_runtime *runtime = ichdev->substream->runtime; intel8x0_suspend() local
2670 if (runtime->dma_area) intel8x0_suspend()
2671 fill_nocache(runtime->dma_area, runtime->dma_bytes, 0); intel8x0_suspend()
2727 struct snd_pcm_runtime *runtime = ichdev->substream->runtime; intel8x0_resume() local
2728 if (runtime->dma_area) intel8x0_resume()
2729 fill_nocache(runtime->dma_area, runtime->dma_bytes, 1); intel8x0_resume()
2741 snd_intel8x0_setup_pcm_out(chip, ichdev->substream->runtime); intel8x0_resume()
995 snd_intel8x0_setup_pcm_out(struct intel8x0 *chip, struct snd_pcm_runtime *runtime) snd_intel8x0_setup_pcm_out() argument
H A Dals4000.c319 static int snd_als4000_get_format(struct snd_pcm_runtime *runtime) snd_als4000_get_format() argument
324 if (snd_pcm_format_signed(runtime->format)) snd_als4000_get_format()
326 if (snd_pcm_format_physical_width(runtime->format) == 16) snd_als4000_get_format()
328 if (runtime->channels > 1) snd_als4000_get_format()
386 struct snd_pcm_runtime *runtime = substream->runtime; snd_als4000_capture_prepare() local
390 chip->capture_format = snd_als4000_get_format(runtime); snd_als4000_capture_prepare()
400 snd_als4000_set_rate(chip, runtime->rate); snd_als4000_capture_prepare()
401 snd_als4000_set_capture_dma(chip, runtime->dma_addr, size); snd_als4000_capture_prepare()
413 struct snd_pcm_runtime *runtime = substream->runtime; snd_als4000_playback_prepare() local
417 chip->playback_format = snd_als4000_get_format(runtime); snd_als4000_playback_prepare()
433 snd_als4000_set_rate(chip, runtime->rate); snd_als4000_playback_prepare()
434 snd_als4000_set_playback_dma(chip, runtime->dma_addr, size); snd_als4000_playback_prepare()
515 return bytes_to_frames( substream->runtime, result ); snd_als4000_capture_pointer()
527 return bytes_to_frames( substream->runtime, result ); snd_als4000_playback_pointer()
638 struct snd_pcm_runtime *runtime = substream->runtime; snd_als4000_playback_open() local
641 runtime->hw = snd_als4000_playback; snd_als4000_playback_open()
657 struct snd_pcm_runtime *runtime = substream->runtime; snd_als4000_capture_open() local
660 runtime->hw = snd_als4000_capture; snd_als4000_capture_open()
H A Dbt87x.c363 .rates = 0, /* set at runtime */
392 static int snd_bt87x_set_digital_hw(struct snd_bt87x *chip, struct snd_pcm_runtime *runtime) snd_bt87x_set_digital_hw() argument
395 runtime->hw = snd_bt87x_digital_hw; snd_bt87x_set_digital_hw()
396 runtime->hw.rates = snd_pcm_rate_to_rate_bit(chip->board.dig_rate); snd_bt87x_set_digital_hw()
397 runtime->hw.rate_min = chip->board.dig_rate; snd_bt87x_set_digital_hw()
398 runtime->hw.rate_max = chip->board.dig_rate; snd_bt87x_set_digital_hw()
402 static int snd_bt87x_set_analog_hw(struct snd_bt87x *chip, struct snd_pcm_runtime *runtime) snd_bt87x_set_analog_hw() argument
416 runtime->hw = snd_bt87x_analog_hw; snd_bt87x_set_analog_hw()
417 return snd_pcm_hw_constraint_ratnums(runtime, 0, SNDRV_PCM_HW_PARAM_RATE, snd_bt87x_set_analog_hw()
424 struct snd_pcm_runtime *runtime = substream->runtime; snd_bt87x_pcm_open() local
431 err = snd_bt87x_set_digital_hw(chip, runtime); snd_bt87x_pcm_open()
433 err = snd_bt87x_set_analog_hw(chip, runtime); snd_bt87x_pcm_open()
437 err = snd_pcm_hw_constraint_integer(runtime, SNDRV_PCM_HW_PARAM_PERIODS); snd_bt87x_pcm_open()
492 struct snd_pcm_runtime *runtime = substream->runtime; snd_bt87x_prepare() local
497 decimation = (ANALOG_CLOCK + runtime->rate / 4) / runtime->rate; snd_bt87x_prepare()
499 if (runtime->format == SNDRV_PCM_FORMAT_S8) snd_bt87x_prepare()
548 struct snd_pcm_runtime *runtime = substream->runtime; snd_bt87x_pointer() local
550 return (snd_pcm_uframes_t)bytes_to_frames(runtime, chip->current_line * chip->line_bytes); snd_bt87x_pointer()
H A Dcs4281.c670 struct cs4281_dma *dma = substream->runtime->private_data; snd_cs4281_trigger()
735 struct snd_pcm_runtime *runtime, snd_cs4281_mode()
742 if (runtime->channels == 1) snd_cs4281_mode()
744 if (snd_pcm_format_unsigned(runtime->format) > 0) snd_cs4281_mode()
746 if (snd_pcm_format_big_endian(runtime->format) > 0) snd_cs4281_mode()
748 switch (snd_pcm_format_width(runtime->format)) { snd_cs4281_mode()
750 if (runtime->channels == 1) snd_cs4281_mode()
757 if (runtime->buffer_size != runtime->period_size) snd_cs4281_mode()
760 snd_cs4281_pokeBA0(chip, dma->regDBA, runtime->dma_addr); snd_cs4281_mode()
761 snd_cs4281_pokeBA0(chip, dma->regDBC, runtime->buffer_size - 1); snd_cs4281_mode()
771 unsigned int val = snd_cs4281_rate(runtime->rate, NULL); snd_cs4281_mode()
777 unsigned int val = snd_cs4281_rate(runtime->rate, NULL); snd_cs4281_mode()
812 struct snd_pcm_runtime *runtime = substream->runtime; snd_cs4281_playback_prepare() local
813 struct cs4281_dma *dma = runtime->private_data; snd_cs4281_playback_prepare()
817 snd_cs4281_mode(chip, dma, runtime, 0, 1); snd_cs4281_playback_prepare()
824 struct snd_pcm_runtime *runtime = substream->runtime; snd_cs4281_capture_prepare() local
825 struct cs4281_dma *dma = runtime->private_data; snd_cs4281_capture_prepare()
829 snd_cs4281_mode(chip, dma, runtime, 1, 1); snd_cs4281_capture_prepare()
836 struct snd_pcm_runtime *runtime = substream->runtime; snd_cs4281_pointer() local
837 struct cs4281_dma *dma = runtime->private_data; snd_cs4281_pointer()
843 snd_cs4281_peekBA0(chip, dma->regDCC), runtime->buffer_size, snd_cs4281_pointer()
846 return runtime->buffer_size - snd_cs4281_pointer()
903 struct snd_pcm_runtime *runtime = substream->runtime; snd_cs4281_playback_open() local
910 runtime->private_data = dma; snd_cs4281_playback_open()
911 runtime->hw = snd_cs4281_playback; snd_cs4281_playback_open()
915 snd_pcm_hw_constraint_msbits(runtime, 0, 32, 20); snd_cs4281_playback_open()
922 struct snd_pcm_runtime *runtime = substream->runtime; snd_cs4281_capture_open() local
929 runtime->private_data = dma; snd_cs4281_capture_open()
930 runtime->hw = snd_cs4281_capture; snd_cs4281_capture_open()
934 snd_pcm_hw_constraint_msbits(runtime, 0, 32, 20); snd_cs4281_capture_open()
940 struct cs4281_dma *dma = substream->runtime->private_data; snd_cs4281_playback_close()
948 struct cs4281_dma *dma = substream->runtime->private_data; snd_cs4281_capture_close()
734 snd_cs4281_mode(struct cs4281 *chip, struct cs4281_dma *dma, struct snd_pcm_runtime *runtime, int capture, int src) snd_cs4281_mode() argument
H A Dmaestro3.c1115 struct m3_dma *s = subs->runtime->private_data; snd_m3_pcm_trigger()
1153 struct snd_pcm_runtime *runtime = subs->runtime; snd_m3_pcm_setup1() local
1165 s->dma_size = frames_to_bytes(runtime, runtime->buffer_size); snd_m3_pcm_setup1()
1166 s->period_size = frames_to_bytes(runtime, runtime->period_size); snd_m3_pcm_setup1()
1236 struct snd_pcm_runtime *runtime) snd_m3_pcm_setup2()
1256 runtime->channels == 2 ? 0 : 1); snd_m3_pcm_setup2()
1260 snd_pcm_format_width(runtime->format) == 16 ? 0 : 1); snd_m3_pcm_setup2()
1263 freq = ((runtime->rate << 15) + 24000 ) / 48000; snd_m3_pcm_setup2()
1322 subs->runtime->rate > 45000 ? 0xff : 0); snd_m3_playback_setup()
1398 struct m3_dma *s = substream->runtime->private_data; snd_m3_pcm_hw_params()
1404 s->buffer_addr = substream->runtime->dma_addr; snd_m3_pcm_hw_params()
1416 if (substream->runtime->private_data == NULL) snd_m3_pcm_hw_free()
1418 s = substream->runtime->private_data; snd_m3_pcm_hw_free()
1428 struct snd_pcm_runtime *runtime = subs->runtime; snd_m3_pcm_prepare() local
1429 struct m3_dma *s = runtime->private_data; snd_m3_pcm_prepare()
1434 if (runtime->format != SNDRV_PCM_FORMAT_U8 && snd_m3_pcm_prepare()
1435 runtime->format != SNDRV_PCM_FORMAT_S16_LE) snd_m3_pcm_prepare()
1437 if (runtime->rate > 48000 || snd_m3_pcm_prepare()
1438 runtime->rate < 8000) snd_m3_pcm_prepare()
1450 snd_m3_pcm_setup2(chip, s, runtime); snd_m3_pcm_prepare()
1490 struct m3_dma *s = subs->runtime->private_data; snd_m3_pcm_pointer()
1498 return bytes_to_frames(subs->runtime, ptr); snd_m3_pcm_pointer()
1749 subs->runtime->private_data = s; snd_m3_substream_open()
1766 struct m3_dma *s = subs->runtime->private_data; snd_m3_substream_close()
1789 struct snd_pcm_runtime *runtime = subs->runtime; snd_m3_playback_open() local
1795 runtime->hw = snd_m3_playback; snd_m3_playback_open()
1813 struct snd_pcm_runtime *runtime = subs->runtime; snd_m3_capture_open() local
1819 runtime->hw = snd_m3_capture; snd_m3_capture_open()
1235 snd_m3_pcm_setup2(struct snd_m3 *chip, struct m3_dma *s, struct snd_pcm_runtime *runtime) snd_m3_pcm_setup2() argument
H A Datiixp.c388 addr = (u32)substream->runtime->dma_addr; atiixp_build_dma_packets()
664 struct snd_pcm_runtime *runtime = substream->runtime; snd_atiixp_pcm_pointer() local
665 struct atiixp_dma *dma = runtime->private_data; snd_atiixp_pcm_pointer()
676 return bytes_to_frames(runtime, curptr); snd_atiixp_pcm_pointer()
724 struct atiixp_dma *dma = substream->runtime->private_data; snd_atiixp_pcm_trigger()
884 substream->runtime->format == SNDRV_PCM_FORMAT_S16_LE ? snd_atiixp_spdif_prepare()
902 switch (substream->runtime->channels) { snd_atiixp_playback_prepare()
926 substream->runtime->format == SNDRV_PCM_FORMAT_S16_LE ? snd_atiixp_playback_prepare()
933 substream->runtime->channels >= 6 ? ATI_REG_6CH_REORDER_EN: 0); snd_atiixp_playback_prepare()
946 substream->runtime->format == SNDRV_PCM_FORMAT_S16_LE ? snd_atiixp_capture_prepare()
959 struct atiixp_dma *dma = substream->runtime->private_data; snd_atiixp_pcm_hw_params()
965 dma->buf_addr = substream->runtime->dma_addr; snd_atiixp_pcm_hw_params()
996 struct atiixp_dma *dma = substream->runtime->private_data; snd_atiixp_pcm_hw_free()
1036 struct snd_pcm_runtime *runtime = substream->runtime; snd_atiixp_pcm_open() local
1045 runtime->hw = snd_atiixp_pcm_hw; snd_atiixp_pcm_open()
1048 runtime->hw.rates = chip->pcms[pcm_type]->rates; snd_atiixp_pcm_open()
1049 snd_pcm_limit_hw_rates(runtime); snd_atiixp_pcm_open()
1052 runtime->hw.formats = SNDRV_PCM_FMTBIT_IEC958_SUBFRAME_LE; snd_atiixp_pcm_open()
1054 if ((err = snd_pcm_hw_constraint_integer(runtime, SNDRV_PCM_HW_PARAM_PERIODS)) < 0) snd_atiixp_pcm_open()
1056 runtime->private_data = dma; snd_atiixp_pcm_open()
1094 substream->runtime->hw.channels_max = chip->max_channels; snd_atiixp_playback_open()
1097 snd_pcm_hw_constraint_step(substream->runtime, 0, snd_atiixp_playback_open()
/linux-4.1.27/sound/soc/intel/haswell/
H A Dsst-haswell-pcm.c115 struct sst_module_runtime *runtime; member in struct:hsw_pcm_data
135 /* runtime DSP */
474 struct snd_pcm_runtime *runtime = substream->runtime; hsw_pcm_hw_params() local
613 ret = create_adsp_page_table(substream, pdata, rtd, runtime->dma_area, hsw_pcm_hw_params()
614 runtime->dma_bytes, rtd->cpu_dai->id); hsw_pcm_hw_params()
621 if (runtime->dma_bytes % PAGE_SIZE) hsw_pcm_hw_params()
622 pages = (runtime->dma_bytes / PAGE_SIZE) + 1; hsw_pcm_hw_params()
624 pages = runtime->dma_bytes / PAGE_SIZE; hsw_pcm_hw_params()
628 pages, runtime->dma_bytes, 0, hsw_pcm_hw_params()
644 pcm_data->runtime); hsw_pcm_hw_params()
682 struct snd_pcm_runtime *runtime = substream->runtime; hsw_pcm_trigger() local
704 pos = runtime->control->appl_ptr % runtime->buffer_size; hsw_pcm_trigger()
719 struct snd_pcm_runtime *runtime = substream->runtime; hsw_notify_pointer() local
725 snd_pcm_uframes_t position = bytes_to_frames(runtime, hsw_notify_pointer()
727 unsigned char *dma_area = runtime->dma_area; hsw_notify_pointer()
729 bytes_to_frames(runtime, runtime->dma_bytes); hsw_notify_pointer()
733 pos = frames_to_bytes(runtime, hsw_notify_pointer()
734 (runtime->control->appl_ptr % runtime->buffer_size)); hsw_notify_pointer()
751 samples = SST_SAMPLES(runtime, position - old_position); hsw_notify_pointer()
752 snd_pcm_format_set_silence(runtime->format, hsw_notify_pointer()
754 runtime, old_position), hsw_notify_pointer()
760 samples = SST_SAMPLES(runtime, hsw_notify_pointer()
762 snd_pcm_format_set_silence(runtime->format, hsw_notify_pointer()
764 runtime, old_position), hsw_notify_pointer()
769 samples = SST_SAMPLES(runtime, position); hsw_notify_pointer()
770 snd_pcm_format_set_silence(runtime->format, hsw_notify_pointer()
785 struct snd_pcm_runtime *runtime = substream->runtime; hsw_pcm_pointer() local
799 offset = bytes_to_frames(runtime, position); hsw_pcm_pointer()
895 /* create new runtime module, use same offset if recreated */ hsw_pcm_create_modules()
896 pcm_data->runtime = sst_hsw_runtime_module_create(hsw, hsw_pcm_create_modules()
898 if (pcm_data->runtime == NULL) hsw_pcm_create_modules()
901 pcm_data->runtime->persistent_offset; hsw_pcm_create_modules()
904 /* create runtime blocks for module waves */ hsw_pcm_create_modules()
917 sst_hsw_runtime_module_free(pcm_data->runtime); hsw_pcm_create_modules()
931 sst_hsw_runtime_module_free(pcm_data->runtime); hsw_pcm_free_modules()
1091 /* allocate runtime modules */ hsw_pcm_probe()
1096 /* enable runtime PM with auto suspend */ hsw_pcm_probe()
1310 err = sst_module_runtime_restore(pcm_data->runtime, hsw_pcm_complete()
1359 err = sst_module_runtime_save(pcm_data->runtime, hsw_pcm_prepare()
/linux-4.1.27/tools/testing/selftests/timers/
H A Dthreadtest.c135 time_t start, now, runtime; main() local
144 runtime = DEFAULT_RUNTIME; main()
150 runtime = atoi(optarg); main()
177 printf("Testing consistency with %i threads for %ld seconds: ", thread_count, runtime); main()
183 while (time(&now) < start + runtime) { main()
H A Dinconsistency-check.c169 int runtime = 10; main() local
176 runtime = atoi(optarg); main()
199 if (consistency_test(clockid, runtime)) main()
/linux-4.1.27/sound/drivers/pcsp/
H A Dpcsp_lib.c48 struct snd_pcm_runtime *runtime; pcsp_timer_update() local
61 runtime = substream->runtime; pcsp_timer_update()
63 val = runtime->dma_area[chip->playback_ptr + chip->fmt_size - 1]; pcsp_timer_update()
242 snd_pcm_format_physical_width(substream->runtime->format) >> 3; snd_pcsp_playback_prepare()
243 chip->is_signed = snd_pcm_format_signed(substream->runtime->format); snd_pcsp_playback_prepare()
251 substream->runtime->periods, snd_pcsp_playback_prepare()
285 return bytes_to_frames(substream->runtime, pos); snd_pcsp_playback_pointer()
313 struct snd_pcm_runtime *runtime = substream->runtime; snd_pcsp_playback_open() local
321 runtime->hw = snd_pcsp_playback; snd_pcsp_playback_open()
/linux-4.1.27/sound/soc/au1x/
H A Ddbdma2.c57 /* runtime data */
198 struct snd_pcm_runtime *runtime = substream->runtime; au1xpsc_pcm_hw_params() local
209 DBG("runtime->dma_area = 0x%08lx dma_addr_t = 0x%08lx dma_size = %d " au1xpsc_pcm_hw_params()
210 "runtime->min_align %d\n", au1xpsc_pcm_hw_params()
211 (unsigned long)runtime->dma_area, au1xpsc_pcm_hw_params()
212 (unsigned long)runtime->dma_addr, runtime->dma_bytes, au1xpsc_pcm_hw_params()
213 runtime->min_align); au1xpsc_pcm_hw_params()
227 pcd->dma_area_s = pcd->dma_area = runtime->dma_addr; au1xpsc_pcm_hw_params()
282 return bytes_to_frames(substream->runtime, to_dmadata(substream)->pos); au1xpsc_pcm_pointer()
/linux-4.1.27/sound/soc/intel/boards/
H A Dcht_bsw_rt5645.c75 * runtime suspended. Codec needs clock for jack detection and button platform_clock_control()
150 static int cht_codec_init(struct snd_soc_pcm_runtime *runtime) cht_codec_init() argument
153 struct snd_soc_codec *codec = runtime->codec; cht_codec_init()
154 struct snd_soc_dai *codec_dai = runtime->codec_dai; cht_codec_init()
155 struct cht_mc_private *ctx = snd_soc_card_get_drvdata(runtime->card); cht_codec_init()
168 dev_err(runtime->dev, "can't set codec TDM slot %d\n", ret); cht_codec_init()
172 ret = snd_soc_card_jack_new(runtime->card, "Headphone Jack", cht_codec_init()
176 dev_err(runtime->dev, "HP jack creation failed %d\n", ret); cht_codec_init()
180 ret = snd_soc_card_jack_new(runtime->card, "Mic Jack", cht_codec_init()
184 dev_err(runtime->dev, "Mic jack creation failed %d\n", ret); cht_codec_init()
221 return snd_pcm_hw_constraint_list(substream->runtime, 0, cht_aif1_startup()
H A Dbyt-max98090.c84 static int byt_max98090_init(struct snd_soc_pcm_runtime *runtime) byt_max98090_init() argument
87 struct snd_soc_card *card = runtime->card; byt_max98090_init()
93 ret = snd_soc_dai_set_sysclk(runtime->codec_dai, byt_max98090_init()
102 ret = snd_soc_card_jack_new(runtime->card, "Headset", byt_max98090_init()
H A Dcht_bsw_rt5672.c95 * when codec is runtime suspended. Codec needs clock for jack platform_clock_control()
170 static int cht_codec_init(struct snd_soc_pcm_runtime *runtime) cht_codec_init() argument
173 struct snd_soc_dai *codec_dai = runtime->codec_dai; cht_codec_init()
179 dev_err(runtime->dev, "can't set codec TDM slot %d\n", ret); cht_codec_init()
197 ret = snd_soc_card_jack_new(runtime->card, "Headset", cht_codec_init()
236 return snd_pcm_hw_constraint_list(substream->runtime, 0, cht_aif1_startup()
H A Dbyt-rt5640.c131 static int byt_rt5640_init(struct snd_soc_pcm_runtime *runtime) byt_rt5640_init() argument
134 struct snd_soc_codec *codec = runtime->codec; byt_rt5640_init()
135 struct snd_soc_card *card = runtime->card; byt_rt5640_init()
/linux-4.1.27/sound/soc/sh/
H A Ddma-sh7760.c203 struct snd_pcm_runtime *runtime = substream->runtime; camelot_prepare() local
208 (u32)runtime->dma_addr, runtime->dma_bytes); camelot_prepare()
211 BRGREG(BRGATXSAR) = (unsigned long)runtime->dma_area; camelot_prepare()
212 BRGREG(BRGATXTCR) = runtime->dma_bytes; camelot_prepare()
214 BRGREG(BRGARXDAR) = (unsigned long)runtime->dma_area; camelot_prepare()
215 BRGREG(BRGARXTCR) = runtime->dma_bytes; camelot_prepare()
277 struct snd_pcm_runtime *runtime = substream->runtime; camelot_pos() local
294 return bytes_to_frames(runtime, pos); camelot_pos()
/linux-4.1.27/arch/x86/include/asm/
H A Defi.h8 * We map the EFI regions needed for runtime services non-contiguously,
10 * for a total max space of 64G. This way, we provide for stable runtime
18 * "efi=old_map" which can be used as a fallback to the old runtime
43 efi.systab->runtime->f)(args); \
53 efi.systab->runtime->f)(args); \
74 __s = efi_call((void *)efi.systab->runtime->f, __VA_ARGS__); \
113 u64 runtime; member in struct:efi_setup_data
/linux-4.1.27/sound/pci/ymfpci/
H A Dymfpci_main.c360 struct snd_pcm_runtime *runtime = substream->runtime; snd_ymfpci_pcm_capture_interrupt() local
361 struct snd_ymfpci_pcm *ypcm = runtime->private_data; snd_ymfpci_pcm_capture_interrupt()
394 struct snd_ymfpci_pcm *ypcm = substream->runtime->private_data; snd_ymfpci_playback_trigger()
439 struct snd_ymfpci_pcm *ypcm = substream->runtime->private_data; snd_ymfpci_capture_trigger()
498 struct snd_pcm_runtime *runtime, snd_ymfpci_pcm_init_voice()
503 u32 delta = snd_ymfpci_calc_delta(runtime->rate); snd_ymfpci_pcm_init_voice()
504 u32 lpfQ = snd_ymfpci_calc_lpfQ(runtime->rate); snd_ymfpci_pcm_init_voice()
505 u32 lpfK = snd_ymfpci_calc_lpfK(runtime->rate); snd_ymfpci_pcm_init_voice()
514 if (runtime->channels == 1) { snd_ymfpci_pcm_init_voice()
531 format = runtime->channels == 2 ? 0x00010000 : 0; snd_ymfpci_pcm_init_voice()
532 if (snd_pcm_format_width(runtime->format) == 8) snd_ymfpci_pcm_init_voice()
535 runtime->rate == 44100 && runtime->channels == 2 && snd_ymfpci_pcm_init_voice()
547 if (runtime->channels == 2 && (voiceidx & 1) != 0) snd_ymfpci_pcm_init_voice()
554 bank->base = cpu_to_le32(runtime->dma_addr); snd_ymfpci_pcm_init_voice()
641 struct snd_pcm_runtime *runtime = substream->runtime; snd_ymfpci_playback_hw_params() local
642 struct snd_ymfpci_pcm *ypcm = runtime->private_data; snd_ymfpci_playback_hw_params()
655 struct snd_pcm_runtime *runtime = substream->runtime; snd_ymfpci_playback_hw_free() local
658 if (runtime->private_data == NULL) snd_ymfpci_playback_hw_free()
660 ypcm = runtime->private_data; snd_ymfpci_playback_hw_free()
679 struct snd_pcm_runtime *runtime = substream->runtime; snd_ymfpci_playback_prepare() local
680 struct snd_ymfpci_pcm *ypcm = runtime->private_data; snd_ymfpci_playback_prepare()
684 ypcm->period_size = runtime->period_size; snd_ymfpci_playback_prepare()
685 ypcm->buffer_size = runtime->buffer_size; snd_ymfpci_playback_prepare()
688 for (nvoice = 0; nvoice < runtime->channels; nvoice++) snd_ymfpci_playback_prepare()
689 snd_ymfpci_pcm_init_voice(ypcm, nvoice, runtime, snd_ymfpci_playback_prepare()
718 struct snd_pcm_runtime *runtime = substream->runtime; snd_ymfpci_capture_prepare() local
719 struct snd_ymfpci_pcm *ypcm = runtime->private_data; snd_ymfpci_capture_prepare()
724 ypcm->period_size = runtime->period_size; snd_ymfpci_capture_prepare()
725 ypcm->buffer_size = runtime->buffer_size; snd_ymfpci_capture_prepare()
729 rate = ((48000 * 4096) / runtime->rate) - 1; snd_ymfpci_capture_prepare()
731 if (runtime->channels == 2) { snd_ymfpci_capture_prepare()
735 if (snd_pcm_format_width(runtime->format) == 8) snd_ymfpci_capture_prepare()
751 bank->base = cpu_to_le32(runtime->dma_addr); snd_ymfpci_capture_prepare()
762 struct snd_pcm_runtime *runtime = substream->runtime; snd_ymfpci_playback_pointer() local
763 struct snd_ymfpci_pcm *ypcm = runtime->private_data; snd_ymfpci_playback_pointer()
774 struct snd_pcm_runtime *runtime = substream->runtime; snd_ymfpci_capture_pointer() local
775 struct snd_ymfpci_pcm *ypcm = runtime->private_data; snd_ymfpci_capture_pointer()
892 static void snd_ymfpci_pcm_free_substream(struct snd_pcm_runtime *runtime) snd_ymfpci_pcm_free_substream() argument
894 kfree(runtime->private_data); snd_ymfpci_pcm_free_substream()
900 struct snd_pcm_runtime *runtime = substream->runtime; snd_ymfpci_playback_open_1() local
904 runtime->hw = snd_ymfpci_playback; snd_ymfpci_playback_open_1()
906 err = snd_pcm_hw_constraint_minmax(runtime, snd_ymfpci_playback_open_1()
911 err = snd_pcm_hw_rule_noresample(runtime, 48000); snd_ymfpci_playback_open_1()
921 runtime->private_data = ypcm; snd_ymfpci_playback_open_1()
922 runtime->private_free = snd_ymfpci_pcm_free_substream; snd_ymfpci_playback_open_1()
954 struct snd_pcm_runtime *runtime = substream->runtime; snd_ymfpci_playback_open() local
960 ypcm = runtime->private_data; snd_ymfpci_playback_open()
976 struct snd_pcm_runtime *runtime = substream->runtime; snd_ymfpci_playback_spdif_open() local
982 ypcm = runtime->private_data; snd_ymfpci_playback_spdif_open()
1004 struct snd_pcm_runtime *runtime = substream->runtime; snd_ymfpci_playback_4ch_open() local
1010 ypcm = runtime->private_data; snd_ymfpci_playback_4ch_open()
1025 struct snd_pcm_runtime *runtime = substream->runtime; snd_ymfpci_capture_open() local
1029 runtime->hw = snd_ymfpci_capture; snd_ymfpci_capture_open()
1031 err = snd_pcm_hw_constraint_minmax(runtime, snd_ymfpci_capture_open()
1036 err = snd_pcm_hw_rule_noresample(runtime, 48000); snd_ymfpci_capture_open()
1048 runtime->private_data = ypcm; snd_ymfpci_capture_open()
1049 runtime->private_free = snd_ymfpci_pcm_free_substream; snd_ymfpci_capture_open()
1072 struct snd_ymfpci_pcm *ypcm = substream->runtime->private_data; snd_ymfpci_playback_close()
1116 struct snd_pcm_runtime *runtime = substream->runtime; snd_ymfpci_capture_close() local
1117 struct snd_ymfpci_pcm *ypcm = runtime->private_data; snd_ymfpci_capture_close()
1768 if (substream->runtime && substream->runtime->private_data) { snd_ymfpci_pcm_vol_put()
1769 struct snd_ymfpci_pcm *ypcm = substream->runtime->private_data; snd_ymfpci_pcm_vol_put()
497 snd_ymfpci_pcm_init_voice(struct snd_ymfpci_pcm *ypcm, unsigned int voiceidx, struct snd_pcm_runtime *runtime, int has_pcm_volume) snd_ymfpci_pcm_init_voice() argument
/linux-4.1.27/sound/usb/misc/
H A Dua101.c202 ua->playback.substream->runtime->delay -= playback_urb_complete()
224 struct snd_pcm_runtime *runtime; copy_playback_data() local
228 runtime = stream->substream->runtime; copy_playback_data()
230 source = runtime->dma_area + stream->buffer_pos * frame_bytes; copy_playback_data()
231 if (stream->buffer_pos + frames <= runtime->buffer_size) { copy_playback_data()
235 frames1 = runtime->buffer_size - stream->buffer_pos; copy_playback_data()
238 runtime->dma_area, (frames - frames1) * frame_bytes); copy_playback_data()
242 if (stream->buffer_pos >= runtime->buffer_size) copy_playback_data()
243 stream->buffer_pos -= runtime->buffer_size; copy_playback_data()
245 if (stream->period_pos >= runtime->period_size) { copy_playback_data()
246 stream->period_pos -= runtime->period_size; copy_playback_data()
317 ua->playback.substream->runtime->delay += frames; playback_tasklet()
328 struct snd_pcm_runtime *runtime; copy_capture_data() local
332 runtime = stream->substream->runtime; copy_capture_data()
334 dest = runtime->dma_area + stream->buffer_pos * frame_bytes; copy_capture_data()
335 if (stream->buffer_pos + frames <= runtime->buffer_size) { copy_capture_data()
339 frames1 = runtime->buffer_size - stream->buffer_pos; copy_capture_data()
341 memcpy(runtime->dma_area, copy_capture_data()
347 if (stream->buffer_pos >= runtime->buffer_size) copy_capture_data()
348 stream->buffer_pos -= runtime->buffer_size; copy_capture_data()
350 if (stream->period_pos >= runtime->period_size) { copy_capture_data()
351 stream->period_pos -= runtime->period_size; copy_capture_data()
631 substream->runtime->hw.info = set_stream_hw()
638 substream->runtime->hw.formats = ua->format_bit; set_stream_hw()
639 substream->runtime->hw.rates = snd_pcm_rate_to_rate_bit(ua->rate); set_stream_hw()
640 substream->runtime->hw.rate_min = ua->rate; set_stream_hw()
641 substream->runtime->hw.rate_max = ua->rate; set_stream_hw()
642 substream->runtime->hw.channels_min = channels; set_stream_hw()
643 substream->runtime->hw.channels_max = channels; set_stream_hw()
644 substream->runtime->hw.buffer_bytes_max = 45000 * 1024; set_stream_hw()
645 substream->runtime->hw.period_bytes_min = 1; set_stream_hw()
646 substream->runtime->hw.period_bytes_max = UINT_MAX; set_stream_hw()
647 substream->runtime->hw.periods_min = 2; set_stream_hw()
648 substream->runtime->hw.periods_max = UINT_MAX; set_stream_hw()
649 err = snd_pcm_hw_constraint_minmax(substream->runtime, set_stream_hw()
655 err = snd_pcm_hw_constraint_msbits(substream->runtime, 0, 32, 24); set_stream_hw()
668 substream->runtime->hw.fifo_size = capture_pcm_open()
670 substream->runtime->delay = substream->runtime->hw.fifo_size; capture_pcm_open()
689 substream->runtime->hw.fifo_size = playback_pcm_open()
825 substream->runtime->delay = 0; playback_pcm_prepare()
/linux-4.1.27/sound/pci/asihpi/
H A Dasihpi.c59 * Must set snd module debug parameter to 3 to enable at runtime.
454 struct snd_pcm_runtime *runtime = substream->runtime; snd_card_asihpi_pcm_hw_params() local
455 struct snd_card_asihpi_pcm *dpcm = runtime->private_data; snd_card_asihpi_pcm_hw_params()
486 params_buffer_bytes(params), runtime->dma_addr); snd_card_asihpi_pcm_hw_params()
491 (unsigned long)runtime->dma_addr); snd_card_asihpi_pcm_hw_params()
518 struct snd_pcm_runtime *runtime = substream->runtime; snd_card_asihpi_hw_free() local
519 struct snd_card_asihpi_pcm *dpcm = runtime->private_data; snd_card_asihpi_hw_free()
527 static void snd_card_asihpi_runtime_free(struct snd_pcm_runtime *runtime) snd_card_asihpi_runtime_free() argument
529 struct snd_card_asihpi_pcm *dpcm = runtime->private_data; snd_card_asihpi_runtime_free()
536 struct snd_pcm_runtime *runtime = substream->runtime; snd_card_asihpi_pcm_timer_start() local
537 struct snd_card_asihpi_pcm *dpcm = runtime->private_data; snd_card_asihpi_pcm_timer_start()
549 struct snd_pcm_runtime *runtime = substream->runtime; snd_card_asihpi_pcm_timer_stop() local
550 struct snd_card_asihpi_pcm *dpcm = runtime->private_data; snd_card_asihpi_pcm_timer_stop()
563 dpcm = (struct snd_card_asihpi_pcm *)substream->runtime->private_data; snd_card_asihpi_pcm_int_start()
583 dpcm = (struct snd_card_asihpi_pcm *)substream->runtime->private_data; snd_card_asihpi_pcm_int_stop()
601 struct snd_card_asihpi_pcm *dpcm = substream->runtime->private_data; snd_card_asihpi_trigger()
613 struct snd_pcm_runtime *runtime = s->runtime; snd_pcm_group_for_each_entry() local
614 struct snd_card_asihpi_pcm *ds = runtime->private_data; snd_pcm_group_for_each_entry()
635 &runtime->dma_area[0], snd_pcm_group_for_each_entry()
674 s->runtime->status->state = SNDRV_PCM_STATE_SETUP; snd_pcm_group_for_each_entry()
761 struct snd_pcm_runtime *runtime; snd_card_asihpi_timer_function() local
777 struct snd_card_asihpi_pcm *ds = s->runtime->private_data; snd_pcm_group_for_each_entry()
778 runtime = s->runtime; snd_pcm_group_for_each_entry()
793 runtime->delay = on_card_bytes; snd_pcm_group_for_each_entry()
843 (unsigned long)frames_to_bytes(runtime, snd_pcm_group_for_each_entry()
844 runtime->status->hw_ptr), snd_pcm_group_for_each_entry()
845 (unsigned long)frames_to_bytes(runtime, snd_pcm_group_for_each_entry()
846 runtime->control->appl_ptr) snd_pcm_group_for_each_entry()
869 struct snd_card_asihpi_pcm *ds = s->runtime->private_data; snd_pcm_group_for_each_entry()
870 runtime = s->runtime; snd_pcm_group_for_each_entry()
888 char *pd = &s->runtime->dma_area[buf_ofs]; snd_pcm_group_for_each_entry()
907 pd = s->runtime->dma_area; snd_pcm_group_for_each_entry()
926 pd = s->runtime->dma_area; snd_pcm_group_for_each_entry()
980 struct snd_pcm_runtime *runtime = substream->runtime; snd_card_asihpi_playback_prepare() local
981 struct snd_card_asihpi_pcm *dpcm = runtime->private_data; snd_card_asihpi_playback_prepare()
995 struct snd_pcm_runtime *runtime = substream->runtime; snd_card_asihpi_playback_pointer() local
996 struct snd_card_asihpi_pcm *dpcm = runtime->private_data; snd_card_asihpi_playback_pointer()
1001 ptr = bytes_to_frames(runtime, dpcm->pcm_buf_dma_ofs % dpcm->buffer_bytes); snd_card_asihpi_playback_pointer()
1041 struct snd_pcm_runtime *runtime = substream->runtime; snd_card_asihpi_playback_open() local
1069 runtime->private_data = dpcm; snd_card_asihpi_playback_open()
1070 runtime->private_free = snd_card_asihpi_runtime_free; snd_card_asihpi_playback_open()
1111 runtime->hw = snd_card_asihpi_playback; snd_card_asihpi_playback_open()
1114 err = snd_pcm_hw_constraint_pow2(runtime, 0, snd_card_asihpi_playback_open()
1119 snd_pcm_hw_constraint_step(runtime, 0, SNDRV_PCM_HW_PARAM_PERIOD_SIZE, snd_card_asihpi_playback_open()
1122 snd_pcm_hw_constraint_minmax(runtime, SNDRV_PCM_HW_PARAM_PERIOD_SIZE, snd_card_asihpi_playback_open()
1132 struct snd_pcm_runtime *runtime = substream->runtime; snd_card_asihpi_playback_close() local
1133 struct snd_card_asihpi_pcm *dpcm = runtime->private_data; snd_card_asihpi_playback_close()
1156 struct snd_pcm_runtime *runtime = substream->runtime; snd_card_asihpi_capture_pointer() local
1157 struct snd_card_asihpi_pcm *dpcm = runtime->private_data; snd_card_asihpi_capture_pointer()
1166 return bytes_to_frames(runtime, dpcm->pcm_buf_dma_ofs % dpcm->buffer_bytes); snd_card_asihpi_capture_pointer()
1177 struct snd_pcm_runtime *runtime = substream->runtime; snd_card_asihpi_capture_prepare() local
1178 struct snd_card_asihpi_pcm *dpcm = runtime->private_data; snd_card_asihpi_capture_prepare()
1224 struct snd_pcm_runtime *runtime = substream->runtime; snd_card_asihpi_capture_open() local
1250 runtime->private_data = dpcm; snd_card_asihpi_capture_open()
1251 runtime->private_free = snd_card_asihpi_runtime_free; snd_card_asihpi_capture_open()
1282 runtime->hw = snd_card_asihpi_capture; snd_card_asihpi_capture_open()
1285 err = snd_pcm_hw_constraint_pow2(runtime, 0, snd_card_asihpi_capture_open()
1290 snd_pcm_hw_constraint_step(runtime, 0, SNDRV_PCM_HW_PARAM_PERIOD_SIZE, snd_card_asihpi_capture_open()
1292 snd_pcm_hw_constraint_minmax(runtime, SNDRV_PCM_HW_PARAM_PERIOD_SIZE, snd_card_asihpi_capture_open()
1302 struct snd_card_asihpi_pcm *dpcm = substream->runtime->private_data; snd_card_asihpi_capture_close()
/linux-4.1.27/sound/pci/ice1712/
H A Dice1724.c566 reg = s->runtime->private_data; snd_pcm_group_for_each_entry()
787 val = (8 - substream->runtime->channels) >> 1; snd_vt1724_playback_pro_prepare()
790 outl(substream->runtime->dma_addr, ICEMT1724(ice, PLAYBACK_ADDR)); snd_vt1724_playback_pro_prepare()
806 substream->runtime->channels, snd_vt1724_playback_pro_prepare()
807 (unsigned int)substream->runtime->dma_addr, snd_vt1724_playback_pro_prepare()
823 if (ptr < substream->runtime->dma_addr) { snd_vt1724_playback_pro_pointer()
827 ptr -= substream->runtime->dma_addr; snd_vt1724_playback_pro_pointer()
828 ptr = bytes_to_frames(substream->runtime, ptr); snd_vt1724_playback_pro_pointer()
829 if (ptr >= substream->runtime->buffer_size) { snd_vt1724_playback_pro_pointer()
831 (int)ptr, (int)substream->runtime->period_size); snd_vt1724_playback_pro_pointer()
837 ptr = bytes_to_frames(substream->runtime, ptr); snd_vt1724_playback_pro_pointer()
840 else if (ptr <= substream->runtime->buffer_size) snd_vt1724_playback_pro_pointer()
841 ptr = substream->runtime->buffer_size - ptr; snd_vt1724_playback_pro_pointer()
844 (int)ptr, (int)substream->runtime->buffer_size); snd_vt1724_playback_pro_pointer()
854 const struct vt1724_pcm_reg *reg = substream->runtime->private_data; snd_vt1724_pcm_prepare()
857 outl(substream->runtime->dma_addr, ice->profi_port + reg->addr); snd_vt1724_pcm_prepare()
869 const struct vt1724_pcm_reg *reg = substream->runtime->private_data; snd_vt1724_pcm_pointer()
876 ptr -= substream->runtime->dma_addr; snd_vt1724_pcm_pointer()
877 return bytes_to_frames(substream->runtime, ptr); snd_vt1724_pcm_pointer()
881 ptr = bytes_to_frames(substream->runtime, ptr); snd_vt1724_pcm_pointer()
884 else if (ptr <= substream->runtime->buffer_size) snd_vt1724_pcm_pointer()
885 ptr = substream->runtime->buffer_size - ptr; snd_vt1724_pcm_pointer()
888 (int)ptr, (int)substream->runtime->buffer_size); snd_vt1724_pcm_pointer()
1006 struct snd_pcm_runtime *runtime = substream->runtime; set_rate_constraints() local
1008 runtime->hw.rate_min = ice->hw_rates->list[0]; set_rate_constraints()
1009 runtime->hw.rate_max = ice->hw_rates->list[ice->hw_rates->count - 1]; set_rate_constraints()
1010 runtime->hw.rates = SNDRV_PCM_RATE_KNOT; set_rate_constraints()
1011 return snd_pcm_hw_constraint_list(runtime, 0, set_rate_constraints()
1016 /* if the card has the internal rate locked (is_pro_locked), limit runtime
1022 struct snd_pcm_runtime *runtime = substream->runtime; constrain_rate_if_locked() local
1026 if (rate >= runtime->hw.rate_min constrain_rate_if_locked()
1027 && rate <= runtime->hw.rate_max) { constrain_rate_if_locked()
1028 runtime->hw.rate_min = rate; constrain_rate_if_locked()
1029 runtime->hw.rate_max = rate; constrain_rate_if_locked()
1042 struct snd_pcm_runtime *runtime = substream->runtime; snd_vt1724_playback_pro_open() local
1046 runtime->private_data = (void *)&vt1724_playback_pro_reg; snd_vt1724_playback_pro_open()
1048 runtime->hw = snd_vt1724_playback_pro; snd_vt1724_playback_pro_open()
1050 snd_pcm_hw_constraint_msbits(runtime, 0, 32, 24); snd_vt1724_playback_pro_open()
1060 runtime->hw.channels_max = chs; snd_vt1724_playback_pro_open()
1062 snd_pcm_hw_constraint_step(runtime, 0, SNDRV_PCM_HW_PARAM_CHANNELS, 2); snd_vt1724_playback_pro_open()
1064 snd_pcm_hw_constraint_step(runtime, 0, SNDRV_PCM_HW_PARAM_PERIOD_BYTES, snd_vt1724_playback_pro_open()
1066 snd_pcm_hw_constraint_step(runtime, 0, SNDRV_PCM_HW_PARAM_BUFFER_BYTES, snd_vt1724_playback_pro_open()
1077 struct snd_pcm_runtime *runtime = substream->runtime; snd_vt1724_capture_pro_open() local
1079 runtime->private_data = (void *)&vt1724_capture_pro_reg; snd_vt1724_capture_pro_open()
1081 runtime->hw = snd_vt1724_2ch_stereo; snd_vt1724_capture_pro_open()
1083 snd_pcm_hw_constraint_msbits(runtime, 0, 32, 24); snd_vt1724_capture_pro_open()
1085 snd_pcm_hw_constraint_step(runtime, 0, SNDRV_PCM_HW_PARAM_PERIOD_BYTES, snd_vt1724_capture_pro_open()
1087 snd_pcm_hw_constraint_step(runtime, 0, SNDRV_PCM_HW_PARAM_BUFFER_BYTES, snd_vt1724_capture_pro_open()
1217 update_spdif_rate(ice, substream->runtime->rate); snd_vt1724_playback_spdif_prepare()
1224 struct snd_pcm_runtime *runtime = substream->runtime; snd_vt1724_playback_spdif_open() local
1226 runtime->private_data = (void *)&vt1724_playback_spdif_reg; snd_vt1724_playback_spdif_open()
1229 runtime->hw = snd_vt1724_2ch_stereo; snd_vt1724_playback_spdif_open()
1232 runtime->hw = snd_vt1724_spdif; snd_vt1724_playback_spdif_open()
1234 snd_pcm_hw_constraint_msbits(runtime, 0, 32, 24); snd_vt1724_playback_spdif_open()
1235 snd_pcm_hw_constraint_step(runtime, 0, SNDRV_PCM_HW_PARAM_PERIOD_BYTES, snd_vt1724_playback_spdif_open()
1237 snd_pcm_hw_constraint_step(runtime, 0, SNDRV_PCM_HW_PARAM_BUFFER_BYTES, snd_vt1724_playback_spdif_open()
1261 struct snd_pcm_runtime *runtime = substream->runtime; snd_vt1724_capture_spdif_open() local
1263 runtime->private_data = (void *)&vt1724_capture_spdif_reg; snd_vt1724_capture_spdif_open()
1266 runtime->hw = snd_vt1724_2ch_stereo; snd_vt1724_capture_spdif_open()
1269 runtime->hw = snd_vt1724_spdif; snd_vt1724_capture_spdif_open()
1271 snd_pcm_hw_constraint_msbits(runtime, 0, 32, 24); snd_vt1724_capture_spdif_open()
1272 snd_pcm_hw_constraint_step(runtime, 0, SNDRV_PCM_HW_PARAM_PERIOD_BYTES, snd_vt1724_capture_spdif_open()
1274 snd_pcm_hw_constraint_step(runtime, 0, SNDRV_PCM_HW_PARAM_BUFFER_BYTES, snd_vt1724_capture_spdif_open()
1410 struct snd_pcm_runtime *runtime = substream->runtime; snd_vt1724_playback_indep_open() local
1419 runtime->private_data = (void *)&vt1724_playback_dma_regs[substream->number]; snd_vt1724_playback_indep_open()
1421 runtime->hw = snd_vt1724_2ch_stereo; snd_vt1724_playback_indep_open()
1423 snd_pcm_hw_constraint_msbits(runtime, 0, 32, 24); snd_vt1724_playback_indep_open()
H A Dice1712.c589 struct snd_pcm_runtime *runtime = substream->runtime; snd_ice1712_playback_prepare() local
595 if (snd_pcm_format_width(runtime->format) == 16) snd_ice1712_playback_prepare()
597 if (runtime->channels == 2) snd_ice1712_playback_prepare()
599 rate = (runtime->rate * 8192) / 375; snd_ice1712_playback_prepare()
605 outl(runtime->dma_addr, ice->ddma_port + 0); snd_ice1712_playback_prepare()
622 struct snd_pcm_runtime *runtime = substream->runtime; snd_ice1712_playback_ds_prepare() local
627 if (snd_pcm_format_width(runtime->format) == 16) snd_ice1712_playback_ds_prepare()
629 if (runtime->channels == 2) snd_ice1712_playback_ds_prepare()
631 rate = (runtime->rate * 8192) / 375; snd_ice1712_playback_ds_prepare()
635 ice->playback_con_virt_addr[substream->number] = runtime->dma_addr; snd_ice1712_playback_ds_prepare()
638 snd_ice1712_ds_write(ice, chn, ICE1712_DSC_ADDR0, runtime->dma_addr); snd_ice1712_playback_ds_prepare()
640 snd_ice1712_ds_write(ice, chn, ICE1712_DSC_ADDR1, runtime->dma_addr + (runtime->periods > 1 ? period_size + 1 : 0)); snd_ice1712_playback_ds_prepare()
645 if (runtime->channels == 2) { snd_ice1712_playback_ds_prepare()
656 struct snd_pcm_runtime *runtime = substream->runtime; snd_ice1712_capture_prepare() local
663 if (snd_pcm_format_width(runtime->format) == 16) snd_ice1712_capture_prepare()
665 if (runtime->channels == 2) snd_ice1712_capture_prepare()
668 outl(ice->capture_con_virt_addr = runtime->dma_addr, ICEREG(ice, CONCAP_ADDR)); snd_ice1712_capture_prepare()
674 snd_ac97_set_rate(ice->ac97, AC97_PCM_LR_ADC_RATE, runtime->rate); snd_ice1712_capture_prepare()
681 struct snd_pcm_runtime *runtime = substream->runtime; snd_ice1712_playback_pointer() local
686 ptr = runtime->buffer_size - inw(ice->ddma_port + 4); snd_ice1712_playback_pointer()
687 ptr = bytes_to_frames(substream->runtime, ptr); snd_ice1712_playback_pointer()
688 if (ptr == runtime->buffer_size) snd_ice1712_playback_pointer()
707 ptr = bytes_to_frames(substream->runtime, ptr); snd_ice1712_playback_ds_pointer()
708 if (ptr == substream->runtime->buffer_size) snd_ice1712_playback_ds_pointer()
721 ptr = bytes_to_frames(substream->runtime, ptr); snd_ice1712_capture_pointer()
722 if (ptr == substream->runtime->buffer_size) snd_ice1712_capture_pointer()
785 struct snd_pcm_runtime *runtime = substream->runtime; snd_ice1712_playback_open() local
789 runtime->hw = snd_ice1712_playback; snd_ice1712_playback_open()
795 struct snd_pcm_runtime *runtime = substream->runtime; snd_ice1712_playback_ds_open() local
800 runtime->hw = snd_ice1712_playback_ds; snd_ice1712_playback_ds_open()
810 struct snd_pcm_runtime *runtime = substream->runtime; snd_ice1712_capture_open() local
814 runtime->hw = snd_ice1712_capture; snd_ice1712_capture_open()
815 runtime->hw.rates = ice->ac97->rates[AC97_RATES_ADC]; snd_ice1712_capture_open()
816 if (!(runtime->hw.rates & SNDRV_PCM_RATE_8000)) snd_ice1712_capture_open()
817 runtime->hw.rate_min = 48000; snd_ice1712_capture_open()
1064 outl(substream->runtime->dma_addr, ICEMT(ice, PLAYBACK_ADDR)); snd_ice1712_playback_pro_prepare()
1087 outl(substream->runtime->dma_addr, ICEMT(ice, CAPTURE_ADDR)); snd_ice1712_capture_pro_prepare()
1111 ptr = bytes_to_frames(substream->runtime, ptr); snd_ice1712_playback_pro_pointer()
1112 if (ptr == substream->runtime->buffer_size) snd_ice1712_playback_pro_pointer()
1125 ptr = bytes_to_frames(substream->runtime, ptr); snd_ice1712_capture_pro_pointer()
1126 if (ptr == substream->runtime->buffer_size) snd_ice1712_capture_pro_pointer()
1171 struct snd_pcm_runtime *runtime = substream->runtime; snd_ice1712_playback_pro_open() local
1175 runtime->hw = snd_ice1712_playback_pro; snd_ice1712_playback_pro_open()
1177 snd_pcm_hw_constraint_msbits(runtime, 0, 32, 24); snd_ice1712_playback_pro_open()
1178 snd_pcm_hw_constraint_list(runtime, 0, SNDRV_PCM_HW_PARAM_RATE, &hw_constraints_rates); snd_ice1712_playback_pro_open()
1180 runtime->hw.rate_min = PRO_RATE_DEFAULT; snd_ice1712_playback_pro_open()
1181 runtime->hw.rate_max = PRO_RATE_DEFAULT; snd_ice1712_playback_pro_open()
1193 struct snd_pcm_runtime *runtime = substream->runtime; snd_ice1712_capture_pro_open() local
1196 runtime->hw = snd_ice1712_capture_pro; snd_ice1712_capture_pro_open()
1198 snd_pcm_hw_constraint_msbits(runtime, 0, 32, 24); snd_ice1712_capture_pro_open()
1199 snd_pcm_hw_constraint_list(runtime, 0, SNDRV_PCM_HW_PARAM_RATE, &hw_constraints_rates); snd_ice1712_capture_pro_open()
1201 runtime->hw.rate_min = PRO_RATE_DEFAULT; snd_ice1712_capture_pro_open()
1202 runtime->hw.rate_max = PRO_RATE_DEFAULT; snd_ice1712_capture_pro_open()
/linux-4.1.27/drivers/media/pci/cx23885/
H A Dcx23885-alsa.c326 struct snd_pcm_runtime *runtime = substream->runtime; snd_cx23885_pcm_open() local
335 err = snd_pcm_hw_constraint_pow2(runtime, 0, snd_cx23885_pcm_open()
342 runtime->hw = snd_cx23885_digital_hw; snd_cx23885_pcm_open()
349 runtime->hw.period_bytes_min = bpl; snd_cx23885_pcm_open()
350 runtime->hw.period_bytes_max = bpl; snd_cx23885_pcm_open()
378 if (substream->runtime->dma_area) { snd_cx23885_hw_params()
380 substream->runtime->dma_area = NULL; snd_cx23885_hw_params()
416 substream->runtime->dma_area = chip->buf->vaddr; snd_cx23885_hw_params()
417 substream->runtime->dma_bytes = chip->dma_size; snd_cx23885_hw_params()
418 substream->runtime->dma_addr = 0; snd_cx23885_hw_params()
436 if (substream->runtime->dma_area) { snd_cx23885_hw_free()
438 substream->runtime->dma_area = NULL; snd_cx23885_hw_free()
488 struct snd_pcm_runtime *runtime = substream->runtime; snd_cx23885_pointer() local
493 return runtime->period_size * (count & (runtime->periods-1)); snd_cx23885_pointer()
502 void *pageptr = substream->runtime->dma_area + offset; snd_cx23885_page()
/linux-4.1.27/sound/soc/xtensa/
H A Dxtfpga-i2s.c80 struct snd_pcm_runtime *runtime,
134 struct xtfpga_i2s *i2s, struct snd_pcm_runtime *runtime, \
138 (void *)runtime->dma_area; \
146 if (++tx_ptr >= runtime->buffer_size) \
169 unsigned new_tx_ptr = i2s->tx_fn(i2s, tx_substream->runtime, xtfpga_pcm_push_tx()
373 struct snd_pcm_runtime *runtime = substream->runtime; xtfpga_pcm_open() local
379 runtime->private_data = p; xtfpga_pcm_open()
394 struct snd_pcm_runtime *runtime = substream->runtime; xtfpga_pcm_hw_params() local
395 struct xtfpga_i2s *i2s = runtime->private_data; xtfpga_pcm_hw_params()
433 struct snd_pcm_runtime *runtime = substream->runtime; xtfpga_pcm_trigger() local
434 struct xtfpga_i2s *i2s = runtime->private_data; xtfpga_pcm_trigger()
460 struct snd_pcm_runtime *runtime = substream->runtime; xtfpga_pcm_pointer() local
461 struct xtfpga_i2s *i2s = runtime->private_data; xtfpga_pcm_pointer()
464 return pos < runtime->buffer_size ? pos : 0; xtfpga_pcm_pointer()
/linux-4.1.27/sound/soc/qcom/
H A Dlpass-platform.c62 struct snd_pcm_runtime *runtime = substream->runtime; lpass_platform_pcmops_open() local
68 runtime->dma_bytes = lpass_platform_pcm_hardware.buffer_bytes_max; lpass_platform_pcmops_open()
70 ret = snd_pcm_hw_constraint_integer(runtime, lpass_platform_pcmops_open()
187 struct snd_pcm_runtime *runtime = substream->runtime; lpass_platform_pcmops_prepare() local
195 runtime->dma_addr); lpass_platform_pcmops_prepare()
326 return bytes_to_frames(substream->runtime, curr_addr - base_addr); lpass_platform_pcmops_pointer()
332 struct snd_pcm_runtime *runtime = substream->runtime; lpass_platform_pcmops_mmap() local
335 runtime->dma_area, runtime->dma_addr, lpass_platform_pcmops_mmap()
336 runtime->dma_bytes); lpass_platform_pcmops_mmap()
/linux-4.1.27/sound/ppc/
H A Dsnd_ps3.c461 substream->runtime->rate, snd_ps3_set_avsetting()
462 snd_pcm_format_width(substream->runtime->format)); snd_ps3_set_avsetting()
468 switch (substream->runtime->rate) { snd_ps3_set_avsetting()
483 substream->runtime->rate); snd_ps3_set_avsetting()
488 switch (snd_pcm_format_width(substream->runtime->format)) { snd_ps3_set_avsetting()
497 snd_pcm_format_width(substream->runtime->format)); snd_ps3_set_avsetting()
527 struct snd_pcm_runtime *runtime = substream->runtime; snd_ps3_pcm_open() local
532 /* to retrieve substream/runtime in interrupt handler */ snd_ps3_pcm_open()
535 runtime->hw = snd_ps3_pcm_hw; snd_ps3_pcm_open()
542 snd_pcm_hw_constraint_step(runtime, 0, SNDRV_PCM_HW_PARAM_BUFFER_BYTES, snd_ps3_pcm_open()
578 rate = substream->runtime->rate; snd_ps3_delay_to_bytes()
579 ret = snd_pcm_format_size(substream->runtime->format, snd_ps3_delay_to_bytes()
581 * substream->runtime->channels; snd_ps3_delay_to_bytes()
587 snd_pcm_format_size(substream->runtime->format, rate), snd_ps3_delay_to_bytes()
596 struct snd_pcm_runtime *runtime = substream->runtime; snd_ps3_pcm_prepare() local
617 card->dma_buffer_size = runtime->dma_bytes; snd_ps3_pcm_prepare()
622 runtime->dma_area; snd_ps3_pcm_prepare()
623 card->dma_start_bus_addr[SND_PS3_CH_L] = runtime->dma_addr; snd_ps3_pcm_prepare()
628 runtime->dma_area + (runtime->dma_bytes / 2); snd_ps3_pcm_prepare()
630 runtime->dma_addr + (runtime->dma_bytes / 2); snd_ps3_pcm_prepare()
706 ret = bytes_to_frames(substream->runtime, bytes * 2); snd_ps3_pcm_pointer()
H A Dpmac.c215 struct snd_pcm_runtime *runtime = subs->runtime; snd_pmac_pcm_prepare() local
224 rate_index = snd_pmac_rate_index(chip, rec, runtime->rate); snd_pmac_pcm_prepare()
231 astr->cur_formats = 1 << runtime->format; snd_pmac_pcm_prepare()
233 chip->format = runtime->format; snd_pmac_pcm_prepare()
252 offset = runtime->dma_addr; snd_pmac_pcm_prepare()
340 return bytes_to_frames(subs->runtime, count); snd_pmac_pcm_pointer()
588 struct snd_pcm_runtime *runtime = subs->runtime; snd_pmac_pcm_open() local
592 runtime->hw.rates = 0; snd_pmac_pcm_open()
595 runtime->hw.rates |= snd_pmac_pcm_open()
601 runtime->hw.rate_max = chip->freq_table[i]; snd_pmac_pcm_open()
607 runtime->hw.rate_min = chip->freq_table[i]; snd_pmac_pcm_open()
611 runtime->hw.formats = chip->formats_ok; snd_pmac_pcm_open()
614 runtime->hw.info |= SNDRV_PCM_INFO_HALF_DUPLEX; snd_pmac_pcm_open()
615 runtime->hw.info |= SNDRV_PCM_INFO_JOINT_DUPLEX; snd_pmac_pcm_open()
617 runtime->private_data = rec; snd_pmac_pcm_open()
621 snd_pcm_hw_rule_add(runtime, 0, SNDRV_PCM_HW_PARAM_RATE, snd_pmac_pcm_open()
623 snd_pcm_hw_rule_add(runtime, 0, SNDRV_PCM_HW_PARAM_FORMAT, snd_pmac_pcm_open()
627 runtime->hw.periods_max = rec->cmd.size - 1; snd_pmac_pcm_open()
630 snd_pcm_hw_constraint_integer(runtime, SNDRV_PCM_HW_PARAM_PERIODS); snd_pmac_pcm_open()
656 subs->runtime->hw = snd_pmac_playback; snd_pmac_playback_open()
664 subs->runtime->hw = snd_pmac_capture; snd_pmac_capture_open()
/linux-4.1.27/drivers/media/pci/saa7134/
H A Dsaa7134-alsa.c256 struct snd_pcm_runtime *runtime = substream->runtime; snd_card_saa7134_capture_trigger() local
257 snd_card_saa7134_pcm_t *pcm = runtime->private_data; snd_card_saa7134_capture_trigger()
520 struct snd_pcm_runtime *runtime = substream->runtime; snd_card_saa7134_capture_prepare() local
525 snd_card_saa7134_pcm_t *pcm = runtime->private_data; snd_card_saa7134_capture_prepare()
531 if (snd_pcm_format_width(runtime->format) == 8) snd_card_saa7134_capture_prepare()
536 if (snd_pcm_format_signed(runtime->format)) snd_card_saa7134_capture_prepare()
541 if (snd_pcm_format_big_endian(runtime->format)) snd_card_saa7134_capture_prepare()
548 if (1 == runtime->channels) snd_card_saa7134_capture_prepare()
550 if (2 == runtime->channels) snd_card_saa7134_capture_prepare()
564 if (1 == runtime->channels) snd_card_saa7134_capture_prepare()
566 if (2 == runtime->channels) snd_card_saa7134_capture_prepare()
576 runtime->format, runtime->channels, fmt, snd_card_saa7134_capture_prepare()
590 dev->dmasound.rate = runtime->rate; snd_card_saa7134_capture_prepare()
614 struct snd_pcm_runtime *runtime = substream->runtime; snd_card_saa7134_capture_pointer() local
615 snd_card_saa7134_pcm_t *pcm = runtime->private_data; snd_card_saa7134_capture_pointer()
625 return bytes_to_frames(runtime, dev->dmasound.read_offset); snd_card_saa7134_capture_pointer()
665 static void snd_card_saa7134_runtime_free(struct snd_pcm_runtime *runtime) snd_card_saa7134_runtime_free() argument
667 snd_card_saa7134_pcm_t *pcm = runtime->private_data; snd_card_saa7134_runtime_free()
707 if (substream->runtime->dma_area) { snd_card_saa7134_hw_params()
711 substream->runtime->dma_area = NULL; snd_card_saa7134_hw_params()
745 /* I should be able to use runtime->dma_addr in the control snd_card_saa7134_hw_params()
749 substream->runtime->dma_area = dev->dmasound.vaddr; snd_card_saa7134_hw_params()
750 substream->runtime->dma_bytes = dev->dmasound.bufsize; snd_card_saa7134_hw_params()
751 substream->runtime->dma_addr = 0; snd_card_saa7134_hw_params()
774 if (substream->runtime->dma_area) { snd_card_saa7134_hw_free()
778 substream->runtime->dma_area = NULL; snd_card_saa7134_hw_free()
817 struct snd_pcm_runtime *runtime = substream->runtime; snd_card_saa7134_capture_open() local
850 runtime->private_data = pcm; snd_card_saa7134_capture_open()
851 runtime->private_free = snd_card_saa7134_runtime_free; snd_card_saa7134_capture_open()
852 runtime->hw = snd_card_saa7134_capture; snd_card_saa7134_capture_open()
860 err = snd_pcm_hw_constraint_integer(runtime, snd_card_saa7134_capture_open()
865 err = snd_pcm_hw_constraint_step(runtime, 0, snd_card_saa7134_capture_open()
880 void *pageptr = substream->runtime->dma_area + offset; snd_card_saa7134_page()
/linux-4.1.27/arch/arm/kvm/
H A Dinit.S35 * - We jump in HYP with four parameters: boot HYP pgd, runtime HYP pgd,
36 * runtime stack, runtime vectors
40 * - Now switch to the runtime pgd (same VA, and still the same physical
50 * - Phase 2: r0 = ToS, r1 = vectors, r2,r3 contain the runtime PGD.
51 * Switches to the runtime PGD, set stack and vectors.
/linux-4.1.27/sound/isa/ad1816a/
H A Dad1816a_lib.c235 struct snd_pcm_runtime *runtime = substream->runtime; snd_ad1816a_playback_prepare() local
244 snd_dma_program(chip->dma1, runtime->dma_addr, size, snd_ad1816a_playback_prepare()
247 rate = runtime->rate; snd_ad1816a_playback_prepare()
253 snd_ad1816a_get_format(chip, runtime->format, snd_ad1816a_playback_prepare()
254 runtime->channels)); snd_ad1816a_playback_prepare()
267 struct snd_pcm_runtime *runtime = substream->runtime; snd_ad1816a_capture_prepare() local
276 snd_dma_program(chip->dma2, runtime->dma_addr, size, snd_ad1816a_capture_prepare()
279 rate = runtime->rate; snd_ad1816a_capture_prepare()
285 snd_ad1816a_get_format(chip, runtime->format, snd_ad1816a_capture_prepare()
286 runtime->channels)); snd_ad1816a_capture_prepare()
303 return bytes_to_frames(substream->runtime, ptr); snd_ad1816a_playback_pointer()
313 return bytes_to_frames(substream->runtime, ptr); snd_ad1816a_capture_pointer()
448 struct snd_pcm_runtime *runtime = substream->runtime; snd_ad1816a_playback_open() local
453 runtime->hw = snd_ad1816a_playback; snd_ad1816a_playback_open()
454 snd_pcm_limit_isa_dma_size(chip->dma1, &runtime->hw.buffer_bytes_max); snd_ad1816a_playback_open()
455 snd_pcm_limit_isa_dma_size(chip->dma1, &runtime->hw.period_bytes_max); snd_ad1816a_playback_open()
463 struct snd_pcm_runtime *runtime = substream->runtime; snd_ad1816a_capture_open() local
468 runtime->hw = snd_ad1816a_capture; snd_ad1816a_capture_open()
469 snd_pcm_limit_isa_dma_size(chip->dma2, &runtime->hw.buffer_bytes_max); snd_ad1816a_capture_open()
470 snd_pcm_limit_isa_dma_size(chip->dma2, &runtime->hw.period_bytes_max); snd_ad1816a_capture_open()
/linux-4.1.27/tools/perf/bench/
H A Dfutex-hash.c31 struct timeval start, end, runtime; variable in typeref:struct:
46 OPT_UINTEGER('r', "runtime", &nsecs, "Specify runtime (in seconds)"),
96 timersub(&end, &start, &runtime); toggle_done()
106 (int) runtime.tv_sec); print_summary()
194 unsigned long t = worker[i].ops/runtime.tv_sec; bench_futex_hash()
H A Dfutex-requeue.c151 struct timeval start, end, runtime; bench_futex_requeue() local
177 timersub(&end, &start, &runtime); bench_futex_requeue()
180 update_stats(&requeuetime_stats, runtime.tv_usec); bench_futex_requeue()
184 j + 1, nrequeued, nthreads, runtime.tv_usec/1e3); bench_futex_requeue()
H A Dfutex-wake.c151 struct timeval start, end, runtime; bench_futex_wake() local
170 timersub(&end, &start, &runtime); bench_futex_wake()
173 update_stats(&waketime_stats, runtime.tv_usec); bench_futex_wake()
177 j + 1, nwoken, nthreads, runtime.tv_usec/1e3); bench_futex_wake()
/linux-4.1.27/arch/blackfin/include/asm/
H A Dl1layout.h26 runtime. */
/linux-4.1.27/sound/soc/pxa/
H A Dpxa2xx-pcm.c30 struct snd_pcm_runtime *runtime = substream->runtime; pxa2xx_pcm_hw_params() local
31 struct pxa2xx_runtime_data *prtd = runtime->private_data; pxa2xx_pcm_hw_params()
67 struct pxa2xx_runtime_data *prtd = substream->runtime->private_data; pxa2xx_pcm_hw_free()
H A Dmmp-pcm.c125 struct snd_pcm_runtime *runtime = substream->runtime; mmp_pcm_mmap() local
130 __phys_to_pfn(runtime->dma_addr) + off, mmp_pcm_mmap()
/linux-4.1.27/drivers/base/power/
H A Druntime.c2 * drivers/base/power/runtime.c - Helper functions for device runtime PM
56 * (as used by programs such as PowerTOP to show the effectiveness of runtime
174 * device driver for solving the deadlock problem during runtime
177 * If memory allocation with GFP_KERNEL is called inside runtime
261 * __rpm_callback - Run a given runtime PM callback for a given device.
290 * Check if the device's runtime PM status allows it to be suspended. If
359 * rpm_callback - Run a given runtime PM callback for a given device.
394 * rpm_suspend - Carry out runtime suspend of given device.
398 * Check if the device's runtime PM status allows it to be suspended.
578 * rpm_resume - Carry out runtime resume of given device.
582 * Check if the device's runtime PM status allows it to be resumed. Cancel
712 * We can resume if the parent's runtime PM is disabled or it
767 * pm_runtime_work - Universal runtime PM work function.
771 * is to be done and execute the appropriate runtime PM function.
870 * __pm_runtime_idle - Entry point for runtime idle operations.
902 * __pm_runtime_suspend - Entry point for runtime put/suspend operations.
934 * __pm_runtime_resume - Entry point for runtime resume operations.
963 * __pm_runtime_set_status - Set runtime PM status of a device.
965 * @status: New runtime PM status of the device.
967 * If runtime PM of the device is disabled or its power.runtime_error field is
1013 * not active, has runtime PM enabled and the __pm_runtime_set_status()
1047 * runtime PM operations involving the device in progress to complete.
1095 * from pm_wq and wait for all runtime PM operations involving the device in
1125 * __pm_runtime_disable - Disable runtime PM of a device.
1130 * cancel all pending runtime PM requests for the device and wait for all
1132 * suspended after its runtime PM has been disabled.
1136 * function will wake up the device before disabling its runtime PM.
1149 * means there probably is some I/O to process and disabling runtime PM __pm_runtime_disable()
1174 * pm_runtime_enable - Enable runtime PM of a device.
1193 * pm_runtime_forbid - Block runtime PM of a device.
1216 * pm_runtime_allow - Unblock runtime PM of a device.
1237 * pm_runtime_no_callbacks - Ignore runtime PM callbacks for a device.
1241 * device is power-managed through its parent and has no runtime PM
1242 * callbacks of its own. The runtime sysfs attributes will be removed.
1262 * the parent from runtime suspending -- otherwise an irq-safe child might have
1281 * Prevent runtime suspend if the new delay is negative and use_autosuspend is
1290 /* Should runtime suspend be prevented now? */ update_autosuspend()
1318 * and the power.use_autosuspend flag is set, prevent runtime suspends. If it
1319 * changes the other way, allow runtime suspends.
1339 * Set the device's power.use_autosuspend flag, and allow or prevent runtime
1356 * pm_runtime_init - Initialize runtime PM fields in given device object.
1405 * Disable runtime PM so we safely can check the device's runtime PM status and
1407 * suspend state. Keep runtime PM disabled to preserve the state unless we
1447 * those actions and brings the device into full power. We update the runtime PM
1448 * status and re-enables runtime PM.
/linux-4.1.27/sound/pci/hda/
H A Dhda_controller.c279 substream->runtime->rate); azx_adjust_codec_delay()
356 struct snd_pcm_runtime *runtime = substream->runtime; azx_setup_periods() local
358 pos_adj = (pos_adj * runtime->rate + 47999) / 48000; azx_setup_periods()
364 pos_adj = frames_to_bytes(runtime, pos_adj); azx_setup_periods()
479 struct snd_pcm_runtime *runtime = substream->runtime; azx_pcm_prepare() local
494 runtime->rate, azx_pcm_prepare()
495 runtime->channels, azx_pcm_prepare()
496 runtime->format, azx_pcm_prepare()
502 runtime->rate, runtime->channels, runtime->format); azx_pcm_prepare()
516 runtime->no_period_wakeup != azx_dev->no_period_wakeup) { azx_pcm_prepare()
520 azx_dev->no_period_wakeup = runtime->no_period_wakeup; azx_pcm_prepare()
530 if (runtime->period_size > 64) azx_pcm_prepare()
531 azx_dev->delay_negative_threshold = -frames_to_bytes(runtime, 64); azx_pcm_prepare()
536 azx_dev->period_wallclk = (((runtime->period_size * 24000) / azx_pcm_prepare()
537 runtime->rate) * 1000); azx_pcm_prepare()
667 snd_pcm_gettime(substream->runtime, &substream->runtime->trigger_tstamp);
668 substream->runtime->trigger_tstamp_latched = true;
716 if (substream->runtime) { azx_get_position()
725 substream->runtime->delay = delay; azx_get_position()
738 return bytes_to_frames(substream->runtime, azx_pcm_pointer()
750 if ((substream->runtime->hw.info & SNDRV_PCM_INFO_HAS_LINK_ATIME) && azx_get_time_info()
753 snd_pcm_gettime(substream->runtime, system_ts); azx_get_time_info()
804 struct snd_pcm_runtime *runtime = substream->runtime; azx_pcm_open() local
816 runtime->hw = azx_pcm_hw; azx_pcm_open()
817 runtime->hw.channels_min = hinfo->channels_min; azx_pcm_open()
818 runtime->hw.channels_max = hinfo->channels_max; azx_pcm_open()
819 runtime->hw.formats = hinfo->formats; azx_pcm_open()
820 runtime->hw.rates = hinfo->rates; azx_pcm_open()
821 snd_pcm_limit_hw_rates(runtime); azx_pcm_open()
822 snd_pcm_hw_constraint_integer(runtime, SNDRV_PCM_HW_PARAM_PERIODS); azx_pcm_open()
825 snd_pcm_hw_constraint_minmax(runtime, SNDRV_PCM_HW_PARAM_BUFFER_TIME, azx_pcm_open()
844 snd_pcm_hw_constraint_step(runtime, 0, SNDRV_PCM_HW_PARAM_BUFFER_BYTES, azx_pcm_open()
846 snd_pcm_hw_constraint_step(runtime, 0, SNDRV_PCM_HW_PARAM_PERIOD_BYTES, azx_pcm_open()
857 snd_pcm_limit_hw_rates(runtime); azx_pcm_open()
859 if (snd_BUG_ON(!runtime->hw.channels_min) || azx_pcm_open()
860 snd_BUG_ON(!runtime->hw.channels_max) || azx_pcm_open()
861 snd_BUG_ON(!runtime->hw.formats) || azx_pcm_open()
862 snd_BUG_ON(!runtime->hw.rates)) { azx_pcm_open()
873 runtime->hw.info &= ~SNDRV_PCM_INFO_HAS_WALL_CLOCK; /* legacy */ azx_pcm_open()
874 runtime->hw.info &= ~SNDRV_PCM_INFO_HAS_LINK_ATIME; azx_pcm_open()
882 runtime->private_data = azx_dev; azx_pcm_open()
/linux-4.1.27/sound/soc/sh/rcar/
H A Dsrc.c136 struct snd_pcm_runtime *runtime = rsnd_io_to_runtime(io); rsnd_src_ssiu_start() local
181 mask <<= runtime->channels * 4; rsnd_src_ssiu_start()
184 switch (runtime->sample_bits) { rsnd_src_ssiu_start()
242 struct snd_pcm_runtime *runtime = rsnd_io_to_runtime(io); rsnd_src_convert_rate() local
245 if (!runtime) rsnd_src_convert_rate()
257 convert_rate = runtime->rate; rsnd_src_convert_rate()
264 struct snd_pcm_runtime *runtime) rsnd_src_get_ssi_rate()
275 * otherwise, return runtime->rate as usual rsnd_src_get_ssi_rate()
281 rate = runtime->rate; rsnd_src_get_ssi_rate()
289 struct snd_pcm_runtime *runtime = rsnd_io_to_runtime(io); rsnd_src_set_convert_rate() local
295 fsrate = 0x0400000 / convert_rate * runtime->rate; rsnd_src_set_convert_rate()
456 struct snd_pcm_runtime *runtime = rsnd_io_to_runtime(io); rsnd_src_set_convert_timing_gen1() local
481 runtime->rate, rsnd_src_set_convert_timing_gen1()
704 struct snd_pcm_runtime *runtime = rsnd_io_to_runtime(io); rsnd_src_set_convert_rate_gen2() local
714 else if (convert_rate > runtime->rate) rsnd_src_set_convert_rate_gen2()
715 ratio = 100 * convert_rate / runtime->rate; rsnd_src_set_convert_rate_gen2()
717 ratio = 100 * runtime->rate / convert_rate; rsnd_src_set_convert_rate_gen2()
763 struct snd_pcm_runtime *runtime = rsnd_io_to_runtime(io); rsnd_src_set_convert_timing_gen2() local
770 runtime->rate, rsnd_src_set_convert_timing_gen2()
858 struct snd_pcm_runtime *runtime = rsnd_io_to_runtime(io); rsnd_src_reconvert_update() local
863 if (!runtime) rsnd_src_reconvert_update()
867 convert_rate = runtime->rate; rsnd_src_reconvert_update()
869 fsrate = 0x0400000 / convert_rate * runtime->rate; rsnd_src_reconvert_update()
262 rsnd_src_get_ssi_rate(struct rsnd_priv *priv, struct rsnd_dai_stream *io, struct snd_pcm_runtime *runtime) rsnd_src_get_ssi_rate() argument
H A Dcore.c180 struct snd_pcm_runtime *runtime = rsnd_io_to_runtime(io); rsnd_get_adinr() local
182 u32 adinr = runtime->channels; rsnd_get_adinr()
184 switch (runtime->sample_bits) { rsnd_get_adinr()
288 struct snd_pcm_runtime *runtime = substream->runtime; rsnd_dai_pointer_offset() local
291 pos %= (runtime->periods * io->byte_per_period); rsnd_dai_pointer_offset()
302 struct snd_pcm_runtime *runtime = substream->runtime; rsnd_dai_pointer_update() local
307 if (io->period_pos >= runtime->periods) { rsnd_dai_pointer_update()
320 struct snd_pcm_runtime *runtime = substream->runtime; rsnd_dai_stream_init() local
325 io->byte_per_period = runtime->period_size * rsnd_dai_stream_init()
326 runtime->channels * rsnd_dai_stream_init()
327 samples_to_bytes(runtime, 1); rsnd_dai_stream_init()
717 struct snd_pcm_runtime *runtime = substream->runtime; rsnd_pcm_open() local
722 ret = snd_pcm_hw_constraint_integer(runtime, rsnd_pcm_open()
746 struct snd_pcm_runtime *runtime = substream->runtime; rsnd_pointer() local
751 return bytes_to_frames(runtime, io->byte_pos); rsnd_pointer()
/linux-4.1.27/sound/pci/nm256/
H A Dnm256.c432 struct snd_pcm_runtime *runtime = substream->runtime; snd_nm256_set_format() local
433 int rate_index = snd_nm256_fixed_rate(runtime->rate); snd_nm256_set_format()
437 if (snd_pcm_format_width(runtime->format) == 16) { snd_nm256_set_format()
441 if (runtime->channels > 1) { snd_nm256_set_format()
446 runtime->rate = samplerates[rate_index]; snd_nm256_set_format()
565 struct nm256_stream *s = substream->runtime->private_data; snd_nm256_playback_trigger()
603 struct nm256_stream *s = substream->runtime->private_data; snd_nm256_capture_trigger()
640 struct snd_pcm_runtime *runtime = substream->runtime; snd_nm256_pcm_prepare() local
641 struct nm256_stream *s = runtime->private_data; snd_nm256_pcm_prepare()
645 s->dma_size = frames_to_bytes(runtime, substream->runtime->buffer_size); snd_nm256_pcm_prepare()
646 s->period_size = frames_to_bytes(runtime, substream->runtime->period_size); snd_nm256_pcm_prepare()
647 s->periods = substream->runtime->periods; snd_nm256_pcm_prepare()
666 struct nm256_stream *s = substream->runtime->private_data; snd_nm256_playback_pointer()
673 return bytes_to_frames(substream->runtime, curp); snd_nm256_playback_pointer()
680 struct nm256_stream *s = substream->runtime->private_data; snd_nm256_capture_pointer()
687 return bytes_to_frames(substream->runtime, curp); snd_nm256_capture_pointer()
702 struct snd_pcm_runtime *runtime = substream->runtime; snd_nm256_playback_silence() local
703 struct nm256_stream *s = runtime->private_data; snd_nm256_playback_silence()
704 count = frames_to_bytes(runtime, count); snd_nm256_playback_silence()
705 pos = frames_to_bytes(runtime, pos); snd_nm256_playback_silence()
717 struct snd_pcm_runtime *runtime = substream->runtime; snd_nm256_playback_copy() local
718 struct nm256_stream *s = runtime->private_data; snd_nm256_playback_copy()
719 count = frames_to_bytes(runtime, count); snd_nm256_playback_copy()
720 pos = frames_to_bytes(runtime, pos); snd_nm256_playback_copy()
736 struct snd_pcm_runtime *runtime = substream->runtime; snd_nm256_capture_copy() local
737 struct nm256_stream *s = runtime->private_data; snd_nm256_capture_copy()
738 count = frames_to_bytes(runtime, count); snd_nm256_capture_copy()
739 pos = frames_to_bytes(runtime, pos); snd_nm256_capture_copy()
829 substream->runtime->dma_bytes = params_buffer_bytes(hw_params); snd_nm256_pcm_hw_params()
840 struct snd_pcm_runtime *runtime = substream->runtime; snd_nm256_setup_stream() local
843 runtime->hw = *hw_ptr; snd_nm256_setup_stream()
844 runtime->hw.buffer_bytes_max = s->bufsize; snd_nm256_setup_stream()
845 runtime->hw.period_bytes_max = s->bufsize / 2; snd_nm256_setup_stream()
846 runtime->dma_area = (void __force *) s->bufptr; snd_nm256_setup_stream()
847 runtime->dma_addr = s->bufptr_addr; snd_nm256_setup_stream()
848 runtime->dma_bytes = s->bufsize; snd_nm256_setup_stream()
849 runtime->private_data = s; snd_nm256_setup_stream()
852 snd_pcm_hw_constraint_list(runtime, 0, SNDRV_PCM_HW_PARAM_RATE, snd_nm256_setup_stream()
/linux-4.1.27/sound/pci/aw2/
H A Daw2-alsa.c397 struct snd_pcm_runtime *runtime = substream->runtime; snd_aw2_pcm_playback_open() local
400 runtime->hw = snd_aw2_playback_hw; snd_aw2_pcm_playback_open()
413 struct snd_pcm_runtime *runtime = substream->runtime; snd_aw2_pcm_capture_open() local
416 runtime->hw = snd_aw2_capture_hw; snd_aw2_pcm_capture_open()
446 struct snd_pcm_runtime *runtime = substream->runtime; snd_aw2_pcm_prepare_playback() local
456 runtime->dma_addr, period_size, snd_aw2_pcm_prepare_playback()
475 struct snd_pcm_runtime *runtime = substream->runtime; snd_aw2_pcm_prepare_capture() local
485 runtime->dma_addr, period_size, snd_aw2_pcm_prepare_capture()
560 struct snd_pcm_runtime *runtime = substream->runtime; snd_aw2_pcm_pointer_playback() local
564 runtime->dma_area, snd_aw2_pcm_pointer_playback()
565 runtime->buffer_size); snd_aw2_pcm_pointer_playback()
567 return bytes_to_frames(substream->runtime, current_ptr); snd_aw2_pcm_pointer_playback()
579 struct snd_pcm_runtime *runtime = substream->runtime; snd_aw2_pcm_pointer_capture() local
583 runtime->dma_area, snd_aw2_pcm_pointer_capture()
584 runtime->buffer_size); snd_aw2_pcm_pointer_capture()
586 return bytes_to_frames(substream->runtime, current_ptr); snd_aw2_pcm_pointer_capture()
/linux-4.1.27/drivers/media/pci/cx88/
H A Dcx88-alsa.c424 struct snd_pcm_runtime *runtime = substream->runtime; snd_cx88_pcm_open() local
433 err = snd_pcm_hw_constraint_pow2(runtime, 0, SNDRV_PCM_HW_PARAM_PERIODS); snd_cx88_pcm_open()
439 runtime->hw = snd_cx88_digital_hw; snd_cx88_pcm_open()
444 runtime->hw.period_bytes_min = bpl; snd_cx88_pcm_open()
445 runtime->hw.period_bytes_max = bpl; snd_cx88_pcm_open()
473 if (substream->runtime->dma_area) { snd_cx88_hw_params()
475 substream->runtime->dma_area = NULL; snd_cx88_hw_params()
510 substream->runtime->dma_area = chip->buf->vaddr; snd_cx88_hw_params()
511 substream->runtime->dma_bytes = chip->dma_size; snd_cx88_hw_params()
512 substream->runtime->dma_addr = 0; snd_cx88_hw_params()
528 if (substream->runtime->dma_area) { snd_cx88_hw_free()
530 substream->runtime->dma_area = NULL; snd_cx88_hw_free()
578 struct snd_pcm_runtime *runtime = substream->runtime; snd_cx88_pointer() local
584 // count, new, count & (runtime->periods-1), snd_cx88_pointer()
585 // runtime->period_size * (count & (runtime->periods-1))); snd_cx88_pointer()
586 return runtime->period_size * (count & (runtime->periods-1)); snd_cx88_pointer()
595 void *pageptr = substream->runtime->dma_area + offset; snd_cx88_page()
/linux-4.1.27/sound/pci/lola/
H A Dlola_pcm.c228 struct snd_pcm_runtime *runtime = substream->runtime; lola_pcm_open() local
238 runtime->hw = lola_pcm_hw; lola_pcm_open()
239 runtime->hw.channels_max = pcm->num_streams - str->index; lola_pcm_open()
242 runtime->hw.rate_min = chip->sample_rate; lola_pcm_open()
243 runtime->hw.rate_max = chip->sample_rate; lola_pcm_open()
245 runtime->hw.rate_min = chip->sample_rate_min; lola_pcm_open()
246 runtime->hw.rate_max = chip->sample_rate_max; lola_pcm_open()
249 snd_pcm_hw_constraint_integer(runtime, SNDRV_PCM_HW_PARAM_PERIODS); lola_pcm_open()
251 snd_pcm_hw_constraint_step(runtime, 0, SNDRV_PCM_HW_PARAM_BUFFER_SIZE, lola_pcm_open()
253 snd_pcm_hw_constraint_step(runtime, 0, SNDRV_PCM_HW_PARAM_PERIOD_SIZE, lola_pcm_open()
385 switch (substream->runtime->format) { lola_get_format_verb()
401 verb |= substream->runtime->channels; lola_get_format_verb()
470 struct snd_pcm_runtime *runtime = substream->runtime; lola_pcm_prepare() local
477 if (str->index + runtime->channels > pcm->num_streams) { lola_pcm_prepare()
481 for (i = 1; i < runtime->channels; i++) { lola_pcm_prepare()
499 err = lola_set_sample_rate(chip, runtime->rate); lola_pcm_prepare()
502 chip->sample_rate = runtime->rate; /* sample rate gets locked */ lola_pcm_prepare()
504 err = lola_set_stream_config(chip, str, runtime->channels); lola_pcm_prepare()
572 return bytes_to_frames(substream->runtime, pos); lola_pcm_pointer()
/linux-4.1.27/sound/soc/
H A Dsoc-pcm.c38 * snd_soc_runtime_activate() - Increment active count for PCM runtime components
39 * @rtd: ASoC PCM runtime that is activated
43 * runtime. Should typically be called when a stream is opened.
73 * snd_soc_runtime_deactivate() - Decrement active count for PCM runtime components
74 * @rtd: ASoC PCM runtime that is deactivated
78 * runtime. Should typically be called when a stream is closed.
109 * @rtd: The ASoC PCM runtime that should be checked.
112 * specific PCM runtime. Returns true if the delay is 0, if it the DAI link has
131 * snd_soc_set_runtime_hwparams - set the runtime hardware parameters
135 * Sets the substream runtime hardware parameters.
140 struct snd_pcm_runtime *runtime = substream->runtime; snd_soc_set_runtime_hwparams() local
141 runtime->hw.info = hw->info; snd_soc_set_runtime_hwparams()
142 runtime->hw.formats = hw->formats; snd_soc_set_runtime_hwparams()
143 runtime->hw.period_bytes_min = hw->period_bytes_min; snd_soc_set_runtime_hwparams()
144 runtime->hw.period_bytes_max = hw->period_bytes_max; snd_soc_set_runtime_hwparams()
145 runtime->hw.periods_min = hw->periods_min; snd_soc_set_runtime_hwparams()
146 runtime->hw.periods_max = hw->periods_max; snd_soc_set_runtime_hwparams()
147 runtime->hw.buffer_bytes_max = hw->buffer_bytes_max; snd_soc_set_runtime_hwparams()
148 runtime->hw.fifo_size = hw->fifo_size; snd_soc_set_runtime_hwparams()
185 ret = snd_pcm_hw_constraint_minmax(substream->runtime, soc_pcm_apply_symmetry()
201 ret = snd_pcm_hw_constraint_minmax(substream->runtime, soc_pcm_apply_symmetry()
218 ret = snd_pcm_hw_constraint_minmax(substream->runtime, soc_pcm_apply_symmetry()
312 ret = snd_pcm_hw_constraint_msbits(substream->runtime, 0, 0, bits); soc_pcm_set_msb()
354 struct snd_pcm_runtime *runtime = substream->runtime; soc_pcm_init_runtime_hw() local
355 struct snd_pcm_hardware *hw = &runtime->hw; soc_pcm_init_runtime_hw()
405 snd_pcm_limit_hw_rates(runtime); soc_pcm_init_runtime_hw()
414 * Called by ALSA when a PCM substream is opened, the runtime->hw record is
421 struct snd_pcm_runtime *runtime = substream->runtime; soc_pcm_open() local
496 runtime->hw.info |= SNDRV_PCM_INFO_JOINT_DUPLEX; soc_pcm_open()
499 if (!runtime->hw.rates) { soc_pcm_open()
504 if (!runtime->hw.formats) { soc_pcm_open()
509 if (!runtime->hw.channels_min || !runtime->hw.channels_max || soc_pcm_open()
510 runtime->hw.channels_min > runtime->hw.channels_max) { soc_pcm_open()
536 pr_debug("ASoC: rate mask 0x%x\n", runtime->hw.rates); soc_pcm_open()
537 pr_debug("ASoC: min ch %d max ch %d\n", runtime->hw.channels_min, soc_pcm_open()
538 runtime->hw.channels_max); soc_pcm_open()
539 pr_debug("ASoC: min rate %d max rate %d\n", runtime->hw.rate_min, soc_pcm_open()
540 runtime->hw.rate_max); soc_pcm_open()
696 * it can refer to the runtime info.
1031 * the runtime->delay will be updated accordingly.
1039 struct snd_pcm_runtime *runtime = substream->runtime; soc_pcm_pointer() local
1067 runtime->delay = delay; soc_pcm_pointer()
1090 be->dpcm[stream].runtime = fe->dpcm[stream].runtime; dpcm_be_connect()
1130 be_substream->runtime = fe_substream->runtime; dpcm_be_reparent()
1328 if (!fe->dpcm[stream].runtime && !fe->fe_compr) dpcm_add_paths()
1395 be_substream->runtime = NULL; dpcm_be_dai_startup_unwind()
1438 be_substream->runtime = be->dpcm[stream].runtime; dpcm_be_dai_startup()
1480 be_substream->runtime = NULL; dpcm_be_dai_startup()
1487 static void dpcm_init_runtime_hw(struct snd_pcm_runtime *runtime, dpcm_init_runtime_hw() argument
1490 runtime->hw.rate_min = stream->rate_min; dpcm_init_runtime_hw()
1491 runtime->hw.rate_max = stream->rate_max; dpcm_init_runtime_hw()
1492 runtime->hw.channels_min = stream->channels_min; dpcm_init_runtime_hw()
1493 runtime->hw.channels_max = stream->channels_max; dpcm_init_runtime_hw()
1494 if (runtime->hw.formats) dpcm_init_runtime_hw()
1495 runtime->hw.formats &= stream->formats; dpcm_init_runtime_hw()
1497 runtime->hw.formats = stream->formats; dpcm_init_runtime_hw()
1498 runtime->hw.rates = stream->rates; dpcm_init_runtime_hw()
1503 struct snd_pcm_runtime *runtime = substream->runtime; dpcm_set_fe_runtime() local
1509 dpcm_init_runtime_hw(runtime, &cpu_dai_drv->playback); dpcm_set_fe_runtime()
1511 dpcm_init_runtime_hw(runtime, &cpu_dai_drv->capture); dpcm_set_fe_runtime()
1540 struct snd_pcm_runtime *runtime = fe_substream->runtime; dpcm_fe_dai_startup() local
1563 snd_pcm_limit_hw_rates(runtime); dpcm_fe_dai_startup()
1606 be_substream->runtime = NULL; dpcm_be_dai_shutdown()
2115 dev_dbg(fe->dev, "ASoC: runtime %s close on FE %s\n", dpcm_run_update_shutdown()
2157 dev_dbg(fe->dev, "ASoC: runtime %s open on FE %s\n", dpcm_run_update_startup()
2281 dev_dbg(fe->dev, "ASoC: DPCM runtime update for FE %s\n", soc_dpcm_runtime_update()
2399 fe->dpcm[stream].runtime = fe_substream->runtime; dpcm_fe_dai_open()
2420 fe->dpcm[stream].runtime = NULL; dpcm_fe_dai_open()
2444 fe->dpcm[stream].runtime = NULL; dpcm_fe_dai_close()
2610 /* get the BE runtime state */
2618 /* set the BE runtime state */ snd_soc_dpcm_be_set_state()
/linux-4.1.27/arch/arm/mach-ux500/
H A Dpm_domains.c24 * register context save/restore from their respective runtime PM pd_power_off()
36 * register context save/restore from their respective runtime PM pd_power_on()
/linux-4.1.27/sound/pci/cs46xx/
H A Dcs46xx_lib.c881 struct snd_pcm_runtime *runtime = substream->runtime; snd_cs46xx_pb_trans_copy() local
882 struct snd_cs46xx_pcm * cpcm = runtime->private_data; snd_cs46xx_pb_trans_copy()
883 memcpy(cpcm->hw_buf.area + rec->hw_data, runtime->dma_area + rec->sw_data, bytes); snd_cs46xx_pb_trans_copy()
888 struct snd_pcm_runtime *runtime = substream->runtime; snd_cs46xx_playback_transfer() local
889 struct snd_cs46xx_pcm * cpcm = runtime->private_data; snd_cs46xx_playback_transfer()
898 struct snd_pcm_runtime *runtime = substream->runtime; snd_cs46xx_cp_trans_copy() local
899 memcpy(runtime->dma_area + rec->sw_data, snd_cs46xx_cp_trans_copy()
914 struct snd_cs46xx_pcm *cpcm = substream->runtime->private_data; snd_cs46xx_playback_direct_pointer()
932 struct snd_cs46xx_pcm *cpcm = substream->runtime->private_data; snd_cs46xx_playback_indirect_pointer()
963 /*struct snd_pcm_runtime *runtime = substream->runtime;*/ snd_cs46xx_playback_trigger()
967 struct snd_cs46xx_pcm *cpcm = substream->runtime->private_data; snd_cs46xx_playback_trigger()
983 if (substream->runtime->periods != CS46XX_FRAGS) snd_cs46xx_playback_trigger()
987 if (substream->runtime->periods != CS46XX_FRAGS) snd_cs46xx_playback_trigger()
1095 struct snd_pcm_runtime *runtime = substream->runtime; snd_cs46xx_playback_hw_params() local
1103 cpcm = runtime->private_data; snd_cs46xx_playback_hw_params()
1135 if (runtime->dma_area != cpcm->hw_buf.area) snd_cs46xx_playback_hw_params()
1137 runtime->dma_area = cpcm->hw_buf.area; snd_cs46xx_playback_hw_params()
1138 runtime->dma_addr = cpcm->hw_buf.addr; snd_cs46xx_playback_hw_params()
1139 runtime->dma_bytes = cpcm->hw_buf.bytes; snd_cs46xx_playback_hw_params()
1159 if (runtime->dma_area == cpcm->hw_buf.area) { snd_cs46xx_playback_hw_params()
1160 runtime->dma_area = NULL; snd_cs46xx_playback_hw_params()
1161 runtime->dma_addr = 0; snd_cs46xx_playback_hw_params()
1162 runtime->dma_bytes = 0; snd_cs46xx_playback_hw_params()
1199 struct snd_pcm_runtime *runtime = substream->runtime; snd_cs46xx_playback_hw_free() local
1202 cpcm = runtime->private_data; snd_cs46xx_playback_hw_free()
1208 if (runtime->dma_area != cpcm->hw_buf.area) snd_cs46xx_playback_hw_free()
1211 runtime->dma_area = NULL; snd_cs46xx_playback_hw_free()
1212 runtime->dma_addr = 0; snd_cs46xx_playback_hw_free()
1213 runtime->dma_bytes = 0; snd_cs46xx_playback_hw_free()
1223 struct snd_pcm_runtime *runtime = substream->runtime; snd_cs46xx_playback_prepare() local
1226 cpcm = runtime->private_data; snd_cs46xx_playback_prepare()
1242 if (runtime->channels == 1) { snd_cs46xx_playback_prepare()
1247 if (snd_pcm_format_width(runtime->format) == 8) { snd_cs46xx_playback_prepare()
1252 if (snd_pcm_format_unsigned(runtime->format)) snd_cs46xx_playback_prepare()
1256 if (snd_pcm_format_width(runtime->format) != 8) { snd_cs46xx_playback_prepare()
1258 if (snd_pcm_format_big_endian(runtime->format)) snd_cs46xx_playback_prepare()
1264 cpcm->pcm_rec.hw_buffer_size = runtime->period_size * CS46XX_FRAGS << cpcm->shift; snd_cs46xx_playback_prepare()
1283 snd_cs46xx_set_play_sample_rate(chip, runtime->rate); snd_cs46xx_playback_prepare()
1293 struct snd_pcm_runtime *runtime = substream->runtime; snd_cs46xx_capture_hw_params() local
1299 if (runtime->periods == CS46XX_FRAGS) { snd_cs46xx_capture_hw_params()
1300 if (runtime->dma_area != chip->capt.hw_buf.area) snd_cs46xx_capture_hw_params()
1302 runtime->dma_area = chip->capt.hw_buf.area; snd_cs46xx_capture_hw_params()
1303 runtime->dma_addr = chip->capt.hw_buf.addr; snd_cs46xx_capture_hw_params()
1304 runtime->dma_bytes = chip->capt.hw_buf.bytes; snd_cs46xx_capture_hw_params()
1307 if (runtime->dma_area == chip->capt.hw_buf.area) { snd_cs46xx_capture_hw_params()
1308 runtime->dma_area = NULL; snd_cs46xx_capture_hw_params()
1309 runtime->dma_addr = 0; snd_cs46xx_capture_hw_params()
1310 runtime->dma_bytes = 0; snd_cs46xx_capture_hw_params()
1323 struct snd_pcm_runtime *runtime = substream->runtime; snd_cs46xx_capture_hw_free() local
1325 if (runtime->dma_area != chip->capt.hw_buf.area) snd_cs46xx_capture_hw_free()
1327 runtime->dma_area = NULL; snd_cs46xx_capture_hw_free()
1328 runtime->dma_addr = 0; snd_cs46xx_capture_hw_free()
1329 runtime->dma_bytes = 0; snd_cs46xx_capture_hw_free()
1337 struct snd_pcm_runtime *runtime = substream->runtime; snd_cs46xx_capture_prepare() local
1343 chip->capt.pcm_rec.hw_buffer_size = runtime->period_size * CS46XX_FRAGS << 2; snd_cs46xx_capture_prepare()
1344 snd_cs46xx_set_capture_sample_rate(chip, runtime->rate); snd_cs46xx_capture_prepare()
1495 static void snd_cs46xx_pcm_free_substream(struct snd_pcm_runtime *runtime) snd_cs46xx_pcm_free_substream() argument
1497 kfree(runtime->private_data); snd_cs46xx_pcm_free_substream()
1504 struct snd_pcm_runtime *runtime = substream->runtime; _cs46xx_playback_open_channel() local
1515 runtime->hw = snd_cs46xx_playback; _cs46xx_playback_open_channel()
1516 runtime->private_data = cpcm; _cs46xx_playback_open_channel()
1517 runtime->private_free = snd_cs46xx_pcm_free_substream; _cs46xx_playback_open_channel()
1526 snd_pcm_hw_constraint_list(runtime, 0, _cs46xx_playback_open_channel()
1536 substream->runtime->hw.info |= SNDRV_PCM_INFO_MMAP_VALID; _cs46xx_playback_open_channel()
1601 substream->runtime->hw = snd_cs46xx_capture; snd_cs46xx_capture_open()
1604 substream->runtime->hw.info |= SNDRV_PCM_INFO_MMAP_VALID; snd_cs46xx_capture_open()
1609 snd_pcm_hw_constraint_list(substream->runtime, 0, snd_cs46xx_capture_open()
1619 struct snd_pcm_runtime *runtime = substream->runtime; snd_cs46xx_playback_close() local
1622 cpcm = runtime->private_data; snd_cs46xx_playback_close()
/linux-4.1.27/sound/core/seq/
H A Dseq_midi.c77 struct snd_rawmidi_runtime *runtime; snd_midi_input_event() local
85 runtime = substream->runtime; snd_midi_input_event()
86 msynth = runtime->private_data; snd_midi_input_event()
90 while (runtime->avail > 0) { snd_midi_input_event()
116 struct snd_rawmidi_runtime *runtime; dump_midi() local
121 runtime = substream->runtime; dump_midi()
122 if ((tmp = runtime->avail) < count) { dump_midi()
184 struct snd_rawmidi_runtime *runtime; midisynth_subscribe() local
195 runtime = msynth->input_rfile.input->runtime; midisynth_subscribe()
204 runtime->event = snd_midi_input_event; midisynth_subscribe()
205 runtime->private_data = msynth; midisynth_subscribe()
H A Dseq_virmidi.c141 struct snd_virmidi *vmidi = substream->runtime->private_data; snd_virmidi_input_trigger()
155 struct snd_virmidi *vmidi = substream->runtime->private_data; snd_virmidi_output_trigger()
175 spin_lock_irqsave(&substream->runtime->lock, flags); snd_virmidi_output_trigger()
198 spin_unlock_irqrestore(&substream->runtime->lock, flags); snd_virmidi_output_trigger()
210 struct snd_rawmidi_runtime *runtime = substream->runtime; snd_virmidi_input_open() local
225 runtime->private_data = vmidi; snd_virmidi_input_open()
239 struct snd_rawmidi_runtime *runtime = substream->runtime; snd_virmidi_output_open() local
255 runtime->private_data = vmidi; snd_virmidi_output_open()
265 struct snd_virmidi *vmidi = substream->runtime->private_data; snd_virmidi_input_close()
271 substream->runtime->private_data = NULL; snd_virmidi_input_close()
281 struct snd_virmidi *vmidi = substream->runtime->private_data; snd_virmidi_output_close()
283 substream->runtime->private_data = NULL; snd_virmidi_output_close()
/linux-4.1.27/sound/pci/mixart/
H A Dmixart.c431 struct mixart_stream *stream = subs->runtime->private_data; snd_mixart_trigger()
493 struct mixart_stream *stream = subs->runtime->private_data; snd_mixart_prepare()
504 chip->mgr->sample_rate = subs->runtime->rate; snd_mixart_prepare()
508 if( mixart_set_clock(chip->mgr, stream->pipe, subs->runtime->rate) ) snd_mixart_prepare()
608 struct mixart_stream *stream = subs->runtime->private_data; snd_mixart_hw_params()
650 bufferinfo[i].buffer_address = subs->runtime->dma_addr; snd_mixart_hw_params()
651 bufferinfo[i].available_length = subs->runtime->dma_bytes; snd_mixart_hw_params()
725 struct snd_pcm_runtime *runtime = subs->runtime; snd_mixart_playback_open() local
736 runtime->hw = snd_mixart_analog_caps; snd_mixart_playback_open()
740 runtime->hw = snd_mixart_digital_caps; snd_mixart_playback_open()
781 runtime->private_data = stream; snd_mixart_playback_open()
783 snd_pcm_hw_constraint_step(runtime, 0, SNDRV_PCM_HW_PARAM_PERIOD_BYTES, 32); snd_mixart_playback_open()
784 snd_pcm_hw_constraint_step(runtime, 0, SNDRV_PCM_HW_PARAM_BUFFER_SIZE, 64); snd_mixart_playback_open()
789 runtime->hw.rate_min = runtime->hw.rate_max = mgr->sample_rate; snd_mixart_playback_open()
804 struct snd_pcm_runtime *runtime = subs->runtime; snd_mixart_capture_open() local
815 runtime->hw = snd_mixart_analog_caps; snd_mixart_capture_open()
819 runtime->hw = snd_mixart_digital_caps; snd_mixart_capture_open()
822 runtime->hw.channels_min = 2; /* for instance, no mono */ snd_mixart_capture_open()
862 runtime->private_data = stream; snd_mixart_capture_open()
864 snd_pcm_hw_constraint_step(runtime, 0, SNDRV_PCM_HW_PARAM_PERIOD_BYTES, 32); snd_mixart_capture_open()
865 snd_pcm_hw_constraint_step(runtime, 0, SNDRV_PCM_HW_PARAM_BUFFER_SIZE, 64); snd_mixart_capture_open()
870 runtime->hw.rate_min = runtime->hw.rate_max = mgr->sample_rate; snd_mixart_capture_open()
886 struct mixart_stream *stream = subs->runtime->private_data; snd_mixart_close()
917 struct snd_pcm_runtime *runtime = subs->runtime; snd_mixart_stream_pointer() local
918 struct mixart_stream *stream = runtime->private_data; snd_mixart_stream_pointer()
920 return (snd_pcm_uframes_t)((stream->buf_periods * runtime->period_size) + stream->buf_period_frag); snd_mixart_stream_pointer()
/linux-4.1.27/include/trace/events/
H A Dsched.h368 * Tracepoint for accounting runtime (time the task is executing
373 TP_PROTO(struct task_struct *tsk, u64 runtime, u64 vruntime),
375 TP_ARGS(tsk, __perf_count(runtime), vruntime),
380 __field( u64, runtime )
387 __entry->runtime = runtime;
391 TP_printk("comm=%s pid=%d runtime=%Lu [ns] vruntime=%Lu [ns]",
393 (unsigned long long)__entry->runtime,
398 TP_PROTO(struct task_struct *tsk, u64 runtime, u64 vruntime),
399 TP_ARGS(tsk, runtime, vruntime));
/linux-4.1.27/drivers/media/usb/em28xx/
H A Dem28xx-audio.c91 struct snd_pcm_runtime *runtime; em28xx_audio_isocirq() local
117 runtime = substream->runtime; em28xx_audio_isocirq()
118 stride = runtime->frame_bits >> 3; em28xx_audio_isocirq()
130 if (oldptr + length >= runtime->buffer_size) { em28xx_audio_isocirq()
132 runtime->buffer_size - oldptr; em28xx_audio_isocirq()
133 memcpy(runtime->dma_area + oldptr * stride, cp, em28xx_audio_isocirq()
135 memcpy(runtime->dma_area, cp + cnt * stride, em28xx_audio_isocirq()
138 memcpy(runtime->dma_area + oldptr * stride, cp, em28xx_audio_isocirq()
146 runtime->buffer_size) em28xx_audio_isocirq()
148 runtime->buffer_size; em28xx_audio_isocirq()
152 runtime->period_size) { em28xx_audio_isocirq()
154 runtime->period_size; em28xx_audio_isocirq()
200 struct snd_pcm_runtime *runtime = subs->runtime; snd_pcm_alloc_vmalloc_buffer() local
203 if (runtime->dma_area) { snd_pcm_alloc_vmalloc_buffer()
204 if (runtime->dma_bytes > size) snd_pcm_alloc_vmalloc_buffer()
207 vfree(runtime->dma_area); snd_pcm_alloc_vmalloc_buffer()
209 runtime->dma_area = vmalloc(size); snd_pcm_alloc_vmalloc_buffer()
210 if (!runtime->dma_area) snd_pcm_alloc_vmalloc_buffer()
213 runtime->dma_bytes = size; snd_pcm_alloc_vmalloc_buffer()
253 struct snd_pcm_runtime *runtime = substream->runtime; snd_em28xx_capture_open() local
274 runtime->hw = snd_em28xx_hw_capture; snd_em28xx_capture_open()
310 snd_pcm_hw_constraint_integer(runtime, SNDRV_PCM_HW_PARAM_PERIODS); snd_em28xx_capture_open()
311 snd_pcm_hw_constraint_minmax(runtime, SNDRV_PCM_HW_PARAM_PERIOD_BYTES, snd_em28xx_capture_open()
340 if (substream->runtime->dma_area) { snd_em28xx_pcm_close()
342 vfree(substream->runtime->dma_area); snd_em28xx_pcm_close()
343 substream->runtime->dma_area = NULL; snd_em28xx_pcm_close()
471 void *pageptr = subs->runtime->dma_area + offset; snd_pcm_get_vmalloc_page()
/linux-4.1.27/sound/isa/es1688/
H A Des1688_lib.c315 struct snd_pcm_runtime *runtime = substream->runtime; snd_es1688_set_rate() local
318 if (runtime->rate_num == clocks[0].num) snd_es1688_set_rate()
319 bits = 256 - runtime->rate_den; snd_es1688_set_rate()
321 bits = 128 - runtime->rate_den; snd_es1688_set_rate()
323 divider = 256 - 7160000*20/(8*82*runtime->rate); snd_es1688_set_rate()
376 struct snd_pcm_runtime *runtime = substream->runtime; snd_es1688_playback_prepare() local
385 snd_es1688_write(chip, 0xa8, (snd_es1688_read(chip, 0xa8) & ~0x03) | (3 - runtime->channels)); snd_es1688_playback_prepare()
387 if (runtime->channels == 1) { snd_es1688_playback_prepare()
388 if (snd_pcm_format_width(runtime->format) == 8) { snd_es1688_playback_prepare()
400 if (snd_pcm_format_width(runtime->format) == 8) { snd_es1688_playback_prepare()
418 snd_dma_program(chip->dma8, runtime->dma_addr, size, DMA_MODE_WRITE | DMA_AUTOINIT); snd_es1688_playback_prepare()
437 struct snd_pcm_runtime *runtime = substream->runtime; snd_es1688_capture_prepare() local
447 snd_es1688_write(chip, 0xa8, (snd_es1688_read(chip, 0xa8) & ~0x03) | (3 - runtime->channels)); snd_es1688_capture_prepare()
449 if (runtime->channels == 1) { snd_es1688_capture_prepare()
450 if (snd_pcm_format_width(runtime->format) == 8) { snd_es1688_capture_prepare()
460 if (snd_pcm_format_width(runtime->format) == 8) { snd_es1688_capture_prepare()
475 snd_dma_program(chip->dma8, runtime->dma_addr, size, DMA_MODE_READ | DMA_AUTOINIT); snd_es1688_capture_prepare()
511 return bytes_to_frames(substream->runtime, ptr); snd_es1688_playback_pointer()
522 return bytes_to_frames(substream->runtime, ptr); snd_es1688_capture_pointer()
572 struct snd_pcm_runtime *runtime = substream->runtime; snd_es1688_playback_open() local
577 runtime->hw = snd_es1688_playback; snd_es1688_playback_open()
578 snd_pcm_hw_constraint_ratnums(runtime, 0, SNDRV_PCM_HW_PARAM_RATE, snd_es1688_playback_open()
586 struct snd_pcm_runtime *runtime = substream->runtime; snd_es1688_capture_open() local
591 runtime->hw = snd_es1688_capture; snd_es1688_capture_open()
592 snd_pcm_hw_constraint_ratnums(runtime, 0, SNDRV_PCM_HW_PARAM_RATE, snd_es1688_capture_open()
/linux-4.1.27/sound/spi/
H A Dat73c213.c211 struct snd_pcm_runtime *runtime = substream->runtime; snd_at73c213_pcm_open() local
215 err = snd_pcm_hw_constraint_integer(runtime, snd_at73c213_pcm_open()
221 runtime->hw = snd_at73c213_playback_hw; snd_at73c213_pcm_open()
257 struct snd_pcm_runtime *runtime = substream->runtime; snd_at73c213_pcm_prepare() local
260 block_size = frames_to_bytes(runtime, runtime->period_size); snd_at73c213_pcm_prepare()
265 (long)runtime->dma_addr); snd_at73c213_pcm_prepare()
267 runtime->period_size * runtime->channels); snd_at73c213_pcm_prepare()
269 (long)runtime->dma_addr + block_size); snd_at73c213_pcm_prepare()
271 runtime->period_size * runtime->channels); snd_at73c213_pcm_prepare()
308 struct snd_pcm_runtime *runtime = substream->runtime; snd_at73c213_pcm_pointer() local
313 - (unsigned long)runtime->dma_addr; snd_at73c213_pcm_pointer()
315 pos = bytes_to_frames(runtime, bytes); snd_at73c213_pcm_pointer()
316 if (pos >= runtime->buffer_size) snd_at73c213_pcm_pointer()
317 pos -= runtime->buffer_size; snd_at73c213_pcm_pointer()
360 struct snd_pcm_runtime *runtime = chip->substream->runtime; snd_at73c213_interrupt() local
369 block_size = frames_to_bytes(runtime, runtime->period_size); snd_at73c213_interrupt()
374 if (chip->period == runtime->periods) snd_at73c213_interrupt()
377 if (next_period == runtime->periods) snd_at73c213_interrupt()
383 (long)runtime->dma_addr + offset); snd_at73c213_interrupt()
385 runtime->period_size * runtime->channels); snd_at73c213_interrupt()
/linux-4.1.27/drivers/media/pci/cx25821/
H A Dcx25821-alsa.c461 struct snd_pcm_runtime *runtime = substream->runtime; snd_cx25821_pcm_open() local
470 err = snd_pcm_hw_constraint_pow2(runtime, 0, snd_cx25821_pcm_open()
477 runtime->hw = snd_cx25821_digital_hw; snd_cx25821_pcm_open()
488 runtime->hw.period_bytes_min = bpl; snd_cx25821_pcm_open()
489 runtime->hw.period_bytes_max = bpl; snd_cx25821_pcm_open()
516 if (substream->runtime->dma_area) { snd_cx25821_hw_params()
518 substream->runtime->dma_area = NULL; snd_cx25821_hw_params()
559 substream->runtime->dma_area = chip->buf->vaddr; snd_cx25821_hw_params()
560 substream->runtime->dma_bytes = chip->dma_size; snd_cx25821_hw_params()
561 substream->runtime->dma_addr = 0; snd_cx25821_hw_params()
578 if (substream->runtime->dma_area) { snd_cx25821_hw_free()
580 substream->runtime->dma_area = NULL; snd_cx25821_hw_free()
630 struct snd_pcm_runtime *runtime = substream->runtime; snd_cx25821_pointer() local
635 return runtime->period_size * (count & (runtime->periods - 1)); snd_cx25821_pointer()
644 void *pageptr = substream->runtime->dma_area + offset; snd_cx25821_page()
/linux-4.1.27/sound/soc/intel/baytrail/
H A Dsst-baytrail-pcm.c57 /* runtime DSP */
217 struct snd_pcm_runtime *runtime = substream->runtime; byt_notify_pointer() local
227 pos = frames_to_bytes(runtime, byt_notify_pointer()
228 (runtime->control->appl_ptr % byt_notify_pointer()
229 runtime->buffer_size)); byt_notify_pointer()
240 struct snd_pcm_runtime *runtime = substream->runtime; sst_byt_pcm_pointer() local
247 return bytes_to_frames(runtime, pcm_data->hw_ptr); sst_byt_pcm_pointer()
/linux-4.1.27/sound/pci/pcxhr/
H A Dpcxhr.c649 chip->chip_idx, (void *)(long)subs->runtime->dma_addr, pcxhr_update_r_buffer()
650 subs->runtime->dma_bytes, subs->number); pcxhr_update_r_buffer()
657 snd_BUG_ON(subs->runtime->dma_bytes >= 0x200000); pcxhr_update_r_buffer()
659 rmh.cmd[1] = subs->runtime->dma_bytes * 8; pcxhr_update_r_buffer()
661 rmh.cmd[2] = subs->runtime->dma_addr >> 24; pcxhr_update_r_buffer()
665 rmh.cmd[3] = subs->runtime->dma_addr & MASK_DSP_WORD; pcxhr_update_r_buffer()
851 stream = s->runtime->private_data; snd_pcm_group_for_each_entry()
858 stream = subs->runtime->private_data;
876 stream = s->runtime->private_data; snd_pcm_group_for_each_entry()
922 subs->runtime->period_size, subs->runtime->periods, pcxhr_prepare()
923 subs->runtime->buffer_size); pcxhr_prepare()
930 if (mgr->sample_rate != subs->runtime->rate) { pcxhr_prepare()
931 err = pcxhr_set_clock(mgr, subs->runtime->rate); pcxhr_prepare()
937 mgr->sample_rate = subs->runtime->rate; pcxhr_prepare()
955 struct pcxhr_stream *stream = subs->runtime->private_data; pcxhr_hw_params()
1020 struct snd_pcm_runtime *runtime = subs->runtime; pcxhr_open() local
1027 runtime->hw = pcxhr_caps; pcxhr_open()
1037 runtime->hw.channels_max = 1; pcxhr_open()
1039 runtime->hw.channels_min = 2; pcxhr_open()
1052 runtime->hw.formats &= ~SNDRV_PCM_FMTBIT_FLOAT_LE; pcxhr_open()
1055 err = snd_pcm_hw_constraint_integer(runtime, pcxhr_open()
1066 runtime->hw.rate_min = runtime->hw.rate_max = mgr->sample_rate; pcxhr_open()
1077 runtime->hw.rate_min = external_rate; pcxhr_open()
1078 runtime->hw.rate_max = external_rate; pcxhr_open()
1086 runtime->private_data = stream; pcxhr_open()
1089 snd_pcm_hw_constraint_step(runtime, 0, pcxhr_open()
1091 snd_pcm_hw_constraint_step(runtime, 0, pcxhr_open()
1106 struct pcxhr_stream *stream = subs->runtime->private_data; pcxhr_close()
1133 struct snd_pcm_runtime *runtime = subs->runtime; pcxhr_stream_pointer() local
1134 struct pcxhr_stream *stream = runtime->private_data; pcxhr_stream_pointer()
1144 return (snd_pcm_uframes_t)((timer_buf_periods * runtime->period_size) + pcxhr_stream_pointer()
/linux-4.1.27/sound/pci/riptide/
H A Driptide.c426 #define get_pcmhwdev(substream) (struct pcmhw *)(substream->runtime->private_data)
1092 struct snd_pcm_runtime *runtime; riptide_handleirq() local
1107 (runtime = substream[i]->runtime) && riptide_handleirq()
1108 (data = runtime->private_data) && data->state != ST_STOP) { riptide_handleirq()
1132 frames_to_bytes(runtime, riptide_handleirq()
1133 runtime->period_size); riptide_handleirq()
1137 bytes_to_frames(runtime, pos), riptide_handleirq()
1138 runtime->period_size); riptide_handleirq()
1361 struct snd_pcm_runtime *runtime = substream->runtime; snd_riptide_pointer() local
1368 if (data->size && runtime->period_size) { snd_riptide_pointer()
1372 bytes_to_frames(runtime, rptr.retlongs[1]), snd_riptide_pointer()
1373 bytes_to_frames(runtime, snd_riptide_pointer()
1374 rptr.retlongs[1]) % runtime->period_size); snd_riptide_pointer()
1377 bytes_to_frames(runtime, snd_riptide_pointer()
1381 bytes_to_frames(runtime, snd_riptide_pointer()
1385 data->size, runtime->period_size); snd_riptide_pointer()
1386 ret = bytes_to_frames(runtime, 0); snd_riptide_pointer()
1456 struct snd_pcm_runtime *runtime = substream->runtime; snd_riptide_prepare() local
1468 runtime->channels, runtime->format, runtime->rate); snd_riptide_prepare()
1471 channels = runtime->channels; snd_riptide_prepare()
1472 format = runtime->format; snd_riptide_prepare()
1473 rate = runtime->rate; snd_riptide_prepare()
1494 size = frames_to_bytes(runtime, runtime->buffer_size); snd_riptide_prepare()
1495 period = frames_to_bytes(runtime, runtime->period_size); snd_riptide_prepare()
1605 struct snd_pcm_runtime *runtime = substream->runtime; snd_riptide_playback_open() local
1610 runtime->hw = snd_riptide_playback; snd_riptide_playback_open()
1621 runtime->private_data = data; snd_riptide_playback_open()
1622 return snd_pcm_hw_constraint_integer(runtime, snd_riptide_playback_open()
1629 struct snd_pcm_runtime *runtime = substream->runtime; snd_riptide_capture_open() local
1633 runtime->hw = snd_riptide_capture; snd_riptide_capture_open()
1644 runtime->private_data = data; snd_riptide_capture_open()
1645 return snd_pcm_hw_constraint_integer(runtime, snd_riptide_capture_open()
1655 substream->runtime->private_data = NULL; snd_riptide_playback_close()
1666 substream->runtime->private_data = NULL; snd_riptide_capture_close()
1945 && chip->playback_substream[i]->runtime snd_riptide_proc_read()
1947 chip->playback_substream[i]->runtime->private_data)) { snd_riptide_proc_read()
1957 && chip->capture_substream->runtime snd_riptide_proc_read()
1958 && (data = chip->capture_substream->runtime->private_data)) { snd_riptide_proc_read()
/linux-4.1.27/sound/pci/ali5451/
H A Dali5451.c200 int count; /* runtime->period_size */
1062 struct snd_pcm_runtime *runtime = substream->runtime; snd_ali_control_mode() local
1068 if (snd_pcm_format_width(runtime->format) == 16) snd_ali_control_mode()
1070 if (!snd_pcm_format_unsigned(runtime->format)) snd_ali_control_mode()
1072 if (runtime->channels > 1) snd_ali_control_mode()
1108 pvoice = s->runtime->private_data; snd_pcm_group_for_each_entry()
1152 struct snd_pcm_runtime *runtime = substream->runtime; snd_ali_playback_hw_params() local
1153 struct snd_ali_voice *pvoice = runtime->private_data; snd_ali_playback_hw_params()
1188 struct snd_pcm_runtime *runtime = substream->runtime; snd_ali_playback_hw_free() local
1189 struct snd_ali_voice *pvoice = runtime->private_data; snd_ali_playback_hw_free()
1215 struct snd_pcm_runtime *runtime = substream->runtime; snd_ali_playback_prepare() local
1216 struct snd_ali_voice *pvoice = runtime->private_data; snd_ali_playback_prepare()
1233 Delta = snd_ali_convert_rate(runtime->rate, 0); snd_ali_playback_prepare()
1242 snd_ali_set_spdif_out_rate(codec, runtime->rate); snd_ali_playback_prepare()
1247 LBA = runtime->dma_addr; snd_ali_playback_prepare()
1250 pvoice->count = runtime->period_size; snd_ali_playback_prepare()
1253 pvoice->eso = runtime->buffer_size; snd_ali_playback_prepare()
1270 pvoice->number,runtime->rate,Delta,GVSEL,PAN,CTRL); snd_ali_playback_prepare()
1308 struct snd_pcm_runtime *runtime = substream->runtime; snd_ali_prepare() local
1309 struct snd_ali_voice *pvoice = runtime->private_data; snd_ali_prepare()
1328 0x1000 : snd_ali_convert_rate(runtime->rate, pvoice->mode); snd_ali_prepare()
1354 Delta = ((rate << 12) / runtime->rate) & 0x00ffff; snd_ali_prepare()
1358 pvoice->eso = runtime->buffer_size; snd_ali_prepare()
1361 pvoice->count = runtime->period_size; snd_ali_prepare()
1364 LBA = runtime->dma_addr; snd_ali_prepare()
1397 struct snd_pcm_runtime *runtime = substream->runtime; snd_ali_playback_pointer() local
1398 struct snd_ali_voice *pvoice = runtime->private_data; snd_ali_playback_pointer()
1418 struct snd_pcm_runtime *runtime = substream->runtime; snd_ali_pointer() local
1419 struct snd_ali_voice *pvoice = runtime->private_data; snd_ali_pointer()
1482 static void snd_ali_pcm_free_substream(struct snd_pcm_runtime *runtime) snd_ali_pcm_free_substream() argument
1484 struct snd_ali_voice *pvoice = runtime->private_data; snd_ali_pcm_free_substream()
1497 struct snd_pcm_runtime *runtime = substream->runtime; snd_ali_open() local
1506 runtime->private_data = pvoice; snd_ali_open()
1507 runtime->private_free = snd_ali_pcm_free_substream; snd_ali_open()
1509 runtime->hw = *phw; snd_ali_open()
1511 snd_pcm_hw_constraint_minmax(runtime, SNDRV_PCM_HW_PARAM_BUFFER_SIZE, snd_ali_open()
1534 struct snd_ali_voice *pvoice = substream->runtime->private_data; snd_ali_close()
1613 return snd_pcm_hw_constraint_list(substream->runtime, 0, snd_ali_modem_open()
/linux-4.1.27/sound/pci/echoaudio/
H A Dechoaudio.c107 static void audiopipe_free(struct snd_pcm_runtime *runtime) audiopipe_free() argument
109 struct audiopipe *pipe = runtime->private_data; audiopipe_free()
274 struct snd_pcm_runtime *runtime; pcm_open() local
282 runtime = substream->runtime; pcm_open()
303 runtime->hw = pipe->hw; pcm_open()
304 runtime->private_data = pipe; pcm_open()
305 runtime->private_free = audiopipe_free; pcm_open()
309 if ((err = snd_pcm_hw_constraint_list(runtime, 0, pcm_open()
315 if ((err = snd_pcm_hw_constraint_integer(runtime, pcm_open()
322 if ((err = snd_pcm_hw_constraint_step(runtime, 0, pcm_open()
326 if ((err = snd_pcm_hw_constraint_step(runtime, 0, pcm_open()
331 if ((err = snd_pcm_hw_rule_add(substream->runtime, 0, pcm_open()
358 if ((err = snd_pcm_hw_rule_add(substream->runtime, 0, pcm_analog_in_open()
363 if ((err = snd_pcm_hw_rule_add(substream->runtime, 0, pcm_analog_in_open()
391 if ((err = snd_pcm_hw_rule_add(substream->runtime, 0, pcm_analog_out_open()
397 if ((err = snd_pcm_hw_rule_add(substream->runtime, 0, pcm_analog_out_open()
433 if ((err = snd_pcm_hw_rule_add(substream->runtime, 0, pcm_digital_in_open()
438 if ((err = snd_pcm_hw_rule_add(substream->runtime, 0, pcm_digital_in_open()
474 if ((err = snd_pcm_hw_rule_add(substream->runtime, 0, pcm_digital_out_open()
480 if ((err = snd_pcm_hw_rule_add(substream->runtime, 0, pcm_digital_out_open()
535 pipe = (struct audiopipe *) substream->runtime->private_data; init_engine()
675 pipe = (struct audiopipe *) substream->runtime->private_data; pcm_hw_free()
695 struct snd_pcm_runtime *runtime = substream->runtime; pcm_prepare() local
697 int pipe_index = ((struct audiopipe *)runtime->private_data)->index; pcm_prepare()
700 runtime->rate, runtime->format, runtime->channels); pcm_prepare()
701 format.interleave = runtime->channels; pcm_prepare()
704 switch (runtime->format) { pcm_prepare()
722 runtime->format); pcm_prepare()
739 struct snd_pcm_runtime *runtime = substream->runtime; pcm_trigger() local
740 struct audiopipe *pipe = runtime->private_data; pcm_trigger()
761 pipe = chip->substream[i]->runtime->private_data;
783 pipe = chip->substream[i]->runtime->private_data;
792 pipe = chip->substream[i]->runtime->private_data;
809 struct snd_pcm_runtime *runtime = substream->runtime; pcm_pointer() local
810 struct audiopipe *pipe = runtime->private_data; pcm_pointer()
816 bufsize = substream->runtime->buffer_size; pcm_pointer()
817 pos = bytes_to_frames(substream->runtime, pipe->position); pcm_pointer()
820 pipe->position -= frames_to_bytes(substream->runtime, bufsize); pcm_pointer()
1838 if (substream && ((struct audiopipe *)substream->runtime-> snd_echo_interrupt()
1841 substream->runtime->period_size; snd_echo_interrupt()
/linux-4.1.27/arch/sh/kernel/
H A Dvmlinux.lds.S72 * .exit.text is discarded at runtime, not link time, to deal with
/linux-4.1.27/arch/um/include/asm/
H A Dcommon.lds.S82 /* .exit.text is discard at runtime, not link time, to deal with references
/linux-4.1.27/drivers/usb/gadget/function/
H A Df_uac2.c318 return bytes_to_frames(substream->runtime, prm->hw_ptr); uac2_pcm_pointer()
336 prm->dma_bytes = substream->runtime->dma_bytes; uac2_pcm_hw_params()
337 prm->dma_area = substream->runtime->dma_area; uac2_pcm_hw_params()
364 struct snd_pcm_runtime *runtime = substream->runtime; uac2_pcm_open() local
381 runtime->hw = uac2_pcm_hardware; uac2_pcm_open()
385 runtime->hw.rate_min = p_srate; uac2_pcm_open()
388 runtime->hw.formats = SNDRV_PCM_FMTBIT_S24_3LE; uac2_pcm_open()
391 runtime->hw.formats = SNDRV_PCM_FMTBIT_S32_LE; uac2_pcm_open()
394 runtime->hw.formats = SNDRV_PCM_FMTBIT_S16_LE; uac2_pcm_open()
397 runtime->hw.channels_min = num_channels(p_chmask); uac2_pcm_open()
398 runtime->hw.period_bytes_min = 2 * uac2->p_prm.max_psize uac2_pcm_open()
399 / runtime->hw.periods_min; uac2_pcm_open()
402 runtime->hw.rate_min = c_srate; uac2_pcm_open()
405 runtime->hw.formats = SNDRV_PCM_FMTBIT_S24_3LE; uac2_pcm_open()
408 runtime->hw.formats = SNDRV_PCM_FMTBIT_S32_LE; uac2_pcm_open()
411 runtime->hw.formats = SNDRV_PCM_FMTBIT_S16_LE; uac2_pcm_open()
414 runtime->hw.channels_min = num_channels(c_chmask); uac2_pcm_open()
415 runtime->hw.period_bytes_min = 2 * uac2->c_prm.max_psize uac2_pcm_open()
416 / runtime->hw.periods_min; uac2_pcm_open()
419 runtime->hw.rate_max = runtime->hw.rate_min; uac2_pcm_open()
420 runtime->hw.channels_max = runtime->hw.channels_min; uac2_pcm_open()
422 snd_pcm_hw_constraint_integer(runtime, SNDRV_PCM_HW_PARAM_PERIODS); uac2_pcm_open()
H A Du_uac1.c159 struct snd_pcm_runtime *runtime = substream->runtime; u_audio_playback() local
165 if (runtime->status->state == SNDRV_PCM_STATE_XRUN || u_audio_playback()
166 runtime->status->state == SNDRV_PCM_STATE_SUSPENDED) { u_audio_playback()
176 frames = bytes_to_frames(runtime, count); u_audio_playback()
/linux-4.1.27/include/linux/
H A Dreciprocal_div.h16 * runtime invariant. The reciprocal of B is calculated in the
/linux-4.1.27/arch/powerpc/include/asm/
H A Dperf_event.h5 * runtime. This would allow multiplatform perf event support for e300 (fsl
/linux-4.1.27/arch/arm/plat-samsung/include/plat/
H A Dfb.h24 * machines will end up dumping their data at runtime.
/linux-4.1.27/sound/isa/msnd/
H A Dmsnd.c480 struct snd_pcm_runtime *runtime = substream->runtime; snd_msnd_playback_open() local
487 runtime->dma_area = chip->mappedbase; snd_msnd_playback_open()
488 runtime->dma_bytes = 0x3000; snd_msnd_playback_open()
491 runtime->hw = snd_msnd_playback; snd_msnd_playback_open()
570 return bytes_to_frames(substream->runtime, chip->playDMAPos); snd_msnd_playback_pointer()
586 struct snd_pcm_runtime *runtime = substream->runtime; snd_msnd_capture_open() local
591 runtime->dma_area = chip->mappedbase + 0x3000; snd_msnd_capture_open()
592 runtime->dma_bytes = 0x3000; snd_msnd_capture_open()
593 memset(runtime->dma_area, 0, runtime->dma_bytes); snd_msnd_capture_open()
595 runtime->hw = snd_msnd_capture; snd_msnd_capture_open()
644 struct snd_pcm_runtime *runtime = substream->runtime; snd_msnd_capture_pointer() local
647 return bytes_to_frames(runtime, chip->captureDMAPos); snd_msnd_capture_pointer()
/linux-4.1.27/sound/usb/caiaq/
H A Daudio.c160 substream->runtime->hw = cdev->pcm_info; snd_usb_caiaq_substream_open()
161 snd_pcm_limit_hw_rates(substream->runtime); snd_usb_caiaq_substream_open()
210 struct snd_pcm_runtime *runtime = substream->runtime; snd_usb_caiaq_pcm_prepare() local
257 if (runtime->rate == rates[i]) snd_usb_caiaq_pcm_prepare()
260 snd_pcm_limit_hw_rates(runtime); snd_usb_caiaq_pcm_prepare()
266 bpp = ((runtime->rate / 8000) + CLOCK_DRIFT_TOLERANCE) snd_usb_caiaq_pcm_prepare()
272 ret = snd_usb_caiaq_set_audio_params(cdev, runtime->rate, snd_usb_caiaq_pcm_prepare()
273 runtime->sample_bits, bpp); snd_usb_caiaq_pcm_prepare()
329 ptr = bytes_to_frames(sub->runtime, snd_usb_caiaq_pcm_pointer()
332 ptr = bytes_to_frames(sub->runtime, snd_usb_caiaq_pcm_pointer()
392 struct snd_pcm_runtime *rt = sub->runtime; read_in_urb_mode0()
439 struct snd_pcm_runtime *rt = sub->runtime; read_in_urb_mode2()
471 struct snd_pcm_runtime *rt = sub->runtime; read_in_urb_mode3()
552 struct snd_pcm_runtime *rt = sub->runtime; fill_out_urb_mode_0()
588 struct snd_pcm_runtime *rt = sub->runtime; fill_out_urb_mode_3()
/linux-4.1.27/kernel/sched/
H A Ddeadline.c7 * runtime won't miss any of their deadlines.
53 void init_dl_bandwidth(struct dl_bandwidth *dl_b, u64 period, u64 runtime) init_dl_bandwidth() argument
57 dl_b->dl_runtime = runtime; init_dl_bandwidth()
314 * - the runtime of the entity has to be set to the maximum value.
335 dl_se->runtime = pi_se->dl_runtime; setup_new_dl_entity()
342 * exhausting its runtime.
344 * Here we are interested in making runtime overrun possible, but we do
350 * This function deals exactly with that, and ensures that when the runtime
355 * runtime, or it just underestimated it during sched_setattr().
371 dl_se->runtime = pi_se->dl_runtime; replenish_dl_entity()
376 * available runtime for the entity. This ensures correct replenish_dl_entity()
377 * handling of situations where the runtime overrun is replenish_dl_entity()
380 while (dl_se->runtime <= 0) { replenish_dl_entity()
382 dl_se->runtime += pi_se->dl_runtime; replenish_dl_entity()
397 dl_se->runtime = pi_se->dl_runtime; replenish_dl_entity()
408 * [re]activated or, in general, enqueued) can use its remaining runtime
411 * one of the CBS rules: when a task wakes up, if the residual runtime
415 * refill the runtime and set the deadline a period in the future,
422 * runtime / (deadline - t) > dl_runtime / dl_period ,
442 * are the relative deadline and the maximum runtime of each dl_entity_overflow()
443 * instance, runtime is the runtime left for the last instance dl_entity_overflow()
453 left = (pi_se->dl_period >> DL_SCALE) * (dl_se->runtime >> DL_SCALE); dl_entity_overflow()
461 * When a -deadline entity is queued back on the runqueue, its runtime and
466 * - using the remaining runtime with the current deadline would make
487 dl_se->runtime = pi_se->dl_runtime; update_dl_entity()
492 * If the entity depleted all its runtime, and if we want it to sleep
544 * means the task is throttled and needs a runtime replenishment.
548 * dequeue_task_dl(). In the former case we must issue the runtime
550 * do nothing but clearing dl_throttled, so that runtime and deadline
645 return (dl_se->runtime <= 0); dl_runtime_exceeded()
651 * Update the current task's runtime statistics (provided it is still
686 dl_se->runtime -= dl_se->dl_yielded ? 0 : delta_exec; update_curr_dl()
699 * account our runtime there too, otherwise actual rt tasks update_curr_dl()
881 * we want a replenishment of its runtime. enqueue_dl_entity()
904 * smaller than our one... OTW we keep our runtime and enqueue_task_dl()
913 * runtime while doing so. No point in replenishing enqueue_task_dl()
952 * a new runtime. This is of little use now, since we
964 * forcing its runtime to zero. This way, update_curr_dl() stops yield_task_dl()
968 if (p->dl.runtime > 0) { yield_task_dl()
970 p->dl.runtime = 0; yield_task_dl()
1075 hrtick_start(rq, p->dl.runtime); start_hrtick_dl()
1155 * Even when we have runtime, update_curr_dl() might have resulted in us task_tick_dl()
1159 if (hrtick_enabled(rq) && queued && p->dl.runtime > 0 && task_tick_dl()
/linux-4.1.27/drivers/misc/mei/
H A Dpci-txe.c161 * For not wake-able HW runtime pm framework mei_txe_probe()
163 * Use domain runtime pm callbacks instead. mei_txe_probe()
321 dev_dbg(&pdev->dev, "rpm: txe: runtime suspend\n"); mei_txe_pm_runtime_suspend()
344 dev_dbg(&pdev->dev, "rpm: txe: runtime suspend ret=%d\n", ret); mei_txe_pm_runtime_suspend()
356 dev_dbg(&pdev->dev, "rpm: txe: runtime resume\n"); mei_txe_pm_runtime_resume()
370 dev_dbg(&pdev->dev, "rpm: txe: runtime resume ret = %d\n", ret); mei_txe_pm_runtime_resume()
H A Dpci-me.c218 * For not wake-able HW runtime pm framework mei_me_probe()
220 * Use domain runtime pm callbacks instead. mei_me_probe()
382 dev_dbg(&pdev->dev, "rpm: me: runtime suspend\n"); mei_me_pm_runtime_suspend()
397 dev_dbg(&pdev->dev, "rpm: me: runtime suspend ret=%d\n", ret); mei_me_pm_runtime_suspend()
408 dev_dbg(&pdev->dev, "rpm: me: runtime resume\n"); mei_me_pm_runtime_resume()
420 dev_dbg(&pdev->dev, "rpm: me: runtime resume ret = %d\n", ret); mei_me_pm_runtime_resume()
/linux-4.1.27/drivers/net/wireless/iwlwifi/
H A Diwl-fw.h78 * @IWL_UCODE_REGULAR: Normal runtime ucode
81 * @IWL_UCODE_REGULAR_USNIFFER: Normal runtime ucode when using usniffer image
112 /* one for each uCode image (inst/data, init/runtime/wowlan) */
150 * @inst_evtlog_ptr: event log offset for runtime ucode.
151 * @inst_evtlog_size: event log size for runtime ucode.
152 * @inst_errlog_ptr: error log offfset for runtime ucode.
/linux-4.1.27/sound/isa/
H A Des18xx.c418 struct snd_pcm_runtime *runtime = substream->runtime; snd_es18xx_rate_set() local
420 if (runtime->rate_num == new_clocks[0].num) snd_es18xx_rate_set()
421 bits = 128 - runtime->rate_den; snd_es18xx_rate_set()
423 bits = 256 - runtime->rate_den; snd_es18xx_rate_set()
425 if (runtime->rate_num == old_clocks[0].num) snd_es18xx_rate_set()
426 bits = 256 - runtime->rate_den; snd_es18xx_rate_set()
428 bits = 128 - runtime->rate_den; snd_es18xx_rate_set()
432 div0 = 256 - 7160000*20/(8*82*runtime->rate); snd_es18xx_rate_set()
484 struct snd_pcm_runtime *runtime = substream->runtime; snd_es18xx_playback1_prepare() local
497 ((runtime->channels == 1) ? 0x00 : 0x02) | snd_es18xx_playback1_prepare()
498 (snd_pcm_format_width(runtime->format) == 16 ? 0x01 : 0x00) | snd_es18xx_playback1_prepare()
499 (snd_pcm_format_unsigned(runtime->format) ? 0x00 : 0x04)); snd_es18xx_playback1_prepare()
502 snd_dma_program(chip->dma2, runtime->dma_addr, size, DMA_MODE_WRITE | DMA_AUTOINIT); snd_es18xx_playback1_prepare()
583 struct snd_pcm_runtime *runtime = substream->runtime; snd_es18xx_capture_prepare() local
590 snd_es18xx_bits(chip, 0xA8, 0x03, runtime->channels == 1 ? 0x02 : 0x01); snd_es18xx_capture_prepare()
605 snd_pcm_format_unsigned(runtime->format) ? 0x51 : 0x71); snd_es18xx_capture_prepare()
607 ((runtime->channels == 1) ? 0x40 : 0x08) | snd_es18xx_capture_prepare()
608 (snd_pcm_format_width(runtime->format) == 16 ? 0x04 : 0x00) | snd_es18xx_capture_prepare()
609 (snd_pcm_format_unsigned(runtime->format) ? 0x00 : 0x20)); snd_es18xx_capture_prepare()
612 snd_dma_program(chip->dma1, runtime->dma_addr, size, DMA_MODE_READ | DMA_AUTOINIT); snd_es18xx_capture_prepare()
649 struct snd_pcm_runtime *runtime = substream->runtime; snd_es18xx_playback2_prepare() local
656 snd_es18xx_bits(chip, 0xA8, 0x03, runtime->channels == 1 ? 0x02 : 0x01); snd_es18xx_playback2_prepare()
667 snd_pcm_format_unsigned(runtime->format) ? 0x80 : 0x00); snd_es18xx_playback2_prepare()
669 snd_pcm_format_unsigned(runtime->format) ? 0x51 : 0x71); snd_es18xx_playback2_prepare()
671 (runtime->channels == 1 ? 0x40 : 0x08) | snd_es18xx_playback2_prepare()
672 (snd_pcm_format_width(runtime->format) == 16 ? 0x04 : 0x00) | snd_es18xx_playback2_prepare()
673 (snd_pcm_format_unsigned(runtime->format) ? 0x00 : 0x20)); snd_es18xx_playback2_prepare()
676 snd_dma_program(chip->dma1, runtime->dma_addr, size, DMA_MODE_WRITE | DMA_AUTOINIT); snd_es18xx_playback2_prepare()
883 struct snd_pcm_runtime *runtime = substream->runtime; snd_es18xx_playback_open() local
889 chip->capture_a_substream->runtime->channels != 1) snd_es18xx_playback_open()
900 substream->runtime->hw = snd_es18xx_playback; snd_es18xx_playback_open()
901 snd_pcm_hw_constraint_ratnums(runtime, 0, SNDRV_PCM_HW_PARAM_RATE, snd_es18xx_playback_open()
908 struct snd_pcm_runtime *runtime = substream->runtime; snd_es18xx_capture_open() local
915 chip->playback_a_substream->runtime->channels != 1) snd_es18xx_capture_open()
918 substream->runtime->hw = snd_es18xx_capture; snd_es18xx_capture_open()
919 snd_pcm_hw_constraint_ratnums(runtime, 0, SNDRV_PCM_HW_PARAM_RATE, snd_es18xx_capture_open()
/linux-4.1.27/sound/aoa/soundbus/i2sbus/
H A Dpcm.c91 hw = &pi->substream->runtime->hw; i2sbus_pcm_open()
196 err = snd_pcm_hw_constraint_integer(pi->substream->runtime, i2sbus_pcm_open()
331 struct snd_pcm_runtime *runtime; i2sbus_pcm_prepare() local
356 if (!pi->substream || !pi->substream->runtime) { i2sbus_pcm_prepare()
361 runtime = pi->substream->runtime; i2sbus_pcm_prepare()
364 ((i2sdev->format != runtime->format) i2sbus_pcm_prepare()
365 || (i2sdev->rate != runtime->rate))) { i2sbus_pcm_prepare()
370 i2sdev->format = runtime->format; i2sbus_pcm_prepare()
371 i2sdev->rate = runtime->rate; i2sbus_pcm_prepare()
374 nperiods = pi->substream->runtime->periods; i2sbus_pcm_prepare()
393 offset = runtime->dma_addr; i2sbus_pcm_prepare()
413 switch (runtime->format) { i2sbus_pcm_prepare()
449 runtime->rate, i2sbus_pcm_prepare()
630 if (fc >= pi->substream->runtime->buffer_size) i2sbus_pcm_pointer()
631 fc %= pi->substream->runtime->buffer_size; i2sbus_pcm_pointer()
642 struct snd_pcm_runtime *runtime; handle_interrupt() local
650 runtime = pi->substream->runtime; handle_interrupt()
661 if (++i >= runtime->periods) { handle_interrupt()
663 pi->frame_count += runtime->buffer_size; handle_interrupt()
672 nframes = i * runtime->period_size; handle_interrupt()
/linux-4.1.27/sound/pci/lx6464es/
H A Dlx6464es.c109 struct snd_pcm_runtime *runtime = substream->runtime; lx_hardware_open() local
110 int channels = runtime->channels; lx_hardware_open()
113 snd_pcm_uframes_t period_size = runtime->period_size; lx_hardware_open()
136 struct snd_pcm_runtime *runtime = substream->runtime; lx_hardware_start() local
140 err = lx_stream_set_format(chip, runtime, 0, is_capture); lx_hardware_start()
215 struct snd_pcm_runtime *runtime = substream->runtime; lx_pcm_open() local
223 runtime->hw = lx_caps; lx_pcm_open()
227 err = snd_pcm_hw_constraint_integer(runtime, lx_pcm_open()
237 err = snd_pcm_hw_constraint_minmax(runtime, SNDRV_PCM_HW_PARAM_RATE, lx_pcm_open()
246 err = snd_pcm_hw_constraint_minmax(runtime, lx_pcm_open()
256 snd_pcm_hw_constraint_step(runtime, 0, lx_pcm_open()
263 runtime->private_data = chip; lx_pcm_open()
290 pos = lx_stream->frame_pos * substream->runtime->period_size; lx_pcm_stream_pointer()
340 if (chip->board_sample_rate != substream->runtime->rate) { lx_pcm_prepare()
342 chip->board_sample_rate = substream->runtime->rate; lx_pcm_prepare()
431 const u32 channels = substream->runtime->channels; lx_trigger_start()
433 const u32 period_size = substream->runtime->period_size; lx_trigger_start()
434 const u32 periods = substream->runtime->periods; lx_trigger_start()
/linux-4.1.27/sound/sparc/
H A Dcs4231.c213 static int snd_cs4231_xrate(struct snd_pcm_runtime *runtime) snd_cs4231_xrate() argument
215 return snd_pcm_hw_constraint_list(runtime, 0, snd_cs4231_xrate()
426 struct snd_pcm_runtime *runtime = substream->runtime; snd_cs4231_advance_dma() local
436 runtime->dma_addr + offset, period_size)) snd_cs4231_advance_dma()
438 (*periods_sent) = ((*periods_sent) + 1) % runtime->periods; snd_cs4231_advance_dma()
908 struct snd_pcm_runtime *runtime = substream->runtime; snd_cs4231_playback_prepare() local
917 if (WARN_ON(runtime->period_size > 0xffff + 1)) { snd_cs4231_playback_prepare()
976 chip->capture_substream->runtime->overrange++; snd_cs4231_overrange()
1008 ptr -= substream->runtime->dma_addr; snd_cs4231_playback_pointer()
1010 return bytes_to_frames(substream->runtime, ptr); snd_cs4231_playback_pointer()
1024 ptr -= substream->runtime->dma_addr; snd_cs4231_capture_pointer()
1026 return bytes_to_frames(substream->runtime, ptr); snd_cs4231_capture_pointer()
1143 struct snd_pcm_runtime *runtime = substream->runtime; snd_cs4231_playback_open() local
1146 runtime->hw = snd_cs4231_playback; snd_cs4231_playback_open()
1150 snd_free_pages(runtime->dma_area, runtime->dma_bytes); snd_cs4231_playback_open()
1156 snd_cs4231_xrate(runtime); snd_cs4231_playback_open()
1164 struct snd_pcm_runtime *runtime = substream->runtime; snd_cs4231_capture_open() local
1167 runtime->hw = snd_cs4231_capture; snd_cs4231_capture_open()
1171 snd_free_pages(runtime->dma_area, runtime->dma_bytes); snd_cs4231_capture_open()
1177 snd_cs4231_xrate(runtime); snd_cs4231_capture_open()
/linux-4.1.27/sound/soc/codecs/
H A Dstac9766.c188 struct snd_pcm_runtime *runtime = substream->runtime; ac97_analog_prepare() local
203 return stac9766_ac97_write(codec, reg, runtime->rate); ac97_analog_prepare()
210 struct snd_pcm_runtime *runtime = substream->runtime; ac97_digital_prepare() local
222 return stac9766_ac97_write(codec, reg, runtime->rate); ac97_digital_prepare()
/linux-4.1.27/drivers/firmware/efi/
H A Druntime-map.c2 * linux/drivers/efi/runtime-map.c
115 map_kset = kset_create_and_add("runtime-map", NULL, kobj); add_sysfs_runtime_map_entry()
/linux-4.1.27/arch/x86/include/asm/uv/
H A Dbios.h56 * capabilities available to the Linux kernel at runtime.
61 u64 function; /* BIOS runtime callback function ptr */
/linux-4.1.27/sound/isa/wss/
H A Dwss_lib.c83 static int snd_wss_xrate(struct snd_pcm_runtime *runtime) snd_wss_xrate() argument
85 return snd_pcm_hw_constraint_list(runtime, 0, SNDRV_PCM_HW_PARAM_RATE, snd_wss_xrate()
1018 struct snd_pcm_runtime *runtime = substream->runtime; snd_wss_playback_prepare() local
1026 snd_dma_program(chip->dma1, runtime->dma_addr, size, DMA_MODE_WRITE | DMA_AUTOINIT); snd_wss_playback_prepare()
1061 struct snd_pcm_runtime *runtime = substream->runtime; snd_wss_capture_prepare() local
1069 snd_dma_program(chip->dma2, runtime->dma_addr, size, DMA_MODE_READ | DMA_AUTOINIT); snd_wss_capture_prepare()
1099 chip->capture_substream->runtime->overrange++; snd_wss_overrange()
1162 return bytes_to_frames(substream->runtime, ptr); snd_wss_playback_pointer()
1173 return bytes_to_frames(substream->runtime, ptr); snd_wss_capture_pointer()
1503 struct snd_pcm_runtime *runtime = substream->runtime; snd_wss_playback_open() local
1506 runtime->hw = snd_wss_playback; snd_wss_playback_open()
1510 runtime->hw.formats &= ~(SNDRV_PCM_FMTBIT_IMA_ADPCM | snd_wss_playback_open()
1515 runtime->hw.formats &= ~SNDRV_PCM_FMTBIT_MU_LAW; snd_wss_playback_open()
1520 runtime->hw.formats = SNDRV_PCM_FMTBIT_U8 | SNDRV_PCM_FMTBIT_S16_LE; snd_wss_playback_open()
1522 snd_pcm_limit_isa_dma_size(chip->dma1, &runtime->hw.buffer_bytes_max); snd_wss_playback_open()
1523 snd_pcm_limit_isa_dma_size(chip->dma1, &runtime->hw.period_bytes_max); snd_wss_playback_open()
1534 snd_free_pages(runtime->dma_area, runtime->dma_bytes); snd_wss_playback_open()
1539 chip->rate_constraint(runtime); snd_wss_playback_open()
1546 struct snd_pcm_runtime *runtime = substream->runtime; snd_wss_capture_open() local
1549 runtime->hw = snd_wss_capture; snd_wss_capture_open()
1553 runtime->hw.formats &= ~(SNDRV_PCM_FMTBIT_IMA_ADPCM | snd_wss_capture_open()
1560 runtime->hw.formats = SNDRV_PCM_FMTBIT_U8 | snd_wss_capture_open()
1563 snd_pcm_limit_isa_dma_size(chip->dma2, &runtime->hw.buffer_bytes_max); snd_wss_capture_open()
1564 snd_pcm_limit_isa_dma_size(chip->dma2, &runtime->hw.period_bytes_max); snd_wss_capture_open()
1575 snd_free_pages(runtime->dma_area, runtime->dma_bytes); snd_wss_capture_open()
1580 chip->rate_constraint(runtime); snd_wss_capture_open()

Completed in 8765 milliseconds

12345