aboutsummaryrefslogtreecommitdiff
path: root/sound/soc/codecs/msm8916-wcd-digital.c
diff options
context:
space:
mode:
authorSrinivas Kandagatla <srinivas.kandagatla@linaro.org>2017-08-02 15:17:46 +0200
committerMark Brown <broonie@kernel.org>2017-08-02 15:39:04 +0100
commit820f7541f952afa8db08ccd420f29a2c6c148709 (patch)
tree55c59855eca637b11ca789bf2904aa3d9f688dfb /sound/soc/codecs/msm8916-wcd-digital.c
parentaf2f010e0f12fdeb26fce502adf4b353daeb302c (diff)
ASoC: codecs: msm8916-wcd-digital: add support to set_sysclk
This patch adds support to set_sysclk() which can let the sound card driver to set default mclk rate. In this case MCLK for internal audio codec is expected to be at 9.6MHz by default. Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org> Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/codecs/msm8916-wcd-digital.c')
-rw-r--r--sound/soc/codecs/msm8916-wcd-digital.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/sound/soc/codecs/msm8916-wcd-digital.c b/sound/soc/codecs/msm8916-wcd-digital.c
index f690442af8c9..825cc7d70bb3 100644
--- a/sound/soc/codecs/msm8916-wcd-digital.c
+++ b/sound/soc/codecs/msm8916-wcd-digital.c
@@ -568,6 +568,15 @@ static int msm8916_wcd_digital_codec_probe(struct snd_soc_codec *codec)
return 0;
}
+static int msm8916_wcd_digital_codec_set_sysclk(struct snd_soc_codec *codec,
+ int clk_id, int source,
+ unsigned int freq, int dir)
+{
+ struct msm8916_wcd_digital_priv *p = dev_get_drvdata(codec->dev);
+
+ return clk_set_rate(p->mclk, freq);
+}
+
static int msm8916_wcd_digital_hw_params(struct snd_pcm_substream *substream,
struct snd_pcm_hw_params *params,
struct snd_soc_dai *dai)
@@ -823,6 +832,7 @@ static struct snd_soc_dai_driver msm8916_wcd_digital_dai[] = {
static struct snd_soc_codec_driver msm8916_wcd_digital = {
.probe = msm8916_wcd_digital_codec_probe,
+ .set_sysclk = msm8916_wcd_digital_codec_set_sysclk,
.component_driver = {
.controls = msm8916_wcd_digital_snd_controls,
.num_controls = ARRAY_SIZE(msm8916_wcd_digital_snd_controls),