asoc: tegra: Fix cs42l73 mclk for all sample rates
Rahul Mittal [Fri, 21 Sep 2012 15:08:05 +0000 (20:08 +0530)]
Some sample rates were failing due to a check in cs42l73 driver
Fixed mclk to support playback for all sample rates

Reviewed-on: http://git-master/r/134421
(cherry picked from commit 0bbadb7bc04c5f7be8e29fe89fb673c6b5bb24e2)

Change-Id: I0ae620b2e15bea1fd0b7021bebc38a91376e7dee
Signed-off-by: Rahul Mittal <rmittal@nvidia.com>
Signed-off-by: Deepak Nibade <dnibade@nvidia.com>
Reviewed-on: http://git-master/r/143144
Reviewed-by: Rohan Somvanshi <rsomvanshi@nvidia.com>
Tested-by: Rohan Somvanshi <rsomvanshi@nvidia.com>

sound/soc/tegra/tegra_cs42l73.c

index 78152aa..b87f7c4 100644 (file)
@@ -80,7 +80,20 @@ static int tegra_cs42l73_hw_params(struct snd_pcm_substream *substream,
        int err, rate;
 
        srate = params_rate(params);
-       mclk = 256 * srate;
+
+       switch (srate) {
+       case 8000:
+       case 16000:
+       case 32000:
+               mclk = 12288000;
+               break;
+       case 11025:
+               mclk = 512 * srate;
+               break;
+       default:
+               mclk = 256 * srate;
+               break;
+       }
 
        i2s_daifmt = SND_SOC_DAIFMT_NB_NF;
        i2s_daifmt |= pdata->i2s_param[HIFI_CODEC].is_i2s_master ?