Lines Matching refs:runtime
53 static void snd_sb16_csp_playback_prepare(struct snd_sb *chip, struct snd_pcm_runtime *runtime) in snd_sb16_csp_playback_prepare() argument
61 ((1U << runtime->format) == csp->acc_format)) { in snd_sb16_csp_playback_prepare()
69 if ((1 << runtime->format) & (SNDRV_PCM_FMTBIT_S8 | SNDRV_PCM_FMTBIT_U8 | in snd_sb16_csp_playback_prepare()
80 if (csp->ops.csp_autoload(csp, runtime->format, SNDRV_SB_CSP_MODE_DSP_WRITE)) { in snd_sb16_csp_playback_prepare()
88 (runtime->channels > 1) ? in snd_sb16_csp_playback_prepare()
101 static void snd_sb16_csp_capture_prepare(struct snd_sb *chip, struct snd_pcm_runtime *runtime) in snd_sb16_csp_capture_prepare() argument
109 ((1U << runtime->format) == csp->acc_format)) { in snd_sb16_csp_capture_prepare()
118 if (csp->ops.csp_autoload(csp, runtime->format, SNDRV_SB_CSP_MODE_DSP_READ)) { in snd_sb16_csp_capture_prepare()
126 (runtime->channels > 1) ? in snd_sb16_csp_capture_prepare()
152 static void snd_sb16_csp_playback_open(struct snd_sb *chip, struct snd_pcm_runtime *runtime) in snd_sb16_csp_playback_open() argument
161 runtime->hw.formats |= csp->acc_format; in snd_sb16_csp_playback_open()
165 runtime->hw.formats |= SNDRV_PCM_FMTBIT_MU_LAW | SNDRV_PCM_FMTBIT_A_LAW | in snd_sb16_csp_playback_open()
183 static void snd_sb16_csp_capture_open(struct snd_sb *chip, struct snd_pcm_runtime *runtime) in snd_sb16_csp_capture_open() argument
192 runtime->hw.formats |= csp->acc_format; in snd_sb16_csp_capture_open()
196 runtime->hw.formats |= SNDRV_PCM_FMTBIT_MU_LAW | SNDRV_PCM_FMTBIT_A_LAW | in snd_sb16_csp_capture_open()
214 #define snd_sb16_csp_playback_prepare(chip, runtime) /*nop*/ argument
215 #define snd_sb16_csp_capture_prepare(chip, runtime) /*nop*/ argument
217 #define snd_sb16_csp_playback_open(chip, runtime) /*nop*/ argument
219 #define snd_sb16_csp_capture_open(chip, runtime) /*nop*/ argument
263 struct snd_pcm_runtime *runtime = substream->runtime; in snd_sb16_playback_prepare() local
267 snd_sb16_csp_playback_prepare(chip, runtime); in snd_sb16_playback_prepare()
268 if (snd_pcm_format_unsigned(runtime->format) > 0) { in snd_sb16_playback_prepare()
269 format = runtime->channels > 1 ? SB_DSP4_MODE_UNS_STEREO : SB_DSP4_MODE_UNS_MONO; in snd_sb16_playback_prepare()
271 format = runtime->channels > 1 ? SB_DSP4_MODE_SIGN_STEREO : SB_DSP4_MODE_SIGN_MONO; in snd_sb16_playback_prepare()
274 snd_sb16_setup_rate(chip, runtime->rate, SNDRV_PCM_STREAM_PLAYBACK); in snd_sb16_playback_prepare()
277 snd_dma_program(dma, runtime->dma_addr, size, DMA_MODE_WRITE | DMA_AUTOINIT); in snd_sb16_playback_prepare()
333 struct snd_pcm_runtime *runtime = substream->runtime; in snd_sb16_capture_prepare() local
337 snd_sb16_csp_capture_prepare(chip, runtime); in snd_sb16_capture_prepare()
338 if (snd_pcm_format_unsigned(runtime->format) > 0) { in snd_sb16_capture_prepare()
339 format = runtime->channels > 1 ? SB_DSP4_MODE_UNS_STEREO : SB_DSP4_MODE_UNS_MONO; in snd_sb16_capture_prepare()
341 format = runtime->channels > 1 ? SB_DSP4_MODE_SIGN_STEREO : SB_DSP4_MODE_SIGN_MONO; in snd_sb16_capture_prepare()
343 snd_sb16_setup_rate(chip, runtime->rate, SNDRV_PCM_STREAM_CAPTURE); in snd_sb16_capture_prepare()
346 snd_dma_program(dma, runtime->dma_addr, size, DMA_MODE_READ | DMA_AUTOINIT); in snd_sb16_capture_prepare()
458 return bytes_to_frames(substream->runtime, ptr); in snd_sb16_playback_pointer()
469 return bytes_to_frames(substream->runtime, ptr); in snd_sb16_capture_pointer()
520 struct snd_pcm_runtime *runtime = substream->runtime; in snd_sb16_playback_open() local
527 runtime->hw = snd_sb16_playback; in snd_sb16_playback_open()
535 runtime->hw.formats = SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_U16_LE; in snd_sb16_playback_open()
538 runtime->hw.buffer_bytes_max = in snd_sb16_playback_open()
539 runtime->hw.period_bytes_max = 64 * 1024; in snd_sb16_playback_open()
541 snd_sb16_csp_playback_open(chip, runtime); in snd_sb16_playback_open()
551 runtime->hw.formats = SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_U16_LE; in snd_sb16_playback_open()
554 runtime->hw.formats = SNDRV_PCM_FMTBIT_U8 | SNDRV_PCM_FMTBIT_S8; in snd_sb16_playback_open()
556 runtime->hw.buffer_bytes_max = in snd_sb16_playback_open()
557 runtime->hw.period_bytes_max = 64 * 1024; in snd_sb16_playback_open()
565 runtime->hw.rate_max = 48000; in snd_sb16_playback_open()
567 runtime->hw.buffer_bytes_max = 32 * 1024; in snd_sb16_playback_open()
568 runtime->hw.periods_min = 2; in snd_sb16_playback_open()
569 runtime->hw.rate_min = 44100; in snd_sb16_playback_open()
572 runtime->hw.rate_min = runtime->hw.rate_max = chip->locked_rate; in snd_sb16_playback_open()
595 struct snd_pcm_runtime *runtime = substream->runtime; in snd_sb16_capture_open() local
602 runtime->hw = snd_sb16_capture; in snd_sb16_capture_open()
610 runtime->hw.formats = SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_U16_LE; in snd_sb16_capture_open()
613 runtime->hw.buffer_bytes_max = in snd_sb16_capture_open()
614 runtime->hw.period_bytes_max = 64 * 1024; in snd_sb16_capture_open()
616 snd_sb16_csp_capture_open(chip, runtime); in snd_sb16_capture_open()
626 runtime->hw.formats = SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_U16_LE; in snd_sb16_capture_open()
629 runtime->hw.formats = SNDRV_PCM_FMTBIT_U8 | SNDRV_PCM_FMTBIT_S8; in snd_sb16_capture_open()
631 runtime->hw.buffer_bytes_max = in snd_sb16_capture_open()
632 runtime->hw.period_bytes_max = 64 * 1024; in snd_sb16_capture_open()
640 runtime->hw.rate_max = 48000; in snd_sb16_capture_open()
642 runtime->hw.buffer_bytes_max = 32 * 1024; in snd_sb16_capture_open()
643 runtime->hw.periods_min = 2; in snd_sb16_capture_open()
644 runtime->hw.rate_min = 44100; in snd_sb16_capture_open()
647 runtime->hw.rate_min = runtime->hw.rate_max = chip->locked_rate; in snd_sb16_capture_open()