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
171 err = snd_dice_stream_lock_try(dice); in pcm_open()
175 err = init_hw_info(dice, substream); in pcm_open()
179 err = snd_dice_transaction_get_clock_source(dice, &source); in pcm_open()
203 amdtp_stream_pcm_running(&dice->tx_stream[0]) || in pcm_open()
204 amdtp_stream_pcm_running(&dice->tx_stream[1]) || in pcm_open()
205 amdtp_stream_pcm_running(&dice->rx_stream[0]) || in pcm_open()
206 amdtp_stream_pcm_running(&dice->rx_stream[1])) { in pcm_open()
209 err = snd_dice_transaction_get_rate(dice, &rate); in pcm_open()
220 snd_dice_stream_lock_release(dice); in pcm_open()
226 struct snd_dice *dice = substream->private_data; in pcm_close() local
228 snd_dice_stream_lock_release(dice); in pcm_close()
236 struct snd_dice *dice = substream->private_data; in pcm_hw_params() local
247 mutex_lock(&dice->mutex); in pcm_hw_params()
248 err = snd_dice_stream_reserve_duplex(dice, rate); in pcm_hw_params()
250 ++dice->substreams_counter; in pcm_hw_params()
251 mutex_unlock(&dice->mutex); in pcm_hw_params()
259 struct snd_dice *dice = substream->private_data; in pcm_hw_free() local
261 mutex_lock(&dice->mutex); in pcm_hw_free()
264 --dice->substreams_counter; in pcm_hw_free()
266 snd_dice_stream_stop_duplex(dice); in pcm_hw_free()
268 mutex_unlock(&dice->mutex); in pcm_hw_free()
275 struct snd_dice *dice = substream->private_data; in capture_prepare() local
276 struct amdtp_stream *stream = &dice->tx_stream[substream->pcm->device]; in capture_prepare()
279 mutex_lock(&dice->mutex); in capture_prepare()
280 err = snd_dice_stream_start_duplex(dice); in capture_prepare()
281 mutex_unlock(&dice->mutex); in capture_prepare()
289 struct snd_dice *dice = substream->private_data; in playback_prepare() local
290 struct amdtp_stream *stream = &dice->rx_stream[substream->pcm->device]; in playback_prepare()
293 mutex_lock(&dice->mutex); in playback_prepare()
294 err = snd_dice_stream_start_duplex(dice); in playback_prepare()
295 mutex_unlock(&dice->mutex); in playback_prepare()
304 struct snd_dice *dice = substream->private_data; in capture_trigger() local
305 struct amdtp_stream *stream = &dice->tx_stream[substream->pcm->device]; in capture_trigger()
322 struct snd_dice *dice = substream->private_data; in playback_trigger() local
323 struct amdtp_stream *stream = &dice->rx_stream[substream->pcm->device]; in playback_trigger()
341 struct snd_dice *dice = substream->private_data; in capture_pointer() local
342 struct amdtp_stream *stream = &dice->tx_stream[substream->pcm->device]; in capture_pointer()
348 struct snd_dice *dice = substream->private_data; in playback_pointer() local
349 struct amdtp_stream *stream = &dice->rx_stream[substream->pcm->device]; in playback_pointer()
356 struct snd_dice *dice = substream->private_data; in capture_ack() local
357 struct amdtp_stream *stream = &dice->tx_stream[substream->pcm->device]; in capture_ack()
364 struct snd_dice *dice = substream->private_data; in playback_ack() local
365 struct amdtp_stream *stream = &dice->rx_stream[substream->pcm->device]; in playback_ack()
370 int snd_dice_create_pcm(struct snd_dice *dice) in snd_dice_create_pcm() argument
404 if (dice->tx_pcm_chs[i][j] > 0) in snd_dice_create_pcm()
406 if (dice->rx_pcm_chs[i][j] > 0) in snd_dice_create_pcm()
410 err = snd_pcm_new(dice->card, "DICE", i, playback, capture, in snd_dice_create_pcm()
414 pcm->private_data = dice; in snd_dice_create_pcm()
415 strcpy(pcm->name, dice->card->shortname); in snd_dice_create_pcm()