diff options
Diffstat (limited to 'sound')
54 files changed, 420 insertions, 232 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 | ||
65 | source "sound/mips/Kconfig" | 65 | source "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 |
69 | source "sound/usb/Kconfig" | 69 | source "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 |
73 | source "sound/pcmcia/Kconfig" | 73 | source "sound/pcmcia/Kconfig" |
74 | 74 | ||
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/core/control.c b/sound/core/control.c index 6973a9686b67..48ef0a09a7a7 100644 --- a/sound/core/control.c +++ b/sound/core/control.c | |||
@@ -1018,10 +1018,6 @@ static int snd_ctl_elem_add(struct snd_ctl_file *file, | |||
1018 | } | 1018 | } |
1019 | switch (info->type) { | 1019 | switch (info->type) { |
1020 | case SNDRV_CTL_ELEM_TYPE_BOOLEAN: | 1020 | case SNDRV_CTL_ELEM_TYPE_BOOLEAN: |
1021 | private_size = sizeof(char); | ||
1022 | if (info->count > 128) | ||
1023 | return -EINVAL; | ||
1024 | break; | ||
1025 | case SNDRV_CTL_ELEM_TYPE_INTEGER: | 1021 | case SNDRV_CTL_ELEM_TYPE_INTEGER: |
1026 | private_size = sizeof(long); | 1022 | private_size = sizeof(long); |
1027 | if (info->count > 128) | 1023 | if (info->count > 128) |
diff --git a/sound/core/info.c b/sound/core/info.c index e43662b33f16..0b4aab3225e5 100644 --- a/sound/core/info.c +++ b/sound/core/info.c | |||
@@ -120,7 +120,10 @@ int snd_iprintf(struct snd_info_buffer *buffer, char *fmt,...) | |||
120 | len = buffer->len - buffer->size; | 120 | len = buffer->len - buffer->size; |
121 | va_start(args, fmt); | 121 | va_start(args, fmt); |
122 | for (;;) { | 122 | for (;;) { |
123 | res = vsnprintf(buffer->buffer + buffer->curr, len, fmt, args); | 123 | va_list ap; |
124 | va_copy(ap, args); | ||
125 | res = vsnprintf(buffer->buffer + buffer->curr, len, fmt, ap); | ||
126 | va_end(ap); | ||
124 | if (res < len) | 127 | if (res < len) |
125 | break; | 128 | break; |
126 | err = resize_info_buffer(buffer, buffer->len + PAGE_SIZE); | 129 | err = resize_info_buffer(buffer, buffer->len + PAGE_SIZE); |
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 | ||
913 | static ssize_t show_pcm_class(struct class_device *class_device, char *buf) | 913 | static 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 | ||
932 | static struct class_device_attribute pcm_attrs = | 933 | static 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 | ||
935 | static int snd_pcm_dev_register(struct snd_device *device) | 936 | static 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..66e24b5da469 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); |
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 | */ |
52 | static struct snd_timer_hardware rtc_hw = { | 49 | static 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 | ||
61 | static int rtctimer_freq = RTC_FREQ; /* frequency */ | 60 | static int rtctimer_freq = RTC_FREQ; /* frequency */ |
62 | static struct snd_timer *rtctimer; | 61 | static struct snd_timer *rtctimer; |
62 | static struct tasklet_struct rtc_tasklet; | ||
63 | static rtc_task_t rtc_task; | 63 | static 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 | ||
109 | static 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 | */ |
111 | static void rtctimer_interrupt(void *private_data) | 117 | static 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); | |||
61 | static struct snd_minor *snd_minors[SNDRV_OS_MINORS]; | 61 | static struct snd_minor *snd_minors[SNDRV_OS_MINORS]; |
62 | static DEFINE_MUTEX(sound_mutex); | 62 | static DEFINE_MUTEX(sound_mutex); |
63 | 63 | ||
64 | extern 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) | |||
331 | EXPORT_SYMBOL(snd_unregister_device); | 327 | EXPORT_SYMBOL(snd_unregister_device); |
332 | 328 | ||
333 | int snd_add_device_sysfs_file(int type, struct snd_card *card, int dev, | 329 | int 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/isa/Kconfig b/sound/isa/Kconfig index 557c4de22960..57371f1a441f 100644 --- a/sound/isa/Kconfig +++ b/sound/isa/Kconfig | |||
@@ -13,6 +13,7 @@ config SND_CS4231_LIB | |||
13 | 13 | ||
14 | config SND_ADLIB | 14 | config SND_ADLIB |
15 | tristate "AdLib FM card" | 15 | tristate "AdLib FM card" |
16 | depends on SND | ||
16 | select SND_OPL3_LIB | 17 | select SND_OPL3_LIB |
17 | help | 18 | help |
18 | Say Y here to include support for AdLib FM cards. | 19 | Say Y here to include support for AdLib FM cards. |
diff --git a/sound/isa/ad1816a/ad1816a.c b/sound/isa/ad1816a/ad1816a.c index b33a5fb59ec2..59034507175b 100644 --- a/sound/isa/ad1816a/ad1816a.c +++ b/sound/isa/ad1816a/ad1816a.c | |||
@@ -120,6 +120,8 @@ static int __devinit snd_card_ad1816a_pnp(int dev, struct snd_card_ad1816a *acar | |||
120 | struct pnp_resource_table *cfg = kmalloc(sizeof(*cfg), GFP_KERNEL); | 120 | struct pnp_resource_table *cfg = kmalloc(sizeof(*cfg), GFP_KERNEL); |
121 | int err; | 121 | int err; |
122 | 122 | ||
123 | if (!cfg) | ||
124 | return -ENOMEM; | ||
123 | acard->dev = pnp_request_card_device(card, id->devs[0].id, NULL); | 125 | acard->dev = pnp_request_card_device(card, id->devs[0].id, NULL); |
124 | if (acard->dev == NULL) { | 126 | if (acard->dev == NULL) { |
125 | kfree(cfg); | 127 | kfree(cfg); |
diff --git a/sound/isa/cmi8330.c b/sound/isa/cmi8330.c index 3c1e9fd56fe0..d1f6dfcec46e 100644 --- a/sound/isa/cmi8330.c +++ b/sound/isa/cmi8330.c | |||
@@ -289,6 +289,8 @@ static int __devinit snd_cmi8330_pnp(int dev, struct snd_cmi8330 *acard, | |||
289 | struct pnp_resource_table * cfg = kmalloc(sizeof(struct pnp_resource_table), GFP_KERNEL); | 289 | struct pnp_resource_table * cfg = kmalloc(sizeof(struct pnp_resource_table), GFP_KERNEL); |
290 | int err; | 290 | int err; |
291 | 291 | ||
292 | if (!cfg) | ||
293 | return -ENOMEM; | ||
292 | acard->cap = pnp_request_card_device(card, id->devs[0].id, NULL); | 294 | acard->cap = pnp_request_card_device(card, id->devs[0].id, NULL); |
293 | if (acard->cap == NULL) { | 295 | if (acard->cap == NULL) { |
294 | kfree(cfg); | 296 | kfree(cfg); |
diff --git a/sound/isa/gus/interwave.c b/sound/isa/gus/interwave.c index f12cd09d1fcc..4ec2d79431fc 100644 --- a/sound/isa/gus/interwave.c +++ b/sound/isa/gus/interwave.c | |||
@@ -564,6 +564,8 @@ static int __devinit snd_interwave_pnp(int dev, struct snd_interwave *iwcard, | |||
564 | struct pnp_resource_table * cfg = kmalloc(sizeof(struct pnp_resource_table), GFP_KERNEL); | 564 | struct pnp_resource_table * cfg = kmalloc(sizeof(struct pnp_resource_table), GFP_KERNEL); |
565 | int err; | 565 | int err; |
566 | 566 | ||
567 | if (!cfg) | ||
568 | return -ENOMEM; | ||
567 | iwcard->dev = pnp_request_card_device(card, id->devs[0].id, NULL); | 569 | iwcard->dev = pnp_request_card_device(card, id->devs[0].id, NULL); |
568 | if (iwcard->dev == NULL) { | 570 | if (iwcard->dev == NULL) { |
569 | kfree(cfg); | 571 | kfree(cfg); |
diff --git a/sound/isa/opti9xx/opti92x-ad1848.c b/sound/isa/opti9xx/opti92x-ad1848.c index a1ad39a8cdce..df227377c333 100644 --- a/sound/isa/opti9xx/opti92x-ad1848.c +++ b/sound/isa/opti9xx/opti92x-ad1848.c | |||
@@ -1683,6 +1683,8 @@ static int __init snd_card_opti9xx_pnp(struct snd_opti9xx *chip, struct pnp_card | |||
1683 | struct pnp_resource_table *cfg = kmalloc(sizeof(*cfg), GFP_KERNEL); | 1683 | struct pnp_resource_table *cfg = kmalloc(sizeof(*cfg), GFP_KERNEL); |
1684 | int err; | 1684 | int err; |
1685 | 1685 | ||
1686 | if (!cfg) | ||
1687 | return -ENOMEM; | ||
1686 | chip->dev = pnp_request_card_device(card, pid->devs[0].id, NULL); | 1688 | chip->dev = pnp_request_card_device(card, pid->devs[0].id, NULL); |
1687 | if (chip->dev == NULL) { | 1689 | if (chip->dev == NULL) { |
1688 | kfree(cfg); | 1690 | kfree(cfg); |
diff --git a/sound/oss/cs46xx.c b/sound/oss/cs46xx.c index 6e3c41f530e6..b1c5d8286e40 100644 --- a/sound/oss/cs46xx.c +++ b/sound/oss/cs46xx.c | |||
@@ -779,7 +779,7 @@ static unsigned int cs_set_adc_rate(struct cs_state *state, unsigned int rate) | |||
779 | rate = 48000 / 9; | 779 | rate = 48000 / 9; |
780 | 780 | ||
781 | /* | 781 | /* |
782 | * We can not capture at at rate greater than the Input Rate (48000). | 782 | * 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. | 783 | * Return an error if an attempt is made to stray outside that limit. |
784 | */ | 784 | */ |
785 | if (rate > 48000) | 785 | if (rate > 48000) |
@@ -4754,8 +4754,8 @@ static int cs_hardware_init(struct cs_card *card) | |||
4754 | mdelay(5 * cs_laptop_wait); /* Shouldnt be needed ?? */ | 4754 | mdelay(5 * cs_laptop_wait); /* Shouldnt be needed ?? */ |
4755 | 4755 | ||
4756 | /* | 4756 | /* |
4757 | * If we are resuming under 2.2.x then we can not schedule a timeout. | 4757 | * If we are resuming under 2.2.x then we cannot schedule a timeout, |
4758 | * so, just spin the CPU. | 4758 | * so just spin the CPU. |
4759 | */ | 4759 | */ |
4760 | if (card->pm.flags & CS46XX_PM_IDLE) { | 4760 | if (card->pm.flags & CS46XX_PM_IDLE) { |
4761 | /* | 4761 | /* |
diff --git a/sound/oss/sh_dac_audio.c b/sound/oss/sh_dac_audio.c index 3b3b4da8cfd3..51f554154c48 100644 --- a/sound/oss/sh_dac_audio.c +++ b/sound/oss/sh_dac_audio.c | |||
@@ -26,7 +26,7 @@ | |||
26 | #include <asm/cpu/dac.h> | 26 | #include <asm/cpu/dac.h> |
27 | #include <asm/cpu/timer.h> | 27 | #include <asm/cpu/timer.h> |
28 | #include <asm/machvec.h> | 28 | #include <asm/machvec.h> |
29 | #include <asm/hp6xx/hp6xx.h> | 29 | #include <asm/hp6xx.h> |
30 | #include <asm/hd64461.h> | 30 | #include <asm/hd64461.h> |
31 | 31 | ||
32 | #define MODNAME "sh_dac_audio" | 32 | #define MODNAME "sh_dac_audio" |
diff --git a/sound/oss/soundcard.c b/sound/oss/soundcard.c index 2344d09c7114..75c5e745705f 100644 --- a/sound/oss/soundcard.c +++ b/sound/oss/soundcard.c | |||
@@ -557,17 +557,17 @@ static int __init oss_init(void) | |||
557 | sound_dmap_flag = (dmabuf > 0 ? 1 : 0); | 557 | sound_dmap_flag = (dmabuf > 0 ? 1 : 0); |
558 | 558 | ||
559 | for (i = 0; i < sizeof (dev_list) / sizeof *dev_list; i++) { | 559 | for (i = 0; i < sizeof (dev_list) / sizeof *dev_list; i++) { |
560 | class_device_create(sound_class, NULL, | 560 | device_create(sound_class, NULL, |
561 | MKDEV(SOUND_MAJOR, dev_list[i].minor), | 561 | MKDEV(SOUND_MAJOR, dev_list[i].minor), |
562 | NULL, "%s", dev_list[i].name); | 562 | "%s", dev_list[i].name); |
563 | 563 | ||
564 | if (!dev_list[i].num) | 564 | if (!dev_list[i].num) |
565 | continue; | 565 | continue; |
566 | 566 | ||
567 | for (j = 1; j < *dev_list[i].num; j++) | 567 | for (j = 1; j < *dev_list[i].num; j++) |
568 | class_device_create(sound_class, NULL, | 568 | device_create(sound_class, NULL, |
569 | MKDEV(SOUND_MAJOR, dev_list[i].minor + (j*0x10)), | 569 | MKDEV(SOUND_MAJOR, dev_list[i].minor + (j*0x10)), |
570 | NULL, "%s%d", dev_list[i].name, j); | 570 | "%s%d", dev_list[i].name, j); |
571 | } | 571 | } |
572 | 572 | ||
573 | if (sound_nblocks >= 1024) | 573 | if (sound_nblocks >= 1024) |
@@ -581,11 +581,11 @@ static void __exit oss_cleanup(void) | |||
581 | int i, j; | 581 | int i, j; |
582 | 582 | ||
583 | for (i = 0; i < sizeof (dev_list) / sizeof *dev_list; i++) { | 583 | for (i = 0; i < sizeof (dev_list) / sizeof *dev_list; i++) { |
584 | class_device_destroy(sound_class, MKDEV(SOUND_MAJOR, dev_list[i].minor)); | 584 | device_destroy(sound_class, MKDEV(SOUND_MAJOR, dev_list[i].minor)); |
585 | if (!dev_list[i].num) | 585 | if (!dev_list[i].num) |
586 | continue; | 586 | continue; |
587 | for (j = 1; j < *dev_list[i].num; j++) | 587 | for (j = 1; j < *dev_list[i].num; j++) |
588 | class_device_destroy(sound_class, MKDEV(SOUND_MAJOR, dev_list[i].minor + (j*0x10))); | 588 | device_destroy(sound_class, MKDEV(SOUND_MAJOR, dev_list[i].minor + (j*0x10))); |
589 | } | 589 | } |
590 | 590 | ||
591 | unregister_sound_special(1); | 591 | unregister_sound_special(1); |
diff --git a/sound/pci/ac97/ac97_codec.c b/sound/pci/ac97/ac97_codec.c index a79e91850ba3..6577b2325357 100644 --- a/sound/pci/ac97/ac97_codec.c +++ b/sound/pci/ac97/ac97_codec.c | |||
@@ -570,8 +570,7 @@ int snd_ac97_put_volsw(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value | |||
570 | ac97->power_up &= ~(1 << (reg>>1)); | 570 | ac97->power_up &= ~(1 << (reg>>1)); |
571 | else | 571 | else |
572 | ac97->power_up |= 1 << (reg>>1); | 572 | ac97->power_up |= 1 << (reg>>1); |
573 | if (power_save) | 573 | update_power_regs(ac97); |
574 | update_power_regs(ac97); | ||
575 | } | 574 | } |
576 | #endif | 575 | #endif |
577 | return err; | 576 | return err; |
@@ -2337,10 +2336,7 @@ int snd_ac97_update_power(struct snd_ac97 *ac97, int reg, int powerup) | |||
2337 | } | 2336 | } |
2338 | } | 2337 | } |
2339 | 2338 | ||
2340 | if (! power_save) | 2339 | if (power_save && !powerup && ac97->power_workq) |
2341 | return 0; | ||
2342 | |||
2343 | if (! powerup && ac97->power_workq) | ||
2344 | /* adjust power-down bits after two seconds delay | 2340 | /* adjust power-down bits after two seconds delay |
2345 | * (for avoiding loud click noises for many (OSS) apps | 2341 | * (for avoiding loud click noises for many (OSS) apps |
2346 | * that open/close frequently) | 2342 | * that open/close frequently) |
diff --git a/sound/pci/ali5451/ali5451.c b/sound/pci/ali5451/ali5451.c index 13a8cefa7749..a7edd56542d4 100644 --- a/sound/pci/ali5451/ali5451.c +++ b/sound/pci/ali5451/ali5451.c | |||
@@ -2032,8 +2032,10 @@ static int ali_suspend(struct pci_dev *pci, pm_message_t state) | |||
2032 | outl(0xffffffff, ALI_REG(chip, ALI_STOP)); | 2032 | outl(0xffffffff, ALI_REG(chip, ALI_STOP)); |
2033 | 2033 | ||
2034 | spin_unlock_irq(&chip->reg_lock); | 2034 | spin_unlock_irq(&chip->reg_lock); |
2035 | |||
2035 | pci_disable_device(pci); | 2036 | pci_disable_device(pci); |
2036 | pci_save_state(pci); | 2037 | pci_save_state(pci); |
2038 | pci_set_power_state(pci, pci_choose_state(pci, state)); | ||
2037 | return 0; | 2039 | return 0; |
2038 | } | 2040 | } |
2039 | 2041 | ||
@@ -2048,8 +2050,15 @@ static int ali_resume(struct pci_dev *pci) | |||
2048 | if (! im) | 2050 | if (! im) |
2049 | return 0; | 2051 | return 0; |
2050 | 2052 | ||
2053 | pci_set_power_state(pci, PCI_D0); | ||
2051 | pci_restore_state(pci); | 2054 | pci_restore_state(pci); |
2052 | pci_enable_device(pci); | 2055 | if (pci_enable_device(pci) < 0) { |
2056 | printk(KERN_ERR "ali5451: pci_enable_device failed, " | ||
2057 | "disabling device\n"); | ||
2058 | snd_card_disconnect(card); | ||
2059 | return -EIO; | ||
2060 | } | ||
2061 | pci_set_master(pci); | ||
2053 | 2062 | ||
2054 | spin_lock_irq(&chip->reg_lock); | 2063 | spin_lock_irq(&chip->reg_lock); |
2055 | 2064 | ||
diff --git a/sound/pci/als300.c b/sound/pci/als300.c index 9b16c299f0a9..95f70f3cc37e 100644 --- a/sound/pci/als300.c +++ b/sound/pci/als300.c | |||
@@ -768,9 +768,9 @@ static int snd_als300_suspend(struct pci_dev *pci, pm_message_t state) | |||
768 | snd_pcm_suspend_all(chip->pcm); | 768 | snd_pcm_suspend_all(chip->pcm); |
769 | snd_ac97_suspend(chip->ac97); | 769 | snd_ac97_suspend(chip->ac97); |
770 | 770 | ||
771 | pci_set_power_state(pci, PCI_D3hot); | ||
772 | pci_disable_device(pci); | 771 | pci_disable_device(pci); |
773 | pci_save_state(pci); | 772 | pci_save_state(pci); |
773 | pci_set_power_state(pci, pci_choose_state(pci, state)); | ||
774 | return 0; | 774 | return 0; |
775 | } | 775 | } |
776 | 776 | ||
@@ -779,9 +779,14 @@ static int snd_als300_resume(struct pci_dev *pci) | |||
779 | struct snd_card *card = pci_get_drvdata(pci); | 779 | struct snd_card *card = pci_get_drvdata(pci); |
780 | struct snd_als300 *chip = card->private_data; | 780 | struct snd_als300 *chip = card->private_data; |
781 | 781 | ||
782 | pci_restore_state(pci); | ||
783 | pci_enable_device(pci); | ||
784 | pci_set_power_state(pci, PCI_D0); | 782 | pci_set_power_state(pci, PCI_D0); |
783 | pci_restore_state(pci); | ||
784 | if (pci_enable_device(pci) < 0) { | ||
785 | printk(KERN_ERR "als300: pci_enable_device failed, " | ||
786 | "disabling device\n"); | ||
787 | snd_card_disconnect(card); | ||
788 | return -EIO; | ||
789 | } | ||
785 | pci_set_master(pci); | 790 | pci_set_master(pci); |
786 | 791 | ||
787 | snd_als300_init(chip); | 792 | snd_als300_init(chip); |
diff --git a/sound/pci/als4000.c b/sound/pci/als4000.c index 15fc3929b5f7..8fb55d3b454b 100644 --- a/sound/pci/als4000.c +++ b/sound/pci/als4000.c | |||
@@ -804,9 +804,9 @@ static int snd_als4000_suspend(struct pci_dev *pci, pm_message_t state) | |||
804 | snd_pcm_suspend_all(chip->pcm); | 804 | snd_pcm_suspend_all(chip->pcm); |
805 | snd_sbmixer_suspend(chip); | 805 | snd_sbmixer_suspend(chip); |
806 | 806 | ||
807 | pci_set_power_state(pci, PCI_D3hot); | ||
808 | pci_disable_device(pci); | 807 | pci_disable_device(pci); |
809 | pci_save_state(pci); | 808 | pci_save_state(pci); |
809 | pci_set_power_state(pci, pci_choose_state(pci, state)); | ||
810 | return 0; | 810 | return 0; |
811 | } | 811 | } |
812 | 812 | ||
@@ -816,9 +816,14 @@ static int snd_als4000_resume(struct pci_dev *pci) | |||
816 | struct snd_card_als4000 *acard = card->private_data; | 816 | struct snd_card_als4000 *acard = card->private_data; |
817 | struct snd_sb *chip = acard->chip; | 817 | struct snd_sb *chip = acard->chip; |
818 | 818 | ||
819 | pci_restore_state(pci); | ||
820 | pci_enable_device(pci); | ||
821 | pci_set_power_state(pci, PCI_D0); | 819 | pci_set_power_state(pci, PCI_D0); |
820 | pci_restore_state(pci); | ||
821 | if (pci_enable_device(pci) < 0) { | ||
822 | printk(KERN_ERR "als4000: pci_enable_device failed, " | ||
823 | "disabling device\n"); | ||
824 | snd_card_disconnect(card); | ||
825 | return -EIO; | ||
826 | } | ||
822 | pci_set_master(pci); | 827 | pci_set_master(pci); |
823 | 828 | ||
824 | snd_als4000_configure(chip); | 829 | snd_als4000_configure(chip); |
diff --git a/sound/pci/atiixp.c b/sound/pci/atiixp.c index 3e8fc5a0006a..e3e99f396711 100644 --- a/sound/pci/atiixp.c +++ b/sound/pci/atiixp.c | |||
@@ -1442,9 +1442,9 @@ static int snd_atiixp_suspend(struct pci_dev *pci, pm_message_t state) | |||
1442 | snd_atiixp_aclink_down(chip); | 1442 | snd_atiixp_aclink_down(chip); |
1443 | snd_atiixp_chip_stop(chip); | 1443 | snd_atiixp_chip_stop(chip); |
1444 | 1444 | ||
1445 | pci_set_power_state(pci, PCI_D3hot); | ||
1446 | pci_disable_device(pci); | 1445 | pci_disable_device(pci); |
1447 | pci_save_state(pci); | 1446 | pci_save_state(pci); |
1447 | pci_set_power_state(pci, pci_choose_state(pci, state)); | ||
1448 | return 0; | 1448 | return 0; |
1449 | } | 1449 | } |
1450 | 1450 | ||
@@ -1454,9 +1454,14 @@ static int snd_atiixp_resume(struct pci_dev *pci) | |||
1454 | struct atiixp *chip = card->private_data; | 1454 | struct atiixp *chip = card->private_data; |
1455 | int i; | 1455 | int i; |
1456 | 1456 | ||
1457 | pci_restore_state(pci); | ||
1458 | pci_enable_device(pci); | ||
1459 | pci_set_power_state(pci, PCI_D0); | 1457 | pci_set_power_state(pci, PCI_D0); |
1458 | pci_restore_state(pci); | ||
1459 | if (pci_enable_device(pci) < 0) { | ||
1460 | printk(KERN_ERR "atiixp: pci_enable_device failed, " | ||
1461 | "disabling device\n"); | ||
1462 | snd_card_disconnect(card); | ||
1463 | return -EIO; | ||
1464 | } | ||
1460 | pci_set_master(pci); | 1465 | pci_set_master(pci); |
1461 | 1466 | ||
1462 | snd_atiixp_aclink_reset(chip); | 1467 | snd_atiixp_aclink_reset(chip); |
diff --git a/sound/pci/atiixp_modem.c b/sound/pci/atiixp_modem.c index c5dda1bf3d46..dc54f2c68ed7 100644 --- a/sound/pci/atiixp_modem.c +++ b/sound/pci/atiixp_modem.c | |||
@@ -1128,9 +1128,9 @@ static int snd_atiixp_suspend(struct pci_dev *pci, pm_message_t state) | |||
1128 | snd_atiixp_aclink_down(chip); | 1128 | snd_atiixp_aclink_down(chip); |
1129 | snd_atiixp_chip_stop(chip); | 1129 | snd_atiixp_chip_stop(chip); |
1130 | 1130 | ||
1131 | pci_set_power_state(pci, PCI_D3hot); | ||
1132 | pci_disable_device(pci); | 1131 | pci_disable_device(pci); |
1133 | pci_save_state(pci); | 1132 | pci_save_state(pci); |
1133 | pci_set_power_state(pci, pci_choose_state(pci, state)); | ||
1134 | return 0; | 1134 | return 0; |
1135 | } | 1135 | } |
1136 | 1136 | ||
@@ -1140,9 +1140,14 @@ static int snd_atiixp_resume(struct pci_dev *pci) | |||
1140 | struct atiixp_modem *chip = card->private_data; | 1140 | struct atiixp_modem *chip = card->private_data; |
1141 | int i; | 1141 | int i; |
1142 | 1142 | ||
1143 | pci_restore_state(pci); | ||
1144 | pci_enable_device(pci); | ||
1145 | pci_set_power_state(pci, PCI_D0); | 1143 | pci_set_power_state(pci, PCI_D0); |
1144 | pci_restore_state(pci); | ||
1145 | if (pci_enable_device(pci) < 0) { | ||
1146 | printk(KERN_ERR "atiixp-modem: pci_enable_device failed, " | ||
1147 | "disabling device\n"); | ||
1148 | snd_card_disconnect(card); | ||
1149 | return -EIO; | ||
1150 | } | ||
1146 | pci_set_master(pci); | 1151 | pci_set_master(pci); |
1147 | 1152 | ||
1148 | snd_atiixp_aclink_reset(chip); | 1153 | snd_atiixp_aclink_reset(chip); |
diff --git a/sound/pci/azt3328.c b/sound/pci/azt3328.c index 692f203d65d8..2414ee630756 100644 --- a/sound/pci/azt3328.c +++ b/sound/pci/azt3328.c | |||
@@ -1903,9 +1903,9 @@ snd_azf3328_suspend(struct pci_dev *pci, pm_message_t state) | |||
1903 | for (reg = 0; reg < AZF_IO_SIZE_SYNTH_PM / 2; reg++) | 1903 | for (reg = 0; reg < AZF_IO_SIZE_SYNTH_PM / 2; reg++) |
1904 | chip->saved_regs_synth[reg] = inw(chip->synth_port + reg * 2); | 1904 | chip->saved_regs_synth[reg] = inw(chip->synth_port + reg * 2); |
1905 | 1905 | ||
1906 | pci_set_power_state(pci, PCI_D3hot); | ||
1907 | pci_disable_device(pci); | 1906 | pci_disable_device(pci); |
1908 | pci_save_state(pci); | 1907 | pci_save_state(pci); |
1908 | pci_set_power_state(pci, pci_choose_state(pci, state)); | ||
1909 | return 0; | 1909 | return 0; |
1910 | } | 1910 | } |
1911 | 1911 | ||
@@ -1916,9 +1916,14 @@ snd_azf3328_resume(struct pci_dev *pci) | |||
1916 | struct snd_azf3328 *chip = card->private_data; | 1916 | struct snd_azf3328 *chip = card->private_data; |
1917 | int reg; | 1917 | int reg; |
1918 | 1918 | ||
1919 | pci_restore_state(pci); | ||
1920 | pci_enable_device(pci); | ||
1921 | pci_set_power_state(pci, PCI_D0); | 1919 | pci_set_power_state(pci, PCI_D0); |
1920 | pci_restore_state(pci); | ||
1921 | if (pci_enable_device(pci) < 0) { | ||
1922 | printk(KERN_ERR "azt3328: pci_enable_device failed, " | ||
1923 | "disabling device\n"); | ||
1924 | snd_card_disconnect(card); | ||
1925 | return -EIO; | ||
1926 | } | ||
1922 | pci_set_master(pci); | 1927 | pci_set_master(pci); |
1923 | 1928 | ||
1924 | for (reg = 0; reg < AZF_IO_SIZE_IO2_PM / 2; reg++) | 1929 | for (reg = 0; reg < AZF_IO_SIZE_IO2_PM / 2; reg++) |
diff --git a/sound/pci/cmipci.c b/sound/pci/cmipci.c index 1f7e71083069..0093cd1f92db 100644 --- a/sound/pci/cmipci.c +++ b/sound/pci/cmipci.c | |||
@@ -3122,9 +3122,9 @@ static int snd_cmipci_suspend(struct pci_dev *pci, pm_message_t state) | |||
3122 | /* disable ints */ | 3122 | /* disable ints */ |
3123 | snd_cmipci_write(cm, CM_REG_INT_HLDCLR, 0); | 3123 | snd_cmipci_write(cm, CM_REG_INT_HLDCLR, 0); |
3124 | 3124 | ||
3125 | pci_set_power_state(pci, PCI_D3hot); | ||
3126 | pci_disable_device(pci); | 3125 | pci_disable_device(pci); |
3127 | pci_save_state(pci); | 3126 | pci_save_state(pci); |
3127 | pci_set_power_state(pci, pci_choose_state(pci, state)); | ||
3128 | return 0; | 3128 | return 0; |
3129 | } | 3129 | } |
3130 | 3130 | ||
@@ -3134,9 +3134,14 @@ static int snd_cmipci_resume(struct pci_dev *pci) | |||
3134 | struct cmipci *cm = card->private_data; | 3134 | struct cmipci *cm = card->private_data; |
3135 | int i; | 3135 | int i; |
3136 | 3136 | ||
3137 | pci_restore_state(pci); | ||
3138 | pci_enable_device(pci); | ||
3139 | pci_set_power_state(pci, PCI_D0); | 3137 | pci_set_power_state(pci, PCI_D0); |
3138 | pci_restore_state(pci); | ||
3139 | if (pci_enable_device(pci) < 0) { | ||
3140 | printk(KERN_ERR "cmipci: pci_enable_device failed, " | ||
3141 | "disabling device\n"); | ||
3142 | snd_card_disconnect(card); | ||
3143 | return -EIO; | ||
3144 | } | ||
3140 | pci_set_master(pci); | 3145 | pci_set_master(pci); |
3141 | 3146 | ||
3142 | /* reset / initialize to a sane state */ | 3147 | /* reset / initialize to a sane state */ |
diff --git a/sound/pci/cs4281.c b/sound/pci/cs4281.c index d54924e60bb1..0905fa88129d 100644 --- a/sound/pci/cs4281.c +++ b/sound/pci/cs4281.c | |||
@@ -2050,6 +2050,7 @@ static int cs4281_suspend(struct pci_dev *pci, pm_message_t state) | |||
2050 | 2050 | ||
2051 | pci_disable_device(pci); | 2051 | pci_disable_device(pci); |
2052 | pci_save_state(pci); | 2052 | pci_save_state(pci); |
2053 | pci_set_power_state(pci, pci_choose_state(pci, state)); | ||
2053 | return 0; | 2054 | return 0; |
2054 | } | 2055 | } |
2055 | 2056 | ||
@@ -2060,8 +2061,14 @@ static int cs4281_resume(struct pci_dev *pci) | |||
2060 | unsigned int i; | 2061 | unsigned int i; |
2061 | u32 ulCLK; | 2062 | u32 ulCLK; |
2062 | 2063 | ||
2064 | pci_set_power_state(pci, PCI_D0); | ||
2063 | pci_restore_state(pci); | 2065 | pci_restore_state(pci); |
2064 | pci_enable_device(pci); | 2066 | if (pci_enable_device(pci) < 0) { |
2067 | printk(KERN_ERR "cs4281: pci_enable_device failed, " | ||
2068 | "disabling device\n"); | ||
2069 | snd_card_disconnect(card); | ||
2070 | return -EIO; | ||
2071 | } | ||
2065 | pci_set_master(pci); | 2072 | pci_set_master(pci); |
2066 | 2073 | ||
2067 | ulCLK = snd_cs4281_peekBA0(chip, BA0_CLKCR1); | 2074 | ulCLK = snd_cs4281_peekBA0(chip, BA0_CLKCR1); |
diff --git a/sound/pci/cs46xx/cs46xx_lib.c b/sound/pci/cs46xx/cs46xx_lib.c index 16d4ebf2a33f..2807b9756ef0 100644 --- a/sound/pci/cs46xx/cs46xx_lib.c +++ b/sound/pci/cs46xx/cs46xx_lib.c | |||
@@ -3687,8 +3687,10 @@ int snd_cs46xx_suspend(struct pci_dev *pci, pm_message_t state) | |||
3687 | /* disable CLKRUN */ | 3687 | /* disable CLKRUN */ |
3688 | chip->active_ctrl(chip, -chip->amplifier); | 3688 | chip->active_ctrl(chip, -chip->amplifier); |
3689 | chip->amplifier = amp_saved; /* restore the status */ | 3689 | chip->amplifier = amp_saved; /* restore the status */ |
3690 | |||
3690 | pci_disable_device(pci); | 3691 | pci_disable_device(pci); |
3691 | pci_save_state(pci); | 3692 | pci_save_state(pci); |
3693 | pci_set_power_state(pci, pci_choose_state(pci, state)); | ||
3692 | return 0; | 3694 | return 0; |
3693 | } | 3695 | } |
3694 | 3696 | ||
@@ -3698,9 +3700,16 @@ int snd_cs46xx_resume(struct pci_dev *pci) | |||
3698 | struct snd_cs46xx *chip = card->private_data; | 3700 | struct snd_cs46xx *chip = card->private_data; |
3699 | int amp_saved; | 3701 | int amp_saved; |
3700 | 3702 | ||
3703 | pci_set_power_state(pci, PCI_D0); | ||
3701 | pci_restore_state(pci); | 3704 | pci_restore_state(pci); |
3702 | pci_enable_device(pci); | 3705 | if (pci_enable_device(pci) < 0) { |
3706 | printk(KERN_ERR "cs46xx: pci_enable_device failed, " | ||
3707 | "disabling device\n"); | ||
3708 | snd_card_disconnect(card); | ||
3709 | return -EIO; | ||
3710 | } | ||
3703 | pci_set_master(pci); | 3711 | pci_set_master(pci); |
3712 | |||
3704 | amp_saved = chip->amplifier; | 3713 | amp_saved = chip->amplifier; |
3705 | chip->amplifier = 0; | 3714 | chip->amplifier = 0; |
3706 | chip->active_ctrl(chip, 1); /* force to on */ | 3715 | chip->active_ctrl(chip, 1); /* force to on */ |
diff --git a/sound/pci/cs5535audio/cs5535audio_pm.c b/sound/pci/cs5535audio/cs5535audio_pm.c index aad0e69db9c1..3e4d198a4502 100644 --- a/sound/pci/cs5535audio/cs5535audio_pm.c +++ b/sound/pci/cs5535audio/cs5535audio_pm.c | |||
@@ -73,9 +73,10 @@ int snd_cs5535audio_suspend(struct pci_dev *pci, pm_message_t state) | |||
73 | snd_ac97_suspend(cs5535au->ac97); | 73 | snd_ac97_suspend(cs5535au->ac97); |
74 | /* save important regs, then disable aclink in hw */ | 74 | /* save important regs, then disable aclink in hw */ |
75 | snd_cs5535audio_stop_hardware(cs5535au); | 75 | snd_cs5535audio_stop_hardware(cs5535au); |
76 | |||
76 | pci_disable_device(pci); | 77 | pci_disable_device(pci); |
77 | pci_save_state(pci); | 78 | pci_save_state(pci); |
78 | 79 | pci_set_power_state(pci, pci_choose_state(pci, state)); | |
79 | return 0; | 80 | return 0; |
80 | } | 81 | } |
81 | 82 | ||
@@ -87,8 +88,14 @@ int snd_cs5535audio_resume(struct pci_dev *pci) | |||
87 | int timeout; | 88 | int timeout; |
88 | int i; | 89 | int i; |
89 | 90 | ||
91 | pci_set_power_state(pci, PCI_D0); | ||
90 | pci_restore_state(pci); | 92 | pci_restore_state(pci); |
91 | pci_enable_device(pci); | 93 | if (pci_enable_device(pci) < 0) { |
94 | printk(KERN_ERR "cs5535audio: pci_enable_device failed, " | ||
95 | "disabling device\n"); | ||
96 | snd_card_disconnect(card); | ||
97 | return -EIO; | ||
98 | } | ||
92 | pci_set_master(pci); | 99 | pci_set_master(pci); |
93 | 100 | ||
94 | /* set LNK_WRM_RST to reset AC link */ | 101 | /* set LNK_WRM_RST to reset AC link */ |
diff --git a/sound/pci/emu10k1/emu10k1.c b/sound/pci/emu10k1/emu10k1.c index 493ec0816bb3..55caf341933a 100644 --- a/sound/pci/emu10k1/emu10k1.c +++ b/sound/pci/emu10k1/emu10k1.c | |||
@@ -226,9 +226,9 @@ static int snd_emu10k1_suspend(struct pci_dev *pci, pm_message_t state) | |||
226 | 226 | ||
227 | snd_emu10k1_done(emu); | 227 | snd_emu10k1_done(emu); |
228 | 228 | ||
229 | pci_set_power_state(pci, PCI_D3hot); | ||
230 | pci_disable_device(pci); | 229 | pci_disable_device(pci); |
231 | pci_save_state(pci); | 230 | pci_save_state(pci); |
231 | pci_set_power_state(pci, pci_choose_state(pci, state)); | ||
232 | return 0; | 232 | return 0; |
233 | } | 233 | } |
234 | 234 | ||
@@ -237,11 +237,16 @@ static int snd_emu10k1_resume(struct pci_dev *pci) | |||
237 | struct snd_card *card = pci_get_drvdata(pci); | 237 | struct snd_card *card = pci_get_drvdata(pci); |
238 | struct snd_emu10k1 *emu = card->private_data; | 238 | struct snd_emu10k1 *emu = card->private_data; |
239 | 239 | ||
240 | pci_restore_state(pci); | ||
241 | pci_enable_device(pci); | ||
242 | pci_set_power_state(pci, PCI_D0); | 240 | pci_set_power_state(pci, PCI_D0); |
241 | pci_restore_state(pci); | ||
242 | if (pci_enable_device(pci) < 0) { | ||
243 | printk(KERN_ERR "emu10k1: pci_enable_device failed, " | ||
244 | "disabling device\n"); | ||
245 | snd_card_disconnect(card); | ||
246 | return -EIO; | ||
247 | } | ||
243 | pci_set_master(pci); | 248 | pci_set_master(pci); |
244 | 249 | ||
245 | snd_emu10k1_resume_init(emu); | 250 | snd_emu10k1_resume_init(emu); |
246 | snd_emu10k1_efx_resume(emu); | 251 | snd_emu10k1_efx_resume(emu); |
247 | snd_ac97_resume(emu->ac97); | 252 | snd_ac97_resume(emu->ac97); |
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/ens1370.c b/sound/pci/ens1370.c index 8cb4fb2412db..d2a811f222c9 100644 --- a/sound/pci/ens1370.c +++ b/sound/pci/ens1370.c | |||
@@ -2072,9 +2072,10 @@ static int snd_ensoniq_suspend(struct pci_dev *pci, pm_message_t state) | |||
2072 | udelay(100); | 2072 | udelay(100); |
2073 | snd_ak4531_suspend(ensoniq->u.es1370.ak4531); | 2073 | snd_ak4531_suspend(ensoniq->u.es1370.ak4531); |
2074 | #endif | 2074 | #endif |
2075 | pci_set_power_state(pci, PCI_D3hot); | 2075 | |
2076 | pci_disable_device(pci); | 2076 | pci_disable_device(pci); |
2077 | pci_save_state(pci); | 2077 | pci_save_state(pci); |
2078 | pci_set_power_state(pci, pci_choose_state(pci, state)); | ||
2078 | return 0; | 2079 | return 0; |
2079 | } | 2080 | } |
2080 | 2081 | ||
@@ -2083,9 +2084,14 @@ static int snd_ensoniq_resume(struct pci_dev *pci) | |||
2083 | struct snd_card *card = pci_get_drvdata(pci); | 2084 | struct snd_card *card = pci_get_drvdata(pci); |
2084 | struct ensoniq *ensoniq = card->private_data; | 2085 | struct ensoniq *ensoniq = card->private_data; |
2085 | 2086 | ||
2086 | pci_restore_state(pci); | ||
2087 | pci_enable_device(pci); | ||
2088 | pci_set_power_state(pci, PCI_D0); | 2087 | pci_set_power_state(pci, PCI_D0); |
2088 | pci_restore_state(pci); | ||
2089 | if (pci_enable_device(pci) < 0) { | ||
2090 | printk(KERN_ERR DRIVER_NAME ": pci_enable_device failed, " | ||
2091 | "disabling device\n"); | ||
2092 | snd_card_disconnect(card); | ||
2093 | return -EIO; | ||
2094 | } | ||
2089 | pci_set_master(pci); | 2095 | pci_set_master(pci); |
2090 | 2096 | ||
2091 | snd_ensoniq_chip_init(ensoniq); | 2097 | snd_ensoniq_chip_init(ensoniq); |
diff --git a/sound/pci/es1938.c b/sound/pci/es1938.c index 2da988f78ba7..1a8d36df4b5d 100644 --- a/sound/pci/es1938.c +++ b/sound/pci/es1938.c | |||
@@ -1481,10 +1481,14 @@ static int es1938_suspend(struct pci_dev *pci, pm_message_t state) | |||
1481 | *d = snd_es1938_reg_read(chip, *s); | 1481 | *d = snd_es1938_reg_read(chip, *s); |
1482 | 1482 | ||
1483 | outb(0x00, SLIO_REG(chip, IRQCONTROL)); /* disable irqs */ | 1483 | outb(0x00, SLIO_REG(chip, IRQCONTROL)); /* disable irqs */ |
1484 | if (chip->irq >= 0) | 1484 | if (chip->irq >= 0) { |
1485 | synchronize_irq(chip->irq); | ||
1485 | free_irq(chip->irq, chip); | 1486 | free_irq(chip->irq, chip); |
1487 | chip->irq = -1; | ||
1488 | } | ||
1486 | pci_disable_device(pci); | 1489 | pci_disable_device(pci); |
1487 | pci_save_state(pci); | 1490 | pci_save_state(pci); |
1491 | pci_set_power_state(pci, pci_choose_state(pci, state)); | ||
1488 | return 0; | 1492 | return 0; |
1489 | } | 1493 | } |
1490 | 1494 | ||
@@ -1494,10 +1498,22 @@ static int es1938_resume(struct pci_dev *pci) | |||
1494 | struct es1938 *chip = card->private_data; | 1498 | struct es1938 *chip = card->private_data; |
1495 | unsigned char *s, *d; | 1499 | unsigned char *s, *d; |
1496 | 1500 | ||
1501 | pci_set_power_state(pci, PCI_D0); | ||
1497 | pci_restore_state(pci); | 1502 | pci_restore_state(pci); |
1498 | pci_enable_device(pci); | 1503 | if (pci_enable_device(pci) < 0) { |
1499 | request_irq(pci->irq, snd_es1938_interrupt, | 1504 | printk(KERN_ERR "es1938: pci_enable_device failed, " |
1500 | IRQF_DISABLED|IRQF_SHARED, "ES1938", chip); | 1505 | "disabling device\n"); |
1506 | snd_card_disconnect(card); | ||
1507 | return -EIO; | ||
1508 | } | ||
1509 | |||
1510 | if (request_irq(pci->irq, snd_es1938_interrupt, | ||
1511 | IRQF_DISABLED|IRQF_SHARED, "ES1938", chip)) { | ||
1512 | printk(KERN_ERR "es1938: unable to grab IRQ %d, " | ||
1513 | "disabling device\n", pci->irq); | ||
1514 | snd_card_disconnect(card); | ||
1515 | return -EIO; | ||
1516 | } | ||
1501 | chip->irq = pci->irq; | 1517 | chip->irq = pci->irq; |
1502 | snd_es1938_chip_init(chip); | 1518 | snd_es1938_chip_init(chip); |
1503 | 1519 | ||
@@ -1556,8 +1572,10 @@ static int snd_es1938_free(struct es1938 *chip) | |||
1556 | 1572 | ||
1557 | snd_es1938_free_gameport(chip); | 1573 | snd_es1938_free_gameport(chip); |
1558 | 1574 | ||
1559 | if (chip->irq >= 0) | 1575 | if (chip->irq >= 0) { |
1576 | synchronize_irq(chip->irq); | ||
1560 | free_irq(chip->irq, chip); | 1577 | free_irq(chip->irq, chip); |
1578 | } | ||
1561 | pci_release_regions(chip->pci); | 1579 | pci_release_regions(chip->pci); |
1562 | pci_disable_device(chip->pci); | 1580 | pci_disable_device(chip->pci); |
1563 | kfree(chip); | 1581 | kfree(chip); |
@@ -1602,6 +1620,7 @@ static int __devinit snd_es1938_create(struct snd_card *card, | |||
1602 | spin_lock_init(&chip->mixer_lock); | 1620 | spin_lock_init(&chip->mixer_lock); |
1603 | chip->card = card; | 1621 | chip->card = card; |
1604 | chip->pci = pci; | 1622 | chip->pci = pci; |
1623 | chip->irq = -1; | ||
1605 | if ((err = pci_request_regions(pci, "ESS Solo-1")) < 0) { | 1624 | if ((err = pci_request_regions(pci, "ESS Solo-1")) < 0) { |
1606 | kfree(chip); | 1625 | kfree(chip); |
1607 | pci_disable_device(pci); | 1626 | pci_disable_device(pci); |
diff --git a/sound/pci/es1968.c b/sound/pci/es1968.c index b9d723c7e1db..092da53e1464 100644 --- a/sound/pci/es1968.c +++ b/sound/pci/es1968.c | |||
@@ -432,46 +432,6 @@ MODULE_PARM_DESC(joystick, "Enable joystick."); | |||
432 | #define ESM_MODE_PLAY 0 | 432 | #define ESM_MODE_PLAY 0 |
433 | #define ESM_MODE_CAPTURE 1 | 433 | #define ESM_MODE_CAPTURE 1 |
434 | 434 | ||
435 | /* acpi states */ | ||
436 | enum { | ||
437 | ACPI_D0=0, | ||
438 | ACPI_D1, | ||
439 | ACPI_D2, | ||
440 | ACPI_D3 | ||
441 | }; | ||
442 | |||
443 | /* bits in the acpi masks */ | ||
444 | #define ACPI_12MHZ ( 1 << 15) | ||
445 | #define ACPI_24MHZ ( 1 << 14) | ||
446 | #define ACPI_978 ( 1 << 13) | ||
447 | #define ACPI_SPDIF ( 1 << 12) | ||
448 | #define ACPI_GLUE ( 1 << 11) | ||
449 | #define ACPI__10 ( 1 << 10) /* reserved */ | ||
450 | #define ACPI_PCIINT ( 1 << 9) | ||
451 | #define ACPI_HV ( 1 << 8) /* hardware volume */ | ||
452 | #define ACPI_GPIO ( 1 << 7) | ||
453 | #define ACPI_ASSP ( 1 << 6) | ||
454 | #define ACPI_SB ( 1 << 5) /* sb emul */ | ||
455 | #define ACPI_FM ( 1 << 4) /* fm emul */ | ||
456 | #define ACPI_RB ( 1 << 3) /* ringbus / aclink */ | ||
457 | #define ACPI_MIDI ( 1 << 2) | ||
458 | #define ACPI_GP ( 1 << 1) /* game port */ | ||
459 | #define ACPI_WP ( 1 << 0) /* wave processor */ | ||
460 | |||
461 | #define ACPI_ALL (0xffff) | ||
462 | #define ACPI_SLEEP (~(ACPI_SPDIF|ACPI_ASSP|ACPI_SB|ACPI_FM| \ | ||
463 | ACPI_MIDI|ACPI_GP|ACPI_WP)) | ||
464 | #define ACPI_NONE (ACPI__10) | ||
465 | |||
466 | /* these masks indicate which units we care about at | ||
467 | which states */ | ||
468 | static u16 acpi_state_mask[] = { | ||
469 | [ACPI_D0] = ACPI_ALL, | ||
470 | [ACPI_D1] = ACPI_SLEEP, | ||
471 | [ACPI_D2] = ACPI_SLEEP, | ||
472 | [ACPI_D3] = ACPI_NONE | ||
473 | }; | ||
474 | |||
475 | 435 | ||
476 | /* APU use in the driver */ | 436 | /* APU use in the driver */ |
477 | enum snd_enum_apu_type { | 437 | enum snd_enum_apu_type { |
@@ -2160,21 +2120,6 @@ static void snd_es1968_reset(struct es1968 *chip) | |||
2160 | } | 2120 | } |
2161 | 2121 | ||
2162 | /* | 2122 | /* |
2163 | * power management | ||
2164 | */ | ||
2165 | static void snd_es1968_set_acpi(struct es1968 *chip, int state) | ||
2166 | { | ||
2167 | u16 active_mask = acpi_state_mask[state]; | ||
2168 | |||
2169 | pci_set_power_state(chip->pci, state); | ||
2170 | /* make sure the units we care about are on | ||
2171 | XXX we might want to do this before state flipping? */ | ||
2172 | pci_write_config_word(chip->pci, 0x54, ~ active_mask); | ||
2173 | pci_write_config_word(chip->pci, 0x56, ~ active_mask); | ||
2174 | } | ||
2175 | |||
2176 | |||
2177 | /* | ||
2178 | * initialize maestro chip | 2123 | * initialize maestro chip |
2179 | */ | 2124 | */ |
2180 | static void snd_es1968_chip_init(struct es1968 *chip) | 2125 | static void snd_es1968_chip_init(struct es1968 *chip) |
@@ -2196,9 +2141,6 @@ static void snd_es1968_chip_init(struct es1968 *chip) | |||
2196 | * IRQs. | 2141 | * IRQs. |
2197 | */ | 2142 | */ |
2198 | 2143 | ||
2199 | /* do config work at full power */ | ||
2200 | snd_es1968_set_acpi(chip, ACPI_D0); | ||
2201 | |||
2202 | /* Config Reg A */ | 2144 | /* Config Reg A */ |
2203 | pci_read_config_word(pci, ESM_CONFIG_A, &w); | 2145 | pci_read_config_word(pci, ESM_CONFIG_A, &w); |
2204 | 2146 | ||
@@ -2397,9 +2339,10 @@ static int es1968_suspend(struct pci_dev *pci, pm_message_t state) | |||
2397 | snd_pcm_suspend_all(chip->pcm); | 2339 | snd_pcm_suspend_all(chip->pcm); |
2398 | snd_ac97_suspend(chip->ac97); | 2340 | snd_ac97_suspend(chip->ac97); |
2399 | snd_es1968_bob_stop(chip); | 2341 | snd_es1968_bob_stop(chip); |
2400 | snd_es1968_set_acpi(chip, ACPI_D3); | 2342 | |
2401 | pci_disable_device(pci); | 2343 | pci_disable_device(pci); |
2402 | pci_save_state(pci); | 2344 | pci_save_state(pci); |
2345 | pci_set_power_state(pci, pci_choose_state(pci, state)); | ||
2403 | return 0; | 2346 | return 0; |
2404 | } | 2347 | } |
2405 | 2348 | ||
@@ -2413,9 +2356,16 @@ static int es1968_resume(struct pci_dev *pci) | |||
2413 | return 0; | 2356 | return 0; |
2414 | 2357 | ||
2415 | /* restore all our config */ | 2358 | /* restore all our config */ |
2359 | pci_set_power_state(pci, PCI_D0); | ||
2416 | pci_restore_state(pci); | 2360 | pci_restore_state(pci); |
2417 | pci_enable_device(pci); | 2361 | if (pci_enable_device(pci) < 0) { |
2362 | printk(KERN_ERR "es1968: pci_enable_device failed, " | ||
2363 | "disabling device\n"); | ||
2364 | snd_card_disconnect(card); | ||
2365 | return -EIO; | ||
2366 | } | ||
2418 | pci_set_master(pci); | 2367 | pci_set_master(pci); |
2368 | |||
2419 | snd_es1968_chip_init(chip); | 2369 | snd_es1968_chip_init(chip); |
2420 | 2370 | ||
2421 | /* need to restore the base pointers.. */ | 2371 | /* need to restore the base pointers.. */ |
@@ -2514,7 +2464,6 @@ static int snd_es1968_free(struct es1968 *chip) | |||
2514 | if (chip->irq >= 0) | 2464 | if (chip->irq >= 0) |
2515 | free_irq(chip->irq, (void *)chip); | 2465 | free_irq(chip->irq, (void *)chip); |
2516 | snd_es1968_free_gameport(chip); | 2466 | snd_es1968_free_gameport(chip); |
2517 | snd_es1968_set_acpi(chip, ACPI_D3); | ||
2518 | chip->master_switch = NULL; | 2467 | chip->master_switch = NULL; |
2519 | chip->master_volume = NULL; | 2468 | chip->master_volume = NULL; |
2520 | pci_release_regions(chip->pci); | 2469 | pci_release_regions(chip->pci); |
diff --git a/sound/pci/fm801.c b/sound/pci/fm801.c index 3ec7d7ee04dd..77e3d5c18302 100644 --- a/sound/pci/fm801.c +++ b/sound/pci/fm801.c | |||
@@ -1531,9 +1531,9 @@ static int snd_fm801_suspend(struct pci_dev *pci, pm_message_t state) | |||
1531 | chip->saved_regs[i] = inw(chip->port + saved_regs[i]); | 1531 | chip->saved_regs[i] = inw(chip->port + saved_regs[i]); |
1532 | /* FIXME: tea575x suspend */ | 1532 | /* FIXME: tea575x suspend */ |
1533 | 1533 | ||
1534 | pci_set_power_state(pci, PCI_D3hot); | ||
1535 | pci_disable_device(pci); | 1534 | pci_disable_device(pci); |
1536 | pci_save_state(pci); | 1535 | pci_save_state(pci); |
1536 | pci_set_power_state(pci, pci_choose_state(pci, state)); | ||
1537 | return 0; | 1537 | return 0; |
1538 | } | 1538 | } |
1539 | 1539 | ||
@@ -1543,9 +1543,14 @@ static int snd_fm801_resume(struct pci_dev *pci) | |||
1543 | struct fm801 *chip = card->private_data; | 1543 | struct fm801 *chip = card->private_data; |
1544 | int i; | 1544 | int i; |
1545 | 1545 | ||
1546 | pci_restore_state(pci); | ||
1547 | pci_enable_device(pci); | ||
1548 | pci_set_power_state(pci, PCI_D0); | 1546 | pci_set_power_state(pci, PCI_D0); |
1547 | pci_restore_state(pci); | ||
1548 | if (pci_enable_device(pci) < 0) { | ||
1549 | printk(KERN_ERR "fm801: pci_enable_device failed, " | ||
1550 | "disabling device\n"); | ||
1551 | snd_card_disconnect(card); | ||
1552 | return -EIO; | ||
1553 | } | ||
1549 | pci_set_master(pci); | 1554 | pci_set_master(pci); |
1550 | 1555 | ||
1551 | snd_fm801_chip_init(chip, 1); | 1556 | snd_fm801_chip_init(chip, 1); |
diff --git a/sound/pci/hda/hda_intel.c b/sound/pci/hda/hda_intel.c index feeed12920b4..e35cfd326df2 100644 --- a/sound/pci/hda/hda_intel.c +++ b/sound/pci/hda/hda_intel.c | |||
@@ -55,7 +55,7 @@ static char *model; | |||
55 | static int position_fix; | 55 | static int position_fix; |
56 | static int probe_mask = -1; | 56 | static int probe_mask = -1; |
57 | static int single_cmd; | 57 | static int single_cmd; |
58 | static int disable_msi; | 58 | static int enable_msi; |
59 | 59 | ||
60 | module_param(index, int, 0444); | 60 | module_param(index, int, 0444); |
61 | MODULE_PARM_DESC(index, "Index value for Intel HD audio interface."); | 61 | MODULE_PARM_DESC(index, "Index value for Intel HD audio interface."); |
@@ -69,8 +69,8 @@ module_param(probe_mask, int, 0444); | |||
69 | MODULE_PARM_DESC(probe_mask, "Bitmask to probe codecs (default = -1)."); | 69 | MODULE_PARM_DESC(probe_mask, "Bitmask to probe codecs (default = -1)."); |
70 | module_param(single_cmd, bool, 0444); | 70 | module_param(single_cmd, bool, 0444); |
71 | MODULE_PARM_DESC(single_cmd, "Use single command to communicate with codecs (for debugging only)."); | 71 | MODULE_PARM_DESC(single_cmd, "Use single command to communicate with codecs (for debugging only)."); |
72 | module_param(disable_msi, int, 0); | 72 | module_param(enable_msi, int, 0); |
73 | MODULE_PARM_DESC(disable_msi, "Disable Message Signaled Interrupt (MSI)"); | 73 | MODULE_PARM_DESC(enable_msi, "Enable Message Signaled Interrupt (MSI)"); |
74 | 74 | ||
75 | 75 | ||
76 | /* just for backward compatibility */ | 76 | /* just for backward compatibility */ |
@@ -86,6 +86,7 @@ MODULE_SUPPORTED_DEVICE("{{Intel, ICH6}," | |||
86 | "{ATI, SB450}," | 86 | "{ATI, SB450}," |
87 | "{ATI, SB600}," | 87 | "{ATI, SB600}," |
88 | "{ATI, RS600}," | 88 | "{ATI, RS600}," |
89 | "{ATI, RS690}," | ||
89 | "{VIA, VT8251}," | 90 | "{VIA, VT8251}," |
90 | "{VIA, VT8237A}," | 91 | "{VIA, VT8237A}," |
91 | "{SiS, SIS966}," | 92 | "{SiS, SIS966}," |
@@ -336,6 +337,7 @@ struct azx { | |||
336 | unsigned int initialized :1; | 337 | unsigned int initialized :1; |
337 | unsigned int single_cmd :1; | 338 | unsigned int single_cmd :1; |
338 | unsigned int polling_mode :1; | 339 | unsigned int polling_mode :1; |
340 | unsigned int msi :1; | ||
339 | }; | 341 | }; |
340 | 342 | ||
341 | /* driver types */ | 343 | /* driver types */ |
@@ -396,6 +398,7 @@ static char *driver_short_names[] __devinitdata = { | |||
396 | */ | 398 | */ |
397 | #define upper_32bit(addr) (sizeof(addr) > 4 ? (u32)((addr) >> 32) : (u32)0) | 399 | #define upper_32bit(addr) (sizeof(addr) > 4 ? (u32)((addr) >> 32) : (u32)0) |
398 | 400 | ||
401 | static int azx_acquire_irq(struct azx *chip, int do_disconnect); | ||
399 | 402 | ||
400 | /* | 403 | /* |
401 | * Interface for HD codec | 404 | * Interface for HD codec |
@@ -535,6 +538,18 @@ static unsigned int azx_rirb_get_response(struct hda_codec *codec) | |||
535 | schedule_timeout_interruptible(1); | 538 | schedule_timeout_interruptible(1); |
536 | } while (time_after_eq(timeout, jiffies)); | 539 | } while (time_after_eq(timeout, jiffies)); |
537 | 540 | ||
541 | if (chip->msi) { | ||
542 | snd_printk(KERN_WARNING "hda_intel: No response from codec, " | ||
543 | "disabling MSI...\n"); | ||
544 | free_irq(chip->irq, chip); | ||
545 | chip->irq = -1; | ||
546 | pci_disable_msi(chip->pci); | ||
547 | chip->msi = 0; | ||
548 | if (azx_acquire_irq(chip, 1) < 0) | ||
549 | return -1; | ||
550 | goto again; | ||
551 | } | ||
552 | |||
538 | if (!chip->polling_mode) { | 553 | if (!chip->polling_mode) { |
539 | snd_printk(KERN_WARNING "hda_intel: azx_get_response timeout, " | 554 | snd_printk(KERN_WARNING "hda_intel: azx_get_response timeout, " |
540 | "switching to polling mode...\n"); | 555 | "switching to polling mode...\n"); |
@@ -1363,6 +1378,20 @@ static int __devinit azx_init_stream(struct azx *chip) | |||
1363 | return 0; | 1378 | return 0; |
1364 | } | 1379 | } |
1365 | 1380 | ||
1381 | static int azx_acquire_irq(struct azx *chip, int do_disconnect) | ||
1382 | { | ||
1383 | if (request_irq(chip->pci->irq, azx_interrupt, IRQF_DISABLED|IRQF_SHARED, | ||
1384 | "HDA Intel", chip)) { | ||
1385 | printk(KERN_ERR "hda-intel: unable to grab IRQ %d, " | ||
1386 | "disabling device\n", chip->pci->irq); | ||
1387 | if (do_disconnect) | ||
1388 | snd_card_disconnect(chip->card); | ||
1389 | return -1; | ||
1390 | } | ||
1391 | chip->irq = chip->pci->irq; | ||
1392 | return 0; | ||
1393 | } | ||
1394 | |||
1366 | 1395 | ||
1367 | #ifdef CONFIG_PM | 1396 | #ifdef CONFIG_PM |
1368 | /* | 1397 | /* |
@@ -1379,12 +1408,16 @@ static int azx_suspend(struct pci_dev *pci, pm_message_t state) | |||
1379 | snd_pcm_suspend_all(chip->pcm[i]); | 1408 | snd_pcm_suspend_all(chip->pcm[i]); |
1380 | snd_hda_suspend(chip->bus, state); | 1409 | snd_hda_suspend(chip->bus, state); |
1381 | azx_free_cmd_io(chip); | 1410 | azx_free_cmd_io(chip); |
1382 | if (chip->irq >= 0) | 1411 | if (chip->irq >= 0) { |
1412 | synchronize_irq(chip->irq); | ||
1383 | free_irq(chip->irq, chip); | 1413 | free_irq(chip->irq, chip); |
1384 | if (!disable_msi) | 1414 | chip->irq = -1; |
1415 | } | ||
1416 | if (chip->msi) | ||
1385 | pci_disable_msi(chip->pci); | 1417 | pci_disable_msi(chip->pci); |
1386 | pci_disable_device(pci); | 1418 | pci_disable_device(pci); |
1387 | pci_save_state(pci); | 1419 | pci_save_state(pci); |
1420 | pci_set_power_state(pci, pci_choose_state(pci, state)); | ||
1388 | return 0; | 1421 | return 0; |
1389 | } | 1422 | } |
1390 | 1423 | ||
@@ -1393,15 +1426,20 @@ static int azx_resume(struct pci_dev *pci) | |||
1393 | struct snd_card *card = pci_get_drvdata(pci); | 1426 | struct snd_card *card = pci_get_drvdata(pci); |
1394 | struct azx *chip = card->private_data; | 1427 | struct azx *chip = card->private_data; |
1395 | 1428 | ||
1429 | pci_set_power_state(pci, PCI_D0); | ||
1396 | pci_restore_state(pci); | 1430 | pci_restore_state(pci); |
1397 | pci_enable_device(pci); | 1431 | if (pci_enable_device(pci) < 0) { |
1398 | if (!disable_msi) | 1432 | printk(KERN_ERR "hda-intel: pci_enable_device failed, " |
1399 | pci_enable_msi(pci); | 1433 | "disabling device\n"); |
1400 | /* FIXME: need proper error handling */ | 1434 | snd_card_disconnect(card); |
1401 | request_irq(pci->irq, azx_interrupt, IRQF_DISABLED|IRQF_SHARED, | 1435 | return -EIO; |
1402 | "HDA Intel", chip); | 1436 | } |
1403 | chip->irq = pci->irq; | ||
1404 | pci_set_master(pci); | 1437 | pci_set_master(pci); |
1438 | if (chip->msi) | ||
1439 | if (pci_enable_msi(pci) < 0) | ||
1440 | chip->msi = 0; | ||
1441 | if (azx_acquire_irq(chip, 1) < 0) | ||
1442 | return -EIO; | ||
1405 | azx_init_chip(chip); | 1443 | azx_init_chip(chip); |
1406 | snd_hda_resume(chip->bus); | 1444 | snd_hda_resume(chip->bus); |
1407 | snd_power_change_state(card, SNDRV_CTL_POWER_D0); | 1445 | snd_power_change_state(card, SNDRV_CTL_POWER_D0); |
@@ -1431,15 +1469,14 @@ static int azx_free(struct azx *chip) | |||
1431 | /* disable position buffer */ | 1469 | /* disable position buffer */ |
1432 | azx_writel(chip, DPLBASE, 0); | 1470 | azx_writel(chip, DPLBASE, 0); |
1433 | azx_writel(chip, DPUBASE, 0); | 1471 | azx_writel(chip, DPUBASE, 0); |
1434 | |||
1435 | synchronize_irq(chip->irq); | ||
1436 | } | 1472 | } |
1437 | 1473 | ||
1438 | if (chip->irq >= 0) { | 1474 | if (chip->irq >= 0) { |
1475 | synchronize_irq(chip->irq); | ||
1439 | free_irq(chip->irq, (void*)chip); | 1476 | free_irq(chip->irq, (void*)chip); |
1440 | if (!disable_msi) | ||
1441 | pci_disable_msi(chip->pci); | ||
1442 | } | 1477 | } |
1478 | if (chip->msi) | ||
1479 | pci_disable_msi(chip->pci); | ||
1443 | if (chip->remap_addr) | 1480 | if (chip->remap_addr) |
1444 | iounmap(chip->remap_addr); | 1481 | iounmap(chip->remap_addr); |
1445 | 1482 | ||
@@ -1494,6 +1531,7 @@ static int __devinit azx_create(struct snd_card *card, struct pci_dev *pci, | |||
1494 | chip->pci = pci; | 1531 | chip->pci = pci; |
1495 | chip->irq = -1; | 1532 | chip->irq = -1; |
1496 | chip->driver_type = driver_type; | 1533 | chip->driver_type = driver_type; |
1534 | chip->msi = enable_msi; | ||
1497 | 1535 | ||
1498 | chip->position_fix = position_fix; | 1536 | chip->position_fix = position_fix; |
1499 | chip->single_cmd = single_cmd; | 1537 | chip->single_cmd = single_cmd; |
@@ -1523,16 +1561,14 @@ static int __devinit azx_create(struct snd_card *card, struct pci_dev *pci, | |||
1523 | goto errout; | 1561 | goto errout; |
1524 | } | 1562 | } |
1525 | 1563 | ||
1526 | if (!disable_msi) | 1564 | if (chip->msi) |
1527 | pci_enable_msi(pci); | 1565 | if (pci_enable_msi(pci) < 0) |
1566 | chip->msi = 0; | ||
1528 | 1567 | ||
1529 | if (request_irq(pci->irq, azx_interrupt, IRQF_DISABLED|IRQF_SHARED, | 1568 | if (azx_acquire_irq(chip, 0) < 0) { |
1530 | "HDA Intel", (void*)chip)) { | ||
1531 | snd_printk(KERN_ERR SFX "unable to grab IRQ %d\n", pci->irq); | ||
1532 | err = -EBUSY; | 1569 | err = -EBUSY; |
1533 | goto errout; | 1570 | goto errout; |
1534 | } | 1571 | } |
1535 | chip->irq = pci->irq; | ||
1536 | 1572 | ||
1537 | pci_set_master(pci); | 1573 | pci_set_master(pci); |
1538 | synchronize_irq(chip->irq); | 1574 | synchronize_irq(chip->irq); |
@@ -1677,6 +1713,7 @@ static struct pci_device_id azx_ids[] = { | |||
1677 | { 0x1002, 0x437b, PCI_ANY_ID, PCI_ANY_ID, 0, 0, AZX_DRIVER_ATI }, /* ATI SB450 */ | 1713 | { 0x1002, 0x437b, PCI_ANY_ID, PCI_ANY_ID, 0, 0, AZX_DRIVER_ATI }, /* ATI SB450 */ |
1678 | { 0x1002, 0x4383, PCI_ANY_ID, PCI_ANY_ID, 0, 0, AZX_DRIVER_ATI }, /* ATI SB600 */ | 1714 | { 0x1002, 0x4383, PCI_ANY_ID, PCI_ANY_ID, 0, 0, AZX_DRIVER_ATI }, /* ATI SB600 */ |
1679 | { 0x1002, 0x793b, PCI_ANY_ID, PCI_ANY_ID, 0, 0, AZX_DRIVER_ATIHDMI }, /* ATI RS600 HDMI */ | 1715 | { 0x1002, 0x793b, PCI_ANY_ID, PCI_ANY_ID, 0, 0, AZX_DRIVER_ATIHDMI }, /* ATI RS600 HDMI */ |
1716 | { 0x1002, 0x7919, PCI_ANY_ID, PCI_ANY_ID, 0, 0, AZX_DRIVER_ATIHDMI }, /* ATI RS690 HDMI */ | ||
1680 | { 0x1106, 0x3288, PCI_ANY_ID, PCI_ANY_ID, 0, 0, AZX_DRIVER_VIA }, /* VIA VT8251/VT8237A */ | 1717 | { 0x1106, 0x3288, PCI_ANY_ID, PCI_ANY_ID, 0, 0, AZX_DRIVER_VIA }, /* VIA VT8251/VT8237A */ |
1681 | { 0x1039, 0x7502, PCI_ANY_ID, PCI_ANY_ID, 0, 0, AZX_DRIVER_SIS }, /* SIS966 */ | 1718 | { 0x1039, 0x7502, PCI_ANY_ID, PCI_ANY_ID, 0, 0, AZX_DRIVER_SIS }, /* SIS966 */ |
1682 | { 0x10b9, 0x5461, PCI_ANY_ID, PCI_ANY_ID, 0, 0, AZX_DRIVER_ULI }, /* ULI M5461 */ | 1719 | { 0x10b9, 0x5461, PCI_ANY_ID, PCI_ANY_ID, 0, 0, AZX_DRIVER_ULI }, /* ULI M5461 */ |
diff --git a/sound/pci/hda/patch_analog.c b/sound/pci/hda/patch_analog.c index 511df07fa2a3..edd22dec8286 100644 --- a/sound/pci/hda/patch_analog.c +++ b/sound/pci/hda/patch_analog.c | |||
@@ -818,6 +818,8 @@ static struct hda_board_config ad1986a_cfg_tbl[] = { | |||
818 | .config = AD1986A_LAPTOP_EAPD }, /* ASUS A6J */ | 818 | .config = AD1986A_LAPTOP_EAPD }, /* ASUS A6J */ |
819 | { .pci_subvendor = 0x1043, .pci_subdevice = 0x11f7, | 819 | { .pci_subvendor = 0x1043, .pci_subdevice = 0x11f7, |
820 | .config = AD1986A_LAPTOP_EAPD }, /* ASUS U5A */ | 820 | .config = AD1986A_LAPTOP_EAPD }, /* ASUS U5A */ |
821 | { .pci_subvendor = 0x1043, .pci_subdevice = 0x1263, | ||
822 | .config = AD1986A_LAPTOP_EAPD }, /* ASUS U5F */ | ||
821 | { .pci_subvendor = 0x1043, .pci_subdevice = 0x1297, | 823 | { .pci_subvendor = 0x1043, .pci_subdevice = 0x1297, |
822 | .config = AD1986A_LAPTOP_EAPD }, /* ASUS Z62F */ | 824 | .config = AD1986A_LAPTOP_EAPD }, /* ASUS Z62F */ |
823 | { .pci_subvendor = 0x103c, .pci_subdevice = 0x30af, | 825 | { .pci_subvendor = 0x103c, .pci_subdevice = 0x30af, |
diff --git a/sound/pci/hda/patch_atihdmi.c b/sound/pci/hda/patch_atihdmi.c index a27440ffd1c8..7333f275decd 100644 --- a/sound/pci/hda/patch_atihdmi.c +++ b/sound/pci/hda/patch_atihdmi.c | |||
@@ -161,5 +161,6 @@ static int patch_atihdmi(struct hda_codec *codec) | |||
161 | */ | 161 | */ |
162 | struct hda_codec_preset snd_hda_preset_atihdmi[] = { | 162 | struct hda_codec_preset snd_hda_preset_atihdmi[] = { |
163 | { .id = 0x1002793c, .name = "ATI RS600 HDMI", .patch = patch_atihdmi }, | 163 | { .id = 0x1002793c, .name = "ATI RS600 HDMI", .patch = patch_atihdmi }, |
164 | { .id = 0x1002791a, .name = "ATI RS690 HDMI", .patch = patch_atihdmi }, | ||
164 | {} /* terminator */ | 165 | {} /* terminator */ |
165 | }; | 166 | }; |
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c index 84a3eb8aacc2..fb961448db19 100644 --- a/sound/pci/hda/patch_realtek.c +++ b/sound/pci/hda/patch_realtek.c | |||
@@ -1799,7 +1799,7 @@ static int alc_build_pcms(struct hda_codec *codec) | |||
1799 | /* SPDIF for stream index #1 */ | 1799 | /* SPDIF for stream index #1 */ |
1800 | if (spec->multiout.dig_out_nid || spec->dig_in_nid) { | 1800 | if (spec->multiout.dig_out_nid || spec->dig_in_nid) { |
1801 | codec->num_pcms = 2; | 1801 | codec->num_pcms = 2; |
1802 | info++; | 1802 | info = spec->pcm_rec + 1; |
1803 | info->name = spec->stream_name_digital; | 1803 | info->name = spec->stream_name_digital; |
1804 | if (spec->multiout.dig_out_nid && | 1804 | if (spec->multiout.dig_out_nid && |
1805 | spec->stream_digital_playback) { | 1805 | spec->stream_digital_playback) { |
@@ -1820,7 +1820,7 @@ static int alc_build_pcms(struct hda_codec *codec) | |||
1820 | if (spec->num_adc_nids > 1 && spec->stream_analog_capture && | 1820 | if (spec->num_adc_nids > 1 && spec->stream_analog_capture && |
1821 | spec->adc_nids) { | 1821 | spec->adc_nids) { |
1822 | codec->num_pcms = 3; | 1822 | codec->num_pcms = 3; |
1823 | info++; | 1823 | info = spec->pcm_rec + 2; |
1824 | info->name = spec->stream_name_analog; | 1824 | info->name = spec->stream_name_analog; |
1825 | /* No playback stream for second PCM */ | 1825 | /* No playback stream for second PCM */ |
1826 | info->stream[SNDRV_PCM_STREAM_PLAYBACK] = alc_pcm_null_playback; | 1826 | info->stream[SNDRV_PCM_STREAM_PLAYBACK] = alc_pcm_null_playback; |
@@ -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/pci/intel8x0.c b/sound/pci/intel8x0.c index f4319b8d4644..9c1bce7afa86 100644 --- a/sound/pci/intel8x0.c +++ b/sound/pci/intel8x0.c | |||
@@ -1962,6 +1962,12 @@ static struct ac97_quirk ac97_quirks[] __devinitdata = { | |||
1962 | .type = AC97_TUNE_HP_ONLY | 1962 | .type = AC97_TUNE_HP_ONLY |
1963 | }, | 1963 | }, |
1964 | { | 1964 | { |
1965 | .subvendor = 0x10f7, | ||
1966 | .subdevice = 0x834c, | ||
1967 | .name = "Panasonic CF-R4", | ||
1968 | .type = AC97_TUNE_HP_ONLY, | ||
1969 | }, | ||
1970 | { | ||
1965 | .subvendor = 0x110a, | 1971 | .subvendor = 0x110a, |
1966 | .subdevice = 0x0056, | 1972 | .subdevice = 0x0056, |
1967 | .name = "Fujitsu-Siemens Scenic", /* AD1981? */ | 1973 | .name = "Fujitsu-Siemens Scenic", /* AD1981? */ |
@@ -2476,10 +2482,14 @@ static int intel8x0_suspend(struct pci_dev *pci, pm_message_t state) | |||
2476 | if (chip->device_type == DEVICE_INTEL_ICH4) | 2482 | if (chip->device_type == DEVICE_INTEL_ICH4) |
2477 | chip->sdm_saved = igetbyte(chip, ICHREG(SDM)); | 2483 | chip->sdm_saved = igetbyte(chip, ICHREG(SDM)); |
2478 | 2484 | ||
2479 | if (chip->irq >= 0) | 2485 | if (chip->irq >= 0) { |
2486 | synchronize_irq(chip->irq); | ||
2480 | free_irq(chip->irq, chip); | 2487 | free_irq(chip->irq, chip); |
2488 | chip->irq = -1; | ||
2489 | } | ||
2481 | pci_disable_device(pci); | 2490 | pci_disable_device(pci); |
2482 | pci_save_state(pci); | 2491 | pci_save_state(pci); |
2492 | pci_set_power_state(pci, pci_choose_state(pci, state)); | ||
2483 | return 0; | 2493 | return 0; |
2484 | } | 2494 | } |
2485 | 2495 | ||
@@ -2489,11 +2499,22 @@ static int intel8x0_resume(struct pci_dev *pci) | |||
2489 | struct intel8x0 *chip = card->private_data; | 2499 | struct intel8x0 *chip = card->private_data; |
2490 | int i; | 2500 | int i; |
2491 | 2501 | ||
2502 | pci_set_power_state(pci, PCI_D0); | ||
2492 | pci_restore_state(pci); | 2503 | pci_restore_state(pci); |
2493 | pci_enable_device(pci); | 2504 | if (pci_enable_device(pci) < 0) { |
2505 | printk(KERN_ERR "intel8x0: pci_enable_device failed, " | ||
2506 | "disabling device\n"); | ||
2507 | snd_card_disconnect(card); | ||
2508 | return -EIO; | ||
2509 | } | ||
2494 | pci_set_master(pci); | 2510 | pci_set_master(pci); |
2495 | request_irq(pci->irq, snd_intel8x0_interrupt, IRQF_DISABLED|IRQF_SHARED, | 2511 | if (request_irq(pci->irq, snd_intel8x0_interrupt, |
2496 | card->shortname, chip); | 2512 | IRQF_DISABLED|IRQF_SHARED, card->shortname, chip)) { |
2513 | printk(KERN_ERR "intel8x0: unable to grab IRQ %d, " | ||
2514 | "disabling device\n", pci->irq); | ||
2515 | snd_card_disconnect(card); | ||
2516 | return -EIO; | ||
2517 | } | ||
2497 | chip->irq = pci->irq; | 2518 | chip->irq = pci->irq; |
2498 | synchronize_irq(chip->irq); | 2519 | synchronize_irq(chip->irq); |
2499 | snd_intel8x0_chip_init(chip, 0); | 2520 | snd_intel8x0_chip_init(chip, 0); |
diff --git a/sound/pci/intel8x0m.c b/sound/pci/intel8x0m.c index 6703f5cb5569..bd467c501123 100644 --- a/sound/pci/intel8x0m.c +++ b/sound/pci/intel8x0m.c | |||
@@ -1045,10 +1045,14 @@ static int intel8x0m_suspend(struct pci_dev *pci, pm_message_t state) | |||
1045 | for (i = 0; i < chip->pcm_devs; i++) | 1045 | for (i = 0; i < chip->pcm_devs; i++) |
1046 | snd_pcm_suspend_all(chip->pcm[i]); | 1046 | snd_pcm_suspend_all(chip->pcm[i]); |
1047 | snd_ac97_suspend(chip->ac97); | 1047 | snd_ac97_suspend(chip->ac97); |
1048 | if (chip->irq >= 0) | 1048 | if (chip->irq >= 0) { |
1049 | synchronize_irq(chip->irq); | ||
1049 | free_irq(chip->irq, chip); | 1050 | free_irq(chip->irq, chip); |
1051 | chip->irq = -1; | ||
1052 | } | ||
1050 | pci_disable_device(pci); | 1053 | pci_disable_device(pci); |
1051 | pci_save_state(pci); | 1054 | pci_save_state(pci); |
1055 | pci_set_power_state(pci, pci_choose_state(pci, state)); | ||
1052 | return 0; | 1056 | return 0; |
1053 | } | 1057 | } |
1054 | 1058 | ||
@@ -1057,11 +1061,22 @@ static int intel8x0m_resume(struct pci_dev *pci) | |||
1057 | struct snd_card *card = pci_get_drvdata(pci); | 1061 | struct snd_card *card = pci_get_drvdata(pci); |
1058 | struct intel8x0m *chip = card->private_data; | 1062 | struct intel8x0m *chip = card->private_data; |
1059 | 1063 | ||
1064 | pci_set_power_state(pci, PCI_D0); | ||
1060 | pci_restore_state(pci); | 1065 | pci_restore_state(pci); |
1061 | pci_enable_device(pci); | 1066 | if (pci_enable_device(pci) < 0) { |
1067 | printk(KERN_ERR "intel8x0m: pci_enable_device failed, " | ||
1068 | "disabling device\n"); | ||
1069 | snd_card_disconnect(card); | ||
1070 | return -EIO; | ||
1071 | } | ||
1062 | pci_set_master(pci); | 1072 | pci_set_master(pci); |
1063 | request_irq(pci->irq, snd_intel8x0_interrupt, IRQF_DISABLED|IRQF_SHARED, | 1073 | if (request_irq(pci->irq, snd_intel8x0_interrupt, |
1064 | card->shortname, chip); | 1074 | IRQF_DISABLED|IRQF_SHARED, card->shortname, chip)) { |
1075 | printk(KERN_ERR "intel8x0m: unable to grab IRQ %d, " | ||
1076 | "disabling device\n", pci->irq); | ||
1077 | snd_card_disconnect(card); | ||
1078 | return -EIO; | ||
1079 | } | ||
1065 | chip->irq = pci->irq; | 1080 | chip->irq = pci->irq; |
1066 | snd_intel8x0_chip_init(chip, 0); | 1081 | snd_intel8x0_chip_init(chip, 0); |
1067 | snd_ac97_resume(chip->ac97); | 1082 | snd_ac97_resume(chip->ac97); |
diff --git a/sound/pci/maestro3.c b/sound/pci/maestro3.c index 05605f474a72..8cab342bbaaf 100644 --- a/sound/pci/maestro3.c +++ b/sound/pci/maestro3.c | |||
@@ -2589,12 +2589,9 @@ static int m3_suspend(struct pci_dev *pci, pm_message_t state) | |||
2589 | chip->suspend_mem[index++] = | 2589 | chip->suspend_mem[index++] = |
2590 | snd_m3_assp_read(chip, MEMTYPE_INTERNAL_DATA, i); | 2590 | snd_m3_assp_read(chip, MEMTYPE_INTERNAL_DATA, i); |
2591 | 2591 | ||
2592 | /* power down apci registers */ | ||
2593 | snd_m3_outw(chip, 0xffff, 0x54); | ||
2594 | snd_m3_outw(chip, 0xffff, 0x56); | ||
2595 | |||
2596 | pci_disable_device(pci); | 2592 | pci_disable_device(pci); |
2597 | pci_save_state(pci); | 2593 | pci_save_state(pci); |
2594 | pci_set_power_state(pci, pci_choose_state(pci, state)); | ||
2598 | return 0; | 2595 | return 0; |
2599 | } | 2596 | } |
2600 | 2597 | ||
@@ -2607,8 +2604,14 @@ static int m3_resume(struct pci_dev *pci) | |||
2607 | if (chip->suspend_mem == NULL) | 2604 | if (chip->suspend_mem == NULL) |
2608 | return 0; | 2605 | return 0; |
2609 | 2606 | ||
2607 | pci_set_power_state(pci, PCI_D0); | ||
2610 | pci_restore_state(pci); | 2608 | pci_restore_state(pci); |
2611 | pci_enable_device(pci); | 2609 | if (pci_enable_device(pci) < 0) { |
2610 | printk(KERN_ERR "maestor3: pci_enable_device failed, " | ||
2611 | "disabling device\n"); | ||
2612 | snd_card_disconnect(card); | ||
2613 | return -EIO; | ||
2614 | } | ||
2612 | pci_set_master(pci); | 2615 | pci_set_master(pci); |
2613 | 2616 | ||
2614 | /* first lets just bring everything back. .*/ | 2617 | /* first lets just bring everything back. .*/ |
diff --git a/sound/pci/nm256/nm256.c b/sound/pci/nm256/nm256.c index b1bbdb9e3b7b..945d21bf187e 100644 --- a/sound/pci/nm256/nm256.c +++ b/sound/pci/nm256/nm256.c | |||
@@ -1390,6 +1390,7 @@ static int nm256_suspend(struct pci_dev *pci, pm_message_t state) | |||
1390 | chip->coeffs_current = 0; | 1390 | chip->coeffs_current = 0; |
1391 | pci_disable_device(pci); | 1391 | pci_disable_device(pci); |
1392 | pci_save_state(pci); | 1392 | pci_save_state(pci); |
1393 | pci_set_power_state(pci, pci_choose_state(pci, state)); | ||
1393 | return 0; | 1394 | return 0; |
1394 | } | 1395 | } |
1395 | 1396 | ||
@@ -1401,8 +1402,17 @@ static int nm256_resume(struct pci_dev *pci) | |||
1401 | 1402 | ||
1402 | /* Perform a full reset on the hardware */ | 1403 | /* Perform a full reset on the hardware */ |
1403 | chip->in_resume = 1; | 1404 | chip->in_resume = 1; |
1405 | |||
1406 | pci_set_power_state(pci, PCI_D0); | ||
1404 | pci_restore_state(pci); | 1407 | pci_restore_state(pci); |
1405 | pci_enable_device(pci); | 1408 | if (pci_enable_device(pci) < 0) { |
1409 | printk(KERN_ERR "nm256: pci_enable_device failed, " | ||
1410 | "disabling device\n"); | ||
1411 | snd_card_disconnect(card); | ||
1412 | return -EIO; | ||
1413 | } | ||
1414 | pci_set_master(pci); | ||
1415 | |||
1406 | snd_nm256_init_chip(chip); | 1416 | snd_nm256_init_chip(chip); |
1407 | 1417 | ||
1408 | /* restore ac97 */ | 1418 | /* restore ac97 */ |
diff --git a/sound/pci/riptide/riptide.c b/sound/pci/riptide/riptide.c index ec4899147e1d..56e0c01123e7 100644 --- a/sound/pci/riptide/riptide.c +++ b/sound/pci/riptide/riptide.c | |||
@@ -1178,9 +1178,9 @@ static int riptide_suspend(struct pci_dev *pci, pm_message_t state) | |||
1178 | snd_power_change_state(card, SNDRV_CTL_POWER_D3hot); | 1178 | snd_power_change_state(card, SNDRV_CTL_POWER_D3hot); |
1179 | snd_pcm_suspend_all(chip->pcm); | 1179 | snd_pcm_suspend_all(chip->pcm); |
1180 | snd_ac97_suspend(chip->ac97); | 1180 | snd_ac97_suspend(chip->ac97); |
1181 | pci_set_power_state(pci, PCI_D3hot); | ||
1182 | pci_disable_device(pci); | 1181 | pci_disable_device(pci); |
1183 | pci_save_state(pci); | 1182 | pci_save_state(pci); |
1183 | pci_set_power_state(pci, pci_choose_state(pci, state)); | ||
1184 | return 0; | 1184 | return 0; |
1185 | } | 1185 | } |
1186 | 1186 | ||
@@ -1189,9 +1189,14 @@ static int riptide_resume(struct pci_dev *pci) | |||
1189 | struct snd_card *card = pci_get_drvdata(pci); | 1189 | struct snd_card *card = pci_get_drvdata(pci); |
1190 | struct snd_riptide *chip = card->private_data; | 1190 | struct snd_riptide *chip = card->private_data; |
1191 | 1191 | ||
1192 | pci_restore_state(pci); | ||
1193 | pci_enable_device(pci); | ||
1194 | pci_set_power_state(pci, PCI_D0); | 1192 | pci_set_power_state(pci, PCI_D0); |
1193 | pci_restore_state(pci); | ||
1194 | if (pci_enable_device(pci) < 0) { | ||
1195 | printk(KERN_ERR "riptide: pci_enable_device failed, " | ||
1196 | "disabling device\n"); | ||
1197 | snd_card_disconnect(card); | ||
1198 | return -EIO; | ||
1199 | } | ||
1195 | pci_set_master(pci); | 1200 | pci_set_master(pci); |
1196 | snd_riptide_initialize(chip); | 1201 | snd_riptide_initialize(chip); |
1197 | snd_ac97_resume(chip->ac97); | 1202 | snd_ac97_resume(chip->ac97); |
diff --git a/sound/pci/trident/trident_main.c b/sound/pci/trident/trident_main.c index 0d478871808d..1fbc4321122f 100644 --- a/sound/pci/trident/trident_main.c +++ b/sound/pci/trident/trident_main.c | |||
@@ -3966,15 +3966,9 @@ int snd_trident_suspend(struct pci_dev *pci, pm_message_t state) | |||
3966 | snd_ac97_suspend(trident->ac97); | 3966 | snd_ac97_suspend(trident->ac97); |
3967 | snd_ac97_suspend(trident->ac97_sec); | 3967 | snd_ac97_suspend(trident->ac97_sec); |
3968 | 3968 | ||
3969 | switch (trident->device) { | ||
3970 | case TRIDENT_DEVICE_ID_DX: | ||
3971 | case TRIDENT_DEVICE_ID_NX: | ||
3972 | break; /* TODO */ | ||
3973 | case TRIDENT_DEVICE_ID_SI7018: | ||
3974 | break; | ||
3975 | } | ||
3976 | pci_disable_device(pci); | 3969 | pci_disable_device(pci); |
3977 | pci_save_state(pci); | 3970 | pci_save_state(pci); |
3971 | pci_set_power_state(pci, pci_choose_state(pci, state)); | ||
3978 | return 0; | 3972 | return 0; |
3979 | } | 3973 | } |
3980 | 3974 | ||
@@ -3983,9 +3977,15 @@ int snd_trident_resume(struct pci_dev *pci) | |||
3983 | struct snd_card *card = pci_get_drvdata(pci); | 3977 | struct snd_card *card = pci_get_drvdata(pci); |
3984 | struct snd_trident *trident = card->private_data; | 3978 | struct snd_trident *trident = card->private_data; |
3985 | 3979 | ||
3980 | pci_set_power_state(pci, PCI_D0); | ||
3986 | pci_restore_state(pci); | 3981 | pci_restore_state(pci); |
3987 | pci_enable_device(pci); | 3982 | if (pci_enable_device(pci) < 0) { |
3988 | pci_set_master(pci); /* to be sure */ | 3983 | printk(KERN_ERR "trident: pci_enable_device failed, " |
3984 | "disabling device\n"); | ||
3985 | snd_card_disconnect(card); | ||
3986 | return -EIO; | ||
3987 | } | ||
3988 | pci_set_master(pci); | ||
3989 | 3989 | ||
3990 | switch (trident->device) { | 3990 | switch (trident->device) { |
3991 | case TRIDENT_DEVICE_ID_DX: | 3991 | case TRIDENT_DEVICE_ID_DX: |
diff --git a/sound/pci/via82xx.c b/sound/pci/via82xx.c index e6990e0bbf23..92b0736c0fdb 100644 --- a/sound/pci/via82xx.c +++ b/sound/pci/via82xx.c | |||
@@ -2185,9 +2185,9 @@ static int snd_via82xx_suspend(struct pci_dev *pci, pm_message_t state) | |||
2185 | chip->capture_src_saved[1] = inb(chip->port + VIA_REG_CAPTURE_CHANNEL + 0x10); | 2185 | chip->capture_src_saved[1] = inb(chip->port + VIA_REG_CAPTURE_CHANNEL + 0x10); |
2186 | } | 2186 | } |
2187 | 2187 | ||
2188 | pci_set_power_state(pci, PCI_D3hot); | ||
2189 | pci_disable_device(pci); | 2188 | pci_disable_device(pci); |
2190 | pci_save_state(pci); | 2189 | pci_save_state(pci); |
2190 | pci_set_power_state(pci, pci_choose_state(pci, state)); | ||
2191 | return 0; | 2191 | return 0; |
2192 | } | 2192 | } |
2193 | 2193 | ||
@@ -2197,9 +2197,15 @@ static int snd_via82xx_resume(struct pci_dev *pci) | |||
2197 | struct via82xx *chip = card->private_data; | 2197 | struct via82xx *chip = card->private_data; |
2198 | int i; | 2198 | int i; |
2199 | 2199 | ||
2200 | pci_restore_state(pci); | ||
2201 | pci_enable_device(pci); | ||
2202 | pci_set_power_state(pci, PCI_D0); | 2200 | pci_set_power_state(pci, PCI_D0); |
2201 | pci_restore_state(pci); | ||
2202 | if (pci_enable_device(pci) < 0) { | ||
2203 | printk(KERN_ERR "via82xx: pci_enable_device failed, " | ||
2204 | "disabling device\n"); | ||
2205 | snd_card_disconnect(card); | ||
2206 | return -EIO; | ||
2207 | } | ||
2208 | pci_set_master(pci); | ||
2203 | 2209 | ||
2204 | snd_via82xx_chip_init(chip); | 2210 | snd_via82xx_chip_init(chip); |
2205 | 2211 | ||
diff --git a/sound/pci/via82xx_modem.c b/sound/pci/via82xx_modem.c index 5ab1cf3d434b..feb27c966256 100644 --- a/sound/pci/via82xx_modem.c +++ b/sound/pci/via82xx_modem.c | |||
@@ -1032,9 +1032,10 @@ static int snd_via82xx_suspend(struct pci_dev *pci, pm_message_t state) | |||
1032 | snd_via82xx_channel_reset(chip, &chip->devs[i]); | 1032 | snd_via82xx_channel_reset(chip, &chip->devs[i]); |
1033 | synchronize_irq(chip->irq); | 1033 | synchronize_irq(chip->irq); |
1034 | snd_ac97_suspend(chip->ac97); | 1034 | snd_ac97_suspend(chip->ac97); |
1035 | pci_set_power_state(pci, PCI_D3hot); | 1035 | |
1036 | pci_disable_device(pci); | 1036 | pci_disable_device(pci); |
1037 | pci_save_state(pci); | 1037 | pci_save_state(pci); |
1038 | pci_set_power_state(pci, pci_choose_state(pci, state)); | ||
1038 | return 0; | 1039 | return 0; |
1039 | } | 1040 | } |
1040 | 1041 | ||
@@ -1044,9 +1045,14 @@ static int snd_via82xx_resume(struct pci_dev *pci) | |||
1044 | struct via82xx_modem *chip = card->private_data; | 1045 | struct via82xx_modem *chip = card->private_data; |
1045 | int i; | 1046 | int i; |
1046 | 1047 | ||
1047 | pci_restore_state(pci); | ||
1048 | pci_enable_device(pci); | ||
1049 | pci_set_power_state(pci, PCI_D0); | 1048 | pci_set_power_state(pci, PCI_D0); |
1049 | pci_restore_state(pci); | ||
1050 | if (pci_enable_device(pci) < 0) { | ||
1051 | printk(KERN_ERR "via82xx-modem: pci_enable_device failed, " | ||
1052 | "disabling device\n"); | ||
1053 | snd_card_disconnect(card); | ||
1054 | return -EIO; | ||
1055 | } | ||
1050 | pci_set_master(pci); | 1056 | pci_set_master(pci); |
1051 | 1057 | ||
1052 | snd_via82xx_chip_init(chip); | 1058 | snd_via82xx_chip_init(chip); |
diff --git a/sound/pci/vx222/vx222.c b/sound/pci/vx222/vx222.c index e7cd8acab59a..af49e8aabf55 100644 --- a/sound/pci/vx222/vx222.c +++ b/sound/pci/vx222/vx222.c | |||
@@ -266,9 +266,9 @@ static int snd_vx222_suspend(struct pci_dev *pci, pm_message_t state) | |||
266 | int err; | 266 | int err; |
267 | 267 | ||
268 | err = snd_vx_suspend(&vx->core, state); | 268 | err = snd_vx_suspend(&vx->core, state); |
269 | pci_set_power_state(pci, PCI_D3hot); | ||
270 | pci_disable_device(pci); | 269 | pci_disable_device(pci); |
271 | pci_save_state(pci); | 270 | pci_save_state(pci); |
271 | pci_set_power_state(pci, pci_choose_state(pci, state)); | ||
272 | return err; | 272 | return err; |
273 | } | 273 | } |
274 | 274 | ||
@@ -277,9 +277,14 @@ static int snd_vx222_resume(struct pci_dev *pci) | |||
277 | struct snd_card *card = pci_get_drvdata(pci); | 277 | struct snd_card *card = pci_get_drvdata(pci); |
278 | struct snd_vx222 *vx = card->private_data; | 278 | struct snd_vx222 *vx = card->private_data; |
279 | 279 | ||
280 | pci_restore_state(pci); | ||
281 | pci_enable_device(pci); | ||
282 | pci_set_power_state(pci, PCI_D0); | 280 | pci_set_power_state(pci, PCI_D0); |
281 | pci_restore_state(pci); | ||
282 | if (pci_enable_device(pci) < 0) { | ||
283 | printk(KERN_ERR "vx222: pci_enable_device failed, " | ||
284 | "disabling device\n"); | ||
285 | snd_card_disconnect(card); | ||
286 | return -EIO; | ||
287 | } | ||
283 | pci_set_master(pci); | 288 | pci_set_master(pci); |
284 | return snd_vx_resume(&vx->core); | 289 | return snd_vx_resume(&vx->core); |
285 | } | 290 | } |
diff --git a/sound/pci/ymfpci/ymfpci_main.c b/sound/pci/ymfpci/ymfpci_main.c index ebc6da89edf3..a40c1085fd20 100644 --- a/sound/pci/ymfpci/ymfpci_main.c +++ b/sound/pci/ymfpci/ymfpci_main.c | |||
@@ -2218,6 +2218,7 @@ int snd_ymfpci_suspend(struct pci_dev *pci, pm_message_t state) | |||
2218 | snd_ymfpci_disable_dsp(chip); | 2218 | snd_ymfpci_disable_dsp(chip); |
2219 | pci_disable_device(pci); | 2219 | pci_disable_device(pci); |
2220 | pci_save_state(pci); | 2220 | pci_save_state(pci); |
2221 | pci_set_power_state(pci, pci_choose_state(pci, state)); | ||
2221 | return 0; | 2222 | return 0; |
2222 | } | 2223 | } |
2223 | 2224 | ||
@@ -2227,8 +2228,14 @@ int snd_ymfpci_resume(struct pci_dev *pci) | |||
2227 | struct snd_ymfpci *chip = card->private_data; | 2228 | struct snd_ymfpci *chip = card->private_data; |
2228 | unsigned int i; | 2229 | unsigned int i; |
2229 | 2230 | ||
2231 | pci_set_power_state(pci, PCI_D0); | ||
2230 | pci_restore_state(pci); | 2232 | pci_restore_state(pci); |
2231 | pci_enable_device(pci); | 2233 | if (pci_enable_device(pci) < 0) { |
2234 | printk(KERN_ERR "ymfpci: pci_enable_device failed, " | ||
2235 | "disabling device\n"); | ||
2236 | snd_card_disconnect(card); | ||
2237 | return -EIO; | ||
2238 | } | ||
2232 | pci_set_master(pci); | 2239 | pci_set_master(pci); |
2233 | snd_ymfpci_aclink_reset(pci); | 2240 | snd_ymfpci_aclink_reset(pci); |
2234 | snd_ymfpci_codec_ready(chip, 0); | 2241 | snd_ymfpci_codec_ready(chip, 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 | } |