Ejemplo n.º 1
0
static int mxc_hdmi_codec_startup(struct snd_pcm_substream *substream,
				  struct snd_soc_dai *dai)
{
	struct mxc_hdmi_priv *hdmi_priv = snd_soc_dai_get_drvdata(dai);
	struct snd_pcm_runtime *runtime = substream->runtime;
	int ret;

	clk_enable(hdmi_priv->isfr_clk);
	clk_enable(hdmi_priv->iahb_clk);

	pr_debug("%s hdmi clks: isfr:%d iahb:%d\n", __func__,
		(int)clk_get_rate(hdmi_priv->isfr_clk),
		(int)clk_get_rate(hdmi_priv->iahb_clk));

	ret = snd_pcm_hw_constraint_list(runtime, 0,
					 SNDRV_PCM_HW_PARAM_RATE,
					 &playback_rate_constraints);
	if (ret < 0)
		return ret;

	ret = snd_pcm_hw_constraint_integer(runtime,
					SNDRV_PCM_HW_PARAM_PERIODS);
	if (ret < 0)
		return ret;

	hdmi_set_audio_flat(0);
	hdmi_set_audio_infoframe();

	return 0;
}
Ejemplo n.º 2
0
static int mxc_hdmi_codec_startup(struct snd_pcm_substream *substream,
				  struct snd_soc_dai *dai)
{
	struct mxc_hdmi_priv *hdmi_priv = snd_soc_dai_get_drvdata(dai);
	int ret;

	clk_enable(hdmi_priv->isfr_clk);
	clk_enable(hdmi_priv->iahb_clk);

	pr_debug("%s hdmi clks: isfr:%d iahb:%d\n", __func__,
		(int)clk_get_rate(hdmi_priv->isfr_clk),
		(int)clk_get_rate(hdmi_priv->iahb_clk));

	ret = mxc_hdmi_update_constraints(hdmi_priv, substream);
	if (ret < 0)
		return ret;

	hdmi_set_audio_flat(0);
	hdmi_set_audio_infoframe();

	return 0;
}