From: zhangjun Date: Tue, 17 Jan 2017 07:53:40 +0000 (+0800) Subject: ASoC: codec cx2072x will only use mclk 12.288M X-Git-Tag: firefly_0821_release~731 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=756733c3abfbd21698f37d1254a4fb1fe3cfcfcf;p=firefly-linux-kernel-4.4.55.git ASoC: codec cx2072x will only use mclk 12.288M 1. due to cx2072x only support playback samplerate 48K 2. set_clk_rate called from codec side will make the clock tree correct, otherwise mclk will be closed from i2s_runtime_suspend unexpected Change-Id: Iaa748bb27635e21f7c2d2997823228cdf7308fe8 Signed-off-by: zhangjun --- diff --git a/sound/soc/codecs/cx2072x.c b/sound/soc/codecs/cx2072x.c index 6921ccfcda18..da54f1d4a528 100644 --- a/sound/soc/codecs/cx2072x.c +++ b/sound/soc/codecs/cx2072x.c @@ -1779,9 +1779,17 @@ static int cx2072x_probe(struct snd_soc_codec *codec) if (PTR_ERR(cx2072x->mclk_clock) == -EPROBE_DEFER) return -EPROBE_DEFER; + ret = clk_set_rate(cx2072x->mclk_clock, CX2072X_RATES_MCLK); + if (ret) { + dev_err(codec->dev, "clk_set_rate is fail!\n"); + return ret; + } + ret = clk_prepare_enable(cx2072x->mclk_clock); - if (ret) + if (ret) { dev_err(codec->dev, "clk_prepare_enable is fail!\n"); + return ret; + } dev_dbg(codec->dev, "codec version: 4.4.20\n"); regmap_read(cx2072x->regmap, CX2072X_VENDOR_ID, &ven_id); diff --git a/sound/soc/codecs/cx2072x.h b/sound/soc/codecs/cx2072x.h index 8dcea850ca2c..cf3205a1ec08 100644 --- a/sound/soc/codecs/cx2072x.h +++ b/sound/soc/codecs/cx2072x.h @@ -18,6 +18,7 @@ #define CX2072X_RATES SNDRV_PCM_RATE_8000_192000 #define CX2072X_RATES_DSP SNDRV_PCM_RATE_48000 +#define CX2072X_RATES_MCLK 12288000 #define CX2072X_REG_MAX 0x8a3c #define AUDDRV_VERSION(major0, major1, minor, build) \