diff options
author | Srinivas Kandagatla <srinivas.kandagatla@linaro.org> | 2017-08-02 09:17:46 -0400 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2017-08-02 10:36:37 -0400 |
commit | 2032ce4de818366adb78d8e0b29291ce58ae1e40 (patch) | |
tree | 9c9194b907ee6a67be157b2d2e5155015dd3a27d | |
parent | a9689bb890ce633c3015ed51e4e2c6ee320fe4dc (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>
-rw-r--r-- | sound/soc/codecs/msm8916-wcd-digital.c | 10 |
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 7e3794fb8c2c..661cd6dd5473 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) | |||
568 | return 0; | 568 | return 0; |
569 | } | 569 | } |
570 | 570 | ||
571 | static int msm8916_wcd_digital_codec_set_sysclk(struct snd_soc_codec *codec, | ||
572 | int clk_id, int source, | ||
573 | unsigned int freq, int dir) | ||
574 | { | ||
575 | struct msm8916_wcd_digital_priv *p = dev_get_drvdata(codec->dev); | ||
576 | |||
577 | return clk_set_rate(p->mclk, freq); | ||
578 | } | ||
579 | |||
571 | static int msm8916_wcd_digital_hw_params(struct snd_pcm_substream *substream, | 580 | static int msm8916_wcd_digital_hw_params(struct snd_pcm_substream *substream, |
572 | struct snd_pcm_hw_params *params, | 581 | struct snd_pcm_hw_params *params, |
573 | struct snd_soc_dai *dai) | 582 | struct snd_soc_dai *dai) |
@@ -823,6 +832,7 @@ static struct snd_soc_dai_driver msm8916_wcd_digital_dai[] = { | |||
823 | 832 | ||
824 | static struct snd_soc_codec_driver msm8916_wcd_digital = { | 833 | static struct snd_soc_codec_driver msm8916_wcd_digital = { |
825 | .probe = msm8916_wcd_digital_codec_probe, | 834 | .probe = msm8916_wcd_digital_codec_probe, |
835 | .set_sysclk = msm8916_wcd_digital_codec_set_sysclk, | ||
826 | .component_driver = { | 836 | .component_driver = { |
827 | .controls = msm8916_wcd_digital_snd_controls, | 837 | .controls = msm8916_wcd_digital_snd_controls, |
828 | .num_controls = ARRAY_SIZE(msm8916_wcd_digital_snd_controls), | 838 | .num_controls = ARRAY_SIZE(msm8916_wcd_digital_snd_controls), |