aboutsummaryrefslogtreecommitdiffstats
path: root/sound
diff options
context:
space:
mode:
Diffstat (limited to 'sound')
-rw-r--r--sound/core/pcm_native.c13
-rw-r--r--sound/i2c/other/ak4113.c2
-rw-r--r--sound/i2c/other/ak4114.c2
-rw-r--r--sound/i2c/other/tea575x-tuner.c205
-rw-r--r--sound/oss/.gitignore1
-rw-r--r--sound/pci/Kconfig4
-rw-r--r--sound/pci/oxygen/oxygen_lib.c8
-rw-r--r--sound/soc/cirrus/ep93xx-ac97.c2
-rw-r--r--sound/soc/cirrus/ep93xx-i2s.c2
-rw-r--r--sound/soc/cirrus/ep93xx-pcm.c2
-rw-r--r--sound/soc/codecs/wm2000.c2
-rw-r--r--sound/soc/codecs/wm5100.c2
-rw-r--r--sound/soc/codecs/wm8350.c2
-rw-r--r--sound/soc/codecs/wm8753.c2
-rw-r--r--sound/soc/fsl/imx-pcm-dma.c2
-rw-r--r--sound/soc/fsl/imx-pcm-fiq.c2
-rw-r--r--sound/soc/fsl/imx-ssi.c2
-rw-r--r--sound/soc/fsl/imx-ssi.h2
-rw-r--r--sound/soc/kirkwood/kirkwood-i2s.c2
-rw-r--r--sound/soc/kirkwood/kirkwood-openrd.c2
-rw-r--r--sound/soc/kirkwood/kirkwood-t5325.c2
-rw-r--r--sound/soc/omap/am3517evm.c2
-rw-r--r--sound/soc/omap/ams-delta.c4
-rw-r--r--sound/soc/omap/mcbsp.c4
-rw-r--r--sound/soc/omap/n810.c2
-rw-r--r--sound/soc/omap/omap-abe-twl6040.c4
-rw-r--r--sound/soc/omap/omap-mcbsp.c3
-rw-r--r--sound/soc/omap/omap-mcpdm.c2
-rw-r--r--sound/soc/omap/omap-pcm.c1
-rw-r--r--sound/soc/omap/omap3pandora.c2
-rw-r--r--sound/soc/omap/osk5912.c2
-rw-r--r--sound/soc/omap/rx51.c2
-rw-r--r--sound/soc/omap/sdp3430.c3
-rw-r--r--sound/soc/omap/zoom2.c2
-rw-r--r--sound/soc/pxa/palm27x.c2
-rw-r--r--sound/soc/samsung/ac97.c2
-rw-r--r--sound/soc/samsung/i2s.c2
-rw-r--r--sound/soc/samsung/pcm.c2
-rw-r--r--sound/soc/samsung/s3c24xx_simtec.c2
-rw-r--r--sound/soc/samsung/spdif.c2
-rw-r--r--sound/soc/soc-core.c6
-rw-r--r--sound/soc/tegra/Kconfig2
-rw-r--r--sound/soc/tegra/tegra_pcm.c232
-rw-r--r--sound/soc/tegra/tegra_pcm.h14
-rw-r--r--sound/usb/endpoint.c8
45 files changed, 231 insertions, 339 deletions
diff --git a/sound/core/pcm_native.c b/sound/core/pcm_native.c
index 53b5ada8f7c3..20554eff5a21 100644
--- a/sound/core/pcm_native.c
+++ b/sound/core/pcm_native.c
@@ -1563,25 +1563,25 @@ static int snd_pcm_drop(struct snd_pcm_substream *substream)
1563 1563
1564 1564
1565/* WARNING: Don't forget to fput back the file */ 1565/* WARNING: Don't forget to fput back the file */
1566static struct file *snd_pcm_file_fd(int fd) 1566static struct file *snd_pcm_file_fd(int fd, int *fput_needed)
1567{ 1567{
1568 struct file *file; 1568 struct file *file;
1569 struct inode *inode; 1569 struct inode *inode;
1570 unsigned int minor; 1570 unsigned int minor;
1571 1571
1572 file = fget(fd); 1572 file = fget_light(fd, fput_needed);
1573 if (!file) 1573 if (!file)
1574 return NULL; 1574 return NULL;
1575 inode = file->f_path.dentry->d_inode; 1575 inode = file->f_path.dentry->d_inode;
1576 if (!S_ISCHR(inode->i_mode) || 1576 if (!S_ISCHR(inode->i_mode) ||
1577 imajor(inode) != snd_major) { 1577 imajor(inode) != snd_major) {
1578 fput(file); 1578 fput_light(file, *fput_needed);
1579 return NULL; 1579 return NULL;
1580 } 1580 }
1581 minor = iminor(inode); 1581 minor = iminor(inode);
1582 if (!snd_lookup_minor_data(minor, SNDRV_DEVICE_TYPE_PCM_PLAYBACK) && 1582 if (!snd_lookup_minor_data(minor, SNDRV_DEVICE_TYPE_PCM_PLAYBACK) &&
1583 !snd_lookup_minor_data(minor, SNDRV_DEVICE_TYPE_PCM_CAPTURE)) { 1583 !snd_lookup_minor_data(minor, SNDRV_DEVICE_TYPE_PCM_CAPTURE)) {
1584 fput(file); 1584 fput_light(file, *fput_needed);
1585 return NULL; 1585 return NULL;
1586 } 1586 }
1587 return file; 1587 return file;
@@ -1597,8 +1597,9 @@ static int snd_pcm_link(struct snd_pcm_substream *substream, int fd)
1597 struct snd_pcm_file *pcm_file; 1597 struct snd_pcm_file *pcm_file;
1598 struct snd_pcm_substream *substream1; 1598 struct snd_pcm_substream *substream1;
1599 struct snd_pcm_group *group; 1599 struct snd_pcm_group *group;
1600 int fput_needed;
1600 1601
1601 file = snd_pcm_file_fd(fd); 1602 file = snd_pcm_file_fd(fd, &fput_needed);
1602 if (!file) 1603 if (!file)
1603 return -EBADFD; 1604 return -EBADFD;
1604 pcm_file = file->private_data; 1605 pcm_file = file->private_data;
@@ -1633,7 +1634,7 @@ static int snd_pcm_link(struct snd_pcm_substream *substream, int fd)
1633 write_unlock_irq(&snd_pcm_link_rwlock); 1634 write_unlock_irq(&snd_pcm_link_rwlock);
1634 up_write(&snd_pcm_link_rwsem); 1635 up_write(&snd_pcm_link_rwsem);
1635 _nolock: 1636 _nolock:
1636 fput(file); 1637 fput_light(file, fput_needed);
1637 if (res < 0) 1638 if (res < 0)
1638 kfree(group); 1639 kfree(group);
1639 return res; 1640 return res;
diff --git a/sound/i2c/other/ak4113.c b/sound/i2c/other/ak4113.c
index dde5c9c92132..ef68d710d08c 100644
--- a/sound/i2c/other/ak4113.c
+++ b/sound/i2c/other/ak4113.c
@@ -141,7 +141,7 @@ void snd_ak4113_reinit(struct ak4113 *chip)
141{ 141{
142 chip->init = 1; 142 chip->init = 1;
143 mb(); 143 mb();
144 flush_delayed_work_sync(&chip->work); 144 flush_delayed_work(&chip->work);
145 ak4113_init_regs(chip); 145 ak4113_init_regs(chip);
146 /* bring up statistics / event queing */ 146 /* bring up statistics / event queing */
147 chip->init = 0; 147 chip->init = 0;
diff --git a/sound/i2c/other/ak4114.c b/sound/i2c/other/ak4114.c
index fdf3c1b65e38..816e7d225fb0 100644
--- a/sound/i2c/other/ak4114.c
+++ b/sound/i2c/other/ak4114.c
@@ -154,7 +154,7 @@ void snd_ak4114_reinit(struct ak4114 *chip)
154{ 154{
155 chip->init = 1; 155 chip->init = 1;
156 mb(); 156 mb();
157 flush_delayed_work_sync(&chip->work); 157 flush_delayed_work(&chip->work);
158 ak4114_init_regs(chip); 158 ak4114_init_regs(chip);
159 /* bring up statistics / event queing */ 159 /* bring up statistics / event queing */
160 chip->init = 0; 160 chip->init = 0;
diff --git a/sound/i2c/other/tea575x-tuner.c b/sound/i2c/other/tea575x-tuner.c
index d14edb7d6484..3c6c1e3226f3 100644
--- a/sound/i2c/other/tea575x-tuner.c
+++ b/sound/i2c/other/tea575x-tuner.c
@@ -37,9 +37,6 @@ MODULE_AUTHOR("Jaroslav Kysela <perex@perex.cz>");
37MODULE_DESCRIPTION("Routines for control of TEA5757/5759 Philips AM/FM radio tuner chips"); 37MODULE_DESCRIPTION("Routines for control of TEA5757/5759 Philips AM/FM radio tuner chips");
38MODULE_LICENSE("GPL"); 38MODULE_LICENSE("GPL");
39 39
40#define FREQ_LO ((tea->tea5759 ? 760 : 875) * 1600U)
41#define FREQ_HI ((tea->tea5759 ? 910 : 1080) * 1600U)
42
43/* 40/*
44 * definitions 41 * definitions
45 */ 42 */
@@ -50,8 +47,8 @@ MODULE_LICENSE("GPL");
50#define TEA575X_BIT_BAND_MASK (3<<20) 47#define TEA575X_BIT_BAND_MASK (3<<20)
51#define TEA575X_BIT_BAND_FM (0<<20) 48#define TEA575X_BIT_BAND_FM (0<<20)
52#define TEA575X_BIT_BAND_MW (1<<20) 49#define TEA575X_BIT_BAND_MW (1<<20)
53#define TEA575X_BIT_BAND_LW (1<<21) 50#define TEA575X_BIT_BAND_LW (2<<20)
54#define TEA575X_BIT_BAND_SW (1<<22) 51#define TEA575X_BIT_BAND_SW (3<<20)
55#define TEA575X_BIT_PORT_0 (1<<19) /* user bit */ 52#define TEA575X_BIT_PORT_0 (1<<19) /* user bit */
56#define TEA575X_BIT_PORT_1 (1<<18) /* user bit */ 53#define TEA575X_BIT_PORT_1 (1<<18) /* user bit */
57#define TEA575X_BIT_SEARCH_MASK (3<<16) /* search level */ 54#define TEA575X_BIT_SEARCH_MASK (3<<16) /* search level */
@@ -62,6 +59,37 @@ MODULE_LICENSE("GPL");
62#define TEA575X_BIT_DUMMY (1<<15) /* buffer */ 59#define TEA575X_BIT_DUMMY (1<<15) /* buffer */
63#define TEA575X_BIT_FREQ_MASK 0x7fff 60#define TEA575X_BIT_FREQ_MASK 0x7fff
64 61
62enum { BAND_FM, BAND_FM_JAPAN, BAND_AM };
63
64static const struct v4l2_frequency_band bands[] = {
65 {
66 .type = V4L2_TUNER_RADIO,
67 .index = 0,
68 .capability = V4L2_TUNER_CAP_LOW | V4L2_TUNER_CAP_STEREO |
69 V4L2_TUNER_CAP_FREQ_BANDS,
70 .rangelow = 87500 * 16,
71 .rangehigh = 108000 * 16,
72 .modulation = V4L2_BAND_MODULATION_FM,
73 },
74 {
75 .type = V4L2_TUNER_RADIO,
76 .index = 0,
77 .capability = V4L2_TUNER_CAP_LOW | V4L2_TUNER_CAP_STEREO |
78 V4L2_TUNER_CAP_FREQ_BANDS,
79 .rangelow = 76000 * 16,
80 .rangehigh = 91000 * 16,
81 .modulation = V4L2_BAND_MODULATION_FM,
82 },
83 {
84 .type = V4L2_TUNER_RADIO,
85 .index = 1,
86 .capability = V4L2_TUNER_CAP_LOW | V4L2_TUNER_CAP_FREQ_BANDS,
87 .rangelow = 530 * 16,
88 .rangehigh = 1710 * 16,
89 .modulation = V4L2_BAND_MODULATION_AM,
90 },
91};
92
65/* 93/*
66 * lowlevel part 94 * lowlevel part
67 */ 95 */
@@ -133,16 +161,29 @@ static u32 snd_tea575x_val_to_freq(struct snd_tea575x *tea, u32 val)
133 if (freq == 0) 161 if (freq == 0)
134 return freq; 162 return freq;
135 163
136 /* freq *= 12.5 */ 164 switch (tea->band) {
137 freq *= 125; 165 case BAND_FM:
138 freq /= 10; 166 /* freq *= 12.5 */
139 /* crystal fixup */ 167 freq *= 125;
140 if (tea->tea5759) 168 freq /= 10;
141 freq += TEA575X_FMIF; 169 /* crystal fixup */
142 else
143 freq -= TEA575X_FMIF; 170 freq -= TEA575X_FMIF;
171 break;
172 case BAND_FM_JAPAN:
173 /* freq *= 12.5 */
174 freq *= 125;
175 freq /= 10;
176 /* crystal fixup */
177 freq += TEA575X_FMIF;
178 break;
179 case BAND_AM:
180 /* crystal fixup */
181 freq -= TEA575X_AMIF;
182 break;
183 }
144 184
145 return clamp(freq * 16, FREQ_LO, FREQ_HI); /* from kHz */ 185 return clamp(freq * 16, bands[tea->band].rangelow,
186 bands[tea->band].rangehigh); /* from kHz */
146} 187}
147 188
148static u32 snd_tea575x_get_freq(struct snd_tea575x *tea) 189static u32 snd_tea575x_get_freq(struct snd_tea575x *tea)
@@ -150,21 +191,37 @@ static u32 snd_tea575x_get_freq(struct snd_tea575x *tea)
150 return snd_tea575x_val_to_freq(tea, snd_tea575x_read(tea)); 191 return snd_tea575x_val_to_freq(tea, snd_tea575x_read(tea));
151} 192}
152 193
153static void snd_tea575x_set_freq(struct snd_tea575x *tea) 194void snd_tea575x_set_freq(struct snd_tea575x *tea)
154{ 195{
155 u32 freq = tea->freq; 196 u32 freq = tea->freq / 16; /* to kHz */
197 u32 band = 0;
156 198
157 freq /= 16; /* to kHz */ 199 switch (tea->band) {
158 /* crystal fixup */ 200 case BAND_FM:
159 if (tea->tea5759) 201 band = TEA575X_BIT_BAND_FM;
160 freq -= TEA575X_FMIF; 202 /* crystal fixup */
161 else
162 freq += TEA575X_FMIF; 203 freq += TEA575X_FMIF;
163 /* freq /= 12.5 */ 204 /* freq /= 12.5 */
164 freq *= 10; 205 freq *= 10;
165 freq /= 125; 206 freq /= 125;
207 break;
208 case BAND_FM_JAPAN:
209 band = TEA575X_BIT_BAND_FM;
210 /* crystal fixup */
211 freq -= TEA575X_FMIF;
212 /* freq /= 12.5 */
213 freq *= 10;
214 freq /= 125;
215 break;
216 case BAND_AM:
217 band = TEA575X_BIT_BAND_MW;
218 /* crystal fixup */
219 freq += TEA575X_AMIF;
220 break;
221 }
166 222
167 tea->val &= ~TEA575X_BIT_FREQ_MASK; 223 tea->val &= ~(TEA575X_BIT_FREQ_MASK | TEA575X_BIT_BAND_MASK);
224 tea->val |= band;
168 tea->val |= freq & TEA575X_BIT_FREQ_MASK; 225 tea->val |= freq & TEA575X_BIT_FREQ_MASK;
169 snd_tea575x_write(tea, tea->val); 226 snd_tea575x_write(tea, tea->val);
170 tea->freq = snd_tea575x_val_to_freq(tea, tea->val); 227 tea->freq = snd_tea575x_val_to_freq(tea, tea->val);
@@ -190,23 +247,57 @@ static int vidioc_querycap(struct file *file, void *priv,
190 return 0; 247 return 0;
191} 248}
192 249
250static int vidioc_enum_freq_bands(struct file *file, void *priv,
251 struct v4l2_frequency_band *band)
252{
253 struct snd_tea575x *tea = video_drvdata(file);
254 int index;
255
256 if (band->tuner != 0)
257 return -EINVAL;
258
259 switch (band->index) {
260 case 0:
261 if (tea->tea5759)
262 index = BAND_FM_JAPAN;
263 else
264 index = BAND_FM;
265 break;
266 case 1:
267 if (tea->has_am) {
268 index = BAND_AM;
269 break;
270 }
271 /* Fall through */
272 default:
273 return -EINVAL;
274 }
275
276 *band = bands[index];
277 if (!tea->cannot_read_data)
278 band->capability |= V4L2_TUNER_CAP_HWSEEK_BOUNDED;
279
280 return 0;
281}
282
193static int vidioc_g_tuner(struct file *file, void *priv, 283static int vidioc_g_tuner(struct file *file, void *priv,
194 struct v4l2_tuner *v) 284 struct v4l2_tuner *v)
195{ 285{
196 struct snd_tea575x *tea = video_drvdata(file); 286 struct snd_tea575x *tea = video_drvdata(file);
287 struct v4l2_frequency_band band_fm = { 0, };
197 288
198 if (v->index > 0) 289 if (v->index > 0)
199 return -EINVAL; 290 return -EINVAL;
200 291
201 snd_tea575x_read(tea); 292 snd_tea575x_read(tea);
293 vidioc_enum_freq_bands(file, priv, &band_fm);
202 294
203 strcpy(v->name, "FM"); 295 memset(v, 0, sizeof(*v));
296 strlcpy(v->name, tea->has_am ? "FM/AM" : "FM", sizeof(v->name));
204 v->type = V4L2_TUNER_RADIO; 297 v->type = V4L2_TUNER_RADIO;
205 v->capability = V4L2_TUNER_CAP_LOW | V4L2_TUNER_CAP_STEREO; 298 v->capability = band_fm.capability;
206 if (!tea->cannot_read_data) 299 v->rangelow = tea->has_am ? bands[BAND_AM].rangelow : band_fm.rangelow;
207 v->capability |= V4L2_TUNER_CAP_HWSEEK_BOUNDED; 300 v->rangehigh = band_fm.rangehigh;
208 v->rangelow = FREQ_LO;
209 v->rangehigh = FREQ_HI;
210 v->rxsubchans = tea->stereo ? V4L2_TUNER_SUB_STEREO : V4L2_TUNER_SUB_MONO; 301 v->rxsubchans = tea->stereo ? V4L2_TUNER_SUB_STEREO : V4L2_TUNER_SUB_MONO;
211 v->audmode = (tea->val & TEA575X_BIT_MONO) ? 302 v->audmode = (tea->val & TEA575X_BIT_MONO) ?
212 V4L2_TUNER_MODE_MONO : V4L2_TUNER_MODE_STEREO; 303 V4L2_TUNER_MODE_MONO : V4L2_TUNER_MODE_STEREO;
@@ -218,13 +309,17 @@ static int vidioc_s_tuner(struct file *file, void *priv,
218 struct v4l2_tuner *v) 309 struct v4l2_tuner *v)
219{ 310{
220 struct snd_tea575x *tea = video_drvdata(file); 311 struct snd_tea575x *tea = video_drvdata(file);
312 u32 orig_val = tea->val;
221 313
222 if (v->index) 314 if (v->index)
223 return -EINVAL; 315 return -EINVAL;
224 tea->val &= ~TEA575X_BIT_MONO; 316 tea->val &= ~TEA575X_BIT_MONO;
225 if (v->audmode == V4L2_TUNER_MODE_MONO) 317 if (v->audmode == V4L2_TUNER_MODE_MONO)
226 tea->val |= TEA575X_BIT_MONO; 318 tea->val |= TEA575X_BIT_MONO;
227 snd_tea575x_write(tea, tea->val); 319 /* Only apply changes if currently tuning FM */
320 if (tea->band != BAND_AM && tea->val != orig_val)
321 snd_tea575x_set_freq(tea);
322
228 return 0; 323 return 0;
229} 324}
230 325
@@ -248,24 +343,56 @@ static int vidioc_s_frequency(struct file *file, void *priv,
248 if (f->tuner != 0 || f->type != V4L2_TUNER_RADIO) 343 if (f->tuner != 0 || f->type != V4L2_TUNER_RADIO)
249 return -EINVAL; 344 return -EINVAL;
250 345
251 tea->val &= ~TEA575X_BIT_SEARCH; 346 if (tea->has_am && f->frequency < (20000 * 16))
252 tea->freq = clamp(f->frequency, FREQ_LO, FREQ_HI); 347 tea->band = BAND_AM;
348 else if (tea->tea5759)
349 tea->band = BAND_FM_JAPAN;
350 else
351 tea->band = BAND_FM;
352
353 tea->freq = clamp(f->frequency, bands[tea->band].rangelow,
354 bands[tea->band].rangehigh);
253 snd_tea575x_set_freq(tea); 355 snd_tea575x_set_freq(tea);
254 return 0; 356 return 0;
255} 357}
256 358
257static int vidioc_s_hw_freq_seek(struct file *file, void *fh, 359static int vidioc_s_hw_freq_seek(struct file *file, void *fh,
258 struct v4l2_hw_freq_seek *a) 360 const struct v4l2_hw_freq_seek *a)
259{ 361{
260 struct snd_tea575x *tea = video_drvdata(file); 362 struct snd_tea575x *tea = video_drvdata(file);
261 unsigned long timeout; 363 unsigned long timeout;
262 int i; 364 int i, spacing;
263 365
264 if (tea->cannot_read_data) 366 if (tea->cannot_read_data)
265 return -ENOTTY; 367 return -ENOTTY;
266 if (a->tuner || a->wrap_around) 368 if (a->tuner || a->wrap_around)
267 return -EINVAL; 369 return -EINVAL;
268 370
371 if (file->f_flags & O_NONBLOCK)
372 return -EWOULDBLOCK;
373
374 if (a->rangelow || a->rangehigh) {
375 for (i = 0; i < ARRAY_SIZE(bands); i++) {
376 if ((i == BAND_FM && tea->tea5759) ||
377 (i == BAND_FM_JAPAN && !tea->tea5759) ||
378 (i == BAND_AM && !tea->has_am))
379 continue;
380 if (bands[i].rangelow == a->rangelow &&
381 bands[i].rangehigh == a->rangehigh)
382 break;
383 }
384 if (i == ARRAY_SIZE(bands))
385 return -EINVAL; /* No matching band found */
386 if (i != tea->band) {
387 tea->band = i;
388 tea->freq = clamp(tea->freq, bands[i].rangelow,
389 bands[i].rangehigh);
390 snd_tea575x_set_freq(tea);
391 }
392 }
393
394 spacing = (tea->band == BAND_AM) ? 5 : 50; /* kHz */
395
269 /* clear the frequency, HW will fill it in */ 396 /* clear the frequency, HW will fill it in */
270 tea->val &= ~TEA575X_BIT_FREQ_MASK; 397 tea->val &= ~TEA575X_BIT_FREQ_MASK;
271 tea->val |= TEA575X_BIT_SEARCH; 398 tea->val |= TEA575X_BIT_SEARCH;
@@ -297,10 +424,10 @@ static int vidioc_s_hw_freq_seek(struct file *file, void *fh,
297 if (freq == 0) /* shouldn't happen */ 424 if (freq == 0) /* shouldn't happen */
298 break; 425 break;
299 /* 426 /*
300 * if we moved by less than 50 kHz, or in the wrong 427 * if we moved by less than the spacing, or in the
301 * direction, continue seeking 428 * wrong direction, continue seeking
302 */ 429 */
303 if (abs(tea->freq - freq) < 16 * 50 || 430 if (abs(tea->freq - freq) < 16 * spacing ||
304 (a->seek_upward && freq < tea->freq) || 431 (a->seek_upward && freq < tea->freq) ||
305 (!a->seek_upward && freq > tea->freq)) { 432 (!a->seek_upward && freq > tea->freq)) {
306 snd_tea575x_write(tea, tea->val); 433 snd_tea575x_write(tea, tea->val);
@@ -344,6 +471,7 @@ static const struct v4l2_ioctl_ops tea575x_ioctl_ops = {
344 .vidioc_g_frequency = vidioc_g_frequency, 471 .vidioc_g_frequency = vidioc_g_frequency,
345 .vidioc_s_frequency = vidioc_s_frequency, 472 .vidioc_s_frequency = vidioc_s_frequency,
346 .vidioc_s_hw_freq_seek = vidioc_s_hw_freq_seek, 473 .vidioc_s_hw_freq_seek = vidioc_s_hw_freq_seek,
474 .vidioc_enum_freq_bands = vidioc_enum_freq_bands,
347 .vidioc_log_status = v4l2_ctrl_log_status, 475 .vidioc_log_status = v4l2_ctrl_log_status,
348 .vidioc_subscribe_event = v4l2_ctrl_subscribe_event, 476 .vidioc_subscribe_event = v4l2_ctrl_subscribe_event,
349 .vidioc_unsubscribe_event = v4l2_event_unsubscribe, 477 .vidioc_unsubscribe_event = v4l2_event_unsubscribe,
@@ -446,3 +574,4 @@ module_exit(alsa_tea575x_module_exit)
446 574
447EXPORT_SYMBOL(snd_tea575x_init); 575EXPORT_SYMBOL(snd_tea575x_init);
448EXPORT_SYMBOL(snd_tea575x_exit); 576EXPORT_SYMBOL(snd_tea575x_exit);
577EXPORT_SYMBOL(snd_tea575x_set_freq);
diff --git a/sound/oss/.gitignore b/sound/oss/.gitignore
index 7efb12b45502..12a3920d6fb6 100644
--- a/sound/oss/.gitignore
+++ b/sound/oss/.gitignore
@@ -1,4 +1,3 @@
1#Ignore generated files 1#Ignore generated files
2maui_boot.h
3pss_boot.h 2pss_boot.h
4trix_boot.h 3trix_boot.h
diff --git a/sound/pci/Kconfig b/sound/pci/Kconfig
index ff3af6e77d61..f99fa2512286 100644
--- a/sound/pci/Kconfig
+++ b/sound/pci/Kconfig
@@ -2,8 +2,8 @@
2 2
3config SND_TEA575X 3config SND_TEA575X
4 tristate 4 tristate
5 depends on SND_FM801_TEA575X_BOOL || SND_ES1968_RADIO || RADIO_SF16FMR2 || RADIO_MAXIRADIO 5 depends on SND_FM801_TEA575X_BOOL || SND_ES1968_RADIO || RADIO_SF16FMR2 || RADIO_MAXIRADIO || RADIO_SHARK
6 default SND_FM801 || SND_ES1968 || RADIO_SF16FMR2 || RADIO_MAXIRADIO 6 default SND_FM801 || SND_ES1968 || RADIO_SF16FMR2 || RADIO_MAXIRADIO || RADIO_SHARK
7 7
8menuconfig SND_PCI 8menuconfig SND_PCI
9 bool "PCI sound devices" 9 bool "PCI sound devices"
diff --git a/sound/pci/oxygen/oxygen_lib.c b/sound/pci/oxygen/oxygen_lib.c
index 25697584b94c..9562dc63ba60 100644
--- a/sound/pci/oxygen/oxygen_lib.c
+++ b/sound/pci/oxygen/oxygen_lib.c
@@ -573,8 +573,8 @@ static void oxygen_card_free(struct snd_card *card)
573 oxygen_shutdown(chip); 573 oxygen_shutdown(chip);
574 if (chip->irq >= 0) 574 if (chip->irq >= 0)
575 free_irq(chip->irq, chip); 575 free_irq(chip->irq, chip);
576 flush_work_sync(&chip->spdif_input_bits_work); 576 flush_work(&chip->spdif_input_bits_work);
577 flush_work_sync(&chip->gpio_work); 577 flush_work(&chip->gpio_work);
578 chip->model.cleanup(chip); 578 chip->model.cleanup(chip);
579 kfree(chip->model_data); 579 kfree(chip->model_data);
580 mutex_destroy(&chip->mutex); 580 mutex_destroy(&chip->mutex);
@@ -751,8 +751,8 @@ static int oxygen_pci_suspend(struct device *dev)
751 spin_unlock_irq(&chip->reg_lock); 751 spin_unlock_irq(&chip->reg_lock);
752 752
753 synchronize_irq(chip->irq); 753 synchronize_irq(chip->irq);
754 flush_work_sync(&chip->spdif_input_bits_work); 754 flush_work(&chip->spdif_input_bits_work);
755 flush_work_sync(&chip->gpio_work); 755 flush_work(&chip->gpio_work);
756 chip->interrupt_mask = saved_interrupt_mask; 756 chip->interrupt_mask = saved_interrupt_mask;
757 757
758 pci_disable_device(pci); 758 pci_disable_device(pci);
diff --git a/sound/soc/cirrus/ep93xx-ac97.c b/sound/soc/cirrus/ep93xx-ac97.c
index bdffab33e160..c3521653cfd3 100644
--- a/sound/soc/cirrus/ep93xx-ac97.c
+++ b/sound/soc/cirrus/ep93xx-ac97.c
@@ -21,7 +21,7 @@
21#include <sound/ac97_codec.h> 21#include <sound/ac97_codec.h>
22#include <sound/soc.h> 22#include <sound/soc.h>
23 23
24#include <mach/dma.h> 24#include <linux/platform_data/dma-ep93xx.h>
25#include "ep93xx-pcm.h" 25#include "ep93xx-pcm.h"
26 26
27/* 27/*
diff --git a/sound/soc/cirrus/ep93xx-i2s.c b/sound/soc/cirrus/ep93xx-i2s.c
index 8df8f6dc474f..ac4a7515e7be 100644
--- a/sound/soc/cirrus/ep93xx-i2s.c
+++ b/sound/soc/cirrus/ep93xx-i2s.c
@@ -28,7 +28,7 @@
28 28
29#include <mach/hardware.h> 29#include <mach/hardware.h>
30#include <mach/ep93xx-regs.h> 30#include <mach/ep93xx-regs.h>
31#include <mach/dma.h> 31#include <linux/platform_data/dma-ep93xx.h>
32 32
33#include "ep93xx-pcm.h" 33#include "ep93xx-pcm.h"
34 34
diff --git a/sound/soc/cirrus/ep93xx-pcm.c b/sound/soc/cirrus/ep93xx-pcm.c
index 4eea98b42bc8..665d9c94cc17 100644
--- a/sound/soc/cirrus/ep93xx-pcm.c
+++ b/sound/soc/cirrus/ep93xx-pcm.c
@@ -25,7 +25,7 @@
25#include <sound/soc.h> 25#include <sound/soc.h>
26#include <sound/dmaengine_pcm.h> 26#include <sound/dmaengine_pcm.h>
27 27
28#include <mach/dma.h> 28#include <linux/platform_data/dma-ep93xx.h>
29#include <mach/hardware.h> 29#include <mach/hardware.h>
30#include <mach/ep93xx-regs.h> 30#include <mach/ep93xx-regs.h>
31 31
diff --git a/sound/soc/codecs/wm2000.c b/sound/soc/codecs/wm2000.c
index b723e910fcdc..683dc43b1d87 100644
--- a/sound/soc/codecs/wm2000.c
+++ b/sound/soc/codecs/wm2000.c
@@ -726,7 +726,7 @@ static bool wm2000_readable_reg(struct device *dev, unsigned int reg)
726} 726}
727 727
728static const struct regmap_config wm2000_regmap = { 728static const struct regmap_config wm2000_regmap = {
729 .reg_bits = 8, 729 .reg_bits = 16,
730 .val_bits = 8, 730 .val_bits = 8,
731 731
732 .max_register = WM2000_REG_IF_CTL, 732 .max_register = WM2000_REG_IF_CTL,
diff --git a/sound/soc/codecs/wm5100.c b/sound/soc/codecs/wm5100.c
index 4da1b92b22c2..7f567585832e 100644
--- a/sound/soc/codecs/wm5100.c
+++ b/sound/soc/codecs/wm5100.c
@@ -1233,7 +1233,7 @@ static const struct snd_soc_dapm_route wm5100_dapm_routes[] = {
1233 { "PWM2", NULL, "PWM2 Driver" }, 1233 { "PWM2", NULL, "PWM2 Driver" },
1234}; 1234};
1235 1235
1236static const __devinitdata struct reg_default wm5100_reva_patches[] = { 1236static const __devinitconst struct reg_default wm5100_reva_patches[] = {
1237 { WM5100_AUDIO_IF_1_10, 0 }, 1237 { WM5100_AUDIO_IF_1_10, 0 },
1238 { WM5100_AUDIO_IF_1_11, 1 }, 1238 { WM5100_AUDIO_IF_1_11, 1 },
1239 { WM5100_AUDIO_IF_1_12, 2 }, 1239 { WM5100_AUDIO_IF_1_12, 2 },
diff --git a/sound/soc/codecs/wm8350.c b/sound/soc/codecs/wm8350.c
index d26c8ae4e6d9..a4cae060bf26 100644
--- a/sound/soc/codecs/wm8350.c
+++ b/sound/soc/codecs/wm8350.c
@@ -1601,7 +1601,7 @@ static int wm8350_codec_remove(struct snd_soc_codec *codec)
1601 1601
1602 /* if there was any work waiting then we run it now and 1602 /* if there was any work waiting then we run it now and
1603 * wait for its completion */ 1603 * wait for its completion */
1604 flush_delayed_work_sync(&codec->dapm.delayed_work); 1604 flush_delayed_work(&codec->dapm.delayed_work);
1605 1605
1606 wm8350_set_bias_level(codec, SND_SOC_BIAS_OFF); 1606 wm8350_set_bias_level(codec, SND_SOC_BIAS_OFF);
1607 1607
diff --git a/sound/soc/codecs/wm8753.c b/sound/soc/codecs/wm8753.c
index 13bff87ddcf5..2e4a775ae560 100644
--- a/sound/soc/codecs/wm8753.c
+++ b/sound/soc/codecs/wm8753.c
@@ -1509,7 +1509,7 @@ static int wm8753_probe(struct snd_soc_codec *codec)
1509/* power down chip */ 1509/* power down chip */
1510static int wm8753_remove(struct snd_soc_codec *codec) 1510static int wm8753_remove(struct snd_soc_codec *codec)
1511{ 1511{
1512 flush_delayed_work_sync(&codec->dapm.delayed_work); 1512 flush_delayed_work(&codec->dapm.delayed_work);
1513 wm8753_set_bias_level(codec, SND_SOC_BIAS_OFF); 1513 wm8753_set_bias_level(codec, SND_SOC_BIAS_OFF);
1514 1514
1515 return 0; 1515 return 0;
diff --git a/sound/soc/fsl/imx-pcm-dma.c b/sound/soc/fsl/imx-pcm-dma.c
index 9a15bc4bd570..d85929b79c35 100644
--- a/sound/soc/fsl/imx-pcm-dma.c
+++ b/sound/soc/fsl/imx-pcm-dma.c
@@ -30,7 +30,7 @@
30#include <sound/soc.h> 30#include <sound/soc.h>
31#include <sound/dmaengine_pcm.h> 31#include <sound/dmaengine_pcm.h>
32 32
33#include <mach/dma.h> 33#include <linux/platform_data/dma-imx.h>
34 34
35#include "imx-pcm.h" 35#include "imx-pcm.h"
36 36
diff --git a/sound/soc/fsl/imx-pcm-fiq.c b/sound/soc/fsl/imx-pcm-fiq.c
index ee27ba3933bd..22c6130957ba 100644
--- a/sound/soc/fsl/imx-pcm-fiq.c
+++ b/sound/soc/fsl/imx-pcm-fiq.c
@@ -30,7 +30,7 @@
30#include <asm/fiq.h> 30#include <asm/fiq.h>
31 31
32#include <mach/irqs.h> 32#include <mach/irqs.h>
33#include <mach/ssi.h> 33#include <linux/platform_data/asoc-imx-ssi.h>
34 34
35#include "imx-ssi.h" 35#include "imx-ssi.h"
36 36
diff --git a/sound/soc/fsl/imx-ssi.c b/sound/soc/fsl/imx-ssi.c
index 3c520c46fa4a..006f7d465ed2 100644
--- a/sound/soc/fsl/imx-ssi.c
+++ b/sound/soc/fsl/imx-ssi.c
@@ -47,7 +47,7 @@
47#include <sound/pcm_params.h> 47#include <sound/pcm_params.h>
48#include <sound/soc.h> 48#include <sound/soc.h>
49 49
50#include <mach/ssi.h> 50#include <linux/platform_data/asoc-imx-ssi.h>
51#include <mach/hardware.h> 51#include <mach/hardware.h>
52 52
53#include "imx-ssi.h" 53#include "imx-ssi.h"
diff --git a/sound/soc/fsl/imx-ssi.h b/sound/soc/fsl/imx-ssi.h
index 5744e86ca878..dc114bdedce5 100644
--- a/sound/soc/fsl/imx-ssi.h
+++ b/sound/soc/fsl/imx-ssi.h
@@ -186,7 +186,7 @@
186#define DRV_NAME "imx-ssi" 186#define DRV_NAME "imx-ssi"
187 187
188#include <linux/dmaengine.h> 188#include <linux/dmaengine.h>
189#include <mach/dma.h> 189#include <linux/platform_data/dma-imx.h>
190#include "imx-pcm.h" 190#include "imx-pcm.h"
191 191
192struct imx_ssi { 192struct imx_ssi {
diff --git a/sound/soc/kirkwood/kirkwood-i2s.c b/sound/soc/kirkwood/kirkwood-i2s.c
index 7646dd7f30cb..542538d10ab7 100644
--- a/sound/soc/kirkwood/kirkwood-i2s.c
+++ b/sound/soc/kirkwood/kirkwood-i2s.c
@@ -21,7 +21,7 @@
21#include <sound/pcm.h> 21#include <sound/pcm.h>
22#include <sound/pcm_params.h> 22#include <sound/pcm_params.h>
23#include <sound/soc.h> 23#include <sound/soc.h>
24#include <plat/audio.h> 24#include <linux/platform_data/asoc-kirkwood.h>
25#include "kirkwood.h" 25#include "kirkwood.h"
26 26
27#define DRV_NAME "kirkwood-i2s" 27#define DRV_NAME "kirkwood-i2s"
diff --git a/sound/soc/kirkwood/kirkwood-openrd.c b/sound/soc/kirkwood/kirkwood-openrd.c
index 80bd59c33be4..c28540aeea25 100644
--- a/sound/soc/kirkwood/kirkwood-openrd.c
+++ b/sound/soc/kirkwood/kirkwood-openrd.c
@@ -17,7 +17,7 @@
17#include <linux/slab.h> 17#include <linux/slab.h>
18#include <sound/soc.h> 18#include <sound/soc.h>
19#include <mach/kirkwood.h> 19#include <mach/kirkwood.h>
20#include <plat/audio.h> 20#include <linux/platform_data/asoc-kirkwood.h>
21#include <asm/mach-types.h> 21#include <asm/mach-types.h>
22#include "../codecs/cs42l51.h" 22#include "../codecs/cs42l51.h"
23 23
diff --git a/sound/soc/kirkwood/kirkwood-t5325.c b/sound/soc/kirkwood/kirkwood-t5325.c
index f8983635f7ef..c67bbc574987 100644
--- a/sound/soc/kirkwood/kirkwood-t5325.c
+++ b/sound/soc/kirkwood/kirkwood-t5325.c
@@ -16,7 +16,7 @@
16#include <linux/slab.h> 16#include <linux/slab.h>
17#include <sound/soc.h> 17#include <sound/soc.h>
18#include <mach/kirkwood.h> 18#include <mach/kirkwood.h>
19#include <plat/audio.h> 19#include <linux/platform_data/asoc-kirkwood.h>
20#include <asm/mach-types.h> 20#include <asm/mach-types.h>
21#include "../codecs/alc5623.h" 21#include "../codecs/alc5623.h"
22 22
diff --git a/sound/soc/omap/am3517evm.c b/sound/soc/omap/am3517evm.c
index 77a87012977c..fad350682ca2 100644
--- a/sound/soc/omap/am3517evm.c
+++ b/sound/soc/omap/am3517evm.c
@@ -27,7 +27,7 @@
27#include <asm/mach-types.h> 27#include <asm/mach-types.h>
28#include <mach/hardware.h> 28#include <mach/hardware.h>
29#include <mach/gpio.h> 29#include <mach/gpio.h>
30#include <plat/mcbsp.h> 30#include <linux/platform_data/asoc-ti-mcbsp.h>
31 31
32#include "omap-mcbsp.h" 32#include "omap-mcbsp.h"
33#include "omap-pcm.h" 33#include "omap-pcm.h"
diff --git a/sound/soc/omap/ams-delta.c b/sound/soc/omap/ams-delta.c
index 7d4fa8ed6699..dc0ee7626626 100644
--- a/sound/soc/omap/ams-delta.c
+++ b/sound/soc/omap/ams-delta.c
@@ -32,8 +32,8 @@
32 32
33#include <asm/mach-types.h> 33#include <asm/mach-types.h>
34 34
35#include <plat/board-ams-delta.h> 35#include <mach/board-ams-delta.h>
36#include <plat/mcbsp.h> 36#include <linux/platform_data/asoc-ti-mcbsp.h>
37 37
38#include "omap-mcbsp.h" 38#include "omap-mcbsp.h"
39#include "omap-pcm.h" 39#include "omap-pcm.h"
diff --git a/sound/soc/omap/mcbsp.c b/sound/soc/omap/mcbsp.c
index bc06175e6367..afb8d4f1bedf 100644
--- a/sound/soc/omap/mcbsp.c
+++ b/sound/soc/omap/mcbsp.c
@@ -26,7 +26,9 @@
26#include <linux/slab.h> 26#include <linux/slab.h>
27#include <linux/pm_runtime.h> 27#include <linux/pm_runtime.h>
28 28
29#include <plat/mcbsp.h> 29#include <linux/platform_data/asoc-ti-mcbsp.h>
30
31#include <plat/cpu.h>
30 32
31#include "mcbsp.h" 33#include "mcbsp.h"
32 34
diff --git a/sound/soc/omap/n810.c b/sound/soc/omap/n810.c
index abac4b690750..521bfc3d2b2b 100644
--- a/sound/soc/omap/n810.c
+++ b/sound/soc/omap/n810.c
@@ -32,7 +32,7 @@
32#include <mach/hardware.h> 32#include <mach/hardware.h>
33#include <linux/gpio.h> 33#include <linux/gpio.h>
34#include <linux/module.h> 34#include <linux/module.h>
35#include <plat/mcbsp.h> 35#include <linux/platform_data/asoc-ti-mcbsp.h>
36 36
37#include "omap-mcbsp.h" 37#include "omap-mcbsp.h"
38#include "omap-pcm.h" 38#include "omap-pcm.h"
diff --git a/sound/soc/omap/omap-abe-twl6040.c b/sound/soc/omap/omap-abe-twl6040.c
index be525dfe9faa..4a73ef3ae12f 100644
--- a/sound/soc/omap/omap-abe-twl6040.c
+++ b/sound/soc/omap/omap-abe-twl6040.c
@@ -32,10 +32,6 @@
32#include <sound/soc.h> 32#include <sound/soc.h>
33#include <sound/jack.h> 33#include <sound/jack.h>
34 34
35#include <asm/mach-types.h>
36#include <plat/hardware.h>
37#include <plat/mux.h>
38
39#include "omap-dmic.h" 35#include "omap-dmic.h"
40#include "omap-mcpdm.h" 36#include "omap-mcpdm.h"
41#include "omap-pcm.h" 37#include "omap-pcm.h"
diff --git a/sound/soc/omap/omap-mcbsp.c b/sound/soc/omap/omap-mcbsp.c
index fef2f5933bb2..a6ee15747859 100644
--- a/sound/soc/omap/omap-mcbsp.c
+++ b/sound/soc/omap/omap-mcbsp.c
@@ -34,7 +34,8 @@
34#include <sound/initval.h> 34#include <sound/initval.h>
35#include <sound/soc.h> 35#include <sound/soc.h>
36 36
37#include <plat/mcbsp.h> 37#include <plat/cpu.h>
38#include <linux/platform_data/asoc-ti-mcbsp.h>
38#include "mcbsp.h" 39#include "mcbsp.h"
39#include "omap-mcbsp.h" 40#include "omap-mcbsp.h"
40#include "omap-pcm.h" 41#include "omap-pcm.h"
diff --git a/sound/soc/omap/omap-mcpdm.c b/sound/soc/omap/omap-mcpdm.c
index 775565032ce3..c02b001ee4b5 100644
--- a/sound/soc/omap/omap-mcpdm.c
+++ b/sound/soc/omap/omap-mcpdm.c
@@ -44,6 +44,8 @@
44#include "omap-mcpdm.h" 44#include "omap-mcpdm.h"
45#include "omap-pcm.h" 45#include "omap-pcm.h"
46 46
47#define OMAP44XX_MCPDM_L3_BASE 0x49032000
48
47struct omap_mcpdm { 49struct omap_mcpdm {
48 struct device *dev; 50 struct device *dev;
49 unsigned long phys_base; 51 unsigned long phys_base;
diff --git a/sound/soc/omap/omap-pcm.c b/sound/soc/omap/omap-pcm.c
index a2636f6b8362..340874ebf9ae 100644
--- a/sound/soc/omap/omap-pcm.c
+++ b/sound/soc/omap/omap-pcm.c
@@ -32,6 +32,7 @@
32#include <sound/dmaengine_pcm.h> 32#include <sound/dmaengine_pcm.h>
33#include <sound/soc.h> 33#include <sound/soc.h>
34 34
35#include <plat/cpu.h>
35#include "omap-pcm.h" 36#include "omap-pcm.h"
36 37
37static const struct snd_pcm_hardware omap_pcm_hardware = { 38static const struct snd_pcm_hardware omap_pcm_hardware = {
diff --git a/sound/soc/omap/omap3pandora.c b/sound/soc/omap/omap3pandora.c
index 4c3a0978578a..43d950a79ff9 100644
--- a/sound/soc/omap/omap3pandora.c
+++ b/sound/soc/omap/omap3pandora.c
@@ -31,7 +31,7 @@
31#include <sound/soc.h> 31#include <sound/soc.h>
32 32
33#include <asm/mach-types.h> 33#include <asm/mach-types.h>
34#include <plat/mcbsp.h> 34#include <linux/platform_data/asoc-ti-mcbsp.h>
35 35
36#include "omap-mcbsp.h" 36#include "omap-mcbsp.h"
37#include "omap-pcm.h" 37#include "omap-pcm.h"
diff --git a/sound/soc/omap/osk5912.c b/sound/soc/omap/osk5912.c
index b1a9d64cbc56..3960e8df9c76 100644
--- a/sound/soc/omap/osk5912.c
+++ b/sound/soc/omap/osk5912.c
@@ -31,7 +31,7 @@
31#include <mach/hardware.h> 31#include <mach/hardware.h>
32#include <linux/gpio.h> 32#include <linux/gpio.h>
33#include <linux/module.h> 33#include <linux/module.h>
34#include <plat/mcbsp.h> 34#include <linux/platform_data/asoc-ti-mcbsp.h>
35 35
36#include "omap-mcbsp.h" 36#include "omap-mcbsp.h"
37#include "omap-pcm.h" 37#include "omap-pcm.h"
diff --git a/sound/soc/omap/rx51.c b/sound/soc/omap/rx51.c
index 2712dd232b6d..d921ddbe3ecb 100644
--- a/sound/soc/omap/rx51.c
+++ b/sound/soc/omap/rx51.c
@@ -31,7 +31,7 @@
31#include <sound/jack.h> 31#include <sound/jack.h>
32#include <sound/pcm.h> 32#include <sound/pcm.h>
33#include <sound/soc.h> 33#include <sound/soc.h>
34#include <plat/mcbsp.h> 34#include <linux/platform_data/asoc-ti-mcbsp.h>
35#include "../codecs/tpa6130a2.h" 35#include "../codecs/tpa6130a2.h"
36 36
37#include <asm/mach-types.h> 37#include <asm/mach-types.h>
diff --git a/sound/soc/omap/sdp3430.c b/sound/soc/omap/sdp3430.c
index 0e283226e2bf..597cae769cea 100644
--- a/sound/soc/omap/sdp3430.c
+++ b/sound/soc/omap/sdp3430.c
@@ -33,7 +33,8 @@
33#include <asm/mach-types.h> 33#include <asm/mach-types.h>
34#include <mach/hardware.h> 34#include <mach/hardware.h>
35#include <mach/gpio.h> 35#include <mach/gpio.h>
36#include <plat/mcbsp.h> 36#include <linux/platform_data/gpio-omap.h>
37#include <linux/platform_data/asoc-ti-mcbsp.h>
37 38
38/* Register descriptions for twl4030 codec part */ 39/* Register descriptions for twl4030 codec part */
39#include <linux/mfd/twl4030-audio.h> 40#include <linux/mfd/twl4030-audio.h>
diff --git a/sound/soc/omap/zoom2.c b/sound/soc/omap/zoom2.c
index df97a4196cd3..677b567935f8 100644
--- a/sound/soc/omap/zoom2.c
+++ b/sound/soc/omap/zoom2.c
@@ -29,7 +29,7 @@
29#include <mach/hardware.h> 29#include <mach/hardware.h>
30#include <mach/gpio.h> 30#include <mach/gpio.h>
31#include <mach/board-zoom.h> 31#include <mach/board-zoom.h>
32#include <plat/mcbsp.h> 32#include <linux/platform_data/asoc-ti-mcbsp.h>
33 33
34/* Register descriptions for twl4030 codec part */ 34/* Register descriptions for twl4030 codec part */
35#include <linux/mfd/twl4030-audio.h> 35#include <linux/mfd/twl4030-audio.h>
diff --git a/sound/soc/pxa/palm27x.c b/sound/soc/pxa/palm27x.c
index db24bc685bd3..aa3da91907c6 100644
--- a/sound/soc/pxa/palm27x.c
+++ b/sound/soc/pxa/palm27x.c
@@ -25,7 +25,7 @@
25 25
26#include <asm/mach-types.h> 26#include <asm/mach-types.h>
27#include <mach/audio.h> 27#include <mach/audio.h>
28#include <mach/palmasoc.h> 28#include <linux/platform_data/asoc-palm27x.h>
29 29
30#include "../codecs/wm9712.h" 30#include "../codecs/wm9712.h"
31#include "pxa2xx-ac97.h" 31#include "pxa2xx-ac97.h"
diff --git a/sound/soc/samsung/ac97.c b/sound/soc/samsung/ac97.c
index 3d04c1fa6781..14fbcd30cae5 100644
--- a/sound/soc/samsung/ac97.c
+++ b/sound/soc/samsung/ac97.c
@@ -21,7 +21,7 @@
21 21
22#include <mach/dma.h> 22#include <mach/dma.h>
23#include <plat/regs-ac97.h> 23#include <plat/regs-ac97.h>
24#include <plat/audio.h> 24#include <linux/platform_data/asoc-s3c.h>
25 25
26#include "dma.h" 26#include "dma.h"
27 27
diff --git a/sound/soc/samsung/i2s.c b/sound/soc/samsung/i2s.c
index 6ac7b8281a02..40b00a13dcd1 100644
--- a/sound/soc/samsung/i2s.c
+++ b/sound/soc/samsung/i2s.c
@@ -20,7 +20,7 @@
20#include <sound/soc.h> 20#include <sound/soc.h>
21#include <sound/pcm_params.h> 21#include <sound/pcm_params.h>
22 22
23#include <plat/audio.h> 23#include <linux/platform_data/asoc-s3c.h>
24 24
25#include "dma.h" 25#include "dma.h"
26#include "idma.h" 26#include "idma.h"
diff --git a/sound/soc/samsung/pcm.c b/sound/soc/samsung/pcm.c
index 89b064650f14..c86081992dfd 100644
--- a/sound/soc/samsung/pcm.c
+++ b/sound/soc/samsung/pcm.c
@@ -19,7 +19,7 @@
19#include <sound/soc.h> 19#include <sound/soc.h>
20#include <sound/pcm_params.h> 20#include <sound/pcm_params.h>
21 21
22#include <plat/audio.h> 22#include <linux/platform_data/asoc-s3c.h>
23#include <mach/dma.h> 23#include <mach/dma.h>
24 24
25#include "dma.h" 25#include "dma.h"
diff --git a/sound/soc/samsung/s3c24xx_simtec.c b/sound/soc/samsung/s3c24xx_simtec.c
index 656d5afe4ca9..335a7d8a4a8d 100644
--- a/sound/soc/samsung/s3c24xx_simtec.c
+++ b/sound/soc/samsung/s3c24xx_simtec.c
@@ -13,7 +13,7 @@
13 13
14#include <sound/soc.h> 14#include <sound/soc.h>
15 15
16#include <plat/audio-simtec.h> 16#include <linux/platform_data/asoc-s3c24xx_simtec.h>
17 17
18#include "s3c24xx-i2s.h" 18#include "s3c24xx-i2s.h"
19#include "s3c24xx_simtec.h" 19#include "s3c24xx_simtec.h"
diff --git a/sound/soc/samsung/spdif.c b/sound/soc/samsung/spdif.c
index a5a56a120345..bc24c7af02b2 100644
--- a/sound/soc/samsung/spdif.c
+++ b/sound/soc/samsung/spdif.c
@@ -17,7 +17,7 @@
17#include <sound/soc.h> 17#include <sound/soc.h>
18#include <sound/pcm_params.h> 18#include <sound/pcm_params.h>
19 19
20#include <plat/audio.h> 20#include <linux/platform_data/asoc-s3c.h>
21#include <mach/dma.h> 21#include <mach/dma.h>
22 22
23#include "dma.h" 23#include "dma.h"
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
index 9a6daf997319..d1198627fc40 100644
--- a/sound/soc/soc-core.c
+++ b/sound/soc/soc-core.c
@@ -591,7 +591,7 @@ int snd_soc_suspend(struct device *dev)
591 591
592 /* close any waiting streams and save state */ 592 /* close any waiting streams and save state */
593 for (i = 0; i < card->num_rtd; i++) { 593 for (i = 0; i < card->num_rtd; i++) {
594 flush_delayed_work_sync(&card->rtd[i].delayed_work); 594 flush_delayed_work(&card->rtd[i].delayed_work);
595 card->rtd[i].codec->dapm.suspend_bias_level = card->rtd[i].codec->dapm.bias_level; 595 card->rtd[i].codec->dapm.suspend_bias_level = card->rtd[i].codec->dapm.bias_level;
596 } 596 }
597 597
@@ -1862,7 +1862,7 @@ static int soc_cleanup_card_resources(struct snd_soc_card *card)
1862 /* make sure any delayed work runs */ 1862 /* make sure any delayed work runs */
1863 for (i = 0; i < card->num_rtd; i++) { 1863 for (i = 0; i < card->num_rtd; i++) {
1864 struct snd_soc_pcm_runtime *rtd = &card->rtd[i]; 1864 struct snd_soc_pcm_runtime *rtd = &card->rtd[i];
1865 flush_delayed_work_sync(&rtd->delayed_work); 1865 flush_delayed_work(&rtd->delayed_work);
1866 } 1866 }
1867 1867
1868 /* remove auxiliary devices */ 1868 /* remove auxiliary devices */
@@ -1906,7 +1906,7 @@ int snd_soc_poweroff(struct device *dev)
1906 * now, we're shutting down so no imminent restart. */ 1906 * now, we're shutting down so no imminent restart. */
1907 for (i = 0; i < card->num_rtd; i++) { 1907 for (i = 0; i < card->num_rtd; i++) {
1908 struct snd_soc_pcm_runtime *rtd = &card->rtd[i]; 1908 struct snd_soc_pcm_runtime *rtd = &card->rtd[i];
1909 flush_delayed_work_sync(&rtd->delayed_work); 1909 flush_delayed_work(&rtd->delayed_work);
1910 } 1910 }
1911 1911
1912 snd_soc_dapm_shutdown(card); 1912 snd_soc_dapm_shutdown(card);
diff --git a/sound/soc/tegra/Kconfig b/sound/soc/tegra/Kconfig
index 02bcd308c189..19e5fe7cc403 100644
--- a/sound/soc/tegra/Kconfig
+++ b/sound/soc/tegra/Kconfig
@@ -1,6 +1,6 @@
1config SND_SOC_TEGRA 1config SND_SOC_TEGRA
2 tristate "SoC Audio for the Tegra System-on-Chip" 2 tristate "SoC Audio for the Tegra System-on-Chip"
3 depends on ARCH_TEGRA && (TEGRA_SYSTEM_DMA || TEGRA20_APB_DMA) 3 depends on ARCH_TEGRA && TEGRA20_APB_DMA
4 select REGMAP_MMIO 4 select REGMAP_MMIO
5 select SND_SOC_DMAENGINE_PCM if TEGRA20_APB_DMA 5 select SND_SOC_DMAENGINE_PCM if TEGRA20_APB_DMA
6 help 6 help
diff --git a/sound/soc/tegra/tegra_pcm.c b/sound/soc/tegra/tegra_pcm.c
index 8d6900c1ee47..e18733963cb4 100644
--- a/sound/soc/tegra/tegra_pcm.c
+++ b/sound/soc/tegra/tegra_pcm.c
@@ -57,237 +57,6 @@ static const struct snd_pcm_hardware tegra_pcm_hardware = {
57 .fifo_size = 4, 57 .fifo_size = 4,
58}; 58};
59 59
60#if defined(CONFIG_TEGRA_SYSTEM_DMA)
61static void tegra_pcm_queue_dma(struct tegra_runtime_data *prtd)
62{
63 struct snd_pcm_substream *substream = prtd->substream;
64 struct snd_dma_buffer *buf = &substream->dma_buffer;
65 struct tegra_dma_req *dma_req;
66 unsigned long addr;
67
68 dma_req = &prtd->dma_req[prtd->dma_req_idx];
69 prtd->dma_req_idx = 1 - prtd->dma_req_idx;
70
71 addr = buf->addr + prtd->dma_pos;
72 prtd->dma_pos += dma_req->size;
73 if (prtd->dma_pos >= prtd->dma_pos_end)
74 prtd->dma_pos = 0;
75
76 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
77 dma_req->source_addr = addr;
78 else
79 dma_req->dest_addr = addr;
80
81 tegra_dma_enqueue_req(prtd->dma_chan, dma_req);
82}
83
84static void dma_complete_callback(struct tegra_dma_req *req)
85{
86 struct tegra_runtime_data *prtd = (struct tegra_runtime_data *)req->dev;
87 struct snd_pcm_substream *substream = prtd->substream;
88 struct snd_pcm_runtime *runtime = substream->runtime;
89
90 spin_lock(&prtd->lock);
91
92 if (!prtd->running) {
93 spin_unlock(&prtd->lock);
94 return;
95 }
96
97 if (++prtd->period_index >= runtime->periods)
98 prtd->period_index = 0;
99
100 tegra_pcm_queue_dma(prtd);
101
102 spin_unlock(&prtd->lock);
103
104 snd_pcm_period_elapsed(substream);
105}
106
107static void setup_dma_tx_request(struct tegra_dma_req *req,
108 struct tegra_pcm_dma_params * dmap)
109{
110 req->complete = dma_complete_callback;
111 req->to_memory = false;
112 req->dest_addr = dmap->addr;
113 req->dest_wrap = dmap->wrap;
114 req->source_bus_width = 32;
115 req->source_wrap = 0;
116 req->dest_bus_width = dmap->width;
117 req->req_sel = dmap->req_sel;
118}
119
120static void setup_dma_rx_request(struct tegra_dma_req *req,
121 struct tegra_pcm_dma_params * dmap)
122{
123 req->complete = dma_complete_callback;
124 req->to_memory = true;
125 req->source_addr = dmap->addr;
126 req->dest_wrap = 0;
127 req->source_bus_width = dmap->width;
128 req->source_wrap = dmap->wrap;
129 req->dest_bus_width = 32;
130 req->req_sel = dmap->req_sel;
131}
132
133static int tegra_pcm_open(struct snd_pcm_substream *substream)
134{
135 struct snd_pcm_runtime *runtime = substream->runtime;
136 struct tegra_runtime_data *prtd;
137 struct snd_soc_pcm_runtime *rtd = substream->private_data;
138 struct tegra_pcm_dma_params * dmap;
139 int ret = 0;
140
141 prtd = kzalloc(sizeof(struct tegra_runtime_data), GFP_KERNEL);
142 if (prtd == NULL)
143 return -ENOMEM;
144
145 runtime->private_data = prtd;
146 prtd->substream = substream;
147
148 spin_lock_init(&prtd->lock);
149
150 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) {
151 dmap = snd_soc_dai_get_dma_data(rtd->cpu_dai, substream);
152 setup_dma_tx_request(&prtd->dma_req[0], dmap);
153 setup_dma_tx_request(&prtd->dma_req[1], dmap);
154 } else {
155 dmap = snd_soc_dai_get_dma_data(rtd->cpu_dai, substream);
156 setup_dma_rx_request(&prtd->dma_req[0], dmap);
157 setup_dma_rx_request(&prtd->dma_req[1], dmap);
158 }
159
160 prtd->dma_req[0].dev = prtd;
161 prtd->dma_req[1].dev = prtd;
162
163 prtd->dma_chan = tegra_dma_allocate_channel(TEGRA_DMA_MODE_ONESHOT);
164 if (prtd->dma_chan == NULL) {
165 ret = -ENOMEM;
166 goto err;
167 }
168
169 /* Set HW params now that initialization is complete */
170 snd_soc_set_runtime_hwparams(substream, &tegra_pcm_hardware);
171
172 /* Ensure that buffer size is a multiple of period size */
173 ret = snd_pcm_hw_constraint_integer(runtime,
174 SNDRV_PCM_HW_PARAM_PERIODS);
175 if (ret < 0)
176 goto err;
177
178 return 0;
179
180err:
181 if (prtd->dma_chan) {
182 tegra_dma_free_channel(prtd->dma_chan);
183 }
184
185 kfree(prtd);
186
187 return ret;
188}
189
190static int tegra_pcm_close(struct snd_pcm_substream *substream)
191{
192 struct snd_pcm_runtime *runtime = substream->runtime;
193 struct tegra_runtime_data *prtd = runtime->private_data;
194
195 tegra_dma_free_channel(prtd->dma_chan);
196
197 kfree(prtd);
198
199 return 0;
200}
201
202static int tegra_pcm_hw_params(struct snd_pcm_substream *substream,
203 struct snd_pcm_hw_params *params)
204{
205 struct snd_pcm_runtime *runtime = substream->runtime;
206 struct tegra_runtime_data *prtd = runtime->private_data;
207
208 snd_pcm_set_runtime_buffer(substream, &substream->dma_buffer);
209
210 prtd->dma_req[0].size = params_period_bytes(params);
211 prtd->dma_req[1].size = prtd->dma_req[0].size;
212
213 return 0;
214}
215
216static int tegra_pcm_hw_free(struct snd_pcm_substream *substream)
217{
218 snd_pcm_set_runtime_buffer(substream, NULL);
219
220 return 0;
221}
222
223static int tegra_pcm_trigger(struct snd_pcm_substream *substream, int cmd)
224{
225 struct snd_pcm_runtime *runtime = substream->runtime;
226 struct tegra_runtime_data *prtd = runtime->private_data;
227 unsigned long flags;
228
229 switch (cmd) {
230 case SNDRV_PCM_TRIGGER_START:
231 prtd->dma_pos = 0;
232 prtd->dma_pos_end = frames_to_bytes(runtime, runtime->periods * runtime->period_size);
233 prtd->period_index = 0;
234 prtd->dma_req_idx = 0;
235 /* Fall-through */
236 case SNDRV_PCM_TRIGGER_RESUME:
237 case SNDRV_PCM_TRIGGER_PAUSE_RELEASE:
238 spin_lock_irqsave(&prtd->lock, flags);
239 prtd->running = 1;
240 spin_unlock_irqrestore(&prtd->lock, flags);
241 tegra_pcm_queue_dma(prtd);
242 tegra_pcm_queue_dma(prtd);
243 break;
244 case SNDRV_PCM_TRIGGER_STOP:
245 case SNDRV_PCM_TRIGGER_SUSPEND:
246 case SNDRV_PCM_TRIGGER_PAUSE_PUSH:
247 spin_lock_irqsave(&prtd->lock, flags);
248 prtd->running = 0;
249 spin_unlock_irqrestore(&prtd->lock, flags);
250 tegra_dma_dequeue_req(prtd->dma_chan, &prtd->dma_req[0]);
251 tegra_dma_dequeue_req(prtd->dma_chan, &prtd->dma_req[1]);
252 break;
253 default:
254 return -EINVAL;
255 }
256
257 return 0;
258}
259
260static snd_pcm_uframes_t tegra_pcm_pointer(struct snd_pcm_substream *substream)
261{
262 struct snd_pcm_runtime *runtime = substream->runtime;
263 struct tegra_runtime_data *prtd = runtime->private_data;
264
265 return prtd->period_index * runtime->period_size;
266}
267
268
269static int tegra_pcm_mmap(struct snd_pcm_substream *substream,
270 struct vm_area_struct *vma)
271{
272 struct snd_pcm_runtime *runtime = substream->runtime;
273
274 return dma_mmap_writecombine(substream->pcm->card->dev, vma,
275 runtime->dma_area,
276 runtime->dma_addr,
277 runtime->dma_bytes);
278}
279
280static struct snd_pcm_ops tegra_pcm_ops = {
281 .open = tegra_pcm_open,
282 .close = tegra_pcm_close,
283 .ioctl = snd_pcm_lib_ioctl,
284 .hw_params = tegra_pcm_hw_params,
285 .hw_free = tegra_pcm_hw_free,
286 .trigger = tegra_pcm_trigger,
287 .pointer = tegra_pcm_pointer,
288 .mmap = tegra_pcm_mmap,
289};
290#else
291static int tegra_pcm_open(struct snd_pcm_substream *substream) 60static int tegra_pcm_open(struct snd_pcm_substream *substream)
292{ 61{
293 struct snd_soc_pcm_runtime *rtd = substream->private_data; 62 struct snd_soc_pcm_runtime *rtd = substream->private_data;
@@ -399,7 +168,6 @@ static struct snd_pcm_ops tegra_pcm_ops = {
399 .pointer = snd_dmaengine_pcm_pointer, 168 .pointer = snd_dmaengine_pcm_pointer,
400 .mmap = tegra_pcm_mmap, 169 .mmap = tegra_pcm_mmap,
401}; 170};
402#endif
403 171
404static int tegra_pcm_preallocate_dma_buffer(struct snd_pcm *pcm, int stream) 172static int tegra_pcm_preallocate_dma_buffer(struct snd_pcm *pcm, int stream)
405{ 173{
diff --git a/sound/soc/tegra/tegra_pcm.h b/sound/soc/tegra/tegra_pcm.h
index a3a450352dcf..b40279b9f413 100644
--- a/sound/soc/tegra/tegra_pcm.h
+++ b/sound/soc/tegra/tegra_pcm.h
@@ -40,20 +40,6 @@ struct tegra_pcm_dma_params {
40 unsigned long req_sel; 40 unsigned long req_sel;
41}; 41};
42 42
43#if defined(CONFIG_TEGRA_SYSTEM_DMA)
44struct tegra_runtime_data {
45 struct snd_pcm_substream *substream;
46 spinlock_t lock;
47 int running;
48 int dma_pos;
49 int dma_pos_end;
50 int period_index;
51 int dma_req_idx;
52 struct tegra_dma_req dma_req[2];
53 struct tegra_dma_channel *dma_chan;
54};
55#endif
56
57int tegra_pcm_platform_register(struct device *dev); 43int tegra_pcm_platform_register(struct device *dev);
58void tegra_pcm_platform_unregister(struct device *dev); 44void tegra_pcm_platform_unregister(struct device *dev);
59 45
diff --git a/sound/usb/endpoint.c b/sound/usb/endpoint.c
index 152bfd48a311..7f78c6d782b0 100644
--- a/sound/usb/endpoint.c
+++ b/sound/usb/endpoint.c
@@ -203,7 +203,13 @@ static void prepare_outbound_urb(struct snd_usb_endpoint *ep,
203 /* no data provider, so send silence */ 203 /* no data provider, so send silence */
204 unsigned int offs = 0; 204 unsigned int offs = 0;
205 for (i = 0; i < ctx->packets; ++i) { 205 for (i = 0; i < ctx->packets; ++i) {
206 int counts = ctx->packet_size[i]; 206 int counts;
207
208 if (ctx->packet_size[i])
209 counts = ctx->packet_size[i];
210 else
211 counts = snd_usb_endpoint_next_packet_size(ep);
212
207 urb->iso_frame_desc[i].offset = offs * ep->stride; 213 urb->iso_frame_desc[i].offset = offs * ep->stride;
208 urb->iso_frame_desc[i].length = counts * ep->stride; 214 urb->iso_frame_desc[i].length = counts * ep->stride;
209 offs += counts; 215 offs += counts;