aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArnaud Pouliquen <arnaud.pouliquen@st.com>2015-07-16 05:36:02 -0400
committerMark Brown <broonie@kernel.org>2015-07-16 16:38:23 -0400
commited6c75f23383ba4e0fbc935c0b6ab165bc9ff65e (patch)
tree7d63d8848e14a6313fbe44e6a1bb9111267c717e
parent76c2145ded6b83488dec4afc46a29a57cee90552 (diff)
ASoC: sti: minor corrections for uniplayer
Minor corrections after code review. Signed-off-by: Arnaud Pouliquen <arnaud.pouliquen@st.com> Signed-off-by: Mark Brown <broonie@kernel.org>
-rw-r--r--sound/soc/sti/uniperif_player.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/sound/soc/sti/uniperif_player.c b/sound/soc/sti/uniperif_player.c
index d66d633f0b29..d12d0502545e 100644
--- a/sound/soc/sti/uniperif_player.c
+++ b/sound/soc/sti/uniperif_player.c
@@ -475,6 +475,7 @@ static int uni_player_set_sysclk(struct snd_soc_dai *dai, int clk_id,
475{ 475{
476 struct sti_uniperiph_data *priv = snd_soc_dai_get_drvdata(dai); 476 struct sti_uniperiph_data *priv = snd_soc_dai_get_drvdata(dai);
477 struct uniperif *player = priv->dai_data.uni; 477 struct uniperif *player = priv->dai_data.uni;
478 int ret;
478 479
479 if (dir == SND_SOC_CLOCK_IN) 480 if (dir == SND_SOC_CLOCK_IN)
480 return 0; 481 return 0;
@@ -482,9 +483,11 @@ static int uni_player_set_sysclk(struct snd_soc_dai *dai, int clk_id,
482 if (clk_id != 0) 483 if (clk_id != 0)
483 return -EINVAL; 484 return -EINVAL;
484 485
485 player->mclk = freq; 486 ret = clk_set_rate(player->clk, freq);
487 if (!ret)
488 player->mclk = freq;
486 489
487 return clk_set_rate(player->clk, freq); 490 return ret;
488} 491}
489 492
490static int uni_player_prepare(struct snd_pcm_substream *substream, 493static int uni_player_prepare(struct snd_pcm_substream *substream,
@@ -562,6 +565,7 @@ static int uni_player_prepare(struct snd_pcm_substream *substream,
562 case SND_SOC_DAIFMT_IB_IF: 565 case SND_SOC_DAIFMT_IB_IF:
563 SET_UNIPERIF_I2S_FMT_LR_POL_HIG(player); 566 SET_UNIPERIF_I2S_FMT_LR_POL_HIG(player);
564 SET_UNIPERIF_I2S_FMT_SCLK_EDGE_FALLING(player); 567 SET_UNIPERIF_I2S_FMT_SCLK_EDGE_FALLING(player);
568 break;
565 } 569 }
566 570
567 switch (player->daifmt & SND_SOC_DAIFMT_FORMAT_MASK) { 571 switch (player->daifmt & SND_SOC_DAIFMT_FORMAT_MASK) {
@@ -840,7 +844,7 @@ int uni_player_init(struct platform_device *pdev,
840 /* Get uniperif resource */ 844 /* Get uniperif resource */
841 player->clk = of_clk_get(pdev->dev.of_node, 0); 845 player->clk = of_clk_get(pdev->dev.of_node, 0);
842 if (IS_ERR(player->clk)) 846 if (IS_ERR(player->clk))
843 ret = (int)PTR_ERR(player->clk); 847 ret = PTR_ERR(player->clk);
844 848
845 /* Select the frequency synthesizer clock */ 849 /* Select the frequency synthesizer clock */
846 if (player->clk_sel) { 850 if (player->clk_sel) {