aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/pxa/pxa2xx-i2s.c
diff options
context:
space:
mode:
authorRussell King <rmk@dyn-67.arm.linux.org.uk>2009-03-28 16:29:51 -0400
committerRussell King <rmk+kernel@arm.linux.org.uk>2009-03-28 16:29:51 -0400
commited40d0c472b136682b2fcba05f89762859c7374f (patch)
tree076b83a26bcd63d6158463735dd34c10bbc591dc /sound/soc/pxa/pxa2xx-i2s.c
parent9e495834e59ca9b29f1a1f63b9f5533bb022ac49 (diff)
parent5d80f8e5a9dc9c9a94d4aeaa567e219a808b8a4a (diff)
Merge branch 'origin' into devel
Conflicts: sound/soc/pxa/pxa2xx-i2s.c
Diffstat (limited to 'sound/soc/pxa/pxa2xx-i2s.c')
-rw-r--r--sound/soc/pxa/pxa2xx-i2s.c54
1 files changed, 10 insertions, 44 deletions
diff --git a/sound/soc/pxa/pxa2xx-i2s.c b/sound/soc/pxa/pxa2xx-i2s.c
index 223de890259e..2f4b6e489b78 100644
--- a/sound/soc/pxa/pxa2xx-i2s.c
+++ b/sound/soc/pxa/pxa2xx-i2s.c
@@ -25,20 +25,11 @@
25 25
26#include <mach/hardware.h> 26#include <mach/hardware.h>
27#include <mach/dma.h> 27#include <mach/dma.h>
28#include <mach/pxa2xx-gpio.h>
29#include <mach/audio.h> 28#include <mach/audio.h>
30 29
31#include "pxa2xx-pcm.h" 30#include "pxa2xx-pcm.h"
32#include "pxa2xx-i2s.h" 31#include "pxa2xx-i2s.h"
33 32
34struct pxa2xx_gpio {
35 u32 sys;
36 u32 rx;
37 u32 tx;
38 u32 clk;
39 u32 frm;
40};
41
42/* 33/*
43 * I2S Controller Register and Bit Definitions 34 * I2S Controller Register and Bit Definitions
44 */ 35 */
@@ -106,21 +97,6 @@ static struct pxa2xx_pcm_dma_params pxa2xx_i2s_pcm_stereo_in = {
106 DCMD_BURST32 | DCMD_WIDTH4, 97 DCMD_BURST32 | DCMD_WIDTH4,
107}; 98};
108 99
109static struct pxa2xx_gpio gpio_bus[] = {
110 { /* I2S SoC Slave */
111 .rx = GPIO29_SDATA_IN_I2S_MD,
112 .tx = GPIO30_SDATA_OUT_I2S_MD,
113 .clk = GPIO28_BITCLK_IN_I2S_MD,
114 .frm = GPIO31_SYNC_I2S_MD,
115 },
116 { /* I2S SoC Master */
117 .rx = GPIO29_SDATA_IN_I2S_MD,
118 .tx = GPIO30_SDATA_OUT_I2S_MD,
119 .clk = GPIO28_BITCLK_OUT_I2S_MD,
120 .frm = GPIO31_SYNC_I2S_MD,
121 },
122};
123
124static int pxa2xx_i2s_startup(struct snd_pcm_substream *substream, 100static int pxa2xx_i2s_startup(struct snd_pcm_substream *substream,
125 struct snd_soc_dai *dai) 101 struct snd_soc_dai *dai)
126{ 102{
@@ -181,9 +157,6 @@ static int pxa2xx_i2s_set_dai_sysclk(struct snd_soc_dai *cpu_dai,
181 if (clk_id != PXA2XX_I2S_SYSCLK) 157 if (clk_id != PXA2XX_I2S_SYSCLK)
182 return -ENODEV; 158 return -ENODEV;
183 159
184 if (pxa_i2s.master && dir == SND_SOC_CLOCK_OUT)
185 pxa_gpio_mode(gpio_bus[pxa_i2s.master].sys);
186
187 return 0; 160 return 0;
188} 161}
189 162
@@ -194,10 +167,6 @@ static int pxa2xx_i2s_hw_params(struct snd_pcm_substream *substream,
194 struct snd_soc_pcm_runtime *rtd = substream->private_data; 167 struct snd_soc_pcm_runtime *rtd = substream->private_data;
195 struct snd_soc_dai *cpu_dai = rtd->dai->cpu_dai; 168 struct snd_soc_dai *cpu_dai = rtd->dai->cpu_dai;
196 169
197 pxa_gpio_mode(gpio_bus[pxa_i2s.master].rx);
198 pxa_gpio_mode(gpio_bus[pxa_i2s.master].tx);
199 pxa_gpio_mode(gpio_bus[pxa_i2s.master].frm);
200 pxa_gpio_mode(gpio_bus[pxa_i2s.master].clk);
201 BUG_ON(IS_ERR(clk_i2s)); 170 BUG_ON(IS_ERR(clk_i2s));
202 clk_enable(clk_i2s); 171 clk_enable(clk_i2s);
203 pxa_i2s_wait(); 172 pxa_i2s_wait();
@@ -335,6 +304,15 @@ static int pxa2xx_i2s_resume(struct snd_soc_dai *dai)
335 SNDRV_PCM_RATE_16000 | SNDRV_PCM_RATE_22050 | SNDRV_PCM_RATE_44100 | \ 304 SNDRV_PCM_RATE_16000 | SNDRV_PCM_RATE_22050 | SNDRV_PCM_RATE_44100 | \
336 SNDRV_PCM_RATE_48000 | SNDRV_PCM_RATE_96000) 305 SNDRV_PCM_RATE_48000 | SNDRV_PCM_RATE_96000)
337 306
307static struct snd_soc_dai_ops pxa_i2s_dai_ops = {
308 .startup = pxa2xx_i2s_startup,
309 .shutdown = pxa2xx_i2s_shutdown,
310 .trigger = pxa2xx_i2s_trigger,
311 .hw_params = pxa2xx_i2s_hw_params,
312 .set_fmt = pxa2xx_i2s_set_dai_fmt,
313 .set_sysclk = pxa2xx_i2s_set_dai_sysclk,
314};
315
338struct snd_soc_dai pxa_i2s_dai = { 316struct snd_soc_dai pxa_i2s_dai = {
339 .name = "pxa2xx-i2s", 317 .name = "pxa2xx-i2s",
340 .id = 0, 318 .id = 0,
@@ -350,14 +328,7 @@ struct snd_soc_dai pxa_i2s_dai = {
350 .channels_max = 2, 328 .channels_max = 2,
351 .rates = PXA2XX_I2S_RATES, 329 .rates = PXA2XX_I2S_RATES,
352 .formats = SNDRV_PCM_FMTBIT_S16_LE,}, 330 .formats = SNDRV_PCM_FMTBIT_S16_LE,},
353 .ops = { 331 .ops = &pxa_i2s_dai_ops,
354 .startup = pxa2xx_i2s_startup,
355 .shutdown = pxa2xx_i2s_shutdown,
356 .trigger = pxa2xx_i2s_trigger,
357 .hw_params = pxa2xx_i2s_hw_params,
358 .set_fmt = pxa2xx_i2s_set_dai_fmt,
359 .set_sysclk = pxa2xx_i2s_set_dai_sysclk,
360 },
361}; 332};
362 333
363EXPORT_SYMBOL_GPL(pxa_i2s_dai); 334EXPORT_SYMBOL_GPL(pxa_i2s_dai);
@@ -398,11 +369,6 @@ static struct platform_driver pxa2xx_i2s_driver = {
398 369
399static int __init pxa2xx_i2s_init(void) 370static int __init pxa2xx_i2s_init(void)
400{ 371{
401 if (cpu_is_pxa27x())
402 gpio_bus[1].sys = GPIO113_I2S_SYSCLK_MD;
403 else
404 gpio_bus[1].sys = GPIO32_SYSCLK_I2S_MD;
405
406 clk_i2s = ERR_PTR(-ENOENT); 372 clk_i2s = ERR_PTR(-ENOENT);
407 return platform_driver_register(&pxa2xx_i2s_driver); 373 return platform_driver_register(&pxa2xx_i2s_driver);
408} 374}