diff options
author | Chen Zhen <zhen1.chen@samsung.com> | 2014-07-07 10:50:01 +0800 |
---|---|---|
committer | Sylwester Nawrocki <s.nawrocki@samsung.com> | 2014-07-15 01:55:31 -0700 |
commit | 98686bf81a9bedd52bca8e73587baea5542a93ec (patch) | |
tree | cafd92fe6ba213275638d02787b73f134ea1e9f2 | |
parent | 34848874f4cb42b8ceb7ab18546b2d944374ad0a (diff) | |
download | linux-3.10-98686bf81a9bedd52bca8e73587baea5542a93ec.tar.gz linux-3.10-98686bf81a9bedd52bca8e73587baea5542a93ec.tar.bz2 linux-3.10-98686bf81a9bedd52bca8e73587baea5542a93ec.zip |
ASoC: odroidx2_max98090: Move clock settings from ops to late_probe
after move the clock operations to late_probe,the configuration of
clock would be done only once and the ops can be removed altogether.
Change-Id: I96b9ffc1374c9404d401728796c8abdfe70f020a
Signed-off-by: Chen Zhen <zhen1.chen@samsung.com>
-rw-r--r-- | sound/soc/samsung/odroidx2_max98090.c | 36 |
1 files changed, 9 insertions, 27 deletions
diff --git a/sound/soc/samsung/odroidx2_max98090.c b/sound/soc/samsung/odroidx2_max98090.c index 2b1f6917b03..8ce4873f098 100644 --- a/sound/soc/samsung/odroidx2_max98090.c +++ b/sound/soc/samsung/odroidx2_max98090.c @@ -24,39 +24,22 @@ struct odroidx2_drv_data { /* Config I2S CDCLK output 19.2MHZ clock to Max98090 */ #define MAX98090_MCLK 19200000 -static int odroidx2_hw_params(struct snd_pcm_substream *substream, - struct snd_pcm_hw_params *params) +static int odroidx2_late_probe(struct snd_soc_card *card) { - struct snd_soc_pcm_runtime *rtd = substream->private_data; - struct snd_soc_dai *cpu_dai = rtd->cpu_dai; - struct snd_soc_dai *codec_dai = rtd->codec_dai; + struct snd_soc_dai *codec_dai = card->rtd[0].codec_dai; + struct snd_soc_dai *cpu_dai = card->rtd[0].cpu_dai; int ret; ret = snd_soc_dai_set_sysclk(codec_dai, 0, MAX98090_MCLK, SND_SOC_CLOCK_IN); - if (ret < 0) { - dev_err(codec_dai->dev, - "Unable to switch to FLL1: %d\n", ret); + if (ret < 0) return ret; - } /* Set the cpu DAI configuration in order to use CDCLK */ - ret = snd_soc_dai_set_sysclk(cpu_dai, SAMSUNG_I2S_CDCLK, + return snd_soc_dai_set_sysclk(cpu_dai, SAMSUNG_I2S_CDCLK, 0, SND_SOC_CLOCK_OUT); - if (ret < 0) - return ret; - - dev_dbg(codec_dai->dev, "HiFi DAI %s params: channels: %d, rate: %d\n", - snd_pcm_stream_str(substream), params_channels(params), - params_rate(params)); - - return 0; } -static struct snd_soc_ops odroidx2_ops = { - .hw_params = odroidx2_hw_params, -}; - static const struct snd_soc_dapm_widget odroidx2_dapm_widgets[] = { SND_SOC_DAPM_HP("Headphone Jack", NULL), SND_SOC_DAPM_MIC("Mic Jack", NULL), @@ -86,7 +69,6 @@ static struct snd_soc_dai_link odroidx2_dai[] = { .codec_dai_name = "HiFi", .dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF | SND_SOC_DAIFMT_CBM_CFM, - .ops = &odroidx2_ops, }, { .name = "MAX98090 SEC", .stream_name = "MAX98090 PCM SEC", @@ -95,15 +77,15 @@ static struct snd_soc_dai_link odroidx2_dai[] = { .platform_name = "samsung-i2s-sec", .dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF | SND_SOC_DAIFMT_CBM_CFM, - .ops = &odroidx2_ops, }, }; static struct snd_soc_card odroidx2 = { - .owner = THIS_MODULE, - .dai_link = odroidx2_dai, - .num_links = ARRAY_SIZE(odroidx2_dai), + .owner = THIS_MODULE, + .dai_link = odroidx2_dai, + .num_links = ARRAY_SIZE(odroidx2_dai), .fully_routed = true, + .late_probe = odroidx2_late_probe, }; struct odroidx2_drv_data odroidx2_drvdata = { |