This function opens a spdif device in capture mode It is called by ALSA framework.
Definition at line 1540 of file mxc-alsa-spdif.c. References spdif_intr_enable(). {
struct mxc_spdif_device *chip;
struct snd_pcm_runtime *runtime;
int err = 0;
struct mxc_spdif_platform_data *spdif_data;
chip = snd_pcm_substream_chip(substream);
spdif_data = chip->card->dev->platform_data;
/* enable rx bus clock */
clk_enable(spdif_data->spdif_clk);
runtime = substream->runtime;
chip->s[SNDRV_PCM_STREAM_CAPTURE].stream = substream;
runtime->hw = snd_spdif_capture_hw;
/* set hw param constraints */
err = snd_pcm_hw_constraint_list(runtime, 0,
SNDRV_PCM_HW_PARAM_RATE,
&hw_capture_rates_stereo);
if (err < 0)
goto failed;
err =
snd_pcm_hw_constraint_integer(runtime, SNDRV_PCM_HW_PARAM_PERIODS);
if (err < 0)
goto failed;
/* enable spdif dpll lock interrupt */
spdif_intr_enable(INT_DPLL_LOCKED, 1);
return 0;
failed:
clk_disable(spdif_data->spdif_clk);
return err;
}
|