asoc: tegra: pcm: Add support for setting bias level
Manoj Gangwal [Fri, 4 May 2012 14:20:30 +0000 (19:20 +0530)]
Allow setting bias level to turn off clock extern1 when codec
is idle.

Bug 964287

Change-Id: I48056b86a9fdaea70202bee9326debaaddf69c0c
Signed-off-by: Manoj Gangwal <mgangwal@nvidia.com>
Reviewed-on: http://git-master/r/99665
Reviewed-by: Simone Willett <swillett@nvidia.com>
Tested-by: Simone Willett <swillett@nvidia.com>

Conflicts:

sound/soc/tegra/tegra_pcm.c

Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>

sound/soc/tegra/tegra_pcm.c

index 9beb921..a533ef1 100644 (file)
@@ -2,7 +2,7 @@
  * tegra_pcm.c - Tegra PCM driver
  *
  * Author: Stephen Warren <swarren@nvidia.com>
- * Copyright (C) 2010 - NVIDIA, Inc.
+ * Copyright (C) 2010-2012 - NVIDIA, Inc.
  *
  * Based on code copyright/by:
  *
@@ -29,6 +29,7 @@
  *
  */
 
+#include <asm/mach-types.h>
 #include <linux/module.h>
 #include <linux/dma-mapping.h>
 #include <linux/slab.h>
@@ -415,10 +416,19 @@ void tegra_pcm_free(struct snd_pcm *pcm)
        tegra_pcm_deallocate_dma_buffer(pcm, SNDRV_PCM_STREAM_PLAYBACK);
 }
 
+static int tegra_pcm_probe(struct snd_soc_platform *platform)
+{
+       if(machine_is_kai())
+               platform->dapm.idle_bias_off = 1;
+
+       return 0;
+}
+
 static struct snd_soc_platform_driver tegra_pcm_platform = {
        .ops            = &tegra_pcm_ops,
        .pcm_new        = tegra_pcm_new,
        .pcm_free       = tegra_pcm_free,
+       .probe          = tegra_pcm_probe,
 };
 
 static int __devinit tegra_pcm_platform_probe(struct platform_device *pdev)