aboutsummaryrefslogtreecommitdiffstats
path: root/sound
diff options
context:
space:
mode:
Diffstat (limited to 'sound')
-rw-r--r--sound/Kconfig4
-rw-r--r--sound/aoa/aoa-gpio.h2
-rw-r--r--sound/aoa/codecs/snd-aoa-codec-tas.c13
-rw-r--r--sound/aoa/core/snd-aoa-gpio-feature.c16
-rw-r--r--sound/aoa/core/snd-aoa-gpio-pmf.c16
-rw-r--r--sound/arm/sa11xx-uda1341.c2
-rw-r--r--sound/core/init.c8
-rw-r--r--sound/core/oss/pcm_oss.c3
-rw-r--r--sound/core/pcm.c7
-rw-r--r--sound/core/pcm_native.c16
-rw-r--r--sound/core/rtctimer.c20
-rw-r--r--sound/core/sound.c22
-rw-r--r--sound/i2c/other/ak4114.c8
-rw-r--r--sound/oss/Kconfig115
-rw-r--r--sound/oss/btaudio.c2
-rw-r--r--sound/oss/cs46xx.c7
-rw-r--r--sound/oss/dmabuf.c1
-rw-r--r--sound/oss/emu10k1/audio.c9
-rw-r--r--sound/oss/emu10k1/cardwi.c31
-rw-r--r--sound/oss/emu10k1/cardwi.h2
-rw-r--r--sound/oss/emu10k1/passthrough.c13
-rw-r--r--sound/oss/es1371.c1
-rw-r--r--sound/oss/i810_audio.c1
-rw-r--r--sound/oss/soundcard.c17
-rw-r--r--sound/oss/sscape.c1
-rw-r--r--sound/oss/trident.c1
-rw-r--r--sound/oss/via82cxxx_audio.c4
-rw-r--r--sound/pci/ac97/ac97_codec.c7
-rw-r--r--sound/pci/emu10k1/emu10k1_main.c1
-rw-r--r--sound/pci/hda/hda_codec.c10
-rw-r--r--sound/pci/hda/hda_intel.c8
-rw-r--r--sound/pci/hda/hda_local.h1
-rw-r--r--sound/pci/hda/patch_realtek.c2
-rw-r--r--sound/pci/hda/patch_sigmatel.c14
-rw-r--r--sound/pcmcia/pdaudiocf/pdaudiocf.c24
-rw-r--r--sound/pcmcia/vx/vxpocket.c26
-rw-r--r--sound/ppc/tumbler.c8
-rw-r--r--sound/sound_core.c6
-rw-r--r--sound/usb/usbaudio.c3
-rw-r--r--sound/usb/usbmidi.c2
-rw-r--r--sound/usb/usbmixer.c9
-rw-r--r--sound/usb/usx2y/usX2Yhwdep.c2
42 files changed, 180 insertions, 285 deletions
diff --git a/sound/Kconfig b/sound/Kconfig
index e0d791a98452..95949b6806ac 100644
--- a/sound/Kconfig
+++ b/sound/Kconfig
@@ -64,11 +64,11 @@ source "sound/arm/Kconfig"
64 64
65source "sound/mips/Kconfig" 65source "sound/mips/Kconfig"
66 66
67# the following will depenend on the order of config. 67# the following will depend on the order of config.
68# here assuming USB is defined before ALSA 68# here assuming USB is defined before ALSA
69source "sound/usb/Kconfig" 69source "sound/usb/Kconfig"
70 70
71# the following will depenend on the order of config. 71# the following will depend on the order of config.
72# here assuming PCMCIA is defined before ALSA 72# here assuming PCMCIA is defined before ALSA
73source "sound/pcmcia/Kconfig" 73source "sound/pcmcia/Kconfig"
74 74
diff --git a/sound/aoa/aoa-gpio.h b/sound/aoa/aoa-gpio.h
index 3a61f3115573..ee64f5de8966 100644
--- a/sound/aoa/aoa-gpio.h
+++ b/sound/aoa/aoa-gpio.h
@@ -59,10 +59,10 @@ struct gpio_methods {
59}; 59};
60 60
61struct gpio_notification { 61struct gpio_notification {
62 struct delayed_work work;
62 notify_func_t notify; 63 notify_func_t notify;
63 void *data; 64 void *data;
64 void *gpio_private; 65 void *gpio_private;
65 struct work_struct work;
66 struct mutex mutex; 66 struct mutex mutex;
67}; 67};
68 68
diff --git a/sound/aoa/codecs/snd-aoa-codec-tas.c b/sound/aoa/codecs/snd-aoa-codec-tas.c
index 2ef55a17917c..9de8485ba3f5 100644
--- a/sound/aoa/codecs/snd-aoa-codec-tas.c
+++ b/sound/aoa/codecs/snd-aoa-codec-tas.c
@@ -514,9 +514,15 @@ static int tas_snd_capture_source_put(struct snd_kcontrol *kcontrol,
514 mutex_lock(&tas->mtx); 514 mutex_lock(&tas->mtx);
515 oldacr = tas->acr; 515 oldacr = tas->acr;
516 516
517 tas->acr &= ~TAS_ACR_INPUT_B; 517 /*
518 * Despite what the data sheet says in one place, the
519 * TAS_ACR_B_MONAUREAL bit forces mono output even when
520 * input A (line in) is selected.
521 */
522 tas->acr &= ~(TAS_ACR_INPUT_B | TAS_ACR_B_MONAUREAL);
518 if (ucontrol->value.enumerated.item[0]) 523 if (ucontrol->value.enumerated.item[0])
519 tas->acr |= TAS_ACR_INPUT_B; 524 tas->acr |= TAS_ACR_INPUT_B | TAS_ACR_B_MONAUREAL |
525 TAS_ACR_B_MON_SEL_RIGHT;
520 if (oldacr == tas->acr) { 526 if (oldacr == tas->acr) {
521 mutex_unlock(&tas->mtx); 527 mutex_unlock(&tas->mtx);
522 return 0; 528 return 0;
@@ -686,8 +692,7 @@ static int tas_reset_init(struct tas *tas)
686 if (tas_write_reg(tas, TAS_REG_MCS, 1, &tmp)) 692 if (tas_write_reg(tas, TAS_REG_MCS, 1, &tmp))
687 goto outerr; 693 goto outerr;
688 694
689 tas->acr |= TAS_ACR_ANALOG_PDOWN | TAS_ACR_B_MONAUREAL | 695 tas->acr |= TAS_ACR_ANALOG_PDOWN;
690 TAS_ACR_B_MON_SEL_RIGHT;
691 if (tas_write_reg(tas, TAS_REG_ACR, 1, &tas->acr)) 696 if (tas_write_reg(tas, TAS_REG_ACR, 1, &tas->acr))
692 goto outerr; 697 goto outerr;
693 698
diff --git a/sound/aoa/core/snd-aoa-gpio-feature.c b/sound/aoa/core/snd-aoa-gpio-feature.c
index 40eb47eccf9a..2b03bc798bcb 100644
--- a/sound/aoa/core/snd-aoa-gpio-feature.c
+++ b/sound/aoa/core/snd-aoa-gpio-feature.c
@@ -195,9 +195,10 @@ static void ftr_gpio_all_amps_restore(struct gpio_runtime *rt)
195 ftr_gpio_set_lineout(rt, (s>>2)&1); 195 ftr_gpio_set_lineout(rt, (s>>2)&1);
196} 196}
197 197
198static void ftr_handle_notify(void *data) 198static void ftr_handle_notify(struct work_struct *work)
199{ 199{
200 struct gpio_notification *notif = data; 200 struct gpio_notification *notif =
201 container_of(work, struct gpio_notification, work.work);
201 202
202 mutex_lock(&notif->mutex); 203 mutex_lock(&notif->mutex);
203 if (notif->notify) 204 if (notif->notify)
@@ -253,12 +254,9 @@ static void ftr_gpio_init(struct gpio_runtime *rt)
253 254
254 ftr_gpio_all_amps_off(rt); 255 ftr_gpio_all_amps_off(rt);
255 rt->implementation_private = 0; 256 rt->implementation_private = 0;
256 INIT_WORK(&rt->headphone_notify.work, ftr_handle_notify, 257 INIT_DELAYED_WORK(&rt->headphone_notify.work, ftr_handle_notify);
257 &rt->headphone_notify); 258 INIT_DELAYED_WORK(&rt->line_in_notify.work, ftr_handle_notify);
258 INIT_WORK(&rt->line_in_notify.work, ftr_handle_notify, 259 INIT_DELAYED_WORK(&rt->line_out_notify.work, ftr_handle_notify);
259 &rt->line_in_notify);
260 INIT_WORK(&rt->line_out_notify.work, ftr_handle_notify,
261 &rt->line_out_notify);
262 mutex_init(&rt->headphone_notify.mutex); 260 mutex_init(&rt->headphone_notify.mutex);
263 mutex_init(&rt->line_in_notify.mutex); 261 mutex_init(&rt->line_in_notify.mutex);
264 mutex_init(&rt->line_out_notify.mutex); 262 mutex_init(&rt->line_out_notify.mutex);
@@ -287,7 +285,7 @@ static irqreturn_t ftr_handle_notify_irq(int xx, void *data)
287{ 285{
288 struct gpio_notification *notif = data; 286 struct gpio_notification *notif = data;
289 287
290 schedule_work(&notif->work); 288 schedule_delayed_work(&notif->work, 0);
291 289
292 return IRQ_HANDLED; 290 return IRQ_HANDLED;
293} 291}
diff --git a/sound/aoa/core/snd-aoa-gpio-pmf.c b/sound/aoa/core/snd-aoa-gpio-pmf.c
index 2836c3218391..5ca2220eac7d 100644
--- a/sound/aoa/core/snd-aoa-gpio-pmf.c
+++ b/sound/aoa/core/snd-aoa-gpio-pmf.c
@@ -69,9 +69,10 @@ static void pmf_gpio_all_amps_restore(struct gpio_runtime *rt)
69 pmf_gpio_set_lineout(rt, (s>>2)&1); 69 pmf_gpio_set_lineout(rt, (s>>2)&1);
70} 70}
71 71
72static void pmf_handle_notify(void *data) 72static void pmf_handle_notify(struct work_struct *work)
73{ 73{
74 struct gpio_notification *notif = data; 74 struct gpio_notification *notif =
75 container_of(work, struct gpio_notification, work.work);
75 76
76 mutex_lock(&notif->mutex); 77 mutex_lock(&notif->mutex);
77 if (notif->notify) 78 if (notif->notify)
@@ -83,12 +84,9 @@ static void pmf_gpio_init(struct gpio_runtime *rt)
83{ 84{
84 pmf_gpio_all_amps_off(rt); 85 pmf_gpio_all_amps_off(rt);
85 rt->implementation_private = 0; 86 rt->implementation_private = 0;
86 INIT_WORK(&rt->headphone_notify.work, pmf_handle_notify, 87 INIT_DELAYED_WORK(&rt->headphone_notify.work, pmf_handle_notify);
87 &rt->headphone_notify); 88 INIT_DELAYED_WORK(&rt->line_in_notify.work, pmf_handle_notify);
88 INIT_WORK(&rt->line_in_notify.work, pmf_handle_notify, 89 INIT_DELAYED_WORK(&rt->line_out_notify.work, pmf_handle_notify);
89 &rt->line_in_notify);
90 INIT_WORK(&rt->line_out_notify.work, pmf_handle_notify,
91 &rt->line_out_notify);
92 mutex_init(&rt->headphone_notify.mutex); 90 mutex_init(&rt->headphone_notify.mutex);
93 mutex_init(&rt->line_in_notify.mutex); 91 mutex_init(&rt->line_in_notify.mutex);
94 mutex_init(&rt->line_out_notify.mutex); 92 mutex_init(&rt->line_out_notify.mutex);
@@ -129,7 +127,7 @@ static void pmf_handle_notify_irq(void *data)
129{ 127{
130 struct gpio_notification *notif = data; 128 struct gpio_notification *notif = data;
131 129
132 schedule_work(&notif->work); 130 schedule_delayed_work(&notif->work, 0);
133} 131}
134 132
135static int pmf_set_notify(struct gpio_runtime *rt, 133static int pmf_set_notify(struct gpio_runtime *rt,
diff --git a/sound/arm/sa11xx-uda1341.c b/sound/arm/sa11xx-uda1341.c
index c79a9afd0955..c7e1b2646193 100644
--- a/sound/arm/sa11xx-uda1341.c
+++ b/sound/arm/sa11xx-uda1341.c
@@ -125,7 +125,7 @@ struct audio_stream {
125#else 125#else
126 dma_regs_t *dma_regs; /* points to our DMA registers */ 126 dma_regs_t *dma_regs; /* points to our DMA registers */
127#endif 127#endif
128 int active:1; /* we are using this stream for transfer now */ 128 unsigned int active:1; /* we are using this stream for transfer now */
129 int period; /* current transfer period */ 129 int period; /* current transfer period */
130 int periods; /* current count of periods registerd in the DMA engine */ 130 int periods; /* current count of periods registerd in the DMA engine */
131 int tx_spin; /* are we recoding - flag used to do DMA trans. for sync */ 131 int tx_spin; /* are we recoding - flag used to do DMA trans. for sync */
diff --git a/sound/core/init.c b/sound/core/init.c
index 3058d626a90a..6152a7554dfd 100644
--- a/sound/core/init.c
+++ b/sound/core/init.c
@@ -361,6 +361,8 @@ static int snd_card_do_free(struct snd_card *card)
361 snd_printk(KERN_WARNING "unable to free card info\n"); 361 snd_printk(KERN_WARNING "unable to free card info\n");
362 /* Not fatal error */ 362 /* Not fatal error */
363 } 363 }
364 if (card->dev)
365 device_unregister(card->dev);
364 kfree(card); 366 kfree(card);
365 return 0; 367 return 0;
366} 368}
@@ -495,6 +497,12 @@ int snd_card_register(struct snd_card *card)
495 int err; 497 int err;
496 498
497 snd_assert(card != NULL, return -EINVAL); 499 snd_assert(card != NULL, return -EINVAL);
500 if (!card->dev) {
501 card->dev = device_create(sound_class, card->parent, 0,
502 "card%i", card->number);
503 if (IS_ERR(card->dev))
504 card->dev = NULL;
505 }
498 if ((err = snd_device_register_all(card)) < 0) 506 if ((err = snd_device_register_all(card)) < 0)
499 return err; 507 return err;
500 mutex_lock(&snd_card_mutex); 508 mutex_lock(&snd_card_mutex);
diff --git a/sound/core/oss/pcm_oss.c b/sound/core/oss/pcm_oss.c
index 505b23ec4058..e0821eb3d851 100644
--- a/sound/core/oss/pcm_oss.c
+++ b/sound/core/oss/pcm_oss.c
@@ -2359,7 +2359,8 @@ static int snd_pcm_oss_release(struct inode *inode, struct file *file)
2359 substream = pcm_oss_file->streams[SNDRV_PCM_STREAM_CAPTURE]; 2359 substream = pcm_oss_file->streams[SNDRV_PCM_STREAM_CAPTURE];
2360 snd_assert(substream != NULL, return -ENXIO); 2360 snd_assert(substream != NULL, return -ENXIO);
2361 pcm = substream->pcm; 2361 pcm = substream->pcm;
2362 snd_pcm_oss_sync(pcm_oss_file); 2362 if (!pcm->card->shutdown)
2363 snd_pcm_oss_sync(pcm_oss_file);
2363 mutex_lock(&pcm->open_mutex); 2364 mutex_lock(&pcm->open_mutex);
2364 snd_pcm_oss_release_file(pcm_oss_file); 2365 snd_pcm_oss_release_file(pcm_oss_file);
2365 mutex_unlock(&pcm->open_mutex); 2366 mutex_unlock(&pcm->open_mutex);
diff --git a/sound/core/pcm.c b/sound/core/pcm.c
index fbbbcd20c4cc..5ac6e19ccb41 100644
--- a/sound/core/pcm.c
+++ b/sound/core/pcm.c
@@ -910,7 +910,8 @@ void snd_pcm_detach_substream(struct snd_pcm_substream *substream)
910 substream->pstr->substream_opened--; 910 substream->pstr->substream_opened--;
911} 911}
912 912
913static ssize_t show_pcm_class(struct class_device *class_device, char *buf) 913static ssize_t show_pcm_class(struct device *dev,
914 struct device_attribute *attr, char *buf)
914{ 915{
915 struct snd_pcm *pcm; 916 struct snd_pcm *pcm;
916 const char *str; 917 const char *str;
@@ -921,7 +922,7 @@ static ssize_t show_pcm_class(struct class_device *class_device, char *buf)
921 [SNDRV_PCM_CLASS_DIGITIZER] = "digitizer", 922 [SNDRV_PCM_CLASS_DIGITIZER] = "digitizer",
922 }; 923 };
923 924
924 if (! (pcm = class_get_devdata(class_device)) || 925 if (! (pcm = dev_get_drvdata(dev)) ||
925 pcm->dev_class > SNDRV_PCM_CLASS_LAST) 926 pcm->dev_class > SNDRV_PCM_CLASS_LAST)
926 str = "none"; 927 str = "none";
927 else 928 else
@@ -929,7 +930,7 @@ static ssize_t show_pcm_class(struct class_device *class_device, char *buf)
929 return snprintf(buf, PAGE_SIZE, "%s\n", str); 930 return snprintf(buf, PAGE_SIZE, "%s\n", str);
930} 931}
931 932
932static struct class_device_attribute pcm_attrs = 933static struct device_attribute pcm_attrs =
933 __ATTR(pcm_class, S_IRUGO, show_pcm_class, NULL); 934 __ATTR(pcm_class, S_IRUGO, show_pcm_class, NULL);
934 935
935static int snd_pcm_dev_register(struct snd_device *device) 936static int snd_pcm_dev_register(struct snd_device *device)
diff --git a/sound/core/pcm_native.c b/sound/core/pcm_native.c
index 37b4b10850ae..6ea67b16c676 100644
--- a/sound/core/pcm_native.c
+++ b/sound/core/pcm_native.c
@@ -1310,7 +1310,8 @@ static int snd_pcm_pre_prepare(struct snd_pcm_substream *substream,
1310 int f_flags) 1310 int f_flags)
1311{ 1311{
1312 struct snd_pcm_runtime *runtime = substream->runtime; 1312 struct snd_pcm_runtime *runtime = substream->runtime;
1313 if (runtime->status->state == SNDRV_PCM_STATE_OPEN) 1313 if (runtime->status->state == SNDRV_PCM_STATE_OPEN ||
1314 runtime->status->state == SNDRV_PCM_STATE_DISCONNECTED)
1314 return -EBADFD; 1315 return -EBADFD;
1315 if (snd_pcm_running(substream)) 1316 if (snd_pcm_running(substream))
1316 return -EBUSY; 1317 return -EBUSY;
@@ -1568,7 +1569,8 @@ static int snd_pcm_drop(struct snd_pcm_substream *substream)
1568 runtime = substream->runtime; 1569 runtime = substream->runtime;
1569 card = substream->pcm->card; 1570 card = substream->pcm->card;
1570 1571
1571 if (runtime->status->state == SNDRV_PCM_STATE_OPEN) 1572 if (runtime->status->state == SNDRV_PCM_STATE_OPEN ||
1573 runtime->status->state == SNDRV_PCM_STATE_DISCONNECTED)
1572 return -EBADFD; 1574 return -EBADFD;
1573 1575
1574 snd_power_lock(card); 1576 snd_power_lock(card);
@@ -3025,7 +3027,7 @@ static struct page * snd_pcm_mmap_status_nopage(struct vm_area_struct *area,
3025 struct page * page; 3027 struct page * page;
3026 3028
3027 if (substream == NULL) 3029 if (substream == NULL)
3028 return NOPAGE_OOM; 3030 return NOPAGE_SIGBUS;
3029 runtime = substream->runtime; 3031 runtime = substream->runtime;
3030 page = virt_to_page(runtime->status); 3032 page = virt_to_page(runtime->status);
3031 get_page(page); 3033 get_page(page);
@@ -3068,7 +3070,7 @@ static struct page * snd_pcm_mmap_control_nopage(struct vm_area_struct *area,
3068 struct page * page; 3070 struct page * page;
3069 3071
3070 if (substream == NULL) 3072 if (substream == NULL)
3071 return NOPAGE_OOM; 3073 return NOPAGE_SIGBUS;
3072 runtime = substream->runtime; 3074 runtime = substream->runtime;
3073 page = virt_to_page(runtime->control); 3075 page = virt_to_page(runtime->control);
3074 get_page(page); 3076 get_page(page);
@@ -3129,18 +3131,18 @@ static struct page *snd_pcm_mmap_data_nopage(struct vm_area_struct *area,
3129 size_t dma_bytes; 3131 size_t dma_bytes;
3130 3132
3131 if (substream == NULL) 3133 if (substream == NULL)
3132 return NOPAGE_OOM; 3134 return NOPAGE_SIGBUS;
3133 runtime = substream->runtime; 3135 runtime = substream->runtime;
3134 offset = area->vm_pgoff << PAGE_SHIFT; 3136 offset = area->vm_pgoff << PAGE_SHIFT;
3135 offset += address - area->vm_start; 3137 offset += address - area->vm_start;
3136 snd_assert((offset % PAGE_SIZE) == 0, return NOPAGE_OOM); 3138 snd_assert((offset % PAGE_SIZE) == 0, return NOPAGE_SIGBUS);
3137 dma_bytes = PAGE_ALIGN(runtime->dma_bytes); 3139 dma_bytes = PAGE_ALIGN(runtime->dma_bytes);
3138 if (offset > dma_bytes - PAGE_SIZE) 3140 if (offset > dma_bytes - PAGE_SIZE)
3139 return NOPAGE_SIGBUS; 3141 return NOPAGE_SIGBUS;
3140 if (substream->ops->page) { 3142 if (substream->ops->page) {
3141 page = substream->ops->page(substream, offset); 3143 page = substream->ops->page(substream, offset);
3142 if (! page) 3144 if (! page)
3143 return NOPAGE_OOM; 3145 return NOPAGE_OOM; /* XXX: is this really due to OOM? */
3144 } else { 3146 } else {
3145 vaddr = runtime->dma_area + offset; 3147 vaddr = runtime->dma_area + offset;
3146 page = virt_to_page(vaddr); 3148 page = virt_to_page(vaddr);
diff --git a/sound/core/rtctimer.c b/sound/core/rtctimer.c
index 412dd62b654e..9f7b32e1ccde 100644
--- a/sound/core/rtctimer.c
+++ b/sound/core/rtctimer.c
@@ -22,13 +22,10 @@
22 22
23#include <sound/driver.h> 23#include <sound/driver.h>
24#include <linux/init.h> 24#include <linux/init.h>
25#include <linux/time.h>
26#include <linux/threads.h>
27#include <linux/interrupt.h> 25#include <linux/interrupt.h>
28#include <linux/moduleparam.h> 26#include <linux/moduleparam.h>
29#include <sound/core.h> 27#include <sound/core.h>
30#include <sound/timer.h> 28#include <sound/timer.h>
31#include <sound/info.h>
32 29
33#if defined(CONFIG_RTC) || defined(CONFIG_RTC_MODULE) 30#if defined(CONFIG_RTC) || defined(CONFIG_RTC_MODULE)
34 31
@@ -50,7 +47,9 @@ static int rtctimer_stop(struct snd_timer *t);
50 * The hardware dependent description for this timer. 47 * The hardware dependent description for this timer.
51 */ 48 */
52static struct snd_timer_hardware rtc_hw = { 49static struct snd_timer_hardware rtc_hw = {
53 .flags = SNDRV_TIMER_HW_FIRST|SNDRV_TIMER_HW_AUTO, 50 .flags = SNDRV_TIMER_HW_AUTO |
51 SNDRV_TIMER_HW_FIRST |
52 SNDRV_TIMER_HW_TASKLET,
54 .ticks = 100000000L, /* FIXME: XXX */ 53 .ticks = 100000000L, /* FIXME: XXX */
55 .open = rtctimer_open, 54 .open = rtctimer_open,
56 .close = rtctimer_close, 55 .close = rtctimer_close,
@@ -60,6 +59,7 @@ static struct snd_timer_hardware rtc_hw = {
60 59
61static int rtctimer_freq = RTC_FREQ; /* frequency */ 60static int rtctimer_freq = RTC_FREQ; /* frequency */
62static struct snd_timer *rtctimer; 61static struct snd_timer *rtctimer;
62static struct tasklet_struct rtc_tasklet;
63static rtc_task_t rtc_task; 63static rtc_task_t rtc_task;
64 64
65 65
@@ -81,6 +81,7 @@ rtctimer_close(struct snd_timer *t)
81 rtc_task_t *rtc = t->private_data; 81 rtc_task_t *rtc = t->private_data;
82 if (rtc) { 82 if (rtc) {
83 rtc_unregister(rtc); 83 rtc_unregister(rtc);
84 tasklet_kill(&rtc_tasklet);
84 t->private_data = NULL; 85 t->private_data = NULL;
85 } 86 }
86 return 0; 87 return 0;
@@ -105,12 +106,17 @@ rtctimer_stop(struct snd_timer *timer)
105 return 0; 106 return 0;
106} 107}
107 108
109static void rtctimer_tasklet(unsigned long data)
110{
111 snd_timer_interrupt((struct snd_timer *)data, 1);
112}
113
108/* 114/*
109 * interrupt 115 * interrupt
110 */ 116 */
111static void rtctimer_interrupt(void *private_data) 117static void rtctimer_interrupt(void *private_data)
112{ 118{
113 snd_timer_interrupt(private_data, 1); 119 tasklet_hi_schedule(private_data);
114} 120}
115 121
116 122
@@ -139,9 +145,11 @@ static int __init rtctimer_init(void)
139 timer->hw = rtc_hw; 145 timer->hw = rtc_hw;
140 timer->hw.resolution = NANO_SEC / rtctimer_freq; 146 timer->hw.resolution = NANO_SEC / rtctimer_freq;
141 147
148 tasklet_init(&rtc_tasklet, rtctimer_tasklet, (unsigned long)timer);
149
142 /* set up RTC callback */ 150 /* set up RTC callback */
143 rtc_task.func = rtctimer_interrupt; 151 rtc_task.func = rtctimer_interrupt;
144 rtc_task.private_data = timer; 152 rtc_task.private_data = &rtc_tasklet;
145 153
146 err = snd_timer_global_register(timer); 154 err = snd_timer_global_register(timer);
147 if (err < 0) { 155 if (err < 0) {
diff --git a/sound/core/sound.c b/sound/core/sound.c
index efa476c5210a..282742022de6 100644
--- a/sound/core/sound.c
+++ b/sound/core/sound.c
@@ -61,9 +61,6 @@ EXPORT_SYMBOL(snd_ecards_limit);
61static struct snd_minor *snd_minors[SNDRV_OS_MINORS]; 61static struct snd_minor *snd_minors[SNDRV_OS_MINORS];
62static DEFINE_MUTEX(sound_mutex); 62static DEFINE_MUTEX(sound_mutex);
63 63
64extern struct class *sound_class;
65
66
67#ifdef CONFIG_KMOD 64#ifdef CONFIG_KMOD
68 65
69/** 66/**
@@ -268,11 +265,10 @@ int snd_register_device(int type, struct snd_card *card, int dev,
268 snd_minors[minor] = preg; 265 snd_minors[minor] = preg;
269 if (card) 266 if (card)
270 device = card->dev; 267 device = card->dev;
271 preg->class_dev = class_device_create(sound_class, NULL, 268 preg->dev = device_create(sound_class, device, MKDEV(major, minor),
272 MKDEV(major, minor), 269 "%s", name);
273 device, "%s", name); 270 if (preg->dev)
274 if (preg->class_dev) 271 dev_set_drvdata(preg->dev, private_data);
275 class_set_devdata(preg->class_dev, private_data);
276 272
277 mutex_unlock(&sound_mutex); 273 mutex_unlock(&sound_mutex);
278 return 0; 274 return 0;
@@ -320,7 +316,7 @@ int snd_unregister_device(int type, struct snd_card *card, int dev)
320 return -EINVAL; 316 return -EINVAL;
321 } 317 }
322 318
323 class_device_destroy(sound_class, MKDEV(major, minor)); 319 device_destroy(sound_class, MKDEV(major, minor));
324 320
325 kfree(snd_minors[minor]); 321 kfree(snd_minors[minor]);
326 snd_minors[minor] = NULL; 322 snd_minors[minor] = NULL;
@@ -331,15 +327,15 @@ int snd_unregister_device(int type, struct snd_card *card, int dev)
331EXPORT_SYMBOL(snd_unregister_device); 327EXPORT_SYMBOL(snd_unregister_device);
332 328
333int snd_add_device_sysfs_file(int type, struct snd_card *card, int dev, 329int snd_add_device_sysfs_file(int type, struct snd_card *card, int dev,
334 const struct class_device_attribute *attr) 330 struct device_attribute *attr)
335{ 331{
336 int minor, ret = -EINVAL; 332 int minor, ret = -EINVAL;
337 struct class_device *cdev; 333 struct device *d;
338 334
339 mutex_lock(&sound_mutex); 335 mutex_lock(&sound_mutex);
340 minor = find_snd_minor(type, card, dev); 336 minor = find_snd_minor(type, card, dev);
341 if (minor >= 0 && (cdev = snd_minors[minor]->class_dev) != NULL) 337 if (minor >= 0 && (d = snd_minors[minor]->dev) != NULL)
342 ret = class_device_create_file(cdev, attr); 338 ret = device_create_file(d, attr);
343 mutex_unlock(&sound_mutex); 339 mutex_unlock(&sound_mutex);
344 return ret; 340 return ret;
345 341
diff --git a/sound/i2c/other/ak4114.c b/sound/i2c/other/ak4114.c
index 12ffffc9e814..d2f2c5078e65 100644
--- a/sound/i2c/other/ak4114.c
+++ b/sound/i2c/other/ak4114.c
@@ -35,7 +35,7 @@ MODULE_LICENSE("GPL");
35 35
36#define AK4114_ADDR 0x00 /* fixed address */ 36#define AK4114_ADDR 0x00 /* fixed address */
37 37
38static void ak4114_stats(void *); 38static void ak4114_stats(struct work_struct *work);
39 39
40static void reg_write(struct ak4114 *ak4114, unsigned char reg, unsigned char val) 40static void reg_write(struct ak4114 *ak4114, unsigned char reg, unsigned char val)
41{ 41{
@@ -158,7 +158,7 @@ void snd_ak4114_reinit(struct ak4114 *chip)
158 reg_write(chip, AK4114_REG_PWRDN, old | AK4114_RST | AK4114_PWN); 158 reg_write(chip, AK4114_REG_PWRDN, old | AK4114_RST | AK4114_PWN);
159 /* bring up statistics / event queing */ 159 /* bring up statistics / event queing */
160 chip->init = 0; 160 chip->init = 0;
161 INIT_WORK(&chip->work, ak4114_stats, chip); 161 INIT_DELAYED_WORK(&chip->work, ak4114_stats);
162 queue_delayed_work(chip->workqueue, &chip->work, HZ / 10); 162 queue_delayed_work(chip->workqueue, &chip->work, HZ / 10);
163} 163}
164 164
@@ -561,9 +561,9 @@ int snd_ak4114_check_rate_and_errors(struct ak4114 *ak4114, unsigned int flags)
561 return res; 561 return res;
562} 562}
563 563
564static void ak4114_stats(void *data) 564static void ak4114_stats(struct work_struct *work)
565{ 565{
566 struct ak4114 *chip = (struct ak4114 *)data; 566 struct ak4114 *chip = container_of(work, struct ak4114, work.work);
567 567
568 if (chip->init) 568 if (chip->init)
569 return; 569 return;
diff --git a/sound/oss/Kconfig b/sound/oss/Kconfig
index cc2b9ab7f4e5..a0588c21324a 100644
--- a/sound/oss/Kconfig
+++ b/sound/oss/Kconfig
@@ -5,20 +5,6 @@
5# 5#
6# Prompt user for primary drivers. 6# Prompt user for primary drivers.
7 7
8config OSS_OBSOLETE_DRIVER
9 bool "Obsolete OSS drivers"
10 depends on SOUND_PRIME
11 help
12 This option enables support for obsolete OSS drivers that
13 are scheduled for removal in the near future since there
14 are ALSA drivers for the same hardware.
15
16 Please contact Adrian Bunk <bunk@stusta.de> if you had to
17 say Y here because your soundcard is not properly supported
18 by ALSA.
19
20 If unsure, say N.
21
22config SOUND_BT878 8config SOUND_BT878
23 tristate "BT878 audio dma" 9 tristate "BT878 audio dma"
24 depends on SOUND_PRIME && PCI 10 depends on SOUND_PRIME && PCI
@@ -35,40 +21,6 @@ config SOUND_BT878
35 To compile this driver as a module, choose M here: the module will 21 To compile this driver as a module, choose M here: the module will
36 be called btaudio. 22 be called btaudio.
37 23
38config SOUND_EMU10K1
39 tristate "Creative SBLive! (EMU10K1)"
40 depends on SOUND_PRIME && PCI && OSS_OBSOLETE_DRIVER
41 ---help---
42 Say Y or M if you have a PCI sound card using the EMU10K1 chipset,
43 such as the Creative SBLive!, SB PCI512 or Emu-APS.
44
45 For more information on this driver and the degree of support for
46 the different card models please check:
47
48 <http://sourceforge.net/projects/emu10k1/>
49
50 It is now possible to load dsp microcode patches into the EMU10K1
51 chip. These patches are used to implement real time sound
52 processing effects which include for example: signal routing,
53 bass/treble control, AC3 passthrough, ...
54 Userspace tools to create new patches and load/unload them can be
55 found in the emu-tools package at the above URL.
56
57config MIDI_EMU10K1
58 bool "Creative SBLive! MIDI (EXPERIMENTAL)"
59 depends on SOUND_EMU10K1 && EXPERIMENTAL && ISA_DMA_API
60 help
61 Say Y if you want to be able to use the OSS /dev/sequencer
62 interface. This code is still experimental.
63
64config SOUND_FUSION
65 tristate "Crystal SoundFusion (CS4280/461x)"
66 depends on SOUND_PRIME && PCI && OSS_OBSOLETE_DRIVER
67 help
68 This module drives the Crystal SoundFusion devices (CS4280/46xx
69 series) when wired as native sound drivers with AC97 codecs. If
70 this driver does not work try the CS4232 driver.
71
72config SOUND_BCM_CS4297A 24config SOUND_BCM_CS4297A
73 tristate "Crystal Sound CS4297a (for Swarm)" 25 tristate "Crystal Sound CS4297a (for Swarm)"
74 depends on SOUND_PRIME && SIBYTE_SWARM 26 depends on SOUND_PRIME && SIBYTE_SWARM
@@ -448,47 +400,6 @@ config SOUND_DMAP
448 400
449 Say Y unless you have 16MB or more RAM or a PCI sound card. 401 Say Y unless you have 16MB or more RAM or a PCI sound card.
450 402
451config SOUND_AD1816
452 tristate "AD1816(A) based cards (EXPERIMENTAL)"
453 depends on EXPERIMENTAL && SOUND_OSS && OSS_OBSOLETE_DRIVER
454 help
455 Say M here if you have a sound card based on the Analog Devices
456 AD1816(A) chip.
457
458 If you compile the driver into the kernel, you have to add
459 "ad1816=<io>,<irq>,<dma>,<dma2>" to the kernel command line.
460
461config SOUND_AD1889
462 tristate "AD1889 based cards (AD1819 codec) (EXPERIMENTAL)"
463 depends on EXPERIMENTAL && SOUND_OSS && PCI && OSS_OBSOLETE_DRIVER
464 help
465 Say M here if you have a sound card based on the Analog Devices
466 AD1889 chip.
467
468config SOUND_ADLIB
469 tristate "Adlib Cards"
470 depends on SOUND_OSS && OSS_OBSOLETE_DRIVER
471 help
472 Includes ASB 64 4D. Information on programming AdLib cards is
473 available at <http://www.itsnet.com/home/ldragon/Specs/adlib.html>.
474
475config SOUND_ACI_MIXER
476 tristate "ACI mixer (miroSOUND PCM1-pro/PCM12/PCM20)"
477 depends on SOUND_OSS && OSS_OBSOLETE_DRIVER
478 ---help---
479 ACI (Audio Command Interface) is a protocol used to communicate with
480 the microcontroller on some sound cards produced by miro and
481 Cardinal Technologies. The main function of the ACI is to control
482 the mixer and to get a product identification.
483
484 This VoxWare ACI driver currently supports the ACI functions on the
485 miroSOUND PCM1-pro, PCM12 and PCM20 radio. On the PCM20 radio, ACI
486 also controls the radio tuner. This is supported in the video4linux
487 miropcm20 driver (say M or Y here and go back to "Multimedia
488 devices" -> "Radio Adapters").
489
490 This driver is also available as a module and will be called aci.
491
492config SOUND_CS4232 403config SOUND_CS4232
493 tristate "Crystal CS4232 based (PnP) cards" 404 tristate "Crystal CS4232 based (PnP) cards"
494 depends on SOUND_OSS 405 depends on SOUND_OSS
@@ -594,18 +505,6 @@ config SOUND_MPU401
594 If you compile the driver into the kernel, you have to add 505 If you compile the driver into the kernel, you have to add
595 "mpu401=<io>,<irq>" to the kernel command line. 506 "mpu401=<io>,<irq>" to the kernel command line.
596 507
597config SOUND_NM256
598 tristate "NM256AV/NM256ZX audio support"
599 depends on SOUND_OSS && OSS_OBSOLETE_DRIVER
600 help
601 Say M here to include audio support for the NeoMagic 256AV/256ZX
602 chipsets. These are the audio chipsets found in the Sony
603 Z505S/SX/DX, some Sony F-series, and the Dell Latitude CPi and CPt
604 laptops. It includes support for an AC97-compatible mixer and an
605 apparently proprietary sound engine.
606
607 See <file:Documentation/sound/oss/NM256> for further information.
608
609config SOUND_PAS 508config SOUND_PAS
610 tristate "ProAudioSpectrum 16 support" 509 tristate "ProAudioSpectrum 16 support"
611 depends on SOUND_OSS 510 depends on SOUND_OSS
@@ -714,20 +613,6 @@ config SOUND_YM3812
714 613
715 If unsure, say Y. 614 If unsure, say Y.
716 615
717config SOUND_OPL3SA2
718 tristate "Yamaha OPL3-SA2 and SA3 based PnP cards"
719 depends on SOUND_OSS && OSS_OBSOLETE_DRIVER
720 help
721 Say Y or M if you have a card based on one of these Yamaha sound
722 chipsets or the "SAx", which is actually a SA3. Read
723 <file:Documentation/sound/oss/OPL3-SA2> for more information on
724 configuring these cards.
725
726 If you compile the driver into the kernel and do not also
727 configure in the optional ISA PnP support, you will have to add
728 "opl3sa2=<io>,<irq>,<dma>,<dma2>,<mssio>,<mpuio>" to the kernel
729 command line.
730
731config SOUND_UART6850 616config SOUND_UART6850
732 tristate "6850 UART support" 617 tristate "6850 UART support"
733 depends on SOUND_OSS 618 depends on SOUND_OSS
diff --git a/sound/oss/btaudio.c b/sound/oss/btaudio.c
index 6ad384114239..ad7210a00dc0 100644
--- a/sound/oss/btaudio.c
+++ b/sound/oss/btaudio.c
@@ -1020,6 +1020,7 @@ static int __devinit btaudio_probe(struct pci_dev *pci_dev,
1020 fail2: 1020 fail2:
1021 free_irq(bta->irq,bta); 1021 free_irq(bta->irq,bta);
1022 fail1: 1022 fail1:
1023 iounmap(bta->mmio);
1023 kfree(bta); 1024 kfree(bta);
1024 fail0: 1025 fail0:
1025 release_mem_region(pci_resource_start(pci_dev,0), 1026 release_mem_region(pci_resource_start(pci_dev,0),
@@ -1051,6 +1052,7 @@ static void __devexit btaudio_remove(struct pci_dev *pci_dev)
1051 free_irq(bta->irq,bta); 1052 free_irq(bta->irq,bta);
1052 release_mem_region(pci_resource_start(pci_dev,0), 1053 release_mem_region(pci_resource_start(pci_dev,0),
1053 pci_resource_len(pci_dev,0)); 1054 pci_resource_len(pci_dev,0));
1055 iounmap(bta->mmio);
1054 1056
1055 /* remove from linked list */ 1057 /* remove from linked list */
1056 if (bta == btaudios) { 1058 if (bta == btaudios) {
diff --git a/sound/oss/cs46xx.c b/sound/oss/cs46xx.c
index 6e3c41f530e6..147c8a951137 100644
--- a/sound/oss/cs46xx.c
+++ b/sound/oss/cs46xx.c
@@ -91,6 +91,7 @@
91#include <linux/poll.h> 91#include <linux/poll.h>
92#include <linux/ac97_codec.h> 92#include <linux/ac97_codec.h>
93#include <linux/mutex.h> 93#include <linux/mutex.h>
94#include <linux/mm.h>
94 95
95#include <asm/io.h> 96#include <asm/io.h>
96#include <asm/dma.h> 97#include <asm/dma.h>
@@ -779,7 +780,7 @@ static unsigned int cs_set_adc_rate(struct cs_state *state, unsigned int rate)
779 rate = 48000 / 9; 780 rate = 48000 / 9;
780 781
781 /* 782 /*
782 * We can not capture at at rate greater than the Input Rate (48000). 783 * We cannot capture at at rate greater than the Input Rate (48000).
783 * Return an error if an attempt is made to stray outside that limit. 784 * Return an error if an attempt is made to stray outside that limit.
784 */ 785 */
785 if (rate > 48000) 786 if (rate > 48000)
@@ -4754,8 +4755,8 @@ static int cs_hardware_init(struct cs_card *card)
4754 mdelay(5 * cs_laptop_wait); /* Shouldnt be needed ?? */ 4755 mdelay(5 * cs_laptop_wait); /* Shouldnt be needed ?? */
4755 4756
4756/* 4757/*
4757* If we are resuming under 2.2.x then we can not schedule a timeout. 4758* If we are resuming under 2.2.x then we cannot schedule a timeout,
4758* so, just spin the CPU. 4759* so just spin the CPU.
4759*/ 4760*/
4760 if (card->pm.flags & CS46XX_PM_IDLE) { 4761 if (card->pm.flags & CS46XX_PM_IDLE) {
4761 /* 4762 /*
diff --git a/sound/oss/dmabuf.c b/sound/oss/dmabuf.c
index b256c0401161..eaf69971bf92 100644
--- a/sound/oss/dmabuf.c
+++ b/sound/oss/dmabuf.c
@@ -25,6 +25,7 @@
25#define BE_CONSERVATIVE 25#define BE_CONSERVATIVE
26#define SAMPLE_ROUNDUP 0 26#define SAMPLE_ROUNDUP 0
27 27
28#include <linux/mm.h>
28#include "sound_config.h" 29#include "sound_config.h"
29 30
30#define DMAP_FREE_ON_CLOSE 0 31#define DMAP_FREE_ON_CLOSE 0
diff --git a/sound/oss/emu10k1/audio.c b/sound/oss/emu10k1/audio.c
index cde4d59d5430..49f902f35c28 100644
--- a/sound/oss/emu10k1/audio.c
+++ b/sound/oss/emu10k1/audio.c
@@ -36,6 +36,7 @@
36#include <linux/bitops.h> 36#include <linux/bitops.h>
37#include <asm/io.h> 37#include <asm/io.h>
38#include <linux/sched.h> 38#include <linux/sched.h>
39#include <linux/mm.h>
39#include <linux/smp_lock.h> 40#include <linux/smp_lock.h>
40 41
41#include "hwaccess.h" 42#include "hwaccess.h"
@@ -110,9 +111,15 @@ static ssize_t emu10k1_audio_read(struct file *file, char __user *buffer, size_t
110 111
111 if ((bytestocopy >= wiinst->buffer.fragment_size) 112 if ((bytestocopy >= wiinst->buffer.fragment_size)
112 || (bytestocopy >= count)) { 113 || (bytestocopy >= count)) {
114 int rc;
115
113 bytestocopy = min_t(u32, bytestocopy, count); 116 bytestocopy = min_t(u32, bytestocopy, count);
114 117
115 emu10k1_wavein_xferdata(wiinst, (u8 __user *)buffer, &bytestocopy); 118 rc = emu10k1_wavein_xferdata(wiinst,
119 (u8 __user *)buffer,
120 &bytestocopy);
121 if (rc)
122 return rc;
116 123
117 count -= bytestocopy; 124 count -= bytestocopy;
118 buffer += bytestocopy; 125 buffer += bytestocopy;
diff --git a/sound/oss/emu10k1/cardwi.c b/sound/oss/emu10k1/cardwi.c
index 8bbf44b881b4..060d1be94d33 100644
--- a/sound/oss/emu10k1/cardwi.c
+++ b/sound/oss/emu10k1/cardwi.c
@@ -304,11 +304,12 @@ void emu10k1_wavein_getxfersize(struct wiinst *wiinst, u32 * size)
304 } 304 }
305} 305}
306 306
307static void copy_block(u8 __user *dst, u8 * src, u32 str, u32 len, u8 cov) 307static int copy_block(u8 __user *dst, u8 * src, u32 str, u32 len, u8 cov)
308{ 308{
309 if (cov == 1) 309 if (cov == 1) {
310 __copy_to_user(dst, src + str, len); 310 if (__copy_to_user(dst, src + str, len))
311 else { 311 return -EFAULT;
312 } else {
312 u8 byte; 313 u8 byte;
313 u32 i; 314 u32 i;
314 315
@@ -316,22 +317,26 @@ static void copy_block(u8 __user *dst, u8 * src, u32 str, u32 len, u8 cov)
316 317
317 for (i = 0; i < len; i++) { 318 for (i = 0; i < len; i++) {
318 byte = src[2 * i] ^ 0x80; 319 byte = src[2 * i] ^ 0x80;
319 __copy_to_user(dst + i, &byte, 1); 320 if (__copy_to_user(dst + i, &byte, 1))
321 return -EFAULT;
320 } 322 }
321 } 323 }
324
325 return 0;
322} 326}
323 327
324void emu10k1_wavein_xferdata(struct wiinst *wiinst, u8 __user *data, u32 * size) 328int emu10k1_wavein_xferdata(struct wiinst *wiinst, u8 __user *data, u32 * size)
325{ 329{
326 struct wavein_buffer *buffer = &wiinst->buffer; 330 struct wavein_buffer *buffer = &wiinst->buffer;
327 u32 sizetocopy, sizetocopy_now, start; 331 u32 sizetocopy, sizetocopy_now, start;
328 unsigned long flags; 332 unsigned long flags;
333 int ret;
329 334
330 sizetocopy = min_t(u32, buffer->size, *size); 335 sizetocopy = min_t(u32, buffer->size, *size);
331 *size = sizetocopy; 336 *size = sizetocopy;
332 337
333 if (!sizetocopy) 338 if (!sizetocopy)
334 return; 339 return 0;
335 340
336 spin_lock_irqsave(&wiinst->lock, flags); 341 spin_lock_irqsave(&wiinst->lock, flags);
337 start = buffer->pos; 342 start = buffer->pos;
@@ -345,11 +350,17 @@ void emu10k1_wavein_xferdata(struct wiinst *wiinst, u8 __user *data, u32 * size)
345 if (sizetocopy > sizetocopy_now) { 350 if (sizetocopy > sizetocopy_now) {
346 sizetocopy -= sizetocopy_now; 351 sizetocopy -= sizetocopy_now;
347 352
348 copy_block(data, buffer->addr, start, sizetocopy_now, buffer->cov); 353 ret = copy_block(data, buffer->addr, start, sizetocopy_now,
349 copy_block(data + sizetocopy_now, buffer->addr, 0, sizetocopy, buffer->cov); 354 buffer->cov);
355 if (ret == 0)
356 ret = copy_block(data + sizetocopy_now, buffer->addr, 0,
357 sizetocopy, buffer->cov);
350 } else { 358 } else {
351 copy_block(data, buffer->addr, start, sizetocopy, buffer->cov); 359 ret = copy_block(data, buffer->addr, start, sizetocopy,
360 buffer->cov);
352 } 361 }
362
363 return ret;
353} 364}
354 365
355void emu10k1_wavein_update(struct emu10k1_card *card, struct wiinst *wiinst) 366void emu10k1_wavein_update(struct emu10k1_card *card, struct wiinst *wiinst)
diff --git a/sound/oss/emu10k1/cardwi.h b/sound/oss/emu10k1/cardwi.h
index 15cfb9b35596..e82029b46ad1 100644
--- a/sound/oss/emu10k1/cardwi.h
+++ b/sound/oss/emu10k1/cardwi.h
@@ -83,7 +83,7 @@ void emu10k1_wavein_close(struct emu10k1_wavedevice *);
83void emu10k1_wavein_start(struct emu10k1_wavedevice *); 83void emu10k1_wavein_start(struct emu10k1_wavedevice *);
84void emu10k1_wavein_stop(struct emu10k1_wavedevice *); 84void emu10k1_wavein_stop(struct emu10k1_wavedevice *);
85void emu10k1_wavein_getxfersize(struct wiinst *, u32 *); 85void emu10k1_wavein_getxfersize(struct wiinst *, u32 *);
86void emu10k1_wavein_xferdata(struct wiinst *, u8 __user *, u32 *); 86int emu10k1_wavein_xferdata(struct wiinst *, u8 __user *, u32 *);
87int emu10k1_wavein_setformat(struct emu10k1_wavedevice *, struct wave_format *); 87int emu10k1_wavein_setformat(struct emu10k1_wavedevice *, struct wave_format *);
88void emu10k1_wavein_update(struct emu10k1_card *, struct wiinst *); 88void emu10k1_wavein_update(struct emu10k1_card *, struct wiinst *);
89 89
diff --git a/sound/oss/emu10k1/passthrough.c b/sound/oss/emu10k1/passthrough.c
index 4e3baca7d41f..6d21d4368dec 100644
--- a/sound/oss/emu10k1/passthrough.c
+++ b/sound/oss/emu10k1/passthrough.c
@@ -162,12 +162,15 @@ ssize_t emu10k1_pt_write(struct file *file, const char __user *buffer, size_t co
162 162
163 DPD(3, "prepend size %d, prepending %d bytes\n", pt->prepend_size, needed); 163 DPD(3, "prepend size %d, prepending %d bytes\n", pt->prepend_size, needed);
164 if (count < needed) { 164 if (count < needed) {
165 copy_from_user(pt->buf + pt->prepend_size, buffer, count); 165 if (copy_from_user(pt->buf + pt->prepend_size,
166 buffer, count))
167 return -EFAULT;
166 pt->prepend_size += count; 168 pt->prepend_size += count;
167 DPD(3, "prepend size now %d\n", pt->prepend_size); 169 DPD(3, "prepend size now %d\n", pt->prepend_size);
168 return count; 170 return count;
169 } 171 }
170 copy_from_user(pt->buf + pt->prepend_size, buffer, needed); 172 if (copy_from_user(pt->buf + pt->prepend_size, buffer, needed))
173 return -EFAULT;
171 r = pt_putblock(wave_dev, (u16 *) pt->buf, nonblock); 174 r = pt_putblock(wave_dev, (u16 *) pt->buf, nonblock);
172 if (r) 175 if (r)
173 return r; 176 return r;
@@ -178,7 +181,8 @@ ssize_t emu10k1_pt_write(struct file *file, const char __user *buffer, size_t co
178 blocks_copied = 0; 181 blocks_copied = 0;
179 while (blocks > 0) { 182 while (blocks > 0) {
180 u16 __user *bufptr = (u16 __user *) buffer + (bytes_copied/2); 183 u16 __user *bufptr = (u16 __user *) buffer + (bytes_copied/2);
181 copy_from_user(pt->buf, bufptr, PT_BLOCKSIZE); 184 if (copy_from_user(pt->buf, bufptr, PT_BLOCKSIZE))
185 return -EFAULT;
182 r = pt_putblock(wave_dev, (u16 *)pt->buf, nonblock); 186 r = pt_putblock(wave_dev, (u16 *)pt->buf, nonblock);
183 if (r) { 187 if (r) {
184 if (bytes_copied) 188 if (bytes_copied)
@@ -193,7 +197,8 @@ ssize_t emu10k1_pt_write(struct file *file, const char __user *buffer, size_t co
193 i = count - bytes_copied; 197 i = count - bytes_copied;
194 if (i) { 198 if (i) {
195 pt->prepend_size = i; 199 pt->prepend_size = i;
196 copy_from_user(pt->buf, buffer + bytes_copied, i); 200 if (copy_from_user(pt->buf, buffer + bytes_copied, i))
201 return -EFAULT;
197 bytes_copied += i; 202 bytes_copied += i;
198 DPD(3, "filling prepend buffer with %d bytes", i); 203 DPD(3, "filling prepend buffer with %d bytes", i);
199 } 204 }
diff --git a/sound/oss/es1371.c b/sound/oss/es1371.c
index ddf6b0a0bca5..cc282a0cd539 100644
--- a/sound/oss/es1371.c
+++ b/sound/oss/es1371.c
@@ -130,6 +130,7 @@
130#include <linux/wait.h> 130#include <linux/wait.h>
131#include <linux/dma-mapping.h> 131#include <linux/dma-mapping.h>
132#include <linux/mutex.h> 132#include <linux/mutex.h>
133#include <linux/mm.h>
133 134
134#include <asm/io.h> 135#include <asm/io.h>
135#include <asm/page.h> 136#include <asm/page.h>
diff --git a/sound/oss/i810_audio.c b/sound/oss/i810_audio.c
index 240cc7939b69..c3c8a720d555 100644
--- a/sound/oss/i810_audio.c
+++ b/sound/oss/i810_audio.c
@@ -101,6 +101,7 @@
101#include <linux/ac97_codec.h> 101#include <linux/ac97_codec.h>
102#include <linux/bitops.h> 102#include <linux/bitops.h>
103#include <linux/mutex.h> 103#include <linux/mutex.h>
104#include <linux/mm.h>
104 105
105#include <asm/uaccess.h> 106#include <asm/uaccess.h>
106 107
diff --git a/sound/oss/soundcard.c b/sound/oss/soundcard.c
index 2344d09c7114..8fb8e7f99556 100644
--- a/sound/oss/soundcard.c
+++ b/sound/oss/soundcard.c
@@ -42,6 +42,7 @@
42#include <linux/proc_fs.h> 42#include <linux/proc_fs.h>
43#include <linux/smp_lock.h> 43#include <linux/smp_lock.h>
44#include <linux/module.h> 44#include <linux/module.h>
45#include <linux/mm.h>
45 46
46/* 47/*
47 * This ought to be moved into include/asm/dma.h 48 * This ought to be moved into include/asm/dma.h
@@ -557,17 +558,17 @@ static int __init oss_init(void)
557 sound_dmap_flag = (dmabuf > 0 ? 1 : 0); 558 sound_dmap_flag = (dmabuf > 0 ? 1 : 0);
558 559
559 for (i = 0; i < sizeof (dev_list) / sizeof *dev_list; i++) { 560 for (i = 0; i < sizeof (dev_list) / sizeof *dev_list; i++) {
560 class_device_create(sound_class, NULL, 561 device_create(sound_class, NULL,
561 MKDEV(SOUND_MAJOR, dev_list[i].minor), 562 MKDEV(SOUND_MAJOR, dev_list[i].minor),
562 NULL, "%s", dev_list[i].name); 563 "%s", dev_list[i].name);
563 564
564 if (!dev_list[i].num) 565 if (!dev_list[i].num)
565 continue; 566 continue;
566 567
567 for (j = 1; j < *dev_list[i].num; j++) 568 for (j = 1; j < *dev_list[i].num; j++)
568 class_device_create(sound_class, NULL, 569 device_create(sound_class, NULL,
569 MKDEV(SOUND_MAJOR, dev_list[i].minor + (j*0x10)), 570 MKDEV(SOUND_MAJOR, dev_list[i].minor + (j*0x10)),
570 NULL, "%s%d", dev_list[i].name, j); 571 "%s%d", dev_list[i].name, j);
571 } 572 }
572 573
573 if (sound_nblocks >= 1024) 574 if (sound_nblocks >= 1024)
@@ -581,11 +582,11 @@ static void __exit oss_cleanup(void)
581 int i, j; 582 int i, j;
582 583
583 for (i = 0; i < sizeof (dev_list) / sizeof *dev_list; i++) { 584 for (i = 0; i < sizeof (dev_list) / sizeof *dev_list; i++) {
584 class_device_destroy(sound_class, MKDEV(SOUND_MAJOR, dev_list[i].minor)); 585 device_destroy(sound_class, MKDEV(SOUND_MAJOR, dev_list[i].minor));
585 if (!dev_list[i].num) 586 if (!dev_list[i].num)
586 continue; 587 continue;
587 for (j = 1; j < *dev_list[i].num; j++) 588 for (j = 1; j < *dev_list[i].num; j++)
588 class_device_destroy(sound_class, MKDEV(SOUND_MAJOR, dev_list[i].minor + (j*0x10))); 589 device_destroy(sound_class, MKDEV(SOUND_MAJOR, dev_list[i].minor + (j*0x10)));
589 } 590 }
590 591
591 unregister_sound_special(1); 592 unregister_sound_special(1);
diff --git a/sound/oss/sscape.c b/sound/oss/sscape.c
index 51f2fa615413..30c36d1f35d7 100644
--- a/sound/oss/sscape.c
+++ b/sound/oss/sscape.c
@@ -39,6 +39,7 @@
39#include <linux/ioport.h> 39#include <linux/ioport.h>
40#include <linux/delay.h> 40#include <linux/delay.h>
41#include <linux/proc_fs.h> 41#include <linux/proc_fs.h>
42#include <linux/mm.h>
42#include <linux/spinlock.h> 43#include <linux/spinlock.h>
43 44
44#include "coproc.h" 45#include "coproc.h"
diff --git a/sound/oss/trident.c b/sound/oss/trident.c
index 7a363a178afd..6b1f8c9cdcf8 100644
--- a/sound/oss/trident.c
+++ b/sound/oss/trident.c
@@ -216,6 +216,7 @@
216#include <linux/gameport.h> 216#include <linux/gameport.h>
217#include <linux/kernel.h> 217#include <linux/kernel.h>
218#include <linux/mutex.h> 218#include <linux/mutex.h>
219#include <linux/mm.h>
219 220
220#include <asm/uaccess.h> 221#include <asm/uaccess.h>
221#include <asm/io.h> 222#include <asm/io.h>
diff --git a/sound/oss/via82cxxx_audio.c b/sound/oss/via82cxxx_audio.c
index 17837d4b5ed3..c96cc8c68b3b 100644
--- a/sound/oss/via82cxxx_audio.c
+++ b/sound/oss/via82cxxx_audio.c
@@ -2120,8 +2120,8 @@ static struct page * via_mm_nopage (struct vm_area_struct * vma,
2120 return NOPAGE_SIGBUS; /* Disallow mremap */ 2120 return NOPAGE_SIGBUS; /* Disallow mremap */
2121 } 2121 }
2122 if (!card) { 2122 if (!card) {
2123 DPRINTK ("EXIT, returning NOPAGE_OOM\n"); 2123 DPRINTK ("EXIT, returning NOPAGE_SIGBUS\n");
2124 return NOPAGE_OOM; /* Nothing allocated */ 2124 return NOPAGE_SIGBUS; /* Nothing allocated */
2125 } 2125 }
2126 2126
2127 pgoff = vma->vm_pgoff + ((address - vma->vm_start) >> PAGE_SHIFT); 2127 pgoff = vma->vm_pgoff + ((address - vma->vm_start) >> PAGE_SHIFT);
diff --git a/sound/pci/ac97/ac97_codec.c b/sound/pci/ac97/ac97_codec.c
index 6577b2325357..7abcb10b2754 100644
--- a/sound/pci/ac97/ac97_codec.c
+++ b/sound/pci/ac97/ac97_codec.c
@@ -1927,9 +1927,10 @@ static int snd_ac97_dev_disconnect(struct snd_device *device)
1927static struct snd_ac97_build_ops null_build_ops; 1927static struct snd_ac97_build_ops null_build_ops;
1928 1928
1929#ifdef CONFIG_SND_AC97_POWER_SAVE 1929#ifdef CONFIG_SND_AC97_POWER_SAVE
1930static void do_update_power(void *data) 1930static void do_update_power(struct work_struct *work)
1931{ 1931{
1932 update_power_regs(data); 1932 update_power_regs(
1933 container_of(work, struct snd_ac97, power_work.work));
1933} 1934}
1934#endif 1935#endif
1935 1936
@@ -1989,7 +1990,7 @@ int snd_ac97_mixer(struct snd_ac97_bus *bus, struct snd_ac97_template *template,
1989 mutex_init(&ac97->page_mutex); 1990 mutex_init(&ac97->page_mutex);
1990#ifdef CONFIG_SND_AC97_POWER_SAVE 1991#ifdef CONFIG_SND_AC97_POWER_SAVE
1991 ac97->power_workq = create_workqueue("ac97"); 1992 ac97->power_workq = create_workqueue("ac97");
1992 INIT_WORK(&ac97->power_work, do_update_power, ac97); 1993 INIT_DELAYED_WORK(&ac97->power_work, do_update_power);
1993#endif 1994#endif
1994 1995
1995#ifdef CONFIG_PCI 1996#ifdef CONFIG_PCI
diff --git a/sound/pci/emu10k1/emu10k1_main.c b/sound/pci/emu10k1/emu10k1_main.c
index 8058059c56e9..8bc4ffa6220d 100644
--- a/sound/pci/emu10k1/emu10k1_main.c
+++ b/sound/pci/emu10k1/emu10k1_main.c
@@ -956,6 +956,7 @@ static struct snd_emu_chip_details emu_chip_details[] = {
956 .ca0151_chip = 1, 956 .ca0151_chip = 1,
957 .spk71 = 1, 957 .spk71 = 1,
958 .spdif_bug = 1, 958 .spdif_bug = 1,
959 .adc_1361t = 1, /* 24 bit capture instead of 16bit. Fixes ALSA bug#324 */
959 .ac97_chip = 1} , 960 .ac97_chip = 1} ,
960 {.vendor = 0x1102, .device = 0x0004, .revision = 0x04, 961 {.vendor = 0x1102, .device = 0x0004, .revision = 0x04,
961 .driver = "Audigy2", .name = "Audigy 2 [Unknown]", 962 .driver = "Audigy2", .name = "Audigy 2 [Unknown]",
diff --git a/sound/pci/hda/hda_codec.c b/sound/pci/hda/hda_codec.c
index 9c3d7ac08068..71482c15a852 100644
--- a/sound/pci/hda/hda_codec.c
+++ b/sound/pci/hda/hda_codec.c
@@ -272,10 +272,11 @@ EXPORT_SYMBOL(snd_hda_queue_unsol_event);
272/* 272/*
273 * process queueud unsolicited events 273 * process queueud unsolicited events
274 */ 274 */
275static void process_unsol_events(void *data) 275static void process_unsol_events(struct work_struct *work)
276{ 276{
277 struct hda_bus *bus = data; 277 struct hda_bus_unsolicited *unsol =
278 struct hda_bus_unsolicited *unsol = bus->unsol; 278 container_of(work, struct hda_bus_unsolicited, work);
279 struct hda_bus *bus = unsol->bus;
279 struct hda_codec *codec; 280 struct hda_codec *codec;
280 unsigned int rp, caddr, res; 281 unsigned int rp, caddr, res;
281 282
@@ -314,7 +315,8 @@ static int init_unsol_queue(struct hda_bus *bus)
314 kfree(unsol); 315 kfree(unsol);
315 return -ENOMEM; 316 return -ENOMEM;
316 } 317 }
317 INIT_WORK(&unsol->work, process_unsol_events, bus); 318 INIT_WORK(&unsol->work, process_unsol_events);
319 unsol->bus = bus;
318 bus->unsol = unsol; 320 bus->unsol = unsol;
319 return 0; 321 return 0;
320} 322}
diff --git a/sound/pci/hda/hda_intel.c b/sound/pci/hda/hda_intel.c
index 0e292dc4fd87..e35cfd326df2 100644
--- a/sound/pci/hda/hda_intel.c
+++ b/sound/pci/hda/hda_intel.c
@@ -55,7 +55,7 @@ static char *model;
55static int position_fix; 55static int position_fix;
56static int probe_mask = -1; 56static int probe_mask = -1;
57static int single_cmd; 57static int single_cmd;
58static int disable_msi; 58static int enable_msi;
59 59
60module_param(index, int, 0444); 60module_param(index, int, 0444);
61MODULE_PARM_DESC(index, "Index value for Intel HD audio interface."); 61MODULE_PARM_DESC(index, "Index value for Intel HD audio interface.");
@@ -69,8 +69,8 @@ module_param(probe_mask, int, 0444);
69MODULE_PARM_DESC(probe_mask, "Bitmask to probe codecs (default = -1)."); 69MODULE_PARM_DESC(probe_mask, "Bitmask to probe codecs (default = -1).");
70module_param(single_cmd, bool, 0444); 70module_param(single_cmd, bool, 0444);
71MODULE_PARM_DESC(single_cmd, "Use single command to communicate with codecs (for debugging only)."); 71MODULE_PARM_DESC(single_cmd, "Use single command to communicate with codecs (for debugging only).");
72module_param(disable_msi, int, 0); 72module_param(enable_msi, int, 0);
73MODULE_PARM_DESC(disable_msi, "Disable Message Signaled Interrupt (MSI)"); 73MODULE_PARM_DESC(enable_msi, "Enable Message Signaled Interrupt (MSI)");
74 74
75 75
76/* just for backward compatibility */ 76/* just for backward compatibility */
@@ -1531,7 +1531,7 @@ static int __devinit azx_create(struct snd_card *card, struct pci_dev *pci,
1531 chip->pci = pci; 1531 chip->pci = pci;
1532 chip->irq = -1; 1532 chip->irq = -1;
1533 chip->driver_type = driver_type; 1533 chip->driver_type = driver_type;
1534 chip->msi = !disable_msi; 1534 chip->msi = enable_msi;
1535 1535
1536 chip->position_fix = position_fix; 1536 chip->position_fix = position_fix;
1537 chip->single_cmd = single_cmd; 1537 chip->single_cmd = single_cmd;
diff --git a/sound/pci/hda/hda_local.h b/sound/pci/hda/hda_local.h
index f9416c36396e..9ca1baf860bd 100644
--- a/sound/pci/hda/hda_local.h
+++ b/sound/pci/hda/hda_local.h
@@ -206,6 +206,7 @@ struct hda_bus_unsolicited {
206 /* workqueue */ 206 /* workqueue */
207 struct workqueue_struct *workq; 207 struct workqueue_struct *workq;
208 struct work_struct work; 208 struct work_struct work;
209 struct hda_bus *bus;
209}; 210};
210 211
211/* 212/*
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
index 0d728c6f697c..fb961448db19 100644
--- a/sound/pci/hda/patch_realtek.c
+++ b/sound/pci/hda/patch_realtek.c
@@ -5870,7 +5870,7 @@ static struct hda_board_config alc262_cfg_tbl[] = {
5870 { .pci_subvendor = 0x10cf, .pci_subdevice = 0x1397, 5870 { .pci_subvendor = 0x10cf, .pci_subdevice = 0x1397,
5871 .config = ALC262_FUJITSU }, 5871 .config = ALC262_FUJITSU },
5872 { .modelname = "hp-bpc", .config = ALC262_HP_BPC }, 5872 { .modelname = "hp-bpc", .config = ALC262_HP_BPC },
5873 { .pci_subvendor = 0x103c, .pci_subdevice = 0x208c, 5873 { .pci_subvendor = 0x103c, .pci_subdevice = 0x280c,
5874 .config = ALC262_HP_BPC }, /* xw4400 */ 5874 .config = ALC262_HP_BPC }, /* xw4400 */
5875 { .pci_subvendor = 0x103c, .pci_subdevice = 0x3014, 5875 { .pci_subvendor = 0x103c, .pci_subdevice = 0x3014,
5876 .config = ALC262_HP_BPC }, /* xw6400 */ 5876 .config = ALC262_HP_BPC }, /* xw6400 */
diff --git a/sound/pci/hda/patch_sigmatel.c b/sound/pci/hda/patch_sigmatel.c
index 731b7b97ee71..fe51ef3e49d2 100644
--- a/sound/pci/hda/patch_sigmatel.c
+++ b/sound/pci/hda/patch_sigmatel.c
@@ -336,6 +336,13 @@ static struct hda_board_config stac9200_cfg_tbl[] = {
336 .pci_subvendor = PCI_VENDOR_ID_INTEL, 336 .pci_subvendor = PCI_VENDOR_ID_INTEL,
337 .pci_subdevice = 0x2668, /* DFI LanParty */ 337 .pci_subdevice = 0x2668, /* DFI LanParty */
338 .config = STAC_REF }, 338 .config = STAC_REF },
339 /* Dell laptops have BIOS problem */
340 { .pci_subvendor = PCI_VENDOR_ID_DELL, .pci_subdevice = 0x01b5,
341 .config = STAC_REF }, /* Dell Inspiron 630m */
342 { .pci_subvendor = PCI_VENDOR_ID_DELL, .pci_subdevice = 0x01c2,
343 .config = STAC_REF }, /* Dell Latitude D620 */
344 { .pci_subvendor = PCI_VENDOR_ID_DELL, .pci_subdevice = 0x01cb,
345 .config = STAC_REF }, /* Dell Latitude 120L */
339 {} /* terminator */ 346 {} /* terminator */
340}; 347};
341 348
@@ -591,13 +598,6 @@ static struct hda_board_config stac9205_cfg_tbl[] = {
591 .pci_subvendor = PCI_VENDOR_ID_INTEL, 598 .pci_subvendor = PCI_VENDOR_ID_INTEL,
592 .pci_subdevice = 0x2668, /* DFI LanParty */ 599 .pci_subdevice = 0x2668, /* DFI LanParty */
593 .config = STAC_REF }, /* SigmaTel reference board */ 600 .config = STAC_REF }, /* SigmaTel reference board */
594 /* Dell laptops have BIOS problem */
595 { .pci_subvendor = PCI_VENDOR_ID_DELL, .pci_subdevice = 0x01b5,
596 .config = STAC_REF }, /* Dell Inspiron 630m */
597 { .pci_subvendor = PCI_VENDOR_ID_DELL, .pci_subdevice = 0x01c2,
598 .config = STAC_REF }, /* Dell Latitude D620 */
599 { .pci_subvendor = PCI_VENDOR_ID_DELL, .pci_subdevice = 0x01cb,
600 .config = STAC_REF }, /* Dell Latitude 120L */
601 {} /* terminator */ 601 {} /* terminator */
602}; 602};
603 603
diff --git a/sound/pcmcia/pdaudiocf/pdaudiocf.c b/sound/pcmcia/pdaudiocf/pdaudiocf.c
index fd3590fcaedb..2d40cc72f236 100644
--- a/sound/pcmcia/pdaudiocf/pdaudiocf.c
+++ b/sound/pcmcia/pdaudiocf/pdaudiocf.c
@@ -219,35 +219,15 @@ do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0)
219static int pdacf_config(struct pcmcia_device *link) 219static int pdacf_config(struct pcmcia_device *link)
220{ 220{
221 struct snd_pdacf *pdacf = link->priv; 221 struct snd_pdacf *pdacf = link->priv;
222 tuple_t tuple;
223 cisparse_t *parse = NULL;
224 u_short buf[32];
225 int last_fn, last_ret; 222 int last_fn, last_ret;
226 223
227 snd_printdd(KERN_DEBUG "pdacf_config called\n"); 224 snd_printdd(KERN_DEBUG "pdacf_config called\n");
228 parse = kmalloc(sizeof(*parse), GFP_KERNEL);
229 if (! parse) {
230 snd_printk(KERN_ERR "pdacf_config: cannot allocate\n");
231 return -ENOMEM;
232 }
233 tuple.DesiredTuple = CISTPL_CFTABLE_ENTRY;
234 tuple.Attributes = 0;
235 tuple.TupleData = (cisdata_t *)buf;
236 tuple.TupleDataMax = sizeof(buf);
237 tuple.TupleOffset = 0;
238 tuple.DesiredTuple = CISTPL_CONFIG;
239 CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(link, &tuple));
240 CS_CHECK(GetTupleData, pcmcia_get_tuple_data(link, &tuple));
241 CS_CHECK(ParseTuple, pcmcia_parse_tuple(link, &tuple, parse));
242 link->conf.ConfigBase = parse->config.base;
243 link->conf.ConfigIndex = 0x5; 225 link->conf.ConfigIndex = 0x5;
244 226
245 CS_CHECK(RequestIO, pcmcia_request_io(link, &link->io)); 227 CS_CHECK(RequestIO, pcmcia_request_io(link, &link->io));
246 CS_CHECK(RequestIRQ, pcmcia_request_irq(link, &link->irq)); 228 CS_CHECK(RequestIRQ, pcmcia_request_irq(link, &link->irq));
247 CS_CHECK(RequestConfiguration, pcmcia_request_configuration(link, &link->conf)); 229 CS_CHECK(RequestConfiguration, pcmcia_request_configuration(link, &link->conf));
248 230
249 kfree(parse);
250
251 if (snd_pdacf_assign_resources(pdacf, link->io.BasePort1, link->irq.AssignedIRQ) < 0) 231 if (snd_pdacf_assign_resources(pdacf, link->io.BasePort1, link->irq.AssignedIRQ) < 0)
252 goto failed; 232 goto failed;
253 233
@@ -255,7 +235,6 @@ static int pdacf_config(struct pcmcia_device *link)
255 return 0; 235 return 0;
256 236
257cs_failed: 237cs_failed:
258 kfree(parse);
259 cs_error(link, last_fn, last_ret); 238 cs_error(link, last_fn, last_ret);
260failed: 239failed:
261 pcmcia_disable_device(link); 240 pcmcia_disable_device(link);
@@ -299,7 +278,8 @@ static int pdacf_resume(struct pcmcia_device *link)
299 * Module entry points 278 * Module entry points
300 */ 279 */
301static struct pcmcia_device_id snd_pdacf_ids[] = { 280static struct pcmcia_device_id snd_pdacf_ids[] = {
302 PCMCIA_DEVICE_MANF_CARD(0x015d, 0x4c45), 281 /* this is too general PCMCIA_DEVICE_MANF_CARD(0x015d, 0x4c45), */
282 PCMCIA_DEVICE_PROD_ID12("Core Sound","PDAudio-CF",0x396d19d2,0x71717b49),
303 PCMCIA_DEVICE_NULL 283 PCMCIA_DEVICE_NULL
304}; 284};
305MODULE_DEVICE_TABLE(pcmcia, snd_pdacf_ids); 285MODULE_DEVICE_TABLE(pcmcia, snd_pdacf_ids);
diff --git a/sound/pcmcia/vx/vxpocket.c b/sound/pcmcia/vx/vxpocket.c
index 3089fcca800e..d7df59e9c647 100644
--- a/sound/pcmcia/vx/vxpocket.c
+++ b/sound/pcmcia/vx/vxpocket.c
@@ -217,34 +217,12 @@ static int vxpocket_config(struct pcmcia_device *link)
217{ 217{
218 struct vx_core *chip = link->priv; 218 struct vx_core *chip = link->priv;
219 struct snd_vxpocket *vxp = (struct snd_vxpocket *)chip; 219 struct snd_vxpocket *vxp = (struct snd_vxpocket *)chip;
220 tuple_t tuple;
221 cisparse_t *parse;
222 u_short buf[32];
223 int last_fn, last_ret; 220 int last_fn, last_ret;
224 221
225 snd_printdd(KERN_DEBUG "vxpocket_config called\n"); 222 snd_printdd(KERN_DEBUG "vxpocket_config called\n");
226 parse = kmalloc(sizeof(*parse), GFP_KERNEL);
227 if (! parse) {
228 snd_printk(KERN_ERR "vx: cannot allocate\n");
229 return -ENOMEM;
230 }
231 tuple.Attributes = 0;
232 tuple.TupleData = (cisdata_t *)buf;
233 tuple.TupleDataMax = sizeof(buf);
234 tuple.TupleOffset = 0;
235 tuple.DesiredTuple = CISTPL_CONFIG;
236 CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(link, &tuple));
237 CS_CHECK(GetTupleData, pcmcia_get_tuple_data(link, &tuple));
238 CS_CHECK(ParseTuple, pcmcia_parse_tuple(link, &tuple, parse));
239 link->conf.ConfigBase = parse->config.base;
240 link->conf.Present = parse->config.rmask[0];
241 223
242 /* redefine hardware record according to the VERSION1 string */ 224 /* redefine hardware record according to the VERSION1 string */
243 tuple.DesiredTuple = CISTPL_VERS_1; 225 if (!strcmp(link->prod_id[1], "VX-POCKET")) {
244 CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(link, &tuple));
245 CS_CHECK(GetTupleData, pcmcia_get_tuple_data(link, &tuple));
246 CS_CHECK(ParseTuple, pcmcia_parse_tuple(link, &tuple, parse));
247 if (! strcmp(parse->version_1.str + parse->version_1.ofs[1], "VX-POCKET")) {
248 snd_printdd("VX-pocket is detected\n"); 226 snd_printdd("VX-pocket is detected\n");
249 } else { 227 } else {
250 snd_printdd("VX-pocket 440 is detected\n"); 228 snd_printdd("VX-pocket 440 is detected\n");
@@ -265,14 +243,12 @@ static int vxpocket_config(struct pcmcia_device *link)
265 goto failed; 243 goto failed;
266 244
267 link->dev_node = &vxp->node; 245 link->dev_node = &vxp->node;
268 kfree(parse);
269 return 0; 246 return 0;
270 247
271cs_failed: 248cs_failed:
272 cs_error(link, last_fn, last_ret); 249 cs_error(link, last_fn, last_ret);
273failed: 250failed:
274 pcmcia_disable_device(link); 251 pcmcia_disable_device(link);
275 kfree(parse);
276 return -ENODEV; 252 return -ENODEV;
277} 253}
278 254
diff --git a/sound/ppc/tumbler.c b/sound/ppc/tumbler.c
index 2fbe1d183fce..8f074c7936e6 100644
--- a/sound/ppc/tumbler.c
+++ b/sound/ppc/tumbler.c
@@ -942,10 +942,11 @@ static void check_mute(struct snd_pmac *chip, struct pmac_gpio *gp, int val, int
942} 942}
943 943
944static struct work_struct device_change; 944static struct work_struct device_change;
945static struct snd_pmac *device_change_chip;
945 946
946static void device_change_handler(void *self) 947static void device_change_handler(struct work_struct *work)
947{ 948{
948 struct snd_pmac *chip = self; 949 struct snd_pmac *chip = device_change_chip;
949 struct pmac_tumbler *mix; 950 struct pmac_tumbler *mix;
950 int headphone, lineout; 951 int headphone, lineout;
951 952
@@ -1417,7 +1418,8 @@ int __init snd_pmac_tumbler_init(struct snd_pmac *chip)
1417 chip->resume = tumbler_resume; 1418 chip->resume = tumbler_resume;
1418#endif 1419#endif
1419 1420
1420 INIT_WORK(&device_change, device_change_handler, (void *)chip); 1421 INIT_WORK(&device_change, device_change_handler);
1422 device_change_chip = chip;
1421 1423
1422#ifdef PMAC_SUPPORT_AUTOMUTE 1424#ifdef PMAC_SUPPORT_AUTOMUTE
1423 if ((mix->headphone_irq >=0 || mix->lineout_irq >= 0) 1425 if ((mix->headphone_irq >=0 || mix->lineout_irq >= 0)
diff --git a/sound/sound_core.c b/sound/sound_core.c
index 5322c50c9617..8f1ced4ab34c 100644
--- a/sound/sound_core.c
+++ b/sound/sound_core.c
@@ -170,8 +170,8 @@ static int sound_insert_unit(struct sound_unit **list, const struct file_operati
170 else 170 else
171 sprintf(s->name, "sound/%s%d", name, r / SOUND_STEP); 171 sprintf(s->name, "sound/%s%d", name, r / SOUND_STEP);
172 172
173 class_device_create(sound_class, NULL, MKDEV(SOUND_MAJOR, s->unit_minor), 173 device_create(sound_class, dev, MKDEV(SOUND_MAJOR, s->unit_minor),
174 dev, s->name+6); 174 s->name+6);
175 return r; 175 return r;
176 176
177 fail: 177 fail:
@@ -193,7 +193,7 @@ static void sound_remove_unit(struct sound_unit **list, int unit)
193 p = __sound_remove_unit(list, unit); 193 p = __sound_remove_unit(list, unit);
194 spin_unlock(&sound_loader_lock); 194 spin_unlock(&sound_loader_lock);
195 if (p) { 195 if (p) {
196 class_device_destroy(sound_class, MKDEV(SOUND_MAJOR, p->unit_minor)); 196 device_destroy(sound_class, MKDEV(SOUND_MAJOR, p->unit_minor));
197 kfree(p); 197 kfree(p);
198 } 198 }
199} 199}
diff --git a/sound/usb/usbaudio.c b/sound/usb/usbaudio.c
index c82b01c7ad3a..67202b9eeb77 100644
--- a/sound/usb/usbaudio.c
+++ b/sound/usb/usbaudio.c
@@ -1469,7 +1469,8 @@ static int snd_usb_hw_free(struct snd_pcm_substream *substream)
1469 subs->cur_audiofmt = NULL; 1469 subs->cur_audiofmt = NULL;
1470 subs->cur_rate = 0; 1470 subs->cur_rate = 0;
1471 subs->period_bytes = 0; 1471 subs->period_bytes = 0;
1472 release_substream_urbs(subs, 0); 1472 if (!subs->stream->chip->shutdown)
1473 release_substream_urbs(subs, 0);
1473 return snd_pcm_free_vmalloc_buffer(substream); 1474 return snd_pcm_free_vmalloc_buffer(substream);
1474} 1475}
1475 1476
diff --git a/sound/usb/usbmidi.c b/sound/usb/usbmidi.c
index b7c5e59b2299..24f5a26c5f0c 100644
--- a/sound/usb/usbmidi.c
+++ b/sound/usb/usbmidi.c
@@ -981,7 +981,7 @@ void snd_usbmidi_disconnect(struct list_head* p)
981 if (umidi->usb_protocol_ops->finish_out_endpoint) 981 if (umidi->usb_protocol_ops->finish_out_endpoint)
982 umidi->usb_protocol_ops->finish_out_endpoint(ep->out); 982 umidi->usb_protocol_ops->finish_out_endpoint(ep->out);
983 } 983 }
984 if (ep->in && ep->in->urb) 984 if (ep->in)
985 usb_kill_urb(ep->in->urb); 985 usb_kill_urb(ep->in->urb);
986 } 986 }
987} 987}
diff --git a/sound/usb/usbmixer.c b/sound/usb/usbmixer.c
index 1024c178f5c0..e74eb1bc8d87 100644
--- a/sound/usb/usbmixer.c
+++ b/sound/usb/usbmixer.c
@@ -1620,8 +1620,7 @@ static void snd_usb_mixer_free(struct usb_mixer_interface *mixer)
1620 kfree(mixer->urb->transfer_buffer); 1620 kfree(mixer->urb->transfer_buffer);
1621 usb_free_urb(mixer->urb); 1621 usb_free_urb(mixer->urb);
1622 } 1622 }
1623 if (mixer->rc_urb) 1623 usb_free_urb(mixer->rc_urb);
1624 usb_free_urb(mixer->rc_urb);
1625 kfree(mixer->rc_setup_packet); 1624 kfree(mixer->rc_setup_packet);
1626 kfree(mixer); 1625 kfree(mixer);
1627} 1626}
@@ -2056,8 +2055,6 @@ void snd_usb_mixer_disconnect(struct list_head *p)
2056 struct usb_mixer_interface *mixer; 2055 struct usb_mixer_interface *mixer;
2057 2056
2058 mixer = list_entry(p, struct usb_mixer_interface, list); 2057 mixer = list_entry(p, struct usb_mixer_interface, list);
2059 if (mixer->urb) 2058 usb_kill_urb(mixer->urb);
2060 usb_kill_urb(mixer->urb); 2059 usb_kill_urb(mixer->rc_urb);
2061 if (mixer->rc_urb)
2062 usb_kill_urb(mixer->rc_urb);
2063} 2060}
diff --git a/sound/usb/usx2y/usX2Yhwdep.c b/sound/usb/usx2y/usX2Yhwdep.c
index 4b52d18dcd53..b76b3dd9df25 100644
--- a/sound/usb/usx2y/usX2Yhwdep.c
+++ b/sound/usb/usx2y/usX2Yhwdep.c
@@ -48,7 +48,7 @@ static struct page * snd_us428ctls_vm_nopage(struct vm_area_struct *area, unsign
48 48
49 offset = area->vm_pgoff << PAGE_SHIFT; 49 offset = area->vm_pgoff << PAGE_SHIFT;
50 offset += address - area->vm_start; 50 offset += address - area->vm_start;
51 snd_assert((offset % PAGE_SIZE) == 0, return NOPAGE_OOM); 51 snd_assert((offset % PAGE_SIZE) == 0, return NOPAGE_SIGBUS);
52 vaddr = (char*)((struct usX2Ydev *)area->vm_private_data)->us428ctls_sharedmem + offset; 52 vaddr = (char*)((struct usX2Ydev *)area->vm_private_data)->us428ctls_sharedmem + offset;
53 page = virt_to_page(vaddr); 53 page = virt_to_page(vaddr);
54 get_page(page); 54 get_page(page);