Lines Matching +full:- +full:chs

1 // SPDX-License-Identifier: GPL-2.0-only
97 if (!apcm->substream) in ct_atc_pcm_interrupt()
100 snd_pcm_period_elapsed(apcm->substream); in ct_atc_pcm_interrupt()
105 struct ct_atc_pcm *apcm = runtime->private_data; in ct_atc_pcm_free_substream()
106 struct ct_atc *atc = snd_pcm_substream_chip(apcm->substream); in ct_atc_pcm_free_substream()
108 atc->pcm_release_resources(atc, apcm); in ct_atc_pcm_free_substream()
109 ct_timer_instance_free(apcm->timer); in ct_atc_pcm_free_substream()
111 runtime->private_data = NULL; in ct_atc_pcm_free_substream()
118 struct snd_pcm_runtime *runtime = substream->runtime; in ct_pcm_playback_open()
124 return -ENOMEM; in ct_pcm_playback_open()
126 apcm->substream = substream; in ct_pcm_playback_open()
127 apcm->interrupt = ct_atc_pcm_interrupt; in ct_pcm_playback_open()
128 if (IEC958 == substream->pcm->device) { in ct_pcm_playback_open()
129 runtime->hw = ct_spdif_passthru_playback_hw; in ct_pcm_playback_open()
130 atc->spdif_out_passthru(atc, 1); in ct_pcm_playback_open()
132 runtime->hw = ct_pcm_playback_hw; in ct_pcm_playback_open()
133 if (FRONT == substream->pcm->device) in ct_pcm_playback_open()
134 runtime->hw.channels_max = 8; in ct_pcm_playback_open()
148 apcm->timer = ct_timer_instance_new(atc->timer, apcm); in ct_pcm_playback_open()
149 if (!apcm->timer) { in ct_pcm_playback_open()
150 err = -ENOMEM; in ct_pcm_playback_open()
153 runtime->private_data = apcm; in ct_pcm_playback_open()
154 runtime->private_free = ct_atc_pcm_free_substream; in ct_pcm_playback_open()
168 if (IEC958 == substream->pcm->device) in ct_pcm_playback_close()
169 atc->spdif_out_passthru(atc, 0); in ct_pcm_playback_close()
171 /* The ct_atc_pcm object will be freed by runtime->private_free */ in ct_pcm_playback_close()
180 struct ct_atc_pcm *apcm = substream->runtime->private_data; in ct_pcm_hw_params()
183 atc->pcm_release_resources(atc, apcm); in ct_pcm_hw_params()
190 struct ct_atc_pcm *apcm = substream->runtime->private_data; in ct_pcm_hw_free()
193 atc->pcm_release_resources(atc, apcm); in ct_pcm_hw_free()
202 struct snd_pcm_runtime *runtime = substream->runtime; in ct_pcm_playback_prepare()
203 struct ct_atc_pcm *apcm = runtime->private_data; in ct_pcm_playback_prepare()
205 if (IEC958 == substream->pcm->device) in ct_pcm_playback_prepare()
206 err = atc->spdif_passthru_playback_prepare(atc, apcm); in ct_pcm_playback_prepare()
208 err = atc->pcm_playback_prepare(atc, apcm); in ct_pcm_playback_prepare()
211 dev_err(atc->card->dev, in ct_pcm_playback_prepare()
223 struct snd_pcm_runtime *runtime = substream->runtime; in ct_pcm_playback_trigger()
224 struct ct_atc_pcm *apcm = runtime->private_data; in ct_pcm_playback_trigger()
230 atc->pcm_playback_start(atc, apcm); in ct_pcm_playback_trigger()
235 atc->pcm_playback_stop(atc, apcm); in ct_pcm_playback_trigger()
249 struct snd_pcm_runtime *runtime = substream->runtime; in ct_pcm_playback_pointer()
250 struct ct_atc_pcm *apcm = runtime->private_data; in ct_pcm_playback_pointer()
253 position = atc->pcm_playback_position(atc, apcm); in ct_pcm_playback_pointer()
255 if (position >= runtime->buffer_size) in ct_pcm_playback_pointer()
264 struct snd_pcm_runtime *runtime = substream->runtime; in ct_pcm_capture_open()
270 return -ENOMEM; in ct_pcm_capture_open()
272 apcm->started = 0; in ct_pcm_capture_open()
273 apcm->substream = substream; in ct_pcm_capture_open()
274 apcm->interrupt = ct_atc_pcm_interrupt; in ct_pcm_capture_open()
275 runtime->hw = ct_pcm_capture_hw; in ct_pcm_capture_open()
276 runtime->hw.rate_max = atc->rsr * atc->msr; in ct_pcm_capture_open()
289 apcm->timer = ct_timer_instance_new(atc->timer, apcm); in ct_pcm_capture_open()
290 if (!apcm->timer) { in ct_pcm_capture_open()
291 err = -ENOMEM; in ct_pcm_capture_open()
294 runtime->private_data = apcm; in ct_pcm_capture_open()
295 runtime->private_free = ct_atc_pcm_free_substream; in ct_pcm_capture_open()
306 /* The ct_atc_pcm object will be freed by runtime->private_free */ in ct_pcm_capture_close()
315 struct snd_pcm_runtime *runtime = substream->runtime; in ct_pcm_capture_prepare()
316 struct ct_atc_pcm *apcm = runtime->private_data; in ct_pcm_capture_prepare()
318 err = atc->pcm_capture_prepare(atc, apcm); in ct_pcm_capture_prepare()
320 dev_err(atc->card->dev, in ct_pcm_capture_prepare()
332 struct snd_pcm_runtime *runtime = substream->runtime; in ct_pcm_capture_trigger()
333 struct ct_atc_pcm *apcm = runtime->private_data; in ct_pcm_capture_trigger()
337 atc->pcm_capture_start(atc, apcm); in ct_pcm_capture_trigger()
340 atc->pcm_capture_stop(atc, apcm); in ct_pcm_capture_trigger()
343 atc->pcm_capture_stop(atc, apcm); in ct_pcm_capture_trigger()
355 struct snd_pcm_runtime *runtime = substream->runtime; in ct_pcm_capture_pointer()
356 struct ct_atc_pcm *apcm = runtime->private_data; in ct_pcm_capture_pointer()
359 position = atc->pcm_capture_position(atc, apcm); in ct_pcm_capture_pointer()
361 if (position >= runtime->buffer_size) in ct_pcm_capture_pointer()
419 int chs; in ct_alsa_pcm_create() local
425 err = snd_pcm_new(atc->card, "ctxfi", device, in ct_alsa_pcm_create()
428 dev_err(atc->card->dev, "snd_pcm_new failed!! Err=%d\n", in ct_alsa_pcm_create()
433 pcm->private_data = atc; in ct_alsa_pcm_create()
434 pcm->info_flags = 0; in ct_alsa_pcm_create()
435 pcm->dev_subclass = SNDRV_PCM_SUBCLASS_GENERIC_MIX; in ct_alsa_pcm_create()
436 strscpy(pcm->name, device_name, sizeof(pcm->name)); in ct_alsa_pcm_create()
445 &atc->pci->dev, 128*1024, 128*1024); in ct_alsa_pcm_create()
447 chs = 2; in ct_alsa_pcm_create()
450 chs = 8; in ct_alsa_pcm_create()
466 err = snd_pcm_add_chmap_ctls(pcm, SNDRV_PCM_STREAM_PLAYBACK, map, chs, in ct_alsa_pcm_create()
472 atc->pcms[device] = pcm; in ct_alsa_pcm_create()