Lines Matching refs:dice

15 	struct snd_dice *dice = substream->private_data;  in dice_rate_constraint()  local
30 pcm_channels = dice->tx_pcm_chs[index]; in dice_rate_constraint()
32 pcm_channels = dice->rx_pcm_chs[index]; in dice_rate_constraint()
36 if (snd_dice_stream_get_rate_mode(dice, rate, &mode) < 0) in dice_rate_constraint()
53 struct snd_dice *dice = substream->private_data; in dice_channels_constraint() local
68 pcm_channels = dice->tx_pcm_chs[index]; in dice_channels_constraint()
70 pcm_channels = dice->rx_pcm_chs[index]; in dice_channels_constraint()
74 if (snd_dice_stream_get_rate_mode(dice, rate, &mode) < 0) in dice_channels_constraint()
87 static int limit_channels_and_rates(struct snd_dice *dice, in limit_channels_and_rates() argument
97 pcm_channels = dice->tx_pcm_chs[index]; in limit_channels_and_rates()
99 pcm_channels = dice->rx_pcm_chs[index]; in limit_channels_and_rates()
109 if (snd_dice_stream_get_rate_mode(dice, rate, &mode) < 0) in limit_channels_and_rates()
125 static int init_hw_info(struct snd_dice *dice, in init_hw_info() argument
138 stream = &dice->tx_stream[index]; in init_hw_info()
142 stream = &dice->rx_stream[index]; in init_hw_info()
145 err = limit_channels_and_rates(dice, substream->runtime, dir, in init_hw_info()
166 struct snd_dice *dice = substream->private_data; in pcm_open() local
167 struct amdtp_domain *d = &dice->domain; in pcm_open()
172 err = snd_dice_stream_lock_try(dice); in pcm_open()
176 err = init_hw_info(dice, substream); in pcm_open()
180 err = snd_dice_transaction_get_clock_source(dice, &source); in pcm_open()
199 mutex_lock(&dice->mutex); in pcm_open()
205 (dice->substreams_counter > 0 && d->events_per_period > 0)) { in pcm_open()
210 err = snd_dice_transaction_get_rate(dice, &rate); in pcm_open()
212 mutex_unlock(&dice->mutex); in pcm_open()
221 if (rate > 96000 && !dice->disable_double_pcm_frames) { in pcm_open()
230 mutex_unlock(&dice->mutex); in pcm_open()
238 mutex_unlock(&dice->mutex); in pcm_open()
244 mutex_unlock(&dice->mutex); in pcm_open()
250 snd_dice_stream_lock_release(dice); in pcm_open()
256 struct snd_dice *dice = substream->private_data; in pcm_close() local
258 snd_dice_stream_lock_release(dice); in pcm_close()
266 struct snd_dice *dice = substream->private_data; in pcm_hw_params() local
274 mutex_lock(&dice->mutex); in pcm_hw_params()
276 if (rate > 96000 && !dice->disable_double_pcm_frames) { in pcm_hw_params()
280 err = snd_dice_stream_reserve_duplex(dice, rate, in pcm_hw_params()
283 ++dice->substreams_counter; in pcm_hw_params()
284 mutex_unlock(&dice->mutex); in pcm_hw_params()
292 struct snd_dice *dice = substream->private_data; in pcm_hw_free() local
294 mutex_lock(&dice->mutex); in pcm_hw_free()
297 --dice->substreams_counter; in pcm_hw_free()
299 snd_dice_stream_stop_duplex(dice); in pcm_hw_free()
301 mutex_unlock(&dice->mutex); in pcm_hw_free()
308 struct snd_dice *dice = substream->private_data; in capture_prepare() local
309 struct amdtp_stream *stream = &dice->tx_stream[substream->pcm->device]; in capture_prepare()
312 mutex_lock(&dice->mutex); in capture_prepare()
313 err = snd_dice_stream_start_duplex(dice); in capture_prepare()
314 mutex_unlock(&dice->mutex); in capture_prepare()
322 struct snd_dice *dice = substream->private_data; in playback_prepare() local
323 struct amdtp_stream *stream = &dice->rx_stream[substream->pcm->device]; in playback_prepare()
326 mutex_lock(&dice->mutex); in playback_prepare()
327 err = snd_dice_stream_start_duplex(dice); in playback_prepare()
328 mutex_unlock(&dice->mutex); in playback_prepare()
337 struct snd_dice *dice = substream->private_data; in capture_trigger() local
338 struct amdtp_stream *stream = &dice->tx_stream[substream->pcm->device]; in capture_trigger()
355 struct snd_dice *dice = substream->private_data; in playback_trigger() local
356 struct amdtp_stream *stream = &dice->rx_stream[substream->pcm->device]; in playback_trigger()
374 struct snd_dice *dice = substream->private_data; in capture_pointer() local
375 struct amdtp_stream *stream = &dice->tx_stream[substream->pcm->device]; in capture_pointer()
377 return amdtp_domain_stream_pcm_pointer(&dice->domain, stream); in capture_pointer()
381 struct snd_dice *dice = substream->private_data; in playback_pointer() local
382 struct amdtp_stream *stream = &dice->rx_stream[substream->pcm->device]; in playback_pointer()
384 return amdtp_domain_stream_pcm_pointer(&dice->domain, stream); in playback_pointer()
389 struct snd_dice *dice = substream->private_data; in capture_ack() local
390 struct amdtp_stream *stream = &dice->tx_stream[substream->pcm->device]; in capture_ack()
392 return amdtp_domain_stream_pcm_ack(&dice->domain, stream); in capture_ack()
397 struct snd_dice *dice = substream->private_data; in playback_ack() local
398 struct amdtp_stream *stream = &dice->rx_stream[substream->pcm->device]; in playback_ack()
400 return amdtp_domain_stream_pcm_ack(&dice->domain, stream); in playback_ack()
403 int snd_dice_create_pcm(struct snd_dice *dice) in snd_dice_create_pcm() argument
433 if (dice->tx_pcm_chs[i][j] > 0) in snd_dice_create_pcm()
435 if (dice->rx_pcm_chs[i][j] > 0) in snd_dice_create_pcm()
439 err = snd_pcm_new(dice->card, "DICE", i, playback, capture, in snd_dice_create_pcm()
443 pcm->private_data = dice; in snd_dice_create_pcm()
444 strcpy(pcm->name, dice->card->shortname); in snd_dice_create_pcm()