sound: soc: tegra: Fix noise during ad1937 arecord on E1861
Nitin Nagaraja [Fri, 8 Mar 2013 11:55:57 +0000 (16:55 +0530)]
Set codec mode to TDM single-line and ASDATA delay to 0
to eliminate noise during ad1937 record on E1861.

Bug 1224769

Change-Id: Ia6d04c1f641ffb4f35930dfdd505b85ce5c43824
Signed-off-by: Nitin Nagaraja <nitinn@nvidia.com>
Reviewed-on: http://git-master/r/207581
(cherry picked from commit 4cc5e040c74800a31bcf5342ae6a57b63d97cd68)
Reviewed-on: http://git-master/r/223788
GVS: Gerrit_Virtual_Submit
Reviewed-by: Nitin Pai <npai@nvidia.com>
Reviewed-by: Scott Peterson <speterson@nvidia.com>
Reviewed-by: Bob Johnston <bjohnston@nvidia.com>

sound/soc/tegra/tegra_vcm.c

index 543c045..f86275f 100644 (file)
@@ -40,6 +40,7 @@
 
 #include "tegra_pcm.h"
 #include "tegra_asoc_utils.h"
+#include "../codecs/ad193x.h"
 
 #ifdef CONFIG_MACH_P1852
 #define DRV_NAME "tegra-snd-p1852"
@@ -169,6 +170,15 @@ static int tegra_vcm_hw_params(struct snd_pcm_substream *substream,
                                        pdata->codec_info[codec_id].slot_width);
                if (err < 0)
                        dev_err(card->dev, "codec_dai tdm mode setting not done\n");
+#ifdef CONFIG_MACH_E1853
+               if (strstr((pdata->codec_info[codec_id].codec_name),
+                                       "ad193x")) {
+                       /* Override the default settings */
+                       /* Set mode to TDM single-line & ASDATA delay to 0 */
+                       /* to eliminate noise during ad1937 record */
+                       snd_soc_write(codec_dai->codec, AD193X_ADC_CTRL1, 0x27);
+               }
+#endif
        }
 
 #ifdef CONFIG_ARCH_TEGRA_2x_SOC