summaryrefslogtreecommitdiff
path: root/sound
diff options
context:
space:
mode:
authorShengjiu Wang <shengjiu.wang@freescale.com>2015-03-31 18:17:35 +0800
committerJason Liu <r64343@freescale.com>2015-05-08 17:23:44 +0800
commit22ebdd4aef8dfdaa9647eeb9c2049eda44ece940 (patch)
treef1eb5d00a1dbba62e4b6ebeebe8d551a9593fa74 /sound
parent1b1ed2303723acaac65bd2d74f315a0175688c2e (diff)
MLK-10515-2: ASoC: fsl_mqs: Move clk get_rate to hw_param
It is too early to put clk get rate in probe, because the rate for the clock may not be ready. Signed-off-by: Shengjiu Wang <shengjiu.wang@freescale.com>
Diffstat (limited to 'sound')
-rw-r--r--sound/soc/codecs/fsl_mqs.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/sound/soc/codecs/fsl_mqs.c b/sound/soc/codecs/fsl_mqs.c
index 244f422d4898..c7555f3a8a42 100644
--- a/sound/soc/codecs/fsl_mqs.c
+++ b/sound/soc/codecs/fsl_mqs.c
@@ -1,7 +1,7 @@
/*
* ALSA SoC IMX MQS driver
*
- * Copyright (C) 2014 Freescale Semiconductor, Inc.
+ * Copyright (C) 2014-2015 Freescale Semiconductor, Inc.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
@@ -45,6 +45,8 @@ static int fsl_mqs_hw_params(struct snd_pcm_substream *substream,
struct fsl_mqs *mqs_priv = snd_soc_codec_get_drvdata(codec);
int div, res;
+ mqs_priv->mclk_rate = clk_get_rate(mqs_priv->mclk);
+
mqs_priv->bclk = snd_soc_params_to_bclk(params);
mqs_priv->lrclk = params_rate(params);
@@ -184,8 +186,6 @@ static int fsl_mqs_probe(struct platform_device *pdev)
goto out;
}
- mqs_priv->mclk_rate = clk_get_rate(mqs_priv->mclk);
-
dev_set_drvdata(&pdev->dev, mqs_priv);
return snd_soc_register_codec(&pdev->dev, &soc_codec_fsl_mqs,