diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2009-05-15 11:06:56 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-05-15 11:06:56 -0400 |
commit | c244450dac6d83be1ceadf29a65a5b49c34ceed8 (patch) | |
tree | 14741f05d136df2da0f1a01c7a6085fc8b864322 /sound/soc/davinci/davinci-evm.c | |
parent | ade385e4d14f4158b3b27acd992a98bca4cd7f23 (diff) | |
parent | 60befb97f5ab11037f1ae7563ca7137878a7bd46 (diff) |
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6:
ASoC: DaVinci EVM board support buildfixes
ASoC: DaVinci I2S updates
ASoC: davinci-pcm buildfixes
ALSA: pcsp: fix printk format warning
ALSA: riptide: postfix increment and off by one
pxa2xx-ac97: fix reset gpio mode setting
ASoC: soc-core: fix crash when removing not instantiated card
Diffstat (limited to 'sound/soc/davinci/davinci-evm.c')
-rw-r--r-- | sound/soc/davinci/davinci-evm.c | 63 |
1 files changed, 52 insertions, 11 deletions
diff --git a/sound/soc/davinci/davinci-evm.c b/sound/soc/davinci/davinci-evm.c index 9b90b347007c..58fd1cbedd88 100644 --- a/sound/soc/davinci/davinci-evm.c +++ b/sound/soc/davinci/davinci-evm.c | |||
@@ -20,7 +20,11 @@ | |||
20 | #include <sound/soc-dapm.h> | 20 | #include <sound/soc-dapm.h> |
21 | 21 | ||
22 | #include <asm/dma.h> | 22 | #include <asm/dma.h> |
23 | #include <mach/hardware.h> | 23 | #include <asm/mach-types.h> |
24 | |||
25 | #include <mach/asp.h> | ||
26 | #include <mach/edma.h> | ||
27 | #include <mach/mux.h> | ||
24 | 28 | ||
25 | #include "../codecs/tlv320aic3x.h" | 29 | #include "../codecs/tlv320aic3x.h" |
26 | #include "davinci-pcm.h" | 30 | #include "davinci-pcm.h" |
@@ -150,7 +154,7 @@ static struct snd_soc_card snd_soc_card_evm = { | |||
150 | 154 | ||
151 | /* evm audio private data */ | 155 | /* evm audio private data */ |
152 | static struct aic3x_setup_data evm_aic3x_setup = { | 156 | static struct aic3x_setup_data evm_aic3x_setup = { |
153 | .i2c_bus = 0, | 157 | .i2c_bus = 1, |
154 | .i2c_address = 0x1b, | 158 | .i2c_address = 0x1b, |
155 | }; | 159 | }; |
156 | 160 | ||
@@ -161,36 +165,73 @@ static struct snd_soc_device evm_snd_devdata = { | |||
161 | .codec_data = &evm_aic3x_setup, | 165 | .codec_data = &evm_aic3x_setup, |
162 | }; | 166 | }; |
163 | 167 | ||
168 | /* DM6446 EVM uses ASP0; line-out is a pair of RCA jacks */ | ||
164 | static struct resource evm_snd_resources[] = { | 169 | static struct resource evm_snd_resources[] = { |
165 | { | 170 | { |
166 | .start = DAVINCI_MCBSP_BASE, | 171 | .start = DAVINCI_ASP0_BASE, |
167 | .end = DAVINCI_MCBSP_BASE + SZ_8K - 1, | 172 | .end = DAVINCI_ASP0_BASE + SZ_8K - 1, |
168 | .flags = IORESOURCE_MEM, | 173 | .flags = IORESOURCE_MEM, |
169 | }, | 174 | }, |
170 | }; | 175 | }; |
171 | 176 | ||
172 | static struct evm_snd_platform_data evm_snd_data = { | 177 | static struct evm_snd_platform_data evm_snd_data = { |
173 | .tx_dma_ch = DM644X_DMACH_MCBSP_TX, | 178 | .tx_dma_ch = DAVINCI_DMA_ASP0_TX, |
174 | .rx_dma_ch = DM644X_DMACH_MCBSP_RX, | 179 | .rx_dma_ch = DAVINCI_DMA_ASP0_RX, |
180 | }; | ||
181 | |||
182 | /* DM335 EVM uses ASP1; line-out is a stereo mini-jack */ | ||
183 | static struct resource dm335evm_snd_resources[] = { | ||
184 | { | ||
185 | .start = DAVINCI_ASP1_BASE, | ||
186 | .end = DAVINCI_ASP1_BASE + SZ_8K - 1, | ||
187 | .flags = IORESOURCE_MEM, | ||
188 | }, | ||
189 | }; | ||
190 | |||
191 | static struct evm_snd_platform_data dm335evm_snd_data = { | ||
192 | .tx_dma_ch = DAVINCI_DMA_ASP1_TX, | ||
193 | .rx_dma_ch = DAVINCI_DMA_ASP1_RX, | ||
175 | }; | 194 | }; |
176 | 195 | ||
177 | static struct platform_device *evm_snd_device; | 196 | static struct platform_device *evm_snd_device; |
178 | 197 | ||
179 | static int __init evm_init(void) | 198 | static int __init evm_init(void) |
180 | { | 199 | { |
200 | struct resource *resources; | ||
201 | unsigned num_resources; | ||
202 | struct evm_snd_platform_data *data; | ||
203 | int index; | ||
181 | int ret; | 204 | int ret; |
182 | 205 | ||
183 | evm_snd_device = platform_device_alloc("soc-audio", 0); | 206 | if (machine_is_davinci_evm()) { |
207 | davinci_cfg_reg(DM644X_MCBSP); | ||
208 | |||
209 | resources = evm_snd_resources; | ||
210 | num_resources = ARRAY_SIZE(evm_snd_resources); | ||
211 | data = &evm_snd_data; | ||
212 | index = 0; | ||
213 | } else if (machine_is_davinci_dm355_evm()) { | ||
214 | /* we don't use ASP1 IRQs, or we'd need to mux them ... */ | ||
215 | davinci_cfg_reg(DM355_EVT8_ASP1_TX); | ||
216 | davinci_cfg_reg(DM355_EVT9_ASP1_RX); | ||
217 | |||
218 | resources = dm335evm_snd_resources; | ||
219 | num_resources = ARRAY_SIZE(dm335evm_snd_resources); | ||
220 | data = &dm335evm_snd_data; | ||
221 | index = 1; | ||
222 | } else | ||
223 | return -EINVAL; | ||
224 | |||
225 | evm_snd_device = platform_device_alloc("soc-audio", index); | ||
184 | if (!evm_snd_device) | 226 | if (!evm_snd_device) |
185 | return -ENOMEM; | 227 | return -ENOMEM; |
186 | 228 | ||
187 | platform_set_drvdata(evm_snd_device, &evm_snd_devdata); | 229 | platform_set_drvdata(evm_snd_device, &evm_snd_devdata); |
188 | evm_snd_devdata.dev = &evm_snd_device->dev; | 230 | evm_snd_devdata.dev = &evm_snd_device->dev; |
189 | platform_device_add_data(evm_snd_device, &evm_snd_data, | 231 | platform_device_add_data(evm_snd_device, data, sizeof(*data)); |
190 | sizeof(evm_snd_data)); | ||
191 | 232 | ||
192 | ret = platform_device_add_resources(evm_snd_device, evm_snd_resources, | 233 | ret = platform_device_add_resources(evm_snd_device, resources, |
193 | ARRAY_SIZE(evm_snd_resources)); | 234 | num_resources); |
194 | if (ret) { | 235 | if (ret) { |
195 | platform_device_put(evm_snd_device); | 236 | platform_device_put(evm_snd_device); |
196 | return ret; | 237 | return ret; |