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