diff options
author | Ravindra Lokhande <rlokhande@nvidia.com> | 2011-01-05 19:39:24 +0530 |
---|---|---|
committer | Bharat Nihalani <bnihalani@nvidia.com> | 2011-01-08 22:40:26 -0800 |
commit | ec12aaa5ce7c6c2cf59781b003667ebf240cc501 (patch) | |
tree | 66dcb9e2b69d1a024e34782a1c34bacc8d8704fe /sound | |
parent | 023fba5e8504110227db93e1cd3786c30b9dba31 (diff) |
[tegra ALSA] making use of das driver
Removed direct call to das registers, instead
using calls of das driver.
Change-Id: I230a98950b06a9b3d36cd983353ad810b1d52290
Reviewed-on: http://git-master/r/15008
Reviewed-by: Sumit Bhattacharya <sumitb@nvidia.com>
Reviewed-by: Scott Peterson <speterson@nvidia.com>
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
Tested-by: Bharat Nihalani <bnihalani@nvidia.com>
Diffstat (limited to 'sound')
-rw-r--r-- | sound/soc/tegra/tegra_i2s.c | 17 | ||||
-rw-r--r-- | sound/soc/tegra/tegra_pcm.c | 29 | ||||
-rw-r--r-- | sound/soc/tegra/tegra_soc.c | 2 | ||||
-rw-r--r-- | sound/soc/tegra/tegra_soc.h | 3 |
4 files changed, 11 insertions, 40 deletions
diff --git a/sound/soc/tegra/tegra_i2s.c b/sound/soc/tegra/tegra_i2s.c index 1596c4f7be5e..25587d8420df 100644 --- a/sound/soc/tegra/tegra_i2s.c +++ b/sound/soc/tegra/tegra_i2s.c @@ -19,19 +19,8 @@ #include "tegra_soc.h" -static void *das_base = IO_ADDRESS(TEGRA_APB_MISC_BASE); struct snd_soc_dai tegra_i2s_dai; -static inline unsigned long das_readl(unsigned long offset) -{ - return readl(das_base + offset); -} - -static inline void das_writel(unsigned long value, unsigned long offset) -{ - writel(value, das_base + offset); -} - static int tegra_i2s_hw_params(struct snd_pcm_substream *substream, struct snd_pcm_hw_params *params, struct snd_soc_dai *dai) @@ -203,14 +192,14 @@ static int tegra_i2s_trigger(struct snd_pcm_substream *substream, int cmd, #ifdef CONFIG_PM int tegra_i2s_suspend(struct snd_soc_dai *i2s_dai) { - struct tegra_runtime_data *prtd = (struct snd_pcm_runtime *)(tegra_i2s_dai.private_data); + struct tegra_runtime_data *prtd = tegra_i2s_dai.private_data; i2s_get_all_regs(I2S_IFC, &prtd->i2s_regs); return 0; } int tegra_i2s_resume(struct snd_soc_dai *i2s_dai) { - struct tegra_runtime_data *prtd = (struct snd_pcm_runtime *)(tegra_i2s_dai.private_data); + struct tegra_runtime_data *prtd = tegra_i2s_dai.private_data; i2s_set_all_regs(I2S_IFC, &prtd->i2s_regs); return 0; } @@ -235,8 +224,6 @@ static int tegra_i2s_probe(struct platform_device *pdev, struct snd_soc_dai *dai) { /* DAC1 -> DAP1, DAC1 master, DAP2 bypass */ - das_writel(0, APB_MISC_DAS_DAP_CTRL_SEL_0); - das_writel(0, APB_MISC_DAS_DAC_INPUT_DATA_CLK_SEL_0); i2s_enable_fifos(I2S_IFC, 0); i2s_set_left_right_control_polarity(I2S_IFC, 0); /* default */ i2s_set_master(I2S_IFC, 1); /* set as master */ diff --git a/sound/soc/tegra/tegra_pcm.c b/sound/soc/tegra/tegra_pcm.c index 760518b2feba..6aea653c2de1 100644 --- a/sound/soc/tegra/tegra_pcm.c +++ b/sound/soc/tegra/tegra_pcm.c @@ -18,6 +18,7 @@ */ #include "tegra_soc.h" +#include <mach/tegra_das.h> #define PLAYBACK_STARTED true #define PLAYBACK_STOPPED false @@ -289,9 +290,6 @@ static snd_pcm_uframes_t tegra_pcm_pointer(struct snd_pcm_substream *substream) static int tegra_pcm_open(struct snd_pcm_substream *substream) { - struct snd_soc_pcm_runtime *rtd = substream->private_data; - struct snd_soc_dai_link *machine = rtd->dai; - struct snd_soc_dai *cpu_dai = machine->cpu_dai; struct snd_pcm_runtime *runtime = substream->runtime; struct tegra_runtime_data *prtd; int ret=0; @@ -304,10 +302,8 @@ static int tegra_pcm_open(struct snd_pcm_substream *substream) runtime->private_data = prtd; prtd->substream = substream; - /* Enable the DAP outputs */ - tegra_pinmux_set_tristate(TEGRA_PINGROUP_DAP1,TEGRA_TRI_NORMAL); - tegra_pinmux_set_tristate(TEGRA_PINGROUP_CDEV1,TEGRA_TRI_NORMAL); - tegra_pinmux_set_tristate(TEGRA_PINGROUP_CDEV2,TEGRA_TRI_NORMAL); + /* set pins state to normal */ + tegra_das_power_mode(true); /* Setup I2S clocks */ prtd->i2s_clk = i2s_get_clock_by_name(I2S_NAME); @@ -373,11 +369,8 @@ fail: tegra_dma_free_channel(prtd->dma_chan); } - if (cpu_dai->active == 0) { - tegra_pinmux_set_tristate(TEGRA_PINGROUP_DAP1,TEGRA_TRI_TRISTATE); - tegra_pinmux_set_tristate(TEGRA_PINGROUP_CDEV1,TEGRA_TRI_TRISTATE); - tegra_pinmux_set_tristate(TEGRA_PINGROUP_CDEV2,TEGRA_TRI_TRISTATE); - } + /* set pins state to tristate */ + tegra_das_power_mode(false); kfree(prtd); @@ -387,9 +380,6 @@ end: static int tegra_pcm_close(struct snd_pcm_substream *substream) { - struct snd_soc_pcm_runtime *rtd = substream->private_data; - struct snd_soc_dai_link *machine = rtd->dai; - struct snd_soc_dai *cpu_dai = machine->cpu_dai; struct snd_pcm_runtime *runtime = substream->runtime; struct tegra_runtime_data *prtd = runtime->private_data; @@ -413,13 +403,10 @@ static int tegra_pcm_close(struct snd_pcm_substream *substream) prtd->dma_chan = NULL; } - kfree(prtd); + /* set pins state to tristate */ + tegra_das_power_mode(false); - if (cpu_dai->active == 0) { - tegra_pinmux_set_tristate(TEGRA_PINGROUP_DAP1,TEGRA_TRI_TRISTATE); - tegra_pinmux_set_tristate(TEGRA_PINGROUP_CDEV1,TEGRA_TRI_TRISTATE); - tegra_pinmux_set_tristate(TEGRA_PINGROUP_CDEV2,TEGRA_TRI_TRISTATE); - } + kfree(prtd); return 0; } diff --git a/sound/soc/tegra/tegra_soc.c b/sound/soc/tegra/tegra_soc.c index 5dbf3c8eb478..9ffbae647254 100644 --- a/sound/soc/tegra/tegra_soc.c +++ b/sound/soc/tegra/tegra_soc.c @@ -15,9 +15,9 @@ * */ -#include "../codecs/wm8903.h" #include "tegra_soc.h" #include <mach/audio.h> +#include "../codecs/wm8903.h" static struct platform_device *tegra_snd_device; static int tegra_jack_func; diff --git a/sound/soc/tegra/tegra_soc.h b/sound/soc/tegra/tegra_soc.h index 1c8e6cef4fa4..d9f5dc5acbc3 100644 --- a/sound/soc/tegra/tegra_soc.h +++ b/sound/soc/tegra/tegra_soc.h @@ -59,9 +59,6 @@ #define STATE_EXITED 3 #define STATE_INVALID 4 -#define APB_MISC_DAS_DAP_CTRL_SEL_0 0xc00 -#define APB_MISC_DAS_DAC_INPUT_DATA_CLK_SEL_0 0xc40 - #define FIFO1 0 #define FIFO2 1 |