aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/pxa/pxa2xx-i2s.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/soc/pxa/pxa2xx-i2s.c')
-rw-r--r--sound/soc/pxa/pxa2xx-i2s.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/sound/soc/pxa/pxa2xx-i2s.c b/sound/soc/pxa/pxa2xx-i2s.c
index 9c06553b9267..8f96d87f7b4b 100644
--- a/sound/soc/pxa/pxa2xx-i2s.c
+++ b/sound/soc/pxa/pxa2xx-i2s.c
@@ -15,6 +15,7 @@
15#include <linux/module.h> 15#include <linux/module.h>
16#include <linux/device.h> 16#include <linux/device.h>
17#include <linux/delay.h> 17#include <linux/delay.h>
18#include <linux/clk.h>
18#include <sound/core.h> 19#include <sound/core.h>
19#include <sound/pcm.h> 20#include <sound/pcm.h>
20#include <sound/initval.h> 21#include <sound/initval.h>
@@ -37,6 +38,7 @@ struct pxa_i2s_port {
37 u32 fmt; 38 u32 fmt;
38}; 39};
39static struct pxa_i2s_port pxa_i2s; 40static struct pxa_i2s_port pxa_i2s;
41static struct clk *clk_i2s;
40 42
41static struct pxa2xx_pcm_dma_params pxa2xx_i2s_pcm_stereo_out = { 43static struct pxa2xx_pcm_dma_params pxa2xx_i2s_pcm_stereo_out = {
42 .name = "I2S PCM Stereo out", 44 .name = "I2S PCM Stereo out",
@@ -79,6 +81,10 @@ static int pxa2xx_i2s_startup(struct snd_pcm_substream *substream)
79 struct snd_soc_pcm_runtime *rtd = substream->private_data; 81 struct snd_soc_pcm_runtime *rtd = substream->private_data;
80 struct snd_soc_dai *cpu_dai = rtd->dai->cpu_dai; 82 struct snd_soc_dai *cpu_dai = rtd->dai->cpu_dai;
81 83
84 clk_i2s = clk_get(NULL, "I2SCLK");
85 if (IS_ERR(clk_i2s))
86 return PTR_ERR(clk_i2s);
87
82 if (!cpu_dai->active) { 88 if (!cpu_dai->active) {
83 SACR0 |= SACR0_RST; 89 SACR0 |= SACR0_RST;
84 SACR0 = 0; 90 SACR0 = 0;
@@ -146,7 +152,7 @@ static int pxa2xx_i2s_hw_params(struct snd_pcm_substream *substream,
146 pxa_gpio_mode(gpio_bus[pxa_i2s.master].tx); 152 pxa_gpio_mode(gpio_bus[pxa_i2s.master].tx);
147 pxa_gpio_mode(gpio_bus[pxa_i2s.master].frm); 153 pxa_gpio_mode(gpio_bus[pxa_i2s.master].frm);
148 pxa_gpio_mode(gpio_bus[pxa_i2s.master].clk); 154 pxa_gpio_mode(gpio_bus[pxa_i2s.master].clk);
149 pxa_set_cken(CKEN_I2S, 1); 155 clk_enable(clk_i2s);
150 pxa_i2s_wait(); 156 pxa_i2s_wait();
151 157
152 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) 158 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
@@ -231,8 +237,10 @@ static void pxa2xx_i2s_shutdown(struct snd_pcm_substream *substream)
231 if (SACR1 & (SACR1_DREC | SACR1_DRPL)) { 237 if (SACR1 & (SACR1_DREC | SACR1_DRPL)) {
232 SACR0 &= ~SACR0_ENB; 238 SACR0 &= ~SACR0_ENB;
233 pxa_i2s_wait(); 239 pxa_i2s_wait();
234 pxa_set_cken(CKEN_I2S, 0); 240 clk_disable(clk_i2s);
235 } 241 }
242
243 clk_put(clk_i2s);
236} 244}
237 245
238#ifdef CONFIG_PM 246#ifdef CONFIG_PM