Lines Matching refs:runtime

37 #define runtime_format_bits(runtime) \  argument
38 ((unsigned int)pcm_format_to_bits((runtime)->format))
41 static void snd_sb16_csp_playback_prepare(struct snd_sb *chip, struct snd_pcm_runtime *runtime) in snd_sb16_csp_playback_prepare() argument
49 (runtime_format_bits(runtime) == csp->acc_format)) { in snd_sb16_csp_playback_prepare()
57 if (runtime_format_bits(runtime) & (SNDRV_PCM_FMTBIT_S8 | SNDRV_PCM_FMTBIT_U8 | in snd_sb16_csp_playback_prepare()
68 if (csp->ops.csp_autoload(csp, runtime->format, SNDRV_SB_CSP_MODE_DSP_WRITE)) { in snd_sb16_csp_playback_prepare()
76 (runtime->channels > 1) ? in snd_sb16_csp_playback_prepare()
89 static void snd_sb16_csp_capture_prepare(struct snd_sb *chip, struct snd_pcm_runtime *runtime) in snd_sb16_csp_capture_prepare() argument
97 (runtime_format_bits(runtime) == csp->acc_format)) { in snd_sb16_csp_capture_prepare()
106 if (csp->ops.csp_autoload(csp, runtime->format, SNDRV_SB_CSP_MODE_DSP_READ)) { in snd_sb16_csp_capture_prepare()
114 (runtime->channels > 1) ? in snd_sb16_csp_capture_prepare()
140 static void snd_sb16_csp_playback_open(struct snd_sb *chip, struct snd_pcm_runtime *runtime) in snd_sb16_csp_playback_open() argument
149 runtime->hw.formats |= csp->acc_format; in snd_sb16_csp_playback_open()
153 runtime->hw.formats |= SNDRV_PCM_FMTBIT_MU_LAW | SNDRV_PCM_FMTBIT_A_LAW | in snd_sb16_csp_playback_open()
171 static void snd_sb16_csp_capture_open(struct snd_sb *chip, struct snd_pcm_runtime *runtime) in snd_sb16_csp_capture_open() argument
180 runtime->hw.formats |= csp->acc_format; in snd_sb16_csp_capture_open()
184 runtime->hw.formats |= SNDRV_PCM_FMTBIT_MU_LAW | SNDRV_PCM_FMTBIT_A_LAW | in snd_sb16_csp_capture_open()
202 #define snd_sb16_csp_playback_prepare(chip, runtime) /*nop*/ argument
203 #define snd_sb16_csp_capture_prepare(chip, runtime) /*nop*/ argument
205 #define snd_sb16_csp_playback_open(chip, runtime) /*nop*/ argument
207 #define snd_sb16_csp_capture_open(chip, runtime) /*nop*/ argument
239 struct snd_pcm_runtime *runtime = substream->runtime; in snd_sb16_playback_prepare() local
243 snd_sb16_csp_playback_prepare(chip, runtime); in snd_sb16_playback_prepare()
244 if (snd_pcm_format_unsigned(runtime->format) > 0) { in snd_sb16_playback_prepare()
245 format = runtime->channels > 1 ? SB_DSP4_MODE_UNS_STEREO : SB_DSP4_MODE_UNS_MONO; in snd_sb16_playback_prepare()
247 format = runtime->channels > 1 ? SB_DSP4_MODE_SIGN_STEREO : SB_DSP4_MODE_SIGN_MONO; in snd_sb16_playback_prepare()
250 snd_sb16_setup_rate(chip, runtime->rate, SNDRV_PCM_STREAM_PLAYBACK); in snd_sb16_playback_prepare()
253 snd_dma_program(dma, runtime->dma_addr, size, DMA_MODE_WRITE | DMA_AUTOINIT); in snd_sb16_playback_prepare()
309 struct snd_pcm_runtime *runtime = substream->runtime; in snd_sb16_capture_prepare() local
313 snd_sb16_csp_capture_prepare(chip, runtime); in snd_sb16_capture_prepare()
314 if (snd_pcm_format_unsigned(runtime->format) > 0) { in snd_sb16_capture_prepare()
315 format = runtime->channels > 1 ? SB_DSP4_MODE_UNS_STEREO : SB_DSP4_MODE_UNS_MONO; in snd_sb16_capture_prepare()
317 format = runtime->channels > 1 ? SB_DSP4_MODE_SIGN_STEREO : SB_DSP4_MODE_SIGN_MONO; in snd_sb16_capture_prepare()
319 snd_sb16_setup_rate(chip, runtime->rate, SNDRV_PCM_STREAM_CAPTURE); in snd_sb16_capture_prepare()
322 snd_dma_program(dma, runtime->dma_addr, size, DMA_MODE_READ | DMA_AUTOINIT); in snd_sb16_capture_prepare()
434 return bytes_to_frames(substream->runtime, ptr); in snd_sb16_playback_pointer()
445 return bytes_to_frames(substream->runtime, ptr); in snd_sb16_capture_pointer()
496 struct snd_pcm_runtime *runtime = substream->runtime; in snd_sb16_playback_open() local
503 runtime->hw = snd_sb16_playback; in snd_sb16_playback_open()
511 runtime->hw.formats = SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_U16_LE; in snd_sb16_playback_open()
514 runtime->hw.buffer_bytes_max = in snd_sb16_playback_open()
515 runtime->hw.period_bytes_max = 64 * 1024; in snd_sb16_playback_open()
517 snd_sb16_csp_playback_open(chip, runtime); in snd_sb16_playback_open()
527 runtime->hw.formats = SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_U16_LE; in snd_sb16_playback_open()
530 runtime->hw.formats = SNDRV_PCM_FMTBIT_U8 | SNDRV_PCM_FMTBIT_S8; in snd_sb16_playback_open()
532 runtime->hw.buffer_bytes_max = in snd_sb16_playback_open()
533 runtime->hw.period_bytes_max = 64 * 1024; in snd_sb16_playback_open()
541 runtime->hw.rate_max = 48000; in snd_sb16_playback_open()
543 runtime->hw.buffer_bytes_max = 32 * 1024; in snd_sb16_playback_open()
544 runtime->hw.periods_min = 2; in snd_sb16_playback_open()
545 runtime->hw.rate_min = 44100; in snd_sb16_playback_open()
548 runtime->hw.rate_min = runtime->hw.rate_max = chip->locked_rate; in snd_sb16_playback_open()
571 struct snd_pcm_runtime *runtime = substream->runtime; in snd_sb16_capture_open() local
578 runtime->hw = snd_sb16_capture; in snd_sb16_capture_open()
586 runtime->hw.formats = SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_U16_LE; in snd_sb16_capture_open()
589 runtime->hw.buffer_bytes_max = in snd_sb16_capture_open()
590 runtime->hw.period_bytes_max = 64 * 1024; in snd_sb16_capture_open()
592 snd_sb16_csp_capture_open(chip, runtime); in snd_sb16_capture_open()
602 runtime->hw.formats = SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_U16_LE; in snd_sb16_capture_open()
605 runtime->hw.formats = SNDRV_PCM_FMTBIT_U8 | SNDRV_PCM_FMTBIT_S8; in snd_sb16_capture_open()
607 runtime->hw.buffer_bytes_max = in snd_sb16_capture_open()
608 runtime->hw.period_bytes_max = 64 * 1024; in snd_sb16_capture_open()
616 runtime->hw.rate_max = 48000; in snd_sb16_capture_open()
618 runtime->hw.buffer_bytes_max = 32 * 1024; in snd_sb16_capture_open()
619 runtime->hw.periods_min = 2; in snd_sb16_capture_open()
620 runtime->hw.rate_min = 44100; in snd_sb16_capture_open()
623 runtime->hw.rate_min = runtime->hw.rate_max = chip->locked_rate; in snd_sb16_capture_open()