提交 ed6c75f2 编写于 作者: A Arnaud Pouliquen 提交者: Mark Brown

ASoC: sti: minor corrections for uniplayer

Minor corrections after code review.
Signed-off-by: NArnaud Pouliquen <arnaud.pouliquen@st.com>
Signed-off-by: NMark Brown <broonie@kernel.org>
上级 76c2145d
...@@ -475,6 +475,7 @@ static int uni_player_set_sysclk(struct snd_soc_dai *dai, int clk_id, ...@@ -475,6 +475,7 @@ static int uni_player_set_sysclk(struct snd_soc_dai *dai, int clk_id,
{ {
struct sti_uniperiph_data *priv = snd_soc_dai_get_drvdata(dai); struct sti_uniperiph_data *priv = snd_soc_dai_get_drvdata(dai);
struct uniperif *player = priv->dai_data.uni; struct uniperif *player = priv->dai_data.uni;
int ret;
if (dir == SND_SOC_CLOCK_IN) if (dir == SND_SOC_CLOCK_IN)
return 0; return 0;
...@@ -482,9 +483,11 @@ static int uni_player_set_sysclk(struct snd_soc_dai *dai, int clk_id, ...@@ -482,9 +483,11 @@ static int uni_player_set_sysclk(struct snd_soc_dai *dai, int clk_id,
if (clk_id != 0) if (clk_id != 0)
return -EINVAL; return -EINVAL;
player->mclk = freq; ret = clk_set_rate(player->clk, freq);
if (!ret)
player->mclk = freq;
return clk_set_rate(player->clk, freq); return ret;
} }
static int uni_player_prepare(struct snd_pcm_substream *substream, static int uni_player_prepare(struct snd_pcm_substream *substream,
...@@ -562,6 +565,7 @@ static int uni_player_prepare(struct snd_pcm_substream *substream, ...@@ -562,6 +565,7 @@ static int uni_player_prepare(struct snd_pcm_substream *substream,
case SND_SOC_DAIFMT_IB_IF: case SND_SOC_DAIFMT_IB_IF:
SET_UNIPERIF_I2S_FMT_LR_POL_HIG(player); SET_UNIPERIF_I2S_FMT_LR_POL_HIG(player);
SET_UNIPERIF_I2S_FMT_SCLK_EDGE_FALLING(player); SET_UNIPERIF_I2S_FMT_SCLK_EDGE_FALLING(player);
break;
} }
switch (player->daifmt & SND_SOC_DAIFMT_FORMAT_MASK) { switch (player->daifmt & SND_SOC_DAIFMT_FORMAT_MASK) {
...@@ -840,7 +844,7 @@ int uni_player_init(struct platform_device *pdev, ...@@ -840,7 +844,7 @@ int uni_player_init(struct platform_device *pdev,
/* Get uniperif resource */ /* Get uniperif resource */
player->clk = of_clk_get(pdev->dev.of_node, 0); player->clk = of_clk_get(pdev->dev.of_node, 0);
if (IS_ERR(player->clk)) if (IS_ERR(player->clk))
ret = (int)PTR_ERR(player->clk); ret = PTR_ERR(player->clk);
/* Select the frequency synthesizer clock */ /* Select the frequency synthesizer clock */
if (player->clk_sel) { if (player->clk_sel) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册