aboutsummaryrefslogtreecommitdiffstats
path: root/sound
diff options
context:
space:
mode:
Diffstat (limited to 'sound')
-rw-r--r--sound/aoa/soundbus/core.c2
-rw-r--r--sound/core/control.c8
-rw-r--r--sound/core/init.c5
-rw-r--r--sound/core/pcm_native.c1
-rw-r--r--sound/core/rawmidi.c8
-rw-r--r--sound/core/timer.c1
-rw-r--r--sound/drivers/ml403-ac97cr.c4
-rw-r--r--sound/drivers/pcsp/pcsp_input.c4
-rw-r--r--sound/isa/ad1848/ad1848.c6
-rw-r--r--sound/isa/adlib.c12
-rw-r--r--sound/isa/cs423x/cs4231.c8
-rw-r--r--sound/isa/cs423x/cs4236.c8
-rw-r--r--sound/isa/es1688/es1688.c9
-rw-r--r--sound/isa/gus/gusclassic.c13
-rw-r--r--sound/isa/gus/gusextreme.c19
-rw-r--r--sound/isa/sb/sb8.c4
-rw-r--r--sound/oss/dmasound/dmasound.h2
-rw-r--r--sound/oss/dmasound/dmasound_core.c4
-rw-r--r--sound/oss/kahlua.c2
-rw-r--r--sound/pci/ac97/ac97_codec.c6
-rw-r--r--sound/pci/ad1889.c2
-rw-r--r--sound/pci/atiixp.c2
-rw-r--r--sound/pci/atiixp_modem.c2
-rw-r--r--sound/pci/au88x0/au88x0.c3
-rw-r--r--sound/pci/bt87x.c3
-rw-r--r--sound/pci/cs4281.c4
-rw-r--r--sound/pci/cs5530.c4
-rw-r--r--sound/pci/emu10k1/emu10k1_main.c3
-rw-r--r--sound/pci/hda/hda_codec.c1
-rw-r--r--sound/pci/hda/hda_intel.c31
-rw-r--r--sound/pci/hda/patch_analog.c1
-rw-r--r--sound/pci/hda/patch_realtek.c106
-rw-r--r--sound/pci/hda/patch_sigmatel.c20
-rw-r--r--sound/pci/ice1712/ice1712.c6
-rw-r--r--sound/pci/intel8x0.c1
-rw-r--r--sound/pci/mixart/mixart.c3
-rw-r--r--sound/soc/blackfin/bf5xx-i2s.c34
-rw-r--r--sound/soc/codecs/wm9713.c2
-rw-r--r--sound/soc/fsl/mpc5200_psc_i2s.c14
-rw-r--r--sound/soc/soc-core.c6
-rw-r--r--sound/sound_core.c2
-rw-r--r--sound/sparc/dbri.c2
-rw-r--r--sound/usb/usbquirks.h30
43 files changed, 296 insertions, 112 deletions
diff --git a/sound/aoa/soundbus/core.c b/sound/aoa/soundbus/core.c
index f84f3e505788..fa8ab2815a98 100644
--- a/sound/aoa/soundbus/core.c
+++ b/sound/aoa/soundbus/core.c
@@ -176,7 +176,7 @@ int soundbus_add_one(struct soundbus_dev *dev)
176 return -EINVAL; 176 return -EINVAL;
177 } 177 }
178 178
179 snprintf(dev->ofdev.dev.bus_id, BUS_ID_SIZE, "soundbus:%x", ++devcount); 179 dev_set_name(&dev->ofdev.dev, "soundbus:%x", ++devcount);
180 dev->ofdev.dev.bus = &soundbus_bus_type; 180 dev->ofdev.dev.bus = &soundbus_bus_type;
181 return of_device_register(&dev->ofdev); 181 return of_device_register(&dev->ofdev);
182} 182}
diff --git a/sound/core/control.c b/sound/core/control.c
index 6d71f9a7ccbb..636b3b52ef8b 100644
--- a/sound/core/control.c
+++ b/sound/core/control.c
@@ -113,7 +113,6 @@ static int snd_ctl_release(struct inode *inode, struct file *file)
113 unsigned int idx; 113 unsigned int idx;
114 114
115 ctl = file->private_data; 115 ctl = file->private_data;
116 fasync_helper(-1, file, 0, &ctl->fasync);
117 file->private_data = NULL; 116 file->private_data = NULL;
118 card = ctl->card; 117 card = ctl->card;
119 write_lock_irqsave(&card->ctl_files_rwlock, flags); 118 write_lock_irqsave(&card->ctl_files_rwlock, flags);
@@ -225,8 +224,13 @@ struct snd_kcontrol *snd_ctl_new1(const struct snd_kcontrol_new *ncontrol,
225 kctl.id.iface = ncontrol->iface; 224 kctl.id.iface = ncontrol->iface;
226 kctl.id.device = ncontrol->device; 225 kctl.id.device = ncontrol->device;
227 kctl.id.subdevice = ncontrol->subdevice; 226 kctl.id.subdevice = ncontrol->subdevice;
228 if (ncontrol->name) 227 if (ncontrol->name) {
229 strlcpy(kctl.id.name, ncontrol->name, sizeof(kctl.id.name)); 228 strlcpy(kctl.id.name, ncontrol->name, sizeof(kctl.id.name));
229 if (strcmp(ncontrol->name, kctl.id.name) != 0)
230 snd_printk(KERN_WARNING
231 "Control name '%s' truncated to '%s'\n",
232 ncontrol->name, kctl.id.name);
233 }
230 kctl.id.index = ncontrol->index; 234 kctl.id.index = ncontrol->index;
231 kctl.count = ncontrol->count ? ncontrol->count : 1; 235 kctl.count = ncontrol->count ? ncontrol->count : 1;
232 access = ncontrol->access == 0 ? SNDRV_CTL_ELEM_ACCESS_READWRITE : 236 access = ncontrol->access == 0 ? SNDRV_CTL_ELEM_ACCESS_READWRITE :
diff --git a/sound/core/init.c b/sound/core/init.c
index ef2352c2e451..b47ff8b44be8 100644
--- a/sound/core/init.c
+++ b/sound/core/init.c
@@ -264,8 +264,11 @@ static int snd_disconnect_release(struct inode *inode, struct file *file)
264 } 264 }
265 spin_unlock(&shutdown_lock); 265 spin_unlock(&shutdown_lock);
266 266
267 if (likely(df)) 267 if (likely(df)) {
268 if ((file->f_flags & FASYNC) && df->disconnected_f_op->fasync)
269 df->disconnected_f_op->fasync(-1, file, 0);
268 return df->disconnected_f_op->release(inode, file); 270 return df->disconnected_f_op->release(inode, file);
271 }
269 272
270 panic("%s(%p, %p) failed!", __func__, inode, file); 273 panic("%s(%p, %p) failed!", __func__, inode, file);
271} 274}
diff --git a/sound/core/pcm_native.c b/sound/core/pcm_native.c
index aef18682c035..a789efc9df39 100644
--- a/sound/core/pcm_native.c
+++ b/sound/core/pcm_native.c
@@ -2169,7 +2169,6 @@ static int snd_pcm_release(struct inode *inode, struct file *file)
2169 if (snd_BUG_ON(!substream)) 2169 if (snd_BUG_ON(!substream))
2170 return -ENXIO; 2170 return -ENXIO;
2171 pcm = substream->pcm; 2171 pcm = substream->pcm;
2172 fasync_helper(-1, file, 0, &substream->runtime->fasync);
2173 mutex_lock(&pcm->open_mutex); 2172 mutex_lock(&pcm->open_mutex);
2174 snd_pcm_release_substream(substream); 2173 snd_pcm_release_substream(substream);
2175 kfree(pcm_file); 2174 kfree(pcm_file);
diff --git a/sound/core/rawmidi.c b/sound/core/rawmidi.c
index c4995c9f5730..39672f68ce5d 100644
--- a/sound/core/rawmidi.c
+++ b/sound/core/rawmidi.c
@@ -148,6 +148,8 @@ static int snd_rawmidi_runtime_free(struct snd_rawmidi_substream *substream)
148 148
149static inline void snd_rawmidi_output_trigger(struct snd_rawmidi_substream *substream,int up) 149static inline void snd_rawmidi_output_trigger(struct snd_rawmidi_substream *substream,int up)
150{ 150{
151 if (!substream->opened)
152 return;
151 if (up) { 153 if (up) {
152 tasklet_hi_schedule(&substream->runtime->tasklet); 154 tasklet_hi_schedule(&substream->runtime->tasklet);
153 } else { 155 } else {
@@ -158,6 +160,8 @@ static inline void snd_rawmidi_output_trigger(struct snd_rawmidi_substream *subs
158 160
159static void snd_rawmidi_input_trigger(struct snd_rawmidi_substream *substream, int up) 161static void snd_rawmidi_input_trigger(struct snd_rawmidi_substream *substream, int up)
160{ 162{
163 if (!substream->opened)
164 return;
161 substream->ops->trigger(substream, up); 165 substream->ops->trigger(substream, up);
162 if (!up && substream->runtime->event) 166 if (!up && substream->runtime->event)
163 tasklet_kill(&substream->runtime->tasklet); 167 tasklet_kill(&substream->runtime->tasklet);
@@ -857,6 +861,8 @@ int snd_rawmidi_receive(struct snd_rawmidi_substream *substream,
857 int result = 0, count1; 861 int result = 0, count1;
858 struct snd_rawmidi_runtime *runtime = substream->runtime; 862 struct snd_rawmidi_runtime *runtime = substream->runtime;
859 863
864 if (!substream->opened)
865 return -EBADFD;
860 if (runtime->buffer == NULL) { 866 if (runtime->buffer == NULL) {
861 snd_printd("snd_rawmidi_receive: input is not active!!!\n"); 867 snd_printd("snd_rawmidi_receive: input is not active!!!\n");
862 return -EINVAL; 868 return -EINVAL;
@@ -1126,6 +1132,8 @@ int snd_rawmidi_transmit_ack(struct snd_rawmidi_substream *substream, int count)
1126int snd_rawmidi_transmit(struct snd_rawmidi_substream *substream, 1132int snd_rawmidi_transmit(struct snd_rawmidi_substream *substream,
1127 unsigned char *buffer, int count) 1133 unsigned char *buffer, int count)
1128{ 1134{
1135 if (!substream->opened)
1136 return -EBADFD;
1129 count = snd_rawmidi_transmit_peek(substream, buffer, count); 1137 count = snd_rawmidi_transmit_peek(substream, buffer, count);
1130 if (count < 0) 1138 if (count < 0)
1131 return count; 1139 return count;
diff --git a/sound/core/timer.c b/sound/core/timer.c
index e582face89d2..c584408c9f17 100644
--- a/sound/core/timer.c
+++ b/sound/core/timer.c
@@ -1263,7 +1263,6 @@ static int snd_timer_user_release(struct inode *inode, struct file *file)
1263 if (file->private_data) { 1263 if (file->private_data) {
1264 tu = file->private_data; 1264 tu = file->private_data;
1265 file->private_data = NULL; 1265 file->private_data = NULL;
1266 fasync_helper(-1, file, 0, &tu->fasync);
1267 if (tu->timeri) 1266 if (tu->timeri)
1268 snd_timer_close(tu->timeri); 1267 snd_timer_close(tu->timeri);
1269 kfree(tu->queue); 1268 kfree(tu->queue);
diff --git a/sound/drivers/ml403-ac97cr.c b/sound/drivers/ml403-ac97cr.c
index ecdbeb6d3603..7783843ca9ae 100644
--- a/sound/drivers/ml403-ac97cr.c
+++ b/sound/drivers/ml403-ac97cr.c
@@ -1153,7 +1153,7 @@ snd_ml403_ac97cr_create(struct snd_card *card, struct platform_device *pfdev,
1153 /* get irq */ 1153 /* get irq */
1154 irq = platform_get_irq(pfdev, 0); 1154 irq = platform_get_irq(pfdev, 0);
1155 if (request_irq(irq, snd_ml403_ac97cr_irq, IRQF_DISABLED, 1155 if (request_irq(irq, snd_ml403_ac97cr_irq, IRQF_DISABLED,
1156 pfdev->dev.bus_id, (void *)ml403_ac97cr)) { 1156 dev_name(&pfdev->dev), (void *)ml403_ac97cr)) {
1157 snd_printk(KERN_ERR SND_ML403_AC97CR_DRIVER ": " 1157 snd_printk(KERN_ERR SND_ML403_AC97CR_DRIVER ": "
1158 "unable to grab IRQ %d\n", 1158 "unable to grab IRQ %d\n",
1159 irq); 1159 irq);
@@ -1166,7 +1166,7 @@ snd_ml403_ac97cr_create(struct snd_card *card, struct platform_device *pfdev,
1166 ml403_ac97cr->irq); 1166 ml403_ac97cr->irq);
1167 irq = platform_get_irq(pfdev, 1); 1167 irq = platform_get_irq(pfdev, 1);
1168 if (request_irq(irq, snd_ml403_ac97cr_irq, IRQF_DISABLED, 1168 if (request_irq(irq, snd_ml403_ac97cr_irq, IRQF_DISABLED,
1169 pfdev->dev.bus_id, (void *)ml403_ac97cr)) { 1169 dev_name(&pfdev->dev), (void *)ml403_ac97cr)) {
1170 snd_printk(KERN_ERR SND_ML403_AC97CR_DRIVER ": " 1170 snd_printk(KERN_ERR SND_ML403_AC97CR_DRIVER ": "
1171 "unable to grab IRQ %d\n", 1171 "unable to grab IRQ %d\n",
1172 irq); 1172 irq);
diff --git a/sound/drivers/pcsp/pcsp_input.c b/sound/drivers/pcsp/pcsp_input.c
index cd9b83e7f7d1..0444cdeb4bec 100644
--- a/sound/drivers/pcsp/pcsp_input.c
+++ b/sound/drivers/pcsp/pcsp_input.c
@@ -24,13 +24,13 @@ static void pcspkr_do_sound(unsigned int count)
24 spin_lock_irqsave(&i8253_lock, flags); 24 spin_lock_irqsave(&i8253_lock, flags);
25 25
26 if (count) { 26 if (count) {
27 /* enable counter 2 */
28 outb_p(inb_p(0x61) | 3, 0x61);
29 /* set command for counter 2, 2 byte write */ 27 /* set command for counter 2, 2 byte write */
30 outb_p(0xB6, 0x43); 28 outb_p(0xB6, 0x43);
31 /* select desired HZ */ 29 /* select desired HZ */
32 outb_p(count & 0xff, 0x42); 30 outb_p(count & 0xff, 0x42);
33 outb((count >> 8) & 0xff, 0x42); 31 outb((count >> 8) & 0xff, 0x42);
32 /* enable counter 2 */
33 outb_p(inb_p(0x61) | 3, 0x61);
34 } else { 34 } else {
35 /* disable counter 2 */ 35 /* disable counter 2 */
36 outb(inb_p(0x61) & 0xFC, 0x61); 36 outb(inb_p(0x61) & 0xFC, 0x61);
diff --git a/sound/isa/ad1848/ad1848.c b/sound/isa/ad1848/ad1848.c
index b68d20edc20f..223a6c038819 100644
--- a/sound/isa/ad1848/ad1848.c
+++ b/sound/isa/ad1848/ad1848.c
@@ -70,15 +70,15 @@ static int __devinit snd_ad1848_match(struct device *dev, unsigned int n)
70 return 0; 70 return 0;
71 71
72 if (port[n] == SNDRV_AUTO_PORT) { 72 if (port[n] == SNDRV_AUTO_PORT) {
73 snd_printk(KERN_ERR "%s: please specify port\n", dev->bus_id); 73 dev_err(dev, "please specify port\n");
74 return 0; 74 return 0;
75 } 75 }
76 if (irq[n] == SNDRV_AUTO_IRQ) { 76 if (irq[n] == SNDRV_AUTO_IRQ) {
77 snd_printk(KERN_ERR "%s: please specify irq\n", dev->bus_id); 77 dev_err(dev, "please specify irq\n");
78 return 0; 78 return 0;
79 } 79 }
80 if (dma1[n] == SNDRV_AUTO_DMA) { 80 if (dma1[n] == SNDRV_AUTO_DMA) {
81 snd_printk(KERN_ERR "%s: please specify dma1\n", dev->bus_id); 81 dev_err(dev, "please specify dma1\n");
82 return 0; 82 return 0;
83 } 83 }
84 return 1; 84 return 1;
diff --git a/sound/isa/adlib.c b/sound/isa/adlib.c
index efa8c80d05b6..374b7177e111 100644
--- a/sound/isa/adlib.c
+++ b/sound/isa/adlib.c
@@ -36,7 +36,7 @@ static int __devinit snd_adlib_match(struct device *dev, unsigned int n)
36 return 0; 36 return 0;
37 37
38 if (port[n] == SNDRV_AUTO_PORT) { 38 if (port[n] == SNDRV_AUTO_PORT) {
39 snd_printk(KERN_ERR "%s: please specify port\n", dev->bus_id); 39 dev_err(dev, "please specify port\n");
40 return 0; 40 return 0;
41 } 41 }
42 return 1; 42 return 1;
@@ -55,13 +55,13 @@ static int __devinit snd_adlib_probe(struct device *dev, unsigned int n)
55 55
56 card = snd_card_new(index[n], id[n], THIS_MODULE, 0); 56 card = snd_card_new(index[n], id[n], THIS_MODULE, 0);
57 if (!card) { 57 if (!card) {
58 snd_printk(KERN_ERR "%s: could not create card\n", dev->bus_id); 58 dev_err(dev, "could not create card\n");
59 return -EINVAL; 59 return -EINVAL;
60 } 60 }
61 61
62 card->private_data = request_region(port[n], 4, CRD_NAME); 62 card->private_data = request_region(port[n], 4, CRD_NAME);
63 if (!card->private_data) { 63 if (!card->private_data) {
64 snd_printk(KERN_ERR "%s: could not grab ports\n", dev->bus_id); 64 dev_err(dev, "could not grab ports\n");
65 error = -EBUSY; 65 error = -EBUSY;
66 goto out; 66 goto out;
67 } 67 }
@@ -73,13 +73,13 @@ static int __devinit snd_adlib_probe(struct device *dev, unsigned int n)
73 73
74 error = snd_opl3_create(card, port[n], port[n] + 2, OPL3_HW_AUTO, 1, &opl3); 74 error = snd_opl3_create(card, port[n], port[n] + 2, OPL3_HW_AUTO, 1, &opl3);
75 if (error < 0) { 75 if (error < 0) {
76 snd_printk(KERN_ERR "%s: could not create OPL\n", dev->bus_id); 76 dev_err(dev, "could not create OPL\n");
77 goto out; 77 goto out;
78 } 78 }
79 79
80 error = snd_opl3_hwdep_new(opl3, 0, 0, NULL); 80 error = snd_opl3_hwdep_new(opl3, 0, 0, NULL);
81 if (error < 0) { 81 if (error < 0) {
82 snd_printk(KERN_ERR "%s: could not create FM\n", dev->bus_id); 82 dev_err(dev, "could not create FM\n");
83 goto out; 83 goto out;
84 } 84 }
85 85
@@ -87,7 +87,7 @@ static int __devinit snd_adlib_probe(struct device *dev, unsigned int n)
87 87
88 error = snd_card_register(card); 88 error = snd_card_register(card);
89 if (error < 0) { 89 if (error < 0) {
90 snd_printk(KERN_ERR "%s: could not register card\n", dev->bus_id); 90 dev_err(dev, "could not register card\n");
91 goto out; 91 goto out;
92 } 92 }
93 93
diff --git a/sound/isa/cs423x/cs4231.c b/sound/isa/cs423x/cs4231.c
index ddd289120aa8..f019d449e2d6 100644
--- a/sound/isa/cs423x/cs4231.c
+++ b/sound/isa/cs423x/cs4231.c
@@ -74,15 +74,15 @@ static int __devinit snd_cs4231_match(struct device *dev, unsigned int n)
74 return 0; 74 return 0;
75 75
76 if (port[n] == SNDRV_AUTO_PORT) { 76 if (port[n] == SNDRV_AUTO_PORT) {
77 snd_printk(KERN_ERR "%s: please specify port\n", dev->bus_id); 77 dev_err(dev, "please specify port\n");
78 return 0; 78 return 0;
79 } 79 }
80 if (irq[n] == SNDRV_AUTO_IRQ) { 80 if (irq[n] == SNDRV_AUTO_IRQ) {
81 snd_printk(KERN_ERR "%s: please specify irq\n", dev->bus_id); 81 dev_err(dev, "please specify irq\n");
82 return 0; 82 return 0;
83 } 83 }
84 if (dma1[n] == SNDRV_AUTO_DMA) { 84 if (dma1[n] == SNDRV_AUTO_DMA) {
85 snd_printk(KERN_ERR "%s: please specify dma1\n", dev->bus_id); 85 dev_err(dev, "please specify dma1\n");
86 return 0; 86 return 0;
87 } 87 }
88 return 1; 88 return 1;
@@ -133,7 +133,7 @@ static int __devinit snd_cs4231_probe(struct device *dev, unsigned int n)
133 mpu_port[n], 0, mpu_irq[n], 133 mpu_port[n], 0, mpu_irq[n],
134 mpu_irq[n] >= 0 ? IRQF_DISABLED : 0, 134 mpu_irq[n] >= 0 ? IRQF_DISABLED : 0,
135 NULL) < 0) 135 NULL) < 0)
136 printk(KERN_WARNING "%s: MPU401 not detected\n", dev->bus_id); 136 dev_warn(dev, "MPU401 not detected\n");
137 } 137 }
138 138
139 snd_card_set_dev(card, dev); 139 snd_card_set_dev(card, dev);
diff --git a/sound/isa/cs423x/cs4236.c b/sound/isa/cs423x/cs4236.c
index 91f9c15d3e30..019c9401663e 100644
--- a/sound/isa/cs423x/cs4236.c
+++ b/sound/isa/cs423x/cs4236.c
@@ -488,19 +488,19 @@ static int __devinit snd_cs423x_isa_match(struct device *pdev,
488 return 0; 488 return 0;
489 489
490 if (port[dev] == SNDRV_AUTO_PORT) { 490 if (port[dev] == SNDRV_AUTO_PORT) {
491 snd_printk(KERN_ERR "%s: please specify port\n", pdev->bus_id); 491 dev_err(pdev, "please specify port\n");
492 return 0; 492 return 0;
493 } 493 }
494 if (cport[dev] == SNDRV_AUTO_PORT) { 494 if (cport[dev] == SNDRV_AUTO_PORT) {
495 snd_printk(KERN_ERR "%s: please specify cport\n", pdev->bus_id); 495 dev_err(pdev, "please specify cport\n");
496 return 0; 496 return 0;
497 } 497 }
498 if (irq[dev] == SNDRV_AUTO_IRQ) { 498 if (irq[dev] == SNDRV_AUTO_IRQ) {
499 snd_printk(KERN_ERR "%s: please specify irq\n", pdev->bus_id); 499 dev_err(pdev, "please specify irq\n");
500 return 0; 500 return 0;
501 } 501 }
502 if (dma1[dev] == SNDRV_AUTO_DMA) { 502 if (dma1[dev] == SNDRV_AUTO_DMA) {
503 snd_printk(KERN_ERR "%s: please specify dma1\n", pdev->bus_id); 503 dev_err(pdev, "please specify dma1\n");
504 return 0; 504 return 0;
505 } 505 }
506 return 1; 506 return 1;
diff --git a/sound/isa/es1688/es1688.c b/sound/isa/es1688/es1688.c
index f88639ea64b2..b46377139cf8 100644
--- a/sound/isa/es1688/es1688.c
+++ b/sound/isa/es1688/es1688.c
@@ -88,16 +88,14 @@ static int __devinit snd_es1688_legacy_create(struct snd_card *card,
88 if (irq[n] == SNDRV_AUTO_IRQ) { 88 if (irq[n] == SNDRV_AUTO_IRQ) {
89 irq[n] = snd_legacy_find_free_irq(possible_irqs); 89 irq[n] = snd_legacy_find_free_irq(possible_irqs);
90 if (irq[n] < 0) { 90 if (irq[n] < 0) {
91 snd_printk(KERN_ERR "%s: unable to find a free IRQ\n", 91 dev_err(dev, "unable to find a free IRQ\n");
92 dev->bus_id);
93 return -EBUSY; 92 return -EBUSY;
94 } 93 }
95 } 94 }
96 if (dma8[n] == SNDRV_AUTO_DMA) { 95 if (dma8[n] == SNDRV_AUTO_DMA) {
97 dma8[n] = snd_legacy_find_free_dma(possible_dmas); 96 dma8[n] = snd_legacy_find_free_dma(possible_dmas);
98 if (dma8[n] < 0) { 97 if (dma8[n] < 0) {
99 snd_printk(KERN_ERR "%s: unable to find a free DMA\n", 98 dev_err(dev, "unable to find a free DMA\n");
100 dev->bus_id);
101 return -EBUSY; 99 return -EBUSY;
102 } 100 }
103 } 101 }
@@ -147,8 +145,7 @@ static int __devinit snd_es1688_probe(struct device *dev, unsigned int n)
147 145
148 if (snd_opl3_create(card, chip->port, chip->port + 2, 146 if (snd_opl3_create(card, chip->port, chip->port + 2,
149 OPL3_HW_OPL3, 0, &opl3) < 0) 147 OPL3_HW_OPL3, 0, &opl3) < 0)
150 printk(KERN_WARNING "%s: opl3 not detected at 0x%lx\n", 148 dev_warn(dev, "opl3 not detected at 0x%lx\n", chip->port);
151 dev->bus_id, chip->port);
152 else { 149 else {
153 error = snd_opl3_hwdep_new(opl3, 0, 1, NULL); 150 error = snd_opl3_hwdep_new(opl3, 0, 1, NULL);
154 if (error < 0) 151 if (error < 0)
diff --git a/sound/isa/gus/gusclassic.c b/sound/isa/gus/gusclassic.c
index 8f914b37bf89..426532a4d730 100644
--- a/sound/isa/gus/gusclassic.c
+++ b/sound/isa/gus/gusclassic.c
@@ -90,24 +90,21 @@ static int __devinit snd_gusclassic_create(struct snd_card *card,
90 if (irq[n] == SNDRV_AUTO_IRQ) { 90 if (irq[n] == SNDRV_AUTO_IRQ) {
91 irq[n] = snd_legacy_find_free_irq(possible_irqs); 91 irq[n] = snd_legacy_find_free_irq(possible_irqs);
92 if (irq[n] < 0) { 92 if (irq[n] < 0) {
93 snd_printk(KERN_ERR "%s: unable to find a free IRQ\n", 93 dev_err(dev, "unable to find a free IRQ\n");
94 dev->bus_id);
95 return -EBUSY; 94 return -EBUSY;
96 } 95 }
97 } 96 }
98 if (dma1[n] == SNDRV_AUTO_DMA) { 97 if (dma1[n] == SNDRV_AUTO_DMA) {
99 dma1[n] = snd_legacy_find_free_dma(possible_dmas); 98 dma1[n] = snd_legacy_find_free_dma(possible_dmas);
100 if (dma1[n] < 0) { 99 if (dma1[n] < 0) {
101 snd_printk(KERN_ERR "%s: unable to find a free DMA1\n", 100 dev_err(dev, "unable to find a free DMA1\n");
102 dev->bus_id);
103 return -EBUSY; 101 return -EBUSY;
104 } 102 }
105 } 103 }
106 if (dma2[n] == SNDRV_AUTO_DMA) { 104 if (dma2[n] == SNDRV_AUTO_DMA) {
107 dma2[n] = snd_legacy_find_free_dma(possible_dmas); 105 dma2[n] = snd_legacy_find_free_dma(possible_dmas);
108 if (dma2[n] < 0) { 106 if (dma2[n] < 0) {
109 snd_printk(KERN_ERR "%s: unable to find a free DMA2\n", 107 dev_err(dev, "unable to find a free DMA2\n");
110 dev->bus_id);
111 return -EBUSY; 108 return -EBUSY;
112 } 109 }
113 } 110 }
@@ -174,8 +171,8 @@ static int __devinit snd_gusclassic_probe(struct device *dev, unsigned int n)
174 171
175 error = -ENODEV; 172 error = -ENODEV;
176 if (gus->max_flag || gus->ess_flag) { 173 if (gus->max_flag || gus->ess_flag) {
177 snd_printk(KERN_ERR "%s: GUS Classic or ACE soundcard was " 174 dev_err(dev, "GUS Classic or ACE soundcard was "
178 "not detected at 0x%lx\n", dev->bus_id, gus->gf1.port); 175 "not detected at 0x%lx\n", gus->gf1.port);
179 goto out; 176 goto out;
180 } 177 }
181 178
diff --git a/sound/isa/gus/gusextreme.c b/sound/isa/gus/gusextreme.c
index da13185eb0a0..7ad4c3b41a84 100644
--- a/sound/isa/gus/gusextreme.c
+++ b/sound/isa/gus/gusextreme.c
@@ -106,16 +106,14 @@ static int __devinit snd_gusextreme_es1688_create(struct snd_card *card,
106 if (irq[n] == SNDRV_AUTO_IRQ) { 106 if (irq[n] == SNDRV_AUTO_IRQ) {
107 irq[n] = snd_legacy_find_free_irq(possible_irqs); 107 irq[n] = snd_legacy_find_free_irq(possible_irqs);
108 if (irq[n] < 0) { 108 if (irq[n] < 0) {
109 snd_printk(KERN_ERR "%s: unable to find a free IRQ " 109 dev_err(dev, "unable to find a free IRQ for ES1688\n");
110 "for ES1688\n", dev->bus_id);
111 return -EBUSY; 110 return -EBUSY;
112 } 111 }
113 } 112 }
114 if (dma8[n] == SNDRV_AUTO_DMA) { 113 if (dma8[n] == SNDRV_AUTO_DMA) {
115 dma8[n] = snd_legacy_find_free_dma(possible_dmas); 114 dma8[n] = snd_legacy_find_free_dma(possible_dmas);
116 if (dma8[n] < 0) { 115 if (dma8[n] < 0) {
117 snd_printk(KERN_ERR "%s: unable to find a free DMA " 116 dev_err(dev, "unable to find a free DMA for ES1688\n");
118 "for ES1688\n", dev->bus_id);
119 return -EBUSY; 117 return -EBUSY;
120 } 118 }
121 } 119 }
@@ -143,16 +141,14 @@ static int __devinit snd_gusextreme_gus_card_create(struct snd_card *card,
143 if (gf1_irq[n] == SNDRV_AUTO_IRQ) { 141 if (gf1_irq[n] == SNDRV_AUTO_IRQ) {
144 gf1_irq[n] = snd_legacy_find_free_irq(possible_irqs); 142 gf1_irq[n] = snd_legacy_find_free_irq(possible_irqs);
145 if (gf1_irq[n] < 0) { 143 if (gf1_irq[n] < 0) {
146 snd_printk(KERN_ERR "%s: unable to find a free IRQ " 144 dev_err(dev, "unable to find a free IRQ for GF1\n");
147 "for GF1\n", dev->bus_id);
148 return -EBUSY; 145 return -EBUSY;
149 } 146 }
150 } 147 }
151 if (dma1[n] == SNDRV_AUTO_DMA) { 148 if (dma1[n] == SNDRV_AUTO_DMA) {
152 dma1[n] = snd_legacy_find_free_dma(possible_dmas); 149 dma1[n] = snd_legacy_find_free_dma(possible_dmas);
153 if (dma1[n] < 0) { 150 if (dma1[n] < 0) {
154 snd_printk(KERN_ERR "%s: unable to find a free DMA " 151 dev_err(dev, "unable to find a free DMA for GF1\n");
155 "for GF1\n", dev->bus_id);
156 return -EBUSY; 152 return -EBUSY;
157 } 153 }
158 } 154 }
@@ -278,8 +274,8 @@ static int __devinit snd_gusextreme_probe(struct device *dev, unsigned int n)
278 274
279 error = -ENODEV; 275 error = -ENODEV;
280 if (!gus->ess_flag) { 276 if (!gus->ess_flag) {
281 snd_printk(KERN_ERR "%s: GUS Extreme soundcard was not " 277 dev_err(dev, "GUS Extreme soundcard was not "
282 "detected at 0x%lx\n", dev->bus_id, gus->gf1.port); 278 "detected at 0x%lx\n", gus->gf1.port);
283 goto out; 279 goto out;
284 } 280 }
285 gus->codec_flag = 1; 281 gus->codec_flag = 1;
@@ -310,8 +306,7 @@ static int __devinit snd_gusextreme_probe(struct device *dev, unsigned int n)
310 306
311 if (snd_opl3_create(card, es1688->port, es1688->port + 2, 307 if (snd_opl3_create(card, es1688->port, es1688->port + 2,
312 OPL3_HW_OPL3, 0, &opl3) < 0) 308 OPL3_HW_OPL3, 0, &opl3) < 0)
313 printk(KERN_ERR "%s: opl3 not detected at 0x%lx\n", 309 dev_warn(dev, "opl3 not detected at 0x%lx\n", es1688->port);
314 dev->bus_id, es1688->port);
315 else { 310 else {
316 error = snd_opl3_hwdep_new(opl3, 0, 2, NULL); 311 error = snd_opl3_hwdep_new(opl3, 0, 2, NULL);
317 if (error < 0) 312 if (error < 0)
diff --git a/sound/isa/sb/sb8.c b/sound/isa/sb/sb8.c
index 336a34277907..667eccc676a4 100644
--- a/sound/isa/sb/sb8.c
+++ b/sound/isa/sb/sb8.c
@@ -85,11 +85,11 @@ static int __devinit snd_sb8_match(struct device *pdev, unsigned int dev)
85 if (!enable[dev]) 85 if (!enable[dev])
86 return 0; 86 return 0;
87 if (irq[dev] == SNDRV_AUTO_IRQ) { 87 if (irq[dev] == SNDRV_AUTO_IRQ) {
88 snd_printk(KERN_ERR "%s: please specify irq\n", pdev->bus_id); 88 dev_err(pdev, "please specify irq\n");
89 return 0; 89 return 0;
90 } 90 }
91 if (dma8[dev] == SNDRV_AUTO_DMA) { 91 if (dma8[dev] == SNDRV_AUTO_DMA) {
92 snd_printk(KERN_ERR "%s: please specify dma8\n", pdev->bus_id); 92 dev_err(pdev, "please specify dma8\n");
93 return 0; 93 return 0;
94 } 94 }
95 return 1; 95 return 1;
diff --git a/sound/oss/dmasound/dmasound.h b/sound/oss/dmasound/dmasound.h
index 1cb13fe56ec4..1308d8d34186 100644
--- a/sound/oss/dmasound/dmasound.h
+++ b/sound/oss/dmasound/dmasound.h
@@ -235,7 +235,7 @@ struct sound_queue {
235 */ 235 */
236 int active; 236 int active;
237 wait_queue_head_t action_queue, open_queue, sync_queue; 237 wait_queue_head_t action_queue, open_queue, sync_queue;
238 fmode_t open_mode; 238 int non_blocking;
239 int busy, syncing, xruns, died; 239 int busy, syncing, xruns, died;
240}; 240};
241 241
diff --git a/sound/oss/dmasound/dmasound_core.c b/sound/oss/dmasound/dmasound_core.c
index b8239f3168fb..793b7f478433 100644
--- a/sound/oss/dmasound/dmasound_core.c
+++ b/sound/oss/dmasound/dmasound_core.c
@@ -603,7 +603,7 @@ static ssize_t sq_write(struct file *file, const char __user *src, size_t uLeft,
603 while (uLeft) { 603 while (uLeft) {
604 while (write_sq.count >= write_sq.max_active) { 604 while (write_sq.count >= write_sq.max_active) {
605 sq_play(); 605 sq_play();
606 if (write_sq.open_mode & O_NONBLOCK) 606 if (write_sq.non_blocking)
607 return uWritten > 0 ? uWritten : -EAGAIN; 607 return uWritten > 0 ? uWritten : -EAGAIN;
608 SLEEP(write_sq.action_queue); 608 SLEEP(write_sq.action_queue);
609 if (signal_pending(current)) 609 if (signal_pending(current))
@@ -718,7 +718,7 @@ static int sq_open2(struct sound_queue *sq, struct file *file, fmode_t mode,
718 return rc; 718 return rc;
719 } 719 }
720 720
721 sq->open_mode = file->f_mode; 721 sq->non_blocking = file->f_flags & O_NONBLOCK;
722 } 722 }
723 return rc; 723 return rc;
724} 724}
diff --git a/sound/oss/kahlua.c b/sound/oss/kahlua.c
index eb9bc365530d..c180598f1710 100644
--- a/sound/oss/kahlua.c
+++ b/sound/oss/kahlua.c
@@ -1,7 +1,7 @@
1/* 1/*
2 * Initialisation code for Cyrix/NatSemi VSA1 softaudio 2 * Initialisation code for Cyrix/NatSemi VSA1 softaudio
3 * 3 *
4 * (C) Copyright 2003 Red Hat Inc <alan@redhat.com> 4 * (C) Copyright 2003 Red Hat Inc <alan@lxorguk.ukuu.org.uk>
5 * 5 *
6 * XpressAudio(tm) is used on the Cyrix MediaGX (now NatSemi Geode) systems. 6 * XpressAudio(tm) is used on the Cyrix MediaGX (now NatSemi Geode) systems.
7 * The older version (VSA1) provides fairly good soundblaster emulation 7 * The older version (VSA1) provides fairly good soundblaster emulation
diff --git a/sound/pci/ac97/ac97_codec.c b/sound/pci/ac97/ac97_codec.c
index 6704acbca8c0..bd510eceff1f 100644
--- a/sound/pci/ac97/ac97_codec.c
+++ b/sound/pci/ac97/ac97_codec.c
@@ -1927,9 +1927,9 @@ static int snd_ac97_dev_register(struct snd_device *device)
1927 ac97->dev.bus = &ac97_bus_type; 1927 ac97->dev.bus = &ac97_bus_type;
1928 ac97->dev.parent = ac97->bus->card->dev; 1928 ac97->dev.parent = ac97->bus->card->dev;
1929 ac97->dev.release = ac97_device_release; 1929 ac97->dev.release = ac97_device_release;
1930 snprintf(ac97->dev.bus_id, BUS_ID_SIZE, "%d-%d:%s", 1930 dev_set_name(&ac97->dev, "%d-%d:%s",
1931 ac97->bus->card->number, ac97->num, 1931 ac97->bus->card->number, ac97->num,
1932 snd_ac97_get_short_name(ac97)); 1932 snd_ac97_get_short_name(ac97));
1933 if ((err = device_register(&ac97->dev)) < 0) { 1933 if ((err = device_register(&ac97->dev)) < 0) {
1934 snd_printk(KERN_ERR "Can't register ac97 bus\n"); 1934 snd_printk(KERN_ERR "Can't register ac97 bus\n");
1935 ac97->dev.bus = NULL; 1935 ac97->dev.bus = NULL;
diff --git a/sound/pci/ad1889.c b/sound/pci/ad1889.c
index 92f3a976ef2e..a7f38e63303f 100644
--- a/sound/pci/ad1889.c
+++ b/sound/pci/ad1889.c
@@ -932,7 +932,7 @@ snd_ad1889_create(struct snd_card *card,
932 goto free_and_ret; 932 goto free_and_ret;
933 933
934 chip->bar = pci_resource_start(pci, 0); 934 chip->bar = pci_resource_start(pci, 0);
935 chip->iobase = ioremap_nocache(chip->bar, pci_resource_len(pci, 0)); 935 chip->iobase = pci_ioremap_bar(pci, 0);
936 if (chip->iobase == NULL) { 936 if (chip->iobase == NULL) {
937 printk(KERN_ERR PFX "unable to reserve region.\n"); 937 printk(KERN_ERR PFX "unable to reserve region.\n");
938 err = -EBUSY; 938 err = -EBUSY;
diff --git a/sound/pci/atiixp.c b/sound/pci/atiixp.c
index 085a52b8c807..226fe8237d31 100644
--- a/sound/pci/atiixp.c
+++ b/sound/pci/atiixp.c
@@ -1609,7 +1609,7 @@ static int __devinit snd_atiixp_create(struct snd_card *card,
1609 return err; 1609 return err;
1610 } 1610 }
1611 chip->addr = pci_resource_start(pci, 0); 1611 chip->addr = pci_resource_start(pci, 0);
1612 chip->remap_addr = ioremap_nocache(chip->addr, pci_resource_len(pci, 0)); 1612 chip->remap_addr = pci_ioremap_bar(pci, 0);
1613 if (chip->remap_addr == NULL) { 1613 if (chip->remap_addr == NULL) {
1614 snd_printk(KERN_ERR "AC'97 space ioremap problem\n"); 1614 snd_printk(KERN_ERR "AC'97 space ioremap problem\n");
1615 snd_atiixp_free(chip); 1615 snd_atiixp_free(chip);
diff --git a/sound/pci/atiixp_modem.c b/sound/pci/atiixp_modem.c
index 2f106306c7fe..0e6e5cc1c501 100644
--- a/sound/pci/atiixp_modem.c
+++ b/sound/pci/atiixp_modem.c
@@ -1252,7 +1252,7 @@ static int __devinit snd_atiixp_create(struct snd_card *card,
1252 return err; 1252 return err;
1253 } 1253 }
1254 chip->addr = pci_resource_start(pci, 0); 1254 chip->addr = pci_resource_start(pci, 0);
1255 chip->remap_addr = ioremap_nocache(chip->addr, pci_resource_len(pci, 0)); 1255 chip->remap_addr = pci_ioremap_bar(pci, 0);
1256 if (chip->remap_addr == NULL) { 1256 if (chip->remap_addr == NULL) {
1257 snd_printk(KERN_ERR "AC'97 space ioremap problem\n"); 1257 snd_printk(KERN_ERR "AC'97 space ioremap problem\n");
1258 snd_atiixp_free(chip); 1258 snd_atiixp_free(chip);
diff --git a/sound/pci/au88x0/au88x0.c b/sound/pci/au88x0/au88x0.c
index 68368e490074..a36d4d1fd419 100644
--- a/sound/pci/au88x0/au88x0.c
+++ b/sound/pci/au88x0/au88x0.c
@@ -180,8 +180,7 @@ snd_vortex_create(struct snd_card *card, struct pci_dev *pci, vortex_t ** rchip)
180 if ((err = pci_request_regions(pci, CARD_NAME_SHORT)) != 0) 180 if ((err = pci_request_regions(pci, CARD_NAME_SHORT)) != 0)
181 goto regions_out; 181 goto regions_out;
182 182
183 chip->mmio = ioremap_nocache(pci_resource_start(pci, 0), 183 chip->mmio = pci_ioremap_bar(pci, 0);
184 pci_resource_len(pci, 0));
185 if (!chip->mmio) { 184 if (!chip->mmio) {
186 printk(KERN_ERR "MMIO area remap failed.\n"); 185 printk(KERN_ERR "MMIO area remap failed.\n");
187 err = -ENOMEM; 186 err = -ENOMEM;
diff --git a/sound/pci/bt87x.c b/sound/pci/bt87x.c
index 3aa8d973540a..1aa1c0402540 100644
--- a/sound/pci/bt87x.c
+++ b/sound/pci/bt87x.c
@@ -749,8 +749,7 @@ static int __devinit snd_bt87x_create(struct snd_card *card,
749 pci_disable_device(pci); 749 pci_disable_device(pci);
750 return err; 750 return err;
751 } 751 }
752 chip->mmio = ioremap_nocache(pci_resource_start(pci, 0), 752 chip->mmio = pci_ioremap_bar(pci, 0);
753 pci_resource_len(pci, 0));
754 if (!chip->mmio) { 753 if (!chip->mmio) {
755 snd_printk(KERN_ERR "cannot remap io memory\n"); 754 snd_printk(KERN_ERR "cannot remap io memory\n");
756 err = -ENOMEM; 755 err = -ENOMEM;
diff --git a/sound/pci/cs4281.c b/sound/pci/cs4281.c
index ef9308f7c45b..192e7842e181 100644
--- a/sound/pci/cs4281.c
+++ b/sound/pci/cs4281.c
@@ -1382,8 +1382,8 @@ static int __devinit snd_cs4281_create(struct snd_card *card,
1382 chip->ba0_addr = pci_resource_start(pci, 0); 1382 chip->ba0_addr = pci_resource_start(pci, 0);
1383 chip->ba1_addr = pci_resource_start(pci, 1); 1383 chip->ba1_addr = pci_resource_start(pci, 1);
1384 1384
1385 chip->ba0 = ioremap_nocache(chip->ba0_addr, pci_resource_len(pci, 0)); 1385 chip->ba0 = pci_ioremap_bar(pci, 0);
1386 chip->ba1 = ioremap_nocache(chip->ba1_addr, pci_resource_len(pci, 1)); 1386 chip->ba1 = pci_ioremap_bar(pci, 1);
1387 if (!chip->ba0 || !chip->ba1) { 1387 if (!chip->ba0 || !chip->ba1) {
1388 snd_cs4281_free(chip); 1388 snd_cs4281_free(chip);
1389 return -ENOMEM; 1389 return -ENOMEM;
diff --git a/sound/pci/cs5530.c b/sound/pci/cs5530.c
index 7ff8b68e997e..6dea5b5cc774 100644
--- a/sound/pci/cs5530.c
+++ b/sound/pci/cs5530.c
@@ -2,7 +2,7 @@
2 * cs5530.c - Initialisation code for Cyrix/NatSemi VSA1 softaudio 2 * cs5530.c - Initialisation code for Cyrix/NatSemi VSA1 softaudio
3 * 3 *
4 * (C) Copyright 2007 Ash Willis <ashwillis@programmer.net> 4 * (C) Copyright 2007 Ash Willis <ashwillis@programmer.net>
5 * (C) Copyright 2003 Red Hat Inc <alan@redhat.com> 5 * (C) Copyright 2003 Red Hat Inc <alan@lxorguk.ukuu.org.uk>
6 * 6 *
7 * This driver was ported (shamelessly ripped ;) from oss/kahlua.c but I did 7 * This driver was ported (shamelessly ripped ;) from oss/kahlua.c but I did
8 * mess with it a bit. The chip seems to have to have trouble with full duplex 8 * mess with it a bit. The chip seems to have to have trouble with full duplex
@@ -132,7 +132,7 @@ static int __devinit snd_cs5530_create(struct snd_card *card,
132 } 132 }
133 chip->pci_base = pci_resource_start(pci, 0); 133 chip->pci_base = pci_resource_start(pci, 0);
134 134
135 mem = ioremap_nocache(chip->pci_base, pci_resource_len(pci, 0)); 135 mem = pci_ioremap_bar(pci, 0);
136 if (mem == NULL) { 136 if (mem == NULL) {
137 kfree(chip); 137 kfree(chip);
138 pci_disable_device(pci); 138 pci_disable_device(pci);
diff --git a/sound/pci/emu10k1/emu10k1_main.c b/sound/pci/emu10k1/emu10k1_main.c
index 2f283ea6ad9a..de5ee8f097f6 100644
--- a/sound/pci/emu10k1/emu10k1_main.c
+++ b/sound/pci/emu10k1/emu10k1_main.c
@@ -1464,6 +1464,7 @@ static struct snd_emu_chip_details emu_chip_details[] = {
1464 .ca0151_chip = 1, 1464 .ca0151_chip = 1,
1465 .spk71 = 1, 1465 .spk71 = 1,
1466 .spdif_bug = 1, 1466 .spdif_bug = 1,
1467 .invert_shared_spdif = 1, /* digital/analog switch swapped */
1467 .ac97_chip = 1} , 1468 .ac97_chip = 1} ,
1468 {.vendor = 0x1102, .device = 0x0004, .subsystem = 0x20021102, 1469 {.vendor = 0x1102, .device = 0x0004, .subsystem = 0x20021102,
1469 .driver = "Audigy2", .name = "Audigy 2 ZS [SB0350]", 1470 .driver = "Audigy2", .name = "Audigy 2 ZS [SB0350]",
@@ -1473,6 +1474,7 @@ static struct snd_emu_chip_details emu_chip_details[] = {
1473 .ca0151_chip = 1, 1474 .ca0151_chip = 1,
1474 .spk71 = 1, 1475 .spk71 = 1,
1475 .spdif_bug = 1, 1476 .spdif_bug = 1,
1477 .invert_shared_spdif = 1, /* digital/analog switch swapped */
1476 .ac97_chip = 1} , 1478 .ac97_chip = 1} ,
1477 {.vendor = 0x1102, .device = 0x0004, .subsystem = 0x20011102, 1479 {.vendor = 0x1102, .device = 0x0004, .subsystem = 0x20011102,
1478 .driver = "Audigy2", .name = "Audigy 2 ZS [2001]", 1480 .driver = "Audigy2", .name = "Audigy 2 ZS [2001]",
@@ -1482,6 +1484,7 @@ static struct snd_emu_chip_details emu_chip_details[] = {
1482 .ca0151_chip = 1, 1484 .ca0151_chip = 1,
1483 .spk71 = 1, 1485 .spk71 = 1,
1484 .spdif_bug = 1, 1486 .spdif_bug = 1,
1487 .invert_shared_spdif = 1, /* digital/analog switch swapped */
1485 .ac97_chip = 1} , 1488 .ac97_chip = 1} ,
1486 /* Audigy 2 */ 1489 /* Audigy 2 */
1487 /* Tested by James@superbug.co.uk 3rd July 2005 */ 1490 /* Tested by James@superbug.co.uk 3rd July 2005 */
diff --git a/sound/pci/hda/hda_codec.c b/sound/pci/hda/hda_codec.c
index 6447754ae56e..ba1ab737b55f 100644
--- a/sound/pci/hda/hda_codec.c
+++ b/sound/pci/hda/hda_codec.c
@@ -64,6 +64,7 @@ static struct hda_vendor_id hda_vendor_ids[] = {
64 { 0x14f1, "Conexant" }, 64 { 0x14f1, "Conexant" },
65 { 0x17e8, "Chrontel" }, 65 { 0x17e8, "Chrontel" },
66 { 0x1854, "LG" }, 66 { 0x1854, "LG" },
67 { 0x1aec, "Wolfson Microelectronics" },
67 { 0x434d, "C-Media" }, 68 { 0x434d, "C-Media" },
68 { 0x8384, "SigmaTel" }, 69 { 0x8384, "SigmaTel" },
69 {} /* terminator */ 70 {} /* terminator */
diff --git a/sound/pci/hda/hda_intel.c b/sound/pci/hda/hda_intel.c
index 9f316c1b2790..35722ec920cb 100644
--- a/sound/pci/hda/hda_intel.c
+++ b/sound/pci/hda/hda_intel.c
@@ -45,6 +45,7 @@
45#include <linux/slab.h> 45#include <linux/slab.h>
46#include <linux/pci.h> 46#include <linux/pci.h>
47#include <linux/mutex.h> 47#include <linux/mutex.h>
48#include <linux/reboot.h>
48#include <sound/core.h> 49#include <sound/core.h>
49#include <sound/initval.h> 50#include <sound/initval.h>
50#include "hda_codec.h" 51#include "hda_codec.h"
@@ -397,6 +398,9 @@ struct azx {
397 398
398 /* for pending irqs */ 399 /* for pending irqs */
399 struct work_struct irq_pending_work; 400 struct work_struct irq_pending_work;
401
402 /* reboot notifier (for mysterious hangup problem at power-down) */
403 struct notifier_block reboot_notifier;
400}; 404};
401 405
402/* driver types */ 406/* driver types */
@@ -1979,12 +1983,36 @@ static int azx_resume(struct pci_dev *pci)
1979 1983
1980 1984
1981/* 1985/*
1986 * reboot notifier for hang-up problem at power-down
1987 */
1988static int azx_halt(struct notifier_block *nb, unsigned long event, void *buf)
1989{
1990 struct azx *chip = container_of(nb, struct azx, reboot_notifier);
1991 azx_stop_chip(chip);
1992 return NOTIFY_OK;
1993}
1994
1995static void azx_notifier_register(struct azx *chip)
1996{
1997 chip->reboot_notifier.notifier_call = azx_halt;
1998 register_reboot_notifier(&chip->reboot_notifier);
1999}
2000
2001static void azx_notifier_unregister(struct azx *chip)
2002{
2003 if (chip->reboot_notifier.notifier_call)
2004 unregister_reboot_notifier(&chip->reboot_notifier);
2005}
2006
2007/*
1982 * destructor 2008 * destructor
1983 */ 2009 */
1984static int azx_free(struct azx *chip) 2010static int azx_free(struct azx *chip)
1985{ 2011{
1986 int i; 2012 int i;
1987 2013
2014 azx_notifier_unregister(chip);
2015
1988 if (chip->initialized) { 2016 if (chip->initialized) {
1989 azx_clear_irq_pending(chip); 2017 azx_clear_irq_pending(chip);
1990 for (i = 0; i < chip->num_streams; i++) 2018 for (i = 0; i < chip->num_streams; i++)
@@ -2158,7 +2186,7 @@ static int __devinit azx_create(struct snd_card *card, struct pci_dev *pci,
2158 } 2186 }
2159 2187
2160 chip->addr = pci_resource_start(pci, 0); 2188 chip->addr = pci_resource_start(pci, 0);
2161 chip->remap_addr = ioremap_nocache(chip->addr, pci_resource_len(pci,0)); 2189 chip->remap_addr = pci_ioremap_bar(pci, 0);
2162 if (chip->remap_addr == NULL) { 2190 if (chip->remap_addr == NULL) {
2163 snd_printk(KERN_ERR SFX "ioremap error\n"); 2191 snd_printk(KERN_ERR SFX "ioremap error\n");
2164 err = -ENXIO; 2192 err = -ENXIO;
@@ -2348,6 +2376,7 @@ static int __devinit azx_probe(struct pci_dev *pci,
2348 pci_set_drvdata(pci, card); 2376 pci_set_drvdata(pci, card);
2349 chip->running = 1; 2377 chip->running = 1;
2350 power_down_all_codecs(chip); 2378 power_down_all_codecs(chip);
2379 azx_notifier_register(chip);
2351 2380
2352 dev++; 2381 dev++;
2353 return err; 2382 return err;
diff --git a/sound/pci/hda/patch_analog.c b/sound/pci/hda/patch_analog.c
index 2b00c4afdf97..d3fd432cb3ea 100644
--- a/sound/pci/hda/patch_analog.c
+++ b/sound/pci/hda/patch_analog.c
@@ -3860,6 +3860,7 @@ static const char *ad1884a_models[AD1884A_MODELS] = {
3860 3860
3861static struct snd_pci_quirk ad1884a_cfg_tbl[] = { 3861static struct snd_pci_quirk ad1884a_cfg_tbl[] = {
3862 SND_PCI_QUIRK(0x103c, 0x3030, "HP", AD1884A_MOBILE), 3862 SND_PCI_QUIRK(0x103c, 0x3030, "HP", AD1884A_MOBILE),
3863 SND_PCI_QUIRK(0x103c, 0x3056, "HP", AD1884A_MOBILE),
3863 SND_PCI_QUIRK(0x17aa, 0x20ac, "Thinkpad X300", AD1884A_THINKPAD), 3864 SND_PCI_QUIRK(0x17aa, 0x20ac, "Thinkpad X300", AD1884A_THINKPAD),
3864 {} 3865 {}
3865}; 3866};
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
index ef4955c73c88..a4666c96a44f 100644
--- a/sound/pci/hda/patch_realtek.c
+++ b/sound/pci/hda/patch_realtek.c
@@ -307,6 +307,13 @@ struct alc_spec {
307 /* for PLL fix */ 307 /* for PLL fix */
308 hda_nid_t pll_nid; 308 hda_nid_t pll_nid;
309 unsigned int pll_coef_idx, pll_coef_bit; 309 unsigned int pll_coef_idx, pll_coef_bit;
310
311#ifdef SND_HDA_NEEDS_RESUME
312#define ALC_MAX_PINS 16
313 unsigned int num_pins;
314 hda_nid_t pin_nids[ALC_MAX_PINS];
315 unsigned int pin_cfgs[ALC_MAX_PINS];
316#endif
310}; 317};
311 318
312/* 319/*
@@ -822,6 +829,7 @@ static void alc_sku_automute(struct hda_codec *codec)
822 spec->jack_present ? 0 : PIN_OUT); 829 spec->jack_present ? 0 : PIN_OUT);
823} 830}
824 831
832#if 0 /* it's broken in some acses -- temporarily disabled */
825static void alc_mic_automute(struct hda_codec *codec) 833static void alc_mic_automute(struct hda_codec *codec)
826{ 834{
827 struct alc_spec *spec = codec->spec; 835 struct alc_spec *spec = codec->spec;
@@ -842,6 +850,9 @@ static void alc_mic_automute(struct hda_codec *codec)
842 snd_hda_codec_amp_stereo(codec, 0x0b, HDA_INPUT, capsrc_idx_fmic, 850 snd_hda_codec_amp_stereo(codec, 0x0b, HDA_INPUT, capsrc_idx_fmic,
843 HDA_AMP_MUTE, present ? HDA_AMP_MUTE : 0); 851 HDA_AMP_MUTE, present ? HDA_AMP_MUTE : 0);
844} 852}
853#else
854#define alc_mic_automute(codec) /* NOP */
855#endif /* disabled */
845 856
846/* unsolicited event for HP jack sensing */ 857/* unsolicited event for HP jack sensing */
847static void alc_sku_unsol_event(struct hda_codec *codec, unsigned int res) 858static void alc_sku_unsol_event(struct hda_codec *codec, unsigned int res)
@@ -1051,12 +1062,14 @@ do_sku:
1051 AC_VERB_SET_UNSOLICITED_ENABLE, 1062 AC_VERB_SET_UNSOLICITED_ENABLE,
1052 AC_USRSP_EN | ALC880_HP_EVENT); 1063 AC_USRSP_EN | ALC880_HP_EVENT);
1053 1064
1065#if 0 /* it's broken in some acses -- temporarily disabled */
1054 if (spec->autocfg.input_pins[AUTO_PIN_MIC] && 1066 if (spec->autocfg.input_pins[AUTO_PIN_MIC] &&
1055 spec->autocfg.input_pins[AUTO_PIN_FRONT_MIC]) 1067 spec->autocfg.input_pins[AUTO_PIN_FRONT_MIC])
1056 snd_hda_codec_write(codec, 1068 snd_hda_codec_write(codec,
1057 spec->autocfg.input_pins[AUTO_PIN_MIC], 0, 1069 spec->autocfg.input_pins[AUTO_PIN_MIC], 0,
1058 AC_VERB_SET_UNSOLICITED_ENABLE, 1070 AC_VERB_SET_UNSOLICITED_ENABLE,
1059 AC_USRSP_EN | ALC880_MIC_EVENT); 1071 AC_USRSP_EN | ALC880_MIC_EVENT);
1072#endif /* disabled */
1060 1073
1061 spec->unsol_event = alc_sku_unsol_event; 1074 spec->unsol_event = alc_sku_unsol_event;
1062} 1075}
@@ -2778,6 +2791,64 @@ static void alc_free(struct hda_codec *codec)
2778 codec->spec = NULL; /* to be sure */ 2791 codec->spec = NULL; /* to be sure */
2779} 2792}
2780 2793
2794#ifdef SND_HDA_NEEDS_RESUME
2795static void store_pin_configs(struct hda_codec *codec)
2796{
2797 struct alc_spec *spec = codec->spec;
2798 hda_nid_t nid, end_nid;
2799
2800 end_nid = codec->start_nid + codec->num_nodes;
2801 for (nid = codec->start_nid; nid < end_nid; nid++) {
2802 unsigned int wid_caps = get_wcaps(codec, nid);
2803 unsigned int wid_type =
2804 (wid_caps & AC_WCAP_TYPE) >> AC_WCAP_TYPE_SHIFT;
2805 if (wid_type != AC_WID_PIN)
2806 continue;
2807 if (spec->num_pins >= ARRAY_SIZE(spec->pin_nids))
2808 break;
2809 spec->pin_nids[spec->num_pins] = nid;
2810 spec->pin_cfgs[spec->num_pins] =
2811 snd_hda_codec_read(codec, nid, 0,
2812 AC_VERB_GET_CONFIG_DEFAULT, 0);
2813 spec->num_pins++;
2814 }
2815}
2816
2817static void resume_pin_configs(struct hda_codec *codec)
2818{
2819 struct alc_spec *spec = codec->spec;
2820 int i;
2821
2822 for (i = 0; i < spec->num_pins; i++) {
2823 hda_nid_t pin_nid = spec->pin_nids[i];
2824 unsigned int pin_config = spec->pin_cfgs[i];
2825 snd_hda_codec_write(codec, pin_nid, 0,
2826 AC_VERB_SET_CONFIG_DEFAULT_BYTES_0,
2827 pin_config & 0x000000ff);
2828 snd_hda_codec_write(codec, pin_nid, 0,
2829 AC_VERB_SET_CONFIG_DEFAULT_BYTES_1,
2830 (pin_config & 0x0000ff00) >> 8);
2831 snd_hda_codec_write(codec, pin_nid, 0,
2832 AC_VERB_SET_CONFIG_DEFAULT_BYTES_2,
2833 (pin_config & 0x00ff0000) >> 16);
2834 snd_hda_codec_write(codec, pin_nid, 0,
2835 AC_VERB_SET_CONFIG_DEFAULT_BYTES_3,
2836 pin_config >> 24);
2837 }
2838}
2839
2840static int alc_resume(struct hda_codec *codec)
2841{
2842 resume_pin_configs(codec);
2843 codec->patch_ops.init(codec);
2844 snd_hda_codec_resume_amp(codec);
2845 snd_hda_codec_resume_cache(codec);
2846 return 0;
2847}
2848#else
2849#define store_pin_configs(codec)
2850#endif
2851
2781/* 2852/*
2782 */ 2853 */
2783static struct hda_codec_ops alc_patch_ops = { 2854static struct hda_codec_ops alc_patch_ops = {
@@ -2786,6 +2857,9 @@ static struct hda_codec_ops alc_patch_ops = {
2786 .init = alc_init, 2857 .init = alc_init,
2787 .free = alc_free, 2858 .free = alc_free,
2788 .unsol_event = alc_unsol_event, 2859 .unsol_event = alc_unsol_event,
2860#ifdef SND_HDA_NEEDS_RESUME
2861 .resume = alc_resume,
2862#endif
2789#ifdef CONFIG_SND_HDA_POWER_SAVE 2863#ifdef CONFIG_SND_HDA_POWER_SAVE
2790 .check_power_status = alc_check_power_status, 2864 .check_power_status = alc_check_power_status,
2791#endif 2865#endif
@@ -3832,6 +3906,7 @@ static int alc880_parse_auto_config(struct hda_codec *codec)
3832 spec->num_mux_defs = 1; 3906 spec->num_mux_defs = 1;
3833 spec->input_mux = &spec->private_imux; 3907 spec->input_mux = &spec->private_imux;
3834 3908
3909 store_pin_configs(codec);
3835 return 1; 3910 return 1;
3836} 3911}
3837 3912
@@ -5250,6 +5325,7 @@ static int alc260_parse_auto_config(struct hda_codec *codec)
5250 } 5325 }
5251 spec->num_mixers++; 5326 spec->num_mixers++;
5252 5327
5328 store_pin_configs(codec);
5253 return 1; 5329 return 1;
5254} 5330}
5255 5331
@@ -8338,6 +8414,7 @@ static const char *alc883_models[ALC883_MODEL_LAST] = {
8338static struct snd_pci_quirk alc883_cfg_tbl[] = { 8414static struct snd_pci_quirk alc883_cfg_tbl[] = {
8339 SND_PCI_QUIRK(0x1019, 0x6668, "ECS", ALC883_3ST_6ch_DIG), 8415 SND_PCI_QUIRK(0x1019, 0x6668, "ECS", ALC883_3ST_6ch_DIG),
8340 SND_PCI_QUIRK(0x1025, 0x006c, "Acer Aspire 9810", ALC883_ACER_ASPIRE), 8416 SND_PCI_QUIRK(0x1025, 0x006c, "Acer Aspire 9810", ALC883_ACER_ASPIRE),
8417 SND_PCI_QUIRK(0x1025, 0x0090, "Acer Aspire", ALC883_ACER_ASPIRE),
8341 SND_PCI_QUIRK(0x1025, 0x0110, "Acer Aspire", ALC883_ACER_ASPIRE), 8418 SND_PCI_QUIRK(0x1025, 0x0110, "Acer Aspire", ALC883_ACER_ASPIRE),
8342 SND_PCI_QUIRK(0x1025, 0x0112, "Acer Aspire 9303", ALC883_ACER_ASPIRE), 8419 SND_PCI_QUIRK(0x1025, 0x0112, "Acer Aspire 9303", ALC883_ACER_ASPIRE),
8343 SND_PCI_QUIRK(0x1025, 0x0121, "Acer Aspire 5920G", ALC883_ACER_ASPIRE), 8420 SND_PCI_QUIRK(0x1025, 0x0121, "Acer Aspire 5920G", ALC883_ACER_ASPIRE),
@@ -10313,6 +10390,7 @@ static int alc262_parse_auto_config(struct hda_codec *codec)
10313 if (err < 0) 10390 if (err < 0)
10314 return err; 10391 return err;
10315 10392
10393 store_pin_configs(codec);
10316 return 1; 10394 return 1;
10317} 10395}
10318 10396
@@ -11447,6 +11525,7 @@ static int alc268_parse_auto_config(struct hda_codec *codec)
11447 if (err < 0) 11525 if (err < 0)
11448 return err; 11526 return err;
11449 11527
11528 store_pin_configs(codec);
11450 return 1; 11529 return 1;
11451} 11530}
11452 11531
@@ -12166,8 +12245,26 @@ static int alc269_auto_create_multi_out_ctls(struct alc_spec *spec,
12166 return 0; 12245 return 0;
12167} 12246}
12168 12247
12169#define alc269_auto_create_analog_input_ctls \ 12248static int alc269_auto_create_analog_input_ctls(struct alc_spec *spec,
12170 alc880_auto_create_analog_input_ctls 12249 const struct auto_pin_cfg *cfg)
12250{
12251 int err;
12252
12253 err = alc880_auto_create_analog_input_ctls(spec, cfg);
12254 if (err < 0)
12255 return err;
12256 /* digital-mic input pin is excluded in alc880_auto_create..()
12257 * because it's under 0x18
12258 */
12259 if (cfg->input_pins[AUTO_PIN_MIC] == 0x12 ||
12260 cfg->input_pins[AUTO_PIN_FRONT_MIC] == 0x12) {
12261 struct hda_input_mux *imux = &spec->private_imux;
12262 imux->items[imux->num_items].label = "Int Mic";
12263 imux->items[imux->num_items].index = 0x05;
12264 imux->num_items++;
12265 }
12266 return 0;
12267}
12171 12268
12172#ifdef CONFIG_SND_HDA_POWER_SAVE 12269#ifdef CONFIG_SND_HDA_POWER_SAVE
12173#define alc269_loopbacks alc880_loopbacks 12270#define alc269_loopbacks alc880_loopbacks
@@ -12230,6 +12327,7 @@ static int alc269_parse_auto_config(struct hda_codec *codec)
12230 spec->mixers[spec->num_mixers] = alc269_capture_mixer; 12327 spec->mixers[spec->num_mixers] = alc269_capture_mixer;
12231 spec->num_mixers++; 12328 spec->num_mixers++;
12232 12329
12330 store_pin_configs(codec);
12233 return 1; 12331 return 1;
12234} 12332}
12235 12333
@@ -13316,6 +13414,7 @@ static int alc861_parse_auto_config(struct hda_codec *codec)
13316 spec->mixers[spec->num_mixers] = alc861_capture_mixer; 13414 spec->mixers[spec->num_mixers] = alc861_capture_mixer;
13317 spec->num_mixers++; 13415 spec->num_mixers++;
13318 13416
13417 store_pin_configs(codec);
13319 return 1; 13418 return 1;
13320} 13419}
13321 13420
@@ -14427,6 +14526,7 @@ static int alc861vd_parse_auto_config(struct hda_codec *codec)
14427 if (err < 0) 14526 if (err < 0)
14428 return err; 14527 return err;
14429 14528
14529 store_pin_configs(codec);
14430 return 1; 14530 return 1;
14431} 14531}
14432 14532
@@ -16258,6 +16358,8 @@ static int alc662_parse_auto_config(struct hda_codec *codec)
16258 16358
16259 spec->mixers[spec->num_mixers] = alc662_capture_mixer; 16359 spec->mixers[spec->num_mixers] = alc662_capture_mixer;
16260 spec->num_mixers++; 16360 spec->num_mixers++;
16361
16362 store_pin_configs(codec);
16261 return 1; 16363 return 1;
16262} 16364}
16263 16365
diff --git a/sound/pci/hda/patch_sigmatel.c b/sound/pci/hda/patch_sigmatel.c
index 788fdc6f3264..e6085915d86d 100644
--- a/sound/pci/hda/patch_sigmatel.c
+++ b/sound/pci/hda/patch_sigmatel.c
@@ -69,6 +69,7 @@ enum {
69enum { 69enum {
70 STAC_92HD73XX_REF, 70 STAC_92HD73XX_REF,
71 STAC_DELL_M6, 71 STAC_DELL_M6,
72 STAC_DELL_EQ,
72 STAC_92HD73XX_MODELS 73 STAC_92HD73XX_MODELS
73}; 74};
74 75
@@ -566,10 +567,8 @@ static int stac92xx_smux_enum_put(struct snd_kcontrol *kcontrol,
566 nid = codec->slave_dig_outs[smux_idx - 1]; 567 nid = codec->slave_dig_outs[smux_idx - 1];
567 if (spec->cur_smux[smux_idx] == smux->num_items - 1) 568 if (spec->cur_smux[smux_idx] == smux->num_items - 1)
568 val = AMP_OUT_MUTE; 569 val = AMP_OUT_MUTE;
569 if (smux_idx == 0)
570 nid = spec->multiout.dig_out_nid;
571 else 570 else
572 nid = codec->slave_dig_outs[smux_idx - 1]; 571 val = AMP_OUT_UNMUTE;
573 /* un/mute SPDIF out */ 572 /* un/mute SPDIF out */
574 snd_hda_codec_write_cache(codec, nid, 0, 573 snd_hda_codec_write_cache(codec, nid, 0,
575 AC_VERB_SET_AMP_GAIN_MUTE, val); 574 AC_VERB_SET_AMP_GAIN_MUTE, val);
@@ -775,9 +774,7 @@ static struct hda_verb dell_eq_core_init[] = {
775}; 774};
776 775
777static struct hda_verb dell_m6_core_init[] = { 776static struct hda_verb dell_m6_core_init[] = {
778 /* set master volume to max value without distortion 777 { 0x1f, AC_VERB_SET_VOLUME_KNOB_CONTROL, 0xff},
779 * and direct control */
780 { 0x1f, AC_VERB_SET_VOLUME_KNOB_CONTROL, 0xec},
781 /* setup audio connections */ 778 /* setup audio connections */
782 { 0x0d, AC_VERB_SET_CONNECT_SEL, 0x00}, 779 { 0x0d, AC_VERB_SET_CONNECT_SEL, 0x00},
783 { 0x0a, AC_VERB_SET_CONNECT_SEL, 0x01}, 780 { 0x0a, AC_VERB_SET_CONNECT_SEL, 0x01},
@@ -1602,11 +1599,13 @@ static unsigned int dell_m6_pin_configs[13] = {
1602static unsigned int *stac92hd73xx_brd_tbl[STAC_92HD73XX_MODELS] = { 1599static unsigned int *stac92hd73xx_brd_tbl[STAC_92HD73XX_MODELS] = {
1603 [STAC_92HD73XX_REF] = ref92hd73xx_pin_configs, 1600 [STAC_92HD73XX_REF] = ref92hd73xx_pin_configs,
1604 [STAC_DELL_M6] = dell_m6_pin_configs, 1601 [STAC_DELL_M6] = dell_m6_pin_configs,
1602 [STAC_DELL_EQ] = dell_m6_pin_configs,
1605}; 1603};
1606 1604
1607static const char *stac92hd73xx_models[STAC_92HD73XX_MODELS] = { 1605static const char *stac92hd73xx_models[STAC_92HD73XX_MODELS] = {
1608 [STAC_92HD73XX_REF] = "ref", 1606 [STAC_92HD73XX_REF] = "ref",
1609 [STAC_DELL_M6] = "dell-m6", 1607 [STAC_DELL_M6] = "dell-m6",
1608 [STAC_DELL_EQ] = "dell-eq",
1610}; 1609};
1611 1610
1612static struct snd_pci_quirk stac92hd73xx_cfg_tbl[] = { 1611static struct snd_pci_quirk stac92hd73xx_cfg_tbl[] = {
@@ -4133,12 +4132,17 @@ again:
4133 sizeof(stac92hd73xx_dmux)); 4132 sizeof(stac92hd73xx_dmux));
4134 4133
4135 switch (spec->board_config) { 4134 switch (spec->board_config) {
4136 case STAC_DELL_M6: 4135 case STAC_DELL_EQ:
4137 spec->init = dell_eq_core_init; 4136 spec->init = dell_eq_core_init;
4137 /* fallthru */
4138 case STAC_DELL_M6:
4138 spec->num_smuxes = 0; 4139 spec->num_smuxes = 0;
4139 spec->mixer = &stac92hd73xx_6ch_mixer[DELL_M6_MIXER]; 4140 spec->mixer = &stac92hd73xx_6ch_mixer[DELL_M6_MIXER];
4140 spec->amp_nids = &stac92hd73xx_amp_nids[DELL_M6_AMP]; 4141 spec->amp_nids = &stac92hd73xx_amp_nids[DELL_M6_AMP];
4141 spec->num_amps = 1; 4142 spec->num_amps = 1;
4143
4144 if (!spec->init)
4145 spec->init = dell_m6_core_init;
4142 switch (codec->subsystem_id) { 4146 switch (codec->subsystem_id) {
4143 case 0x1028025e: /* Analog Mics */ 4147 case 0x1028025e: /* Analog Mics */
4144 case 0x1028025f: 4148 case 0x1028025f:
@@ -4148,8 +4152,6 @@ again:
4148 break; 4152 break;
4149 case 0x10280271: /* Digital Mics */ 4153 case 0x10280271: /* Digital Mics */
4150 case 0x10280272: 4154 case 0x10280272:
4151 spec->init = dell_m6_core_init;
4152 /* fall-through */
4153 case 0x10280254: 4155 case 0x10280254:
4154 case 0x10280255: 4156 case 0x10280255:
4155 stac92xx_set_config_reg(codec, 0x13, 0x90A60160); 4157 stac92xx_set_config_reg(codec, 0x13, 0x90A60160);
diff --git a/sound/pci/ice1712/ice1712.c b/sound/pci/ice1712/ice1712.c
index 5b442383fcda..58d7cda03de5 100644
--- a/sound/pci/ice1712/ice1712.c
+++ b/sound/pci/ice1712/ice1712.c
@@ -2688,12 +2688,13 @@ static int __devinit snd_ice1712_probe(struct pci_dev *pci,
2688 return err; 2688 return err;
2689 } 2689 }
2690 2690
2691 if (ice_has_con_ac97(ice)) 2691 if (ice_has_con_ac97(ice)) {
2692 err = snd_ice1712_pcm(ice, pcm_dev++, NULL); 2692 err = snd_ice1712_pcm(ice, pcm_dev++, NULL);
2693 if (err < 0) { 2693 if (err < 0) {
2694 snd_card_free(card); 2694 snd_card_free(card);
2695 return err; 2695 return err;
2696 } 2696 }
2697 }
2697 2698
2698 err = snd_ice1712_ac97_mixer(ice); 2699 err = snd_ice1712_ac97_mixer(ice);
2699 if (err < 0) { 2700 if (err < 0) {
@@ -2715,12 +2716,13 @@ static int __devinit snd_ice1712_probe(struct pci_dev *pci,
2715 } 2716 }
2716 } 2717 }
2717 2718
2718 if (ice_has_con_ac97(ice)) 2719 if (ice_has_con_ac97(ice)) {
2719 err = snd_ice1712_pcm_ds(ice, pcm_dev++, NULL); 2720 err = snd_ice1712_pcm_ds(ice, pcm_dev++, NULL);
2720 if (err < 0) { 2721 if (err < 0) {
2721 snd_card_free(card); 2722 snd_card_free(card);
2722 return err; 2723 return err;
2723 } 2724 }
2725 }
2724 2726
2725 if (!c->no_mpu401) { 2727 if (!c->no_mpu401) {
2726 err = snd_mpu401_uart_new(card, 0, MPU401_HW_ICE1712, 2728 err = snd_mpu401_uart_new(card, 0, MPU401_HW_ICE1712,
diff --git a/sound/pci/intel8x0.c b/sound/pci/intel8x0.c
index c88d1eace1c4..19d3391e229f 100644
--- a/sound/pci/intel8x0.c
+++ b/sound/pci/intel8x0.c
@@ -2702,6 +2702,7 @@ static struct snd_pci_quirk intel8x0_clock_list[] __devinitdata = {
2702 SND_PCI_QUIRK(0x0e11, 0x008a, "AD1885", 41000), 2702 SND_PCI_QUIRK(0x0e11, 0x008a, "AD1885", 41000),
2703 SND_PCI_QUIRK(0x1028, 0x00be, "AD1885", 44100), 2703 SND_PCI_QUIRK(0x1028, 0x00be, "AD1885", 44100),
2704 SND_PCI_QUIRK(0x1028, 0x0177, "AD1980", 48000), 2704 SND_PCI_QUIRK(0x1028, 0x0177, "AD1980", 48000),
2705 SND_PCI_QUIRK(0x1028, 0x01ad, "AD1981B", 48000),
2705 SND_PCI_QUIRK(0x1043, 0x80f3, "AD1985", 48000), 2706 SND_PCI_QUIRK(0x1043, 0x80f3, "AD1985", 48000),
2706 { } /* terminator */ 2707 { } /* terminator */
2707}; 2708};
diff --git a/sound/pci/mixart/mixart.c b/sound/pci/mixart/mixart.c
index 2d0dce649a64..ae7601f353a7 100644
--- a/sound/pci/mixart/mixart.c
+++ b/sound/pci/mixart/mixart.c
@@ -1314,8 +1314,7 @@ static int __devinit snd_mixart_probe(struct pci_dev *pci,
1314 } 1314 }
1315 for (i = 0; i < 2; i++) { 1315 for (i = 0; i < 2; i++) {
1316 mgr->mem[i].phys = pci_resource_start(pci, i); 1316 mgr->mem[i].phys = pci_resource_start(pci, i);
1317 mgr->mem[i].virt = ioremap_nocache(mgr->mem[i].phys, 1317 mgr->mem[i].virt = pci_ioremap_bar(pci, i);
1318 pci_resource_len(pci, i));
1319 if (!mgr->mem[i].virt) { 1318 if (!mgr->mem[i].virt) {
1320 printk(KERN_ERR "unable to remap resource 0x%lx\n", 1319 printk(KERN_ERR "unable to remap resource 0x%lx\n",
1321 mgr->mem[i].phys); 1320 mgr->mem[i].phys);
diff --git a/sound/soc/blackfin/bf5xx-i2s.c b/sound/soc/blackfin/bf5xx-i2s.c
index 827587f08180..e020c160ee44 100644
--- a/sound/soc/blackfin/bf5xx-i2s.c
+++ b/sound/soc/blackfin/bf5xx-i2s.c
@@ -70,12 +70,24 @@ static struct sport_param sport_params[2] = {
70 } 70 }
71}; 71};
72 72
73static u16 sport_req[][7] = { 73/*
74 { P_SPORT0_DTPRI, P_SPORT0_TSCLK, P_SPORT0_RFS, 74 * Setting the TFS pin selector for SPORT 0 based on whether the selected
75 P_SPORT0_DRPRI, P_SPORT0_RSCLK, 0}, 75 * port id F or G. If the port is F then no conflict should exist for the
76 { P_SPORT1_DTPRI, P_SPORT1_TSCLK, P_SPORT1_RFS, 76 * TFS. When Port G is selected and EMAC then there is a conflict between
77 P_SPORT1_DRPRI, P_SPORT1_RSCLK, 0}, 77 * the PHY interrupt line and TFS. Current settings prevent the conflict
78}; 78 * by ignoring the TFS pin when Port G is selected. This allows both
79 * ssm2602 using Port G and EMAC concurrently.
80 */
81#ifdef CONFIG_BF527_SPORT0_PORTF
82#define LOCAL_SPORT0_TFS (P_SPORT0_TFS)
83#else
84#define LOCAL_SPORT0_TFS (0)
85#endif
86
87static u16 sport_req[][7] = { {P_SPORT0_DTPRI, P_SPORT0_TSCLK, P_SPORT0_RFS,
88 P_SPORT0_DRPRI, P_SPORT0_RSCLK, LOCAL_SPORT0_TFS, 0},
89 {P_SPORT1_DTPRI, P_SPORT1_TSCLK, P_SPORT1_RFS, P_SPORT1_DRPRI,
90 P_SPORT1_RSCLK, P_SPORT1_TFS, 0} };
79 91
80static int bf5xx_i2s_set_dai_fmt(struct snd_soc_dai *cpu_dai, 92static int bf5xx_i2s_set_dai_fmt(struct snd_soc_dai *cpu_dai,
81 unsigned int fmt) 93 unsigned int fmt)
@@ -98,23 +110,21 @@ static int bf5xx_i2s_set_dai_fmt(struct snd_soc_dai *cpu_dai,
98 ret = -EINVAL; 110 ret = -EINVAL;
99 break; 111 break;
100 default: 112 default:
113 printk(KERN_ERR "%s: Unknown DAI format type\n", __func__);
101 ret = -EINVAL; 114 ret = -EINVAL;
102 break; 115 break;
103 } 116 }
104 117
105 switch (fmt & SND_SOC_DAIFMT_MASTER_MASK) { 118 switch (fmt & SND_SOC_DAIFMT_MASTER_MASK) {
106 case SND_SOC_DAIFMT_CBS_CFS:
107 ret = -EINVAL;
108 break;
109 case SND_SOC_DAIFMT_CBM_CFS:
110 ret = -EINVAL;
111 break;
112 case SND_SOC_DAIFMT_CBM_CFM: 119 case SND_SOC_DAIFMT_CBM_CFM:
113 break; 120 break;
121 case SND_SOC_DAIFMT_CBS_CFS:
122 case SND_SOC_DAIFMT_CBM_CFS:
114 case SND_SOC_DAIFMT_CBS_CFM: 123 case SND_SOC_DAIFMT_CBS_CFM:
115 ret = -EINVAL; 124 ret = -EINVAL;
116 break; 125 break;
117 default: 126 default:
127 printk(KERN_ERR "%s: Unknown DAI master type\n", __func__);
118 ret = -EINVAL; 128 ret = -EINVAL;
119 break; 129 break;
120 } 130 }
diff --git a/sound/soc/codecs/wm9713.c b/sound/soc/codecs/wm9713.c
index aba402b3c999..945b32ed9884 100644
--- a/sound/soc/codecs/wm9713.c
+++ b/sound/soc/codecs/wm9713.c
@@ -140,7 +140,7 @@ SOC_SINGLE("Capture ADC Boost (+20dB) Switch", AC97_VIDEO, 6, 1, 0),
140 140
141SOC_SINGLE("ALC Target Volume", AC97_CODEC_CLASS_REV, 12, 15, 0), 141SOC_SINGLE("ALC Target Volume", AC97_CODEC_CLASS_REV, 12, 15, 0),
142SOC_SINGLE("ALC Hold Time", AC97_CODEC_CLASS_REV, 8, 15, 0), 142SOC_SINGLE("ALC Hold Time", AC97_CODEC_CLASS_REV, 8, 15, 0),
143SOC_SINGLE("ALC Decay Time ", AC97_CODEC_CLASS_REV, 4, 15, 0), 143SOC_SINGLE("ALC Decay Time", AC97_CODEC_CLASS_REV, 4, 15, 0),
144SOC_SINGLE("ALC Attack Time", AC97_CODEC_CLASS_REV, 0, 15, 0), 144SOC_SINGLE("ALC Attack Time", AC97_CODEC_CLASS_REV, 0, 15, 0),
145SOC_ENUM("ALC Function", wm9713_enum[6]), 145SOC_ENUM("ALC Function", wm9713_enum[6]),
146SOC_SINGLE("ALC Max Volume", AC97_PCI_SVID, 11, 7, 0), 146SOC_SINGLE("ALC Max Volume", AC97_PCI_SVID, 11, 7, 0),
diff --git a/sound/soc/fsl/mpc5200_psc_i2s.c b/sound/soc/fsl/mpc5200_psc_i2s.c
index 86923299bc10..94a02eaa4825 100644
--- a/sound/soc/fsl/mpc5200_psc_i2s.c
+++ b/sound/soc/fsl/mpc5200_psc_i2s.c
@@ -277,7 +277,7 @@ static int psc_i2s_trigger(struct snd_pcm_substream *substream, int cmd)
277 struct mpc52xx_psc __iomem *regs = psc_i2s->psc_regs; 277 struct mpc52xx_psc __iomem *regs = psc_i2s->psc_regs;
278 u16 imr; 278 u16 imr;
279 u8 psc_cmd; 279 u8 psc_cmd;
280 long flags; 280 unsigned long flags;
281 281
282 if (substream->pstr->stream == SNDRV_PCM_STREAM_CAPTURE) 282 if (substream->pstr->stream == SNDRV_PCM_STREAM_CAPTURE)
283 s = &psc_i2s->capture; 283 s = &psc_i2s->capture;
@@ -699,9 +699,11 @@ static ssize_t psc_i2s_stat_store(struct device *dev,
699 return count; 699 return count;
700} 700}
701 701
702DEVICE_ATTR(status, 0644, psc_i2s_status_show, NULL); 702static DEVICE_ATTR(status, 0644, psc_i2s_status_show, NULL);
703DEVICE_ATTR(playback_underrun, 0644, psc_i2s_stat_show, psc_i2s_stat_store); 703static DEVICE_ATTR(playback_underrun, 0644, psc_i2s_stat_show,
704DEVICE_ATTR(capture_overrun, 0644, psc_i2s_stat_show, psc_i2s_stat_store); 704 psc_i2s_stat_store);
705static DEVICE_ATTR(capture_overrun, 0644, psc_i2s_stat_show,
706 psc_i2s_stat_store);
705 707
706/* --------------------------------------------------------------------- 708/* ---------------------------------------------------------------------
707 * OF platform bus binding code: 709 * OF platform bus binding code:
@@ -819,8 +821,8 @@ static int __devinit psc_i2s_of_probe(struct of_device *op,
819 821
820 /* Register the SYSFS files */ 822 /* Register the SYSFS files */
821 rc = device_create_file(psc_i2s->dev, &dev_attr_status); 823 rc = device_create_file(psc_i2s->dev, &dev_attr_status);
822 rc = device_create_file(psc_i2s->dev, &dev_attr_capture_overrun); 824 rc |= device_create_file(psc_i2s->dev, &dev_attr_capture_overrun);
823 rc = device_create_file(psc_i2s->dev, &dev_attr_playback_underrun); 825 rc |= device_create_file(psc_i2s->dev, &dev_attr_playback_underrun);
824 if (rc) 826 if (rc)
825 dev_info(psc_i2s->dev, "error creating sysfs files\n"); 827 dev_info(psc_i2s->dev, "error creating sysfs files\n");
826 828
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
index 462e635dfc74..16c7453f4946 100644
--- a/sound/soc/soc-core.c
+++ b/sound/soc/soc-core.c
@@ -95,8 +95,8 @@ static int soc_ac97_dev_register(struct snd_soc_codec *codec)
95 codec->ac97->dev.parent = NULL; 95 codec->ac97->dev.parent = NULL;
96 codec->ac97->dev.release = soc_ac97_device_release; 96 codec->ac97->dev.release = soc_ac97_device_release;
97 97
98 snprintf(codec->ac97->dev.bus_id, BUS_ID_SIZE, "%d-%d:%s", 98 dev_set_name(&codec->ac97->dev, "%d-%d:%s",
99 codec->card->number, 0, codec->name); 99 codec->card->number, 0, codec->name);
100 err = device_register(&codec->ac97->dev); 100 err = device_register(&codec->ac97->dev);
101 if (err < 0) { 101 if (err < 0) {
102 snd_printk(KERN_ERR "Can't register ac97 bus\n"); 102 snd_printk(KERN_ERR "Can't register ac97 bus\n");
@@ -1462,7 +1462,7 @@ int snd_soc_info_volsw(struct snd_kcontrol *kcontrol,
1462 struct soc_mixer_control *mc = 1462 struct soc_mixer_control *mc =
1463 (struct soc_mixer_control *)kcontrol->private_value; 1463 (struct soc_mixer_control *)kcontrol->private_value;
1464 int max = mc->max; 1464 int max = mc->max;
1465 unsigned int shift = mc->min; 1465 unsigned int shift = mc->shift;
1466 unsigned int rshift = mc->rshift; 1466 unsigned int rshift = mc->rshift;
1467 1467
1468 if (max == 1) 1468 if (max == 1)
diff --git a/sound/sound_core.c b/sound/sound_core.c
index faef87a9bc3f..a75b289a5d78 100644
--- a/sound/sound_core.c
+++ b/sound/sound_core.c
@@ -57,7 +57,7 @@ module_exit(cleanup_soundcore);
57/* 57/*
58 * OSS sound core handling. Breaks out sound functions to submodules 58 * OSS sound core handling. Breaks out sound functions to submodules
59 * 59 *
60 * Author: Alan Cox <alan.cox@linux.org> 60 * Author: Alan Cox <alan@lxorguk.ukuu.org.uk>
61 * 61 *
62 * Fixes: 62 * Fixes:
63 * 63 *
diff --git a/sound/sparc/dbri.c b/sound/sparc/dbri.c
index c257ad8bdfbc..23ed6f04a718 100644
--- a/sound/sparc/dbri.c
+++ b/sound/sparc/dbri.c
@@ -2534,6 +2534,8 @@ static int __devinit snd_dbri_create(struct snd_card *card,
2534 dbri->dma = dma_alloc_coherent(&op->dev, 2534 dbri->dma = dma_alloc_coherent(&op->dev,
2535 sizeof(struct dbri_dma), 2535 sizeof(struct dbri_dma),
2536 &dbri->dma_dvma, GFP_ATOMIC); 2536 &dbri->dma_dvma, GFP_ATOMIC);
2537 if (!dbri->dma)
2538 return -ENOMEM;
2537 memset((void *)dbri->dma, 0, sizeof(struct dbri_dma)); 2539 memset((void *)dbri->dma, 0, sizeof(struct dbri_dma));
2538 2540
2539 dprintk(D_GEN, "DMA Cmd Block 0x%p (0x%08x)\n", 2541 dprintk(D_GEN, "DMA Cmd Block 0x%p (0x%08x)\n",
diff --git a/sound/usb/usbquirks.h b/sound/usb/usbquirks.h
index 69689e79bf79..92115755d98e 100644
--- a/sound/usb/usbquirks.h
+++ b/sound/usb/usbquirks.h
@@ -1480,6 +1480,36 @@ YAMAHA_DEVICE(0x7010, "UB99"),
1480 } 1480 }
1481 } 1481 }
1482}, 1482},
1483{
1484 /* Advanced modes of the Edirol UA-25EX.
1485 * For the standard mode, UA-25EX has ID 0582:00e7, which
1486 * offers only 16-bit PCM at 44.1 kHz and no MIDI.
1487 */
1488 USB_DEVICE_VENDOR_SPEC(0x0582, 0x00e6),
1489 .driver_info = (unsigned long) & (const struct snd_usb_audio_quirk) {
1490 .vendor_name = "EDIROL",
1491 .product_name = "UA-25EX",
1492 .ifnum = QUIRK_ANY_INTERFACE,
1493 .type = QUIRK_COMPOSITE,
1494 .data = (const struct snd_usb_audio_quirk[]) {
1495 {
1496 .ifnum = 0,
1497 .type = QUIRK_AUDIO_EDIROL_UAXX
1498 },
1499 {
1500 .ifnum = 1,
1501 .type = QUIRK_AUDIO_EDIROL_UAXX
1502 },
1503 {
1504 .ifnum = 2,
1505 .type = QUIRK_AUDIO_EDIROL_UAXX
1506 },
1507 {
1508 .ifnum = -1
1509 }
1510 }
1511 }
1512},
1483 1513
1484/* Guillemot devices */ 1514/* Guillemot devices */
1485{ 1515{