Lines Matching full: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()
50 /* Supported runtime PCM format for playback */ 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()
98 /* Supported runtime PCM format for capture */ 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
251 struct snd_pcm_runtime *runtime = substream->runtime; in snd_sb16_playback_prepare() local
255 snd_sb16_csp_playback_prepare(chip, runtime); in snd_sb16_playback_prepare()
256 if (snd_pcm_format_unsigned(runtime->format) > 0) { in snd_sb16_playback_prepare()
257 format = runtime->channels > 1 ? SB_DSP4_MODE_UNS_STEREO : SB_DSP4_MODE_UNS_MONO; in snd_sb16_playback_prepare()
259 format = runtime->channels > 1 ? SB_DSP4_MODE_SIGN_STEREO : SB_DSP4_MODE_SIGN_MONO; in snd_sb16_playback_prepare()
262 snd_sb16_setup_rate(chip, runtime->rate, SNDRV_PCM_STREAM_PLAYBACK); in snd_sb16_playback_prepare()
265 snd_dma_program(dma, runtime->dma_addr, size, DMA_MODE_WRITE | DMA_AUTOINIT); in snd_sb16_playback_prepare()
321 struct snd_pcm_runtime *runtime = substream->runtime; in snd_sb16_capture_prepare() local
325 snd_sb16_csp_capture_prepare(chip, runtime); in snd_sb16_capture_prepare()
326 if (snd_pcm_format_unsigned(runtime->format) > 0) { in snd_sb16_capture_prepare()
327 format = runtime->channels > 1 ? SB_DSP4_MODE_UNS_STEREO : SB_DSP4_MODE_UNS_MONO; in snd_sb16_capture_prepare()
329 format = runtime->channels > 1 ? SB_DSP4_MODE_SIGN_STEREO : SB_DSP4_MODE_SIGN_MONO; in snd_sb16_capture_prepare()
331 snd_sb16_setup_rate(chip, runtime->rate, SNDRV_PCM_STREAM_CAPTURE); in snd_sb16_capture_prepare()
334 snd_dma_program(dma, runtime->dma_addr, size, DMA_MODE_READ | DMA_AUTOINIT); in snd_sb16_capture_prepare()
446 return bytes_to_frames(substream->runtime, ptr); in snd_sb16_playback_pointer()
457 return bytes_to_frames(substream->runtime, ptr); in snd_sb16_capture_pointer()
508 struct snd_pcm_runtime *runtime = substream->runtime; in snd_sb16_playback_open() local
515 runtime->hw = snd_sb16_playback; in snd_sb16_playback_open()
523 runtime->hw.formats = SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_U16_LE; in snd_sb16_playback_open()
526 runtime->hw.buffer_bytes_max = in snd_sb16_playback_open()
527 runtime->hw.period_bytes_max = 64 * 1024; in snd_sb16_playback_open()
529 snd_sb16_csp_playback_open(chip, runtime); in snd_sb16_playback_open()
539 runtime->hw.formats = SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_U16_LE; in snd_sb16_playback_open()
542 runtime->hw.formats = SNDRV_PCM_FMTBIT_U8 | SNDRV_PCM_FMTBIT_S8; in snd_sb16_playback_open()
544 runtime->hw.buffer_bytes_max = in snd_sb16_playback_open()
545 runtime->hw.period_bytes_max = 64 * 1024; in snd_sb16_playback_open()
553 runtime->hw.rate_max = 48000; in snd_sb16_playback_open()
555 runtime->hw.buffer_bytes_max = 32 * 1024; in snd_sb16_playback_open()
556 runtime->hw.periods_min = 2; in snd_sb16_playback_open()
557 runtime->hw.rate_min = 44100; in snd_sb16_playback_open()
560 runtime->hw.rate_min = runtime->hw.rate_max = chip->locked_rate; in snd_sb16_playback_open()
583 struct snd_pcm_runtime *runtime = substream->runtime; in snd_sb16_capture_open() local
590 runtime->hw = snd_sb16_capture; in snd_sb16_capture_open()
598 runtime->hw.formats = SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_U16_LE; in snd_sb16_capture_open()
601 runtime->hw.buffer_bytes_max = in snd_sb16_capture_open()
602 runtime->hw.period_bytes_max = 64 * 1024; in snd_sb16_capture_open()
604 snd_sb16_csp_capture_open(chip, runtime); in snd_sb16_capture_open()
614 runtime->hw.formats = SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_U16_LE; in snd_sb16_capture_open()
617 runtime->hw.formats = SNDRV_PCM_FMTBIT_U8 | SNDRV_PCM_FMTBIT_S8; in snd_sb16_capture_open()
619 runtime->hw.buffer_bytes_max = in snd_sb16_capture_open()
620 runtime->hw.period_bytes_max = 64 * 1024; in snd_sb16_capture_open()
628 runtime->hw.rate_max = 48000; in snd_sb16_capture_open()
630 runtime->hw.buffer_bytes_max = 32 * 1024; in snd_sb16_capture_open()
631 runtime->hw.periods_min = 2; in snd_sb16_capture_open()
632 runtime->hw.rate_min = 44100; in snd_sb16_capture_open()
635 runtime->hw.rate_min = runtime->hw.rate_max = chip->locked_rate; in snd_sb16_capture_open()