diff options
author | Peter Ujfalusi <peter.ujfalusi@ti.com> | 2012-01-24 12:36:10 +0200 |
---|---|---|
committer | Peter Ujfalusi <peter.ujfalusi@ti.com> | 2012-01-26 15:40:53 +0200 |
commit | 62ba98ce4a74ef606e6a7f6c8541fc5e3127f944 (patch) | |
tree | 2dcd79c447375da87342db52a3a32bc9bf48a4b3 /sound/soc/omap/omap-abe-twl6040.c | |
parent | 4ca07cb0cf698151a21e9a9e68a67ca9656d3632 (diff) |
ASoC: omap-abe-twl6040: Use provided MCLK frequency from pdata
Avoid using hardwired configuration for MCLK frequency.
Different board design might use other MCLK frequency.
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'sound/soc/omap/omap-abe-twl6040.c')
-rw-r--r-- | sound/soc/omap/omap-abe-twl6040.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/sound/soc/omap/omap-abe-twl6040.c b/sound/soc/omap/omap-abe-twl6040.c index 1da26031e26..93bb8eee22b 100644 --- a/sound/soc/omap/omap-abe-twl6040.c +++ b/sound/soc/omap/omap-abe-twl6040.c @@ -45,12 +45,15 @@ static int omap_abe_hw_params(struct snd_pcm_substream *substream, { struct snd_soc_pcm_runtime *rtd = substream->private_data; struct snd_soc_dai *codec_dai = rtd->codec_dai; + struct snd_soc_codec *codec = rtd->codec; + struct snd_soc_card *card = codec->card; + struct omap_abe_twl6040_data *pdata = dev_get_platdata(card->dev); int clk_id, freq; int ret; clk_id = twl6040_get_clk_id(rtd->codec); if (clk_id == TWL6040_SYSCLK_SEL_HPPLL) - freq = 38400000; + freq = pdata->mclk_freq; else if (clk_id == TWL6040_SYSCLK_SEL_LPPLL) freq = 32768; else @@ -298,6 +301,11 @@ static __devinit int omap_abe_probe(struct platform_device *pdev) return -ENODEV; } + if (!pdata->mclk_freq) { + dev_err(&pdev->dev, "MCLK frequency missing\n"); + return -ENODEV; + } + if (pdata->has_dmic) { card->dai_link = twl6040_dmic_dai; card->num_links = ARRAY_SIZE(twl6040_dmic_dai); |