Lines Matching +full:post +full:-

1 // SPDX-License-Identifier: GPL-2.0-or-later
21 unsigned long rate, mult, fsize, l, post; in snd_pcm_timer_resolution_change() local
22 struct snd_pcm_runtime *runtime = substream->runtime; in snd_pcm_timer_resolution_change()
25 rate = runtime->rate; in snd_pcm_timer_resolution_change()
31 fsize = runtime->period_size; in snd_pcm_timer_resolution_change()
37 post = 1; in snd_pcm_timer_resolution_change()
40 post *= 2; in snd_pcm_timer_resolution_change()
43 pcm_err(substream->pcm, in snd_pcm_timer_resolution_change()
45 runtime->rate, runtime->period_size); in snd_pcm_timer_resolution_change()
46 runtime->timer_resolution = -1; in snd_pcm_timer_resolution_change()
49 runtime->timer_resolution = (mult * fsize / rate) * post; in snd_pcm_timer_resolution_change()
56 substream = timer->private_data; in snd_pcm_timer_resolution()
57 return substream->runtime ? substream->runtime->timer_resolution : 0; in snd_pcm_timer_resolution()
65 substream->timer_running = 1; in snd_pcm_timer_start()
74 substream->timer_running = 0; in snd_pcm_timer_stop()
94 struct snd_pcm_substream *substream = timer->private_data; in snd_pcm_timer_free()
95 substream->timer = NULL; in snd_pcm_timer_free()
105 tid.card = substream->pcm->card->number; in snd_pcm_timer_init()
106 tid.device = substream->pcm->device; in snd_pcm_timer_init()
107 tid.subdevice = (substream->number << 1) | (substream->stream & 1); in snd_pcm_timer_init()
108 if (snd_timer_new(substream->pcm->card, "PCM", &tid, &timer) < 0) in snd_pcm_timer_init()
110 sprintf(timer->name, "PCM %s %i-%i-%i", in snd_pcm_timer_init()
111 substream->stream == SNDRV_PCM_STREAM_CAPTURE ? in snd_pcm_timer_init()
114 timer->hw = snd_pcm_timer; in snd_pcm_timer_init()
115 if (snd_device_register(timer->card, timer) < 0) { in snd_pcm_timer_init()
116 snd_device_free(timer->card, timer); in snd_pcm_timer_init()
119 timer->private_data = substream; in snd_pcm_timer_init()
120 timer->private_free = snd_pcm_timer_free; in snd_pcm_timer_init()
121 substream->timer = timer; in snd_pcm_timer_init()
126 if (substream->timer) { in snd_pcm_timer_done()
127 snd_device_free(substream->pcm->card, substream->timer); in snd_pcm_timer_done()
128 substream->timer = NULL; in snd_pcm_timer_done()