summaryrefslogtreecommitdiff
path: root/sound
diff options
context:
space:
mode:
authorMisael Lopez Cruz <misael.lopez@ti.com>2011-05-31 09:23:15 +0100
committerAndy Green <andy.green@linaro.org>2011-05-31 11:04:44 +0100
commit49c118d819b861cf31173a28b384dd63c04c6986 (patch)
tree70da8c3f223d1b1d6ffe59f854aaa29841a2c227 /sound
parent67db923bb10c4d191e67a4a307d4f391b7b0793c (diff)
ASoC: twl6040: Update sysclk in hw_params
TWL6040 sysclk can be changed during hw_params() call depending on the requested sample rate, which requires private sysclk value to be updated as well. Change-Id: I26cd8c6314b64946f073012c17455d4cfc9efafb Signed-off-by: Misael Lopez Cruz <misael.lopez@ti.com>
Diffstat (limited to 'sound')
-rw-r--r--sound/soc/codecs/twl6040.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/sound/soc/codecs/twl6040.c b/sound/soc/codecs/twl6040.c
index d41ffecebd6..4c4bf760bbe 100644
--- a/sound/soc/codecs/twl6040.c
+++ b/sound/soc/codecs/twl6040.c
@@ -1340,7 +1340,7 @@ static int twl6040_hw_params(struct snd_pcm_substream *substream,
struct twl6040 *twl6040 = codec->control_data;
struct twl6040_data *priv = snd_soc_codec_get_drvdata(codec);
unsigned int sysclk;
- int rate;
+ int rate, ret;
/* nothing to do for high-perf pll, it supports only 48 kHz */
if (priv->pll == TWL6040_HPPLL_ID)
@@ -1366,7 +1366,13 @@ static int twl6040_hw_params(struct snd_pcm_substream *substream,
return -EINVAL;
}
- return twl6040_set_pll(twl6040, TWL6040_LPPLL_ID, priv->clk_in, sysclk);
+ ret = twl6040_set_pll(twl6040, TWL6040_LPPLL_ID, priv->clk_in, sysclk);
+ if (ret)
+ return ret;
+
+ priv->sysclk = twl6040_get_sysclk(twl6040);
+
+ return 0;
}
static int twl6040_prepare(struct snd_pcm_substream *substream,