Lines Matching refs:runtime
52 #define runtime_format_bits(runtime) \ argument
53 ((unsigned int)pcm_format_to_bits((runtime)->format))
56 static void snd_sb16_csp_playback_prepare(struct snd_sb *chip, struct snd_pcm_runtime *runtime) in snd_sb16_csp_playback_prepare() argument
64 (runtime_format_bits(runtime) == csp->acc_format)) { in snd_sb16_csp_playback_prepare()
72 if (runtime_format_bits(runtime) & (SNDRV_PCM_FMTBIT_S8 | SNDRV_PCM_FMTBIT_U8 | in snd_sb16_csp_playback_prepare()
83 if (csp->ops.csp_autoload(csp, runtime->format, SNDRV_SB_CSP_MODE_DSP_WRITE)) { in snd_sb16_csp_playback_prepare()
91 (runtime->channels > 1) ? in snd_sb16_csp_playback_prepare()
104 static void snd_sb16_csp_capture_prepare(struct snd_sb *chip, struct snd_pcm_runtime *runtime) in snd_sb16_csp_capture_prepare() argument
112 (runtime_format_bits(runtime) == csp->acc_format)) { in snd_sb16_csp_capture_prepare()
121 if (csp->ops.csp_autoload(csp, runtime->format, SNDRV_SB_CSP_MODE_DSP_READ)) { in snd_sb16_csp_capture_prepare()
129 (runtime->channels > 1) ? in snd_sb16_csp_capture_prepare()
155 static void snd_sb16_csp_playback_open(struct snd_sb *chip, struct snd_pcm_runtime *runtime) in snd_sb16_csp_playback_open() argument
164 runtime->hw.formats |= csp->acc_format; in snd_sb16_csp_playback_open()
168 runtime->hw.formats |= SNDRV_PCM_FMTBIT_MU_LAW | SNDRV_PCM_FMTBIT_A_LAW | in snd_sb16_csp_playback_open()
186 static void snd_sb16_csp_capture_open(struct snd_sb *chip, struct snd_pcm_runtime *runtime) in snd_sb16_csp_capture_open() argument
195 runtime->hw.formats |= csp->acc_format; in snd_sb16_csp_capture_open()
199 runtime->hw.formats |= SNDRV_PCM_FMTBIT_MU_LAW | SNDRV_PCM_FMTBIT_A_LAW | in snd_sb16_csp_capture_open()
217 #define snd_sb16_csp_playback_prepare(chip, runtime) /*nop*/ argument
218 #define snd_sb16_csp_capture_prepare(chip, runtime) /*nop*/ argument
220 #define snd_sb16_csp_playback_open(chip, runtime) /*nop*/ argument
222 #define snd_sb16_csp_capture_open(chip, runtime) /*nop*/ argument
266 struct snd_pcm_runtime *runtime = substream->runtime; in snd_sb16_playback_prepare() local
270 snd_sb16_csp_playback_prepare(chip, runtime); in snd_sb16_playback_prepare()
271 if (snd_pcm_format_unsigned(runtime->format) > 0) { in snd_sb16_playback_prepare()
272 format = runtime->channels > 1 ? SB_DSP4_MODE_UNS_STEREO : SB_DSP4_MODE_UNS_MONO; in snd_sb16_playback_prepare()
274 format = runtime->channels > 1 ? SB_DSP4_MODE_SIGN_STEREO : SB_DSP4_MODE_SIGN_MONO; in snd_sb16_playback_prepare()
277 snd_sb16_setup_rate(chip, runtime->rate, SNDRV_PCM_STREAM_PLAYBACK); in snd_sb16_playback_prepare()
280 snd_dma_program(dma, runtime->dma_addr, size, DMA_MODE_WRITE | DMA_AUTOINIT); in snd_sb16_playback_prepare()
336 struct snd_pcm_runtime *runtime = substream->runtime; in snd_sb16_capture_prepare() local
340 snd_sb16_csp_capture_prepare(chip, runtime); in snd_sb16_capture_prepare()
341 if (snd_pcm_format_unsigned(runtime->format) > 0) { in snd_sb16_capture_prepare()
342 format = runtime->channels > 1 ? SB_DSP4_MODE_UNS_STEREO : SB_DSP4_MODE_UNS_MONO; in snd_sb16_capture_prepare()
344 format = runtime->channels > 1 ? SB_DSP4_MODE_SIGN_STEREO : SB_DSP4_MODE_SIGN_MONO; in snd_sb16_capture_prepare()
346 snd_sb16_setup_rate(chip, runtime->rate, SNDRV_PCM_STREAM_CAPTURE); in snd_sb16_capture_prepare()
349 snd_dma_program(dma, runtime->dma_addr, size, DMA_MODE_READ | DMA_AUTOINIT); in snd_sb16_capture_prepare()
461 return bytes_to_frames(substream->runtime, ptr); in snd_sb16_playback_pointer()
472 return bytes_to_frames(substream->runtime, ptr); in snd_sb16_capture_pointer()
523 struct snd_pcm_runtime *runtime = substream->runtime; in snd_sb16_playback_open() local
530 runtime->hw = snd_sb16_playback; in snd_sb16_playback_open()
538 runtime->hw.formats = SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_U16_LE; in snd_sb16_playback_open()
541 runtime->hw.buffer_bytes_max = in snd_sb16_playback_open()
542 runtime->hw.period_bytes_max = 64 * 1024; in snd_sb16_playback_open()
544 snd_sb16_csp_playback_open(chip, runtime); in snd_sb16_playback_open()
554 runtime->hw.formats = SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_U16_LE; in snd_sb16_playback_open()
557 runtime->hw.formats = SNDRV_PCM_FMTBIT_U8 | SNDRV_PCM_FMTBIT_S8; in snd_sb16_playback_open()
559 runtime->hw.buffer_bytes_max = in snd_sb16_playback_open()
560 runtime->hw.period_bytes_max = 64 * 1024; in snd_sb16_playback_open()
568 runtime->hw.rate_max = 48000; in snd_sb16_playback_open()
570 runtime->hw.buffer_bytes_max = 32 * 1024; in snd_sb16_playback_open()
571 runtime->hw.periods_min = 2; in snd_sb16_playback_open()
572 runtime->hw.rate_min = 44100; in snd_sb16_playback_open()
575 runtime->hw.rate_min = runtime->hw.rate_max = chip->locked_rate; in snd_sb16_playback_open()
598 struct snd_pcm_runtime *runtime = substream->runtime; in snd_sb16_capture_open() local
605 runtime->hw = snd_sb16_capture; in snd_sb16_capture_open()
613 runtime->hw.formats = SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_U16_LE; in snd_sb16_capture_open()
616 runtime->hw.buffer_bytes_max = in snd_sb16_capture_open()
617 runtime->hw.period_bytes_max = 64 * 1024; in snd_sb16_capture_open()
619 snd_sb16_csp_capture_open(chip, runtime); in snd_sb16_capture_open()
629 runtime->hw.formats = SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_U16_LE; in snd_sb16_capture_open()
632 runtime->hw.formats = SNDRV_PCM_FMTBIT_U8 | SNDRV_PCM_FMTBIT_S8; in snd_sb16_capture_open()
634 runtime->hw.buffer_bytes_max = in snd_sb16_capture_open()
635 runtime->hw.period_bytes_max = 64 * 1024; in snd_sb16_capture_open()
643 runtime->hw.rate_max = 48000; in snd_sb16_capture_open()
645 runtime->hw.buffer_bytes_max = 32 * 1024; in snd_sb16_capture_open()
646 runtime->hw.periods_min = 2; in snd_sb16_capture_open()
647 runtime->hw.rate_min = 44100; in snd_sb16_capture_open()
650 runtime->hw.rate_min = runtime->hw.rate_max = chip->locked_rate; in snd_sb16_capture_open()