diff options
| author | Ingo Molnar <mingo@elte.hu> | 2008-11-23 02:55:47 -0500 |
|---|---|---|
| committer | Ingo Molnar <mingo@elte.hu> | 2008-11-23 02:55:47 -0500 |
| commit | ca9eed76133c00e7f4b1eeb4c1a6cb800cd2654c (patch) | |
| tree | 5f011f4bd00c921e41605b1915c227aeaf411a0d /sound | |
| parent | 8652cb4b0d87accbe78725fd2a13be2787059649 (diff) | |
| parent | 13d428afc007fcfcd6deeb215618f54cf9c0cae6 (diff) | |
Merge commit 'v2.6.28-rc6' into x86/debug
Diffstat (limited to 'sound')
38 files changed, 369 insertions, 131 deletions
diff --git a/sound/aoa/soundbus/core.c b/sound/aoa/soundbus/core.c index f84f3e50578..fa8ab2815a9 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 6d71f9a7ccb..636b3b52ef8 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 ef2352c2e45..b47ff8b44be 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 aef18682c03..a789efc9df3 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 c4995c9f573..39672f68ce5 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 | ||
| 149 | static inline void snd_rawmidi_output_trigger(struct snd_rawmidi_substream *substream,int up) | 149 | static 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 | ||
| 159 | static void snd_rawmidi_input_trigger(struct snd_rawmidi_substream *substream, int up) | 161 | static 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) | |||
| 1126 | int snd_rawmidi_transmit(struct snd_rawmidi_substream *substream, | 1132 | int 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 e582face89d..c584408c9f1 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 ecdbeb6d360..7783843ca9a 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 cd9b83e7f7d..0444cdeb4be 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/Kconfig b/sound/isa/Kconfig index 660beb41f76..ce0aa044e27 100644 --- a/sound/isa/Kconfig +++ b/sound/isa/Kconfig | |||
| @@ -211,7 +211,7 @@ config SND_GUSCLASSIC | |||
| 211 | 211 | ||
| 212 | config SND_GUSEXTREME | 212 | config SND_GUSEXTREME |
| 213 | tristate "Gravis UltraSound Extreme" | 213 | tristate "Gravis UltraSound Extreme" |
| 214 | select SND_HWDEP | 214 | select SND_OPL3_LIB |
| 215 | select SND_MPU401_UART | 215 | select SND_MPU401_UART |
| 216 | select SND_PCM | 216 | select SND_PCM |
| 217 | help | 217 | help |
diff --git a/sound/isa/ad1848/ad1848.c b/sound/isa/ad1848/ad1848.c index b68d20edc20..223a6c03881 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 efa8c80d05b..374b7177e11 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 ddd289120aa..f019d449e2d 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 91f9c15d3e3..019c9401663 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 f88639ea64b..b46377139cf 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 8f914b37bf8..426532a4d73 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 da13185eb0a..7ad4c3b41a8 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 336a3427790..667eccc676a 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 1cb13fe56ec..1308d8d3418 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 b8239f3168f..793b7f47843 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/pci/ac97/ac97_codec.c b/sound/pci/ac97/ac97_codec.c index 6704acbca8c..bd510eceff1 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/emu10k1/emu10k1_main.c b/sound/pci/emu10k1/emu10k1_main.c index 2f283ea6ad9..de5ee8f097f 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_beep.c b/sound/pci/hda/hda_beep.c index 9b77b3e0fa9..3ecd7e797de 100644 --- a/sound/pci/hda/hda_beep.c +++ b/sound/pci/hda/hda_beep.c | |||
| @@ -37,6 +37,9 @@ static void snd_hda_generate_beep(struct work_struct *work) | |||
| 37 | container_of(work, struct hda_beep, beep_work); | 37 | container_of(work, struct hda_beep, beep_work); |
| 38 | struct hda_codec *codec = beep->codec; | 38 | struct hda_codec *codec = beep->codec; |
| 39 | 39 | ||
| 40 | if (!beep->enabled) | ||
| 41 | return; | ||
| 42 | |||
| 40 | /* generate tone */ | 43 | /* generate tone */ |
| 41 | snd_hda_codec_write_cache(codec, beep->nid, 0, | 44 | snd_hda_codec_write_cache(codec, beep->nid, 0, |
| 42 | AC_VERB_SET_BEEP_CONTROL, beep->tone); | 45 | AC_VERB_SET_BEEP_CONTROL, beep->tone); |
| @@ -85,6 +88,10 @@ int snd_hda_attach_beep_device(struct hda_codec *codec, int nid) | |||
| 85 | snprintf(beep->phys, sizeof(beep->phys), | 88 | snprintf(beep->phys, sizeof(beep->phys), |
| 86 | "card%d/codec#%d/beep0", codec->bus->card->number, codec->addr); | 89 | "card%d/codec#%d/beep0", codec->bus->card->number, codec->addr); |
| 87 | input_dev = input_allocate_device(); | 90 | input_dev = input_allocate_device(); |
| 91 | if (!input_dev) { | ||
| 92 | kfree(beep); | ||
| 93 | return -ENOMEM; | ||
| 94 | } | ||
| 88 | 95 | ||
| 89 | /* setup digital beep device */ | 96 | /* setup digital beep device */ |
| 90 | input_dev->name = "HDA Digital PCBeep"; | 97 | input_dev->name = "HDA Digital PCBeep"; |
| @@ -115,6 +122,7 @@ int snd_hda_attach_beep_device(struct hda_codec *codec, int nid) | |||
| 115 | beep->nid = nid; | 122 | beep->nid = nid; |
| 116 | beep->dev = input_dev; | 123 | beep->dev = input_dev; |
| 117 | beep->codec = codec; | 124 | beep->codec = codec; |
| 125 | beep->enabled = 1; | ||
| 118 | codec->beep = beep; | 126 | codec->beep = beep; |
| 119 | 127 | ||
| 120 | INIT_WORK(&beep->beep_work, &snd_hda_generate_beep); | 128 | INIT_WORK(&beep->beep_work, &snd_hda_generate_beep); |
diff --git a/sound/pci/hda/hda_beep.h b/sound/pci/hda/hda_beep.h index de4036e6e71..b9679f081ca 100644 --- a/sound/pci/hda/hda_beep.h +++ b/sound/pci/hda/hda_beep.h | |||
| @@ -31,6 +31,7 @@ struct hda_beep { | |||
| 31 | char phys[32]; | 31 | char phys[32]; |
| 32 | int tone; | 32 | int tone; |
| 33 | int nid; | 33 | int nid; |
| 34 | int enabled; | ||
| 34 | struct work_struct beep_work; /* scheduled task for beep event */ | 35 | struct work_struct beep_work; /* scheduled task for beep event */ |
| 35 | }; | 36 | }; |
| 36 | 37 | ||
diff --git a/sound/pci/hda/hda_codec.c b/sound/pci/hda/hda_codec.c index 6447754ae56..ba1ab737b55 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 f080f8ce0ec..35722ec920c 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 | */ | ||
| 1988 | static 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 | |||
| 1995 | static 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 | |||
| 2001 | static 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 | */ |
| 1984 | static int azx_free(struct azx *chip) | 2010 | static 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++) |
| @@ -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/hda_proc.c b/sound/pci/hda/hda_proc.c index 743d77922bc..c39af986bff 100644 --- a/sound/pci/hda/hda_proc.c +++ b/sound/pci/hda/hda_proc.c | |||
| @@ -483,6 +483,8 @@ static void print_gpio(struct snd_info_buffer *buffer, | |||
| 483 | (gpio & AC_GPIO_UNSOLICITED) ? 1 : 0, | 483 | (gpio & AC_GPIO_UNSOLICITED) ? 1 : 0, |
| 484 | (gpio & AC_GPIO_WAKE) ? 1 : 0); | 484 | (gpio & AC_GPIO_WAKE) ? 1 : 0); |
| 485 | max = gpio & AC_GPIO_IO_COUNT; | 485 | max = gpio & AC_GPIO_IO_COUNT; |
| 486 | if (!max || max > 8) | ||
| 487 | return; | ||
| 486 | enable = snd_hda_codec_read(codec, nid, 0, | 488 | enable = snd_hda_codec_read(codec, nid, 0, |
| 487 | AC_VERB_GET_GPIO_MASK, 0); | 489 | AC_VERB_GET_GPIO_MASK, 0); |
| 488 | direction = snd_hda_codec_read(codec, nid, 0, | 490 | direction = snd_hda_codec_read(codec, nid, 0, |
diff --git a/sound/pci/hda/patch_analog.c b/sound/pci/hda/patch_analog.c index 2b00c4afdf9..686c77491de 100644 --- a/sound/pci/hda/patch_analog.c +++ b/sound/pci/hda/patch_analog.c | |||
| @@ -3860,6 +3860,9 @@ static const char *ad1884a_models[AD1884A_MODELS] = { | |||
| 3860 | 3860 | ||
| 3861 | static struct snd_pci_quirk ad1884a_cfg_tbl[] = { | 3861 | static 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), | ||
| 3864 | SND_PCI_QUIRK(0x103c, 0x30e7, "HP EliteBook 8530p", AD1884A_LAPTOP), | ||
| 3865 | SND_PCI_QUIRK(0x103c, 0x3614, "HP 6730s", AD1884A_LAPTOP), | ||
| 3863 | SND_PCI_QUIRK(0x17aa, 0x20ac, "Thinkpad X300", AD1884A_THINKPAD), | 3866 | SND_PCI_QUIRK(0x17aa, 0x20ac, "Thinkpad X300", AD1884A_THINKPAD), |
| 3864 | {} | 3867 | {} |
| 3865 | }; | 3868 | }; |
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c index 4eceab9bd10..a378c014512 100644 --- a/sound/pci/hda/patch_realtek.c +++ b/sound/pci/hda/patch_realtek.c | |||
| @@ -829,6 +829,7 @@ static void alc_sku_automute(struct hda_codec *codec) | |||
| 829 | spec->jack_present ? 0 : PIN_OUT); | 829 | spec->jack_present ? 0 : PIN_OUT); |
| 830 | } | 830 | } |
| 831 | 831 | ||
| 832 | #if 0 /* it's broken in some acses -- temporarily disabled */ | ||
| 832 | static void alc_mic_automute(struct hda_codec *codec) | 833 | static void alc_mic_automute(struct hda_codec *codec) |
| 833 | { | 834 | { |
| 834 | struct alc_spec *spec = codec->spec; | 835 | struct alc_spec *spec = codec->spec; |
| @@ -849,6 +850,9 @@ static void alc_mic_automute(struct hda_codec *codec) | |||
| 849 | 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, |
| 850 | HDA_AMP_MUTE, present ? HDA_AMP_MUTE : 0); | 851 | HDA_AMP_MUTE, present ? HDA_AMP_MUTE : 0); |
| 851 | } | 852 | } |
| 853 | #else | ||
| 854 | #define alc_mic_automute(codec) /* NOP */ | ||
| 855 | #endif /* disabled */ | ||
| 852 | 856 | ||
| 853 | /* unsolicited event for HP jack sensing */ | 857 | /* unsolicited event for HP jack sensing */ |
| 854 | static void alc_sku_unsol_event(struct hda_codec *codec, unsigned int res) | 858 | static void alc_sku_unsol_event(struct hda_codec *codec, unsigned int res) |
| @@ -1058,12 +1062,14 @@ do_sku: | |||
| 1058 | AC_VERB_SET_UNSOLICITED_ENABLE, | 1062 | AC_VERB_SET_UNSOLICITED_ENABLE, |
| 1059 | AC_USRSP_EN | ALC880_HP_EVENT); | 1063 | AC_USRSP_EN | ALC880_HP_EVENT); |
| 1060 | 1064 | ||
| 1065 | #if 0 /* it's broken in some acses -- temporarily disabled */ | ||
| 1061 | if (spec->autocfg.input_pins[AUTO_PIN_MIC] && | 1066 | if (spec->autocfg.input_pins[AUTO_PIN_MIC] && |
| 1062 | spec->autocfg.input_pins[AUTO_PIN_FRONT_MIC]) | 1067 | spec->autocfg.input_pins[AUTO_PIN_FRONT_MIC]) |
| 1063 | snd_hda_codec_write(codec, | 1068 | snd_hda_codec_write(codec, |
| 1064 | spec->autocfg.input_pins[AUTO_PIN_MIC], 0, | 1069 | spec->autocfg.input_pins[AUTO_PIN_MIC], 0, |
| 1065 | AC_VERB_SET_UNSOLICITED_ENABLE, | 1070 | AC_VERB_SET_UNSOLICITED_ENABLE, |
| 1066 | AC_USRSP_EN | ALC880_MIC_EVENT); | 1071 | AC_USRSP_EN | ALC880_MIC_EVENT); |
| 1072 | #endif /* disabled */ | ||
| 1067 | 1073 | ||
| 1068 | spec->unsol_event = alc_sku_unsol_event; | 1074 | spec->unsol_event = alc_sku_unsol_event; |
| 1069 | } | 1075 | } |
| @@ -8408,6 +8414,7 @@ static const char *alc883_models[ALC883_MODEL_LAST] = { | |||
| 8408 | static struct snd_pci_quirk alc883_cfg_tbl[] = { | 8414 | static struct snd_pci_quirk alc883_cfg_tbl[] = { |
| 8409 | SND_PCI_QUIRK(0x1019, 0x6668, "ECS", ALC883_3ST_6ch_DIG), | 8415 | SND_PCI_QUIRK(0x1019, 0x6668, "ECS", ALC883_3ST_6ch_DIG), |
| 8410 | 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), | ||
| 8411 | SND_PCI_QUIRK(0x1025, 0x0110, "Acer Aspire", ALC883_ACER_ASPIRE), | 8418 | SND_PCI_QUIRK(0x1025, 0x0110, "Acer Aspire", ALC883_ACER_ASPIRE), |
| 8412 | SND_PCI_QUIRK(0x1025, 0x0112, "Acer Aspire 9303", ALC883_ACER_ASPIRE), | 8419 | SND_PCI_QUIRK(0x1025, 0x0112, "Acer Aspire 9303", ALC883_ACER_ASPIRE), |
| 8413 | SND_PCI_QUIRK(0x1025, 0x0121, "Acer Aspire 5920G", ALC883_ACER_ASPIRE), | 8420 | SND_PCI_QUIRK(0x1025, 0x0121, "Acer Aspire 5920G", ALC883_ACER_ASPIRE), |
| @@ -8462,6 +8469,7 @@ static struct snd_pci_quirk alc883_cfg_tbl[] = { | |||
| 8462 | SND_PCI_QUIRK(0x17aa, 0x3bfd, "Lenovo NB0763", ALC883_LENOVO_NB0763), | 8469 | SND_PCI_QUIRK(0x17aa, 0x3bfd, "Lenovo NB0763", ALC883_LENOVO_NB0763), |
| 8463 | SND_PCI_QUIRK(0x17aa, 0x101d, "Lenovo Sky", ALC888_LENOVO_SKY), | 8470 | SND_PCI_QUIRK(0x17aa, 0x101d, "Lenovo Sky", ALC888_LENOVO_SKY), |
| 8464 | SND_PCI_QUIRK(0x17c0, 0x4071, "MEDION MD2", ALC883_MEDION_MD2), | 8471 | SND_PCI_QUIRK(0x17c0, 0x4071, "MEDION MD2", ALC883_MEDION_MD2), |
| 8472 | SND_PCI_QUIRK(0x17c0, 0x4085, "MEDION MD96630", ALC888_LENOVO_MS7195_DIG), | ||
| 8465 | SND_PCI_QUIRK(0x17f2, 0x5000, "Albatron KI690-AM2", ALC883_6ST_DIG), | 8473 | SND_PCI_QUIRK(0x17f2, 0x5000, "Albatron KI690-AM2", ALC883_6ST_DIG), |
| 8466 | SND_PCI_QUIRK(0x1991, 0x5625, "Haier W66", ALC883_HAIER_W66), | 8474 | SND_PCI_QUIRK(0x1991, 0x5625, "Haier W66", ALC883_HAIER_W66), |
| 8467 | SND_PCI_QUIRK(0x8086, 0x0001, "DG33BUC", ALC883_3ST_6ch_INTEL), | 8475 | SND_PCI_QUIRK(0x8086, 0x0001, "DG33BUC", ALC883_3ST_6ch_INTEL), |
| @@ -12238,8 +12246,26 @@ static int alc269_auto_create_multi_out_ctls(struct alc_spec *spec, | |||
| 12238 | return 0; | 12246 | return 0; |
| 12239 | } | 12247 | } |
| 12240 | 12248 | ||
| 12241 | #define alc269_auto_create_analog_input_ctls \ | 12249 | static int alc269_auto_create_analog_input_ctls(struct alc_spec *spec, |
| 12242 | alc880_auto_create_analog_input_ctls | 12250 | const struct auto_pin_cfg *cfg) |
| 12251 | { | ||
| 12252 | int err; | ||
| 12253 | |||
| 12254 | err = alc880_auto_create_analog_input_ctls(spec, cfg); | ||
| 12255 | if (err < 0) | ||
| 12256 | return err; | ||
| 12257 | /* digital-mic input pin is excluded in alc880_auto_create..() | ||
| 12258 | * because it's under 0x18 | ||
| 12259 | */ | ||
| 12260 | if (cfg->input_pins[AUTO_PIN_MIC] == 0x12 || | ||
| 12261 | cfg->input_pins[AUTO_PIN_FRONT_MIC] == 0x12) { | ||
| 12262 | struct hda_input_mux *imux = &spec->private_imux; | ||
| 12263 | imux->items[imux->num_items].label = "Int Mic"; | ||
| 12264 | imux->items[imux->num_items].index = 0x05; | ||
| 12265 | imux->num_items++; | ||
| 12266 | } | ||
| 12267 | return 0; | ||
| 12268 | } | ||
| 12243 | 12269 | ||
| 12244 | #ifdef CONFIG_SND_HDA_POWER_SAVE | 12270 | #ifdef CONFIG_SND_HDA_POWER_SAVE |
| 12245 | #define alc269_loopbacks alc880_loopbacks | 12271 | #define alc269_loopbacks alc880_loopbacks |
diff --git a/sound/pci/hda/patch_sigmatel.c b/sound/pci/hda/patch_sigmatel.c index 788fdc6f326..9563b5bbb27 100644 --- a/sound/pci/hda/patch_sigmatel.c +++ b/sound/pci/hda/patch_sigmatel.c | |||
| @@ -36,9 +36,11 @@ | |||
| 36 | #include "hda_beep.h" | 36 | #include "hda_beep.h" |
| 37 | 37 | ||
| 38 | #define NUM_CONTROL_ALLOC 32 | 38 | #define NUM_CONTROL_ALLOC 32 |
| 39 | |||
| 40 | #define STAC_VREF_EVENT 0x00 | ||
| 41 | #define STAC_INSERT_EVENT 0x10 | ||
| 39 | #define STAC_PWR_EVENT 0x20 | 42 | #define STAC_PWR_EVENT 0x20 |
| 40 | #define STAC_HP_EVENT 0x30 | 43 | #define STAC_HP_EVENT 0x30 |
| 41 | #define STAC_VREF_EVENT 0x40 | ||
| 42 | 44 | ||
| 43 | enum { | 45 | enum { |
| 44 | STAC_REF, | 46 | STAC_REF, |
| @@ -69,6 +71,7 @@ enum { | |||
| 69 | enum { | 71 | enum { |
| 70 | STAC_92HD73XX_REF, | 72 | STAC_92HD73XX_REF, |
| 71 | STAC_DELL_M6, | 73 | STAC_DELL_M6, |
| 74 | STAC_DELL_EQ, | ||
| 72 | STAC_92HD73XX_MODELS | 75 | STAC_92HD73XX_MODELS |
| 73 | }; | 76 | }; |
| 74 | 77 | ||
| @@ -211,7 +214,7 @@ struct sigmatel_spec { | |||
| 211 | /* i/o switches */ | 214 | /* i/o switches */ |
| 212 | unsigned int io_switch[2]; | 215 | unsigned int io_switch[2]; |
| 213 | unsigned int clfe_swap; | 216 | unsigned int clfe_swap; |
| 214 | unsigned int hp_switch; | 217 | unsigned int hp_switch; /* NID of HP as line-out */ |
| 215 | unsigned int aloopback; | 218 | unsigned int aloopback; |
| 216 | 219 | ||
| 217 | struct hda_pcm pcm_rec[2]; /* PCM information */ | 220 | struct hda_pcm pcm_rec[2]; /* PCM information */ |
| @@ -566,10 +569,8 @@ static int stac92xx_smux_enum_put(struct snd_kcontrol *kcontrol, | |||
| 566 | nid = codec->slave_dig_outs[smux_idx - 1]; | 569 | nid = codec->slave_dig_outs[smux_idx - 1]; |
| 567 | if (spec->cur_smux[smux_idx] == smux->num_items - 1) | 570 | if (spec->cur_smux[smux_idx] == smux->num_items - 1) |
| 568 | val = AMP_OUT_MUTE; | 571 | val = AMP_OUT_MUTE; |
| 569 | if (smux_idx == 0) | ||
| 570 | nid = spec->multiout.dig_out_nid; | ||
| 571 | else | 572 | else |
| 572 | nid = codec->slave_dig_outs[smux_idx - 1]; | 573 | val = AMP_OUT_UNMUTE; |
| 573 | /* un/mute SPDIF out */ | 574 | /* un/mute SPDIF out */ |
| 574 | snd_hda_codec_write_cache(codec, nid, 0, | 575 | snd_hda_codec_write_cache(codec, nid, 0, |
| 575 | AC_VERB_SET_AMP_GAIN_MUTE, val); | 576 | AC_VERB_SET_AMP_GAIN_MUTE, val); |
| @@ -775,9 +776,7 @@ static struct hda_verb dell_eq_core_init[] = { | |||
| 775 | }; | 776 | }; |
| 776 | 777 | ||
| 777 | static struct hda_verb dell_m6_core_init[] = { | 778 | static struct hda_verb dell_m6_core_init[] = { |
| 778 | /* set master volume to max value without distortion | 779 | { 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 */ | 780 | /* setup audio connections */ |
| 782 | { 0x0d, AC_VERB_SET_CONNECT_SEL, 0x00}, | 781 | { 0x0d, AC_VERB_SET_CONNECT_SEL, 0x00}, |
| 783 | { 0x0a, AC_VERB_SET_CONNECT_SEL, 0x01}, | 782 | { 0x0a, AC_VERB_SET_CONNECT_SEL, 0x01}, |
| @@ -1602,11 +1601,13 @@ static unsigned int dell_m6_pin_configs[13] = { | |||
| 1602 | static unsigned int *stac92hd73xx_brd_tbl[STAC_92HD73XX_MODELS] = { | 1601 | static unsigned int *stac92hd73xx_brd_tbl[STAC_92HD73XX_MODELS] = { |
| 1603 | [STAC_92HD73XX_REF] = ref92hd73xx_pin_configs, | 1602 | [STAC_92HD73XX_REF] = ref92hd73xx_pin_configs, |
| 1604 | [STAC_DELL_M6] = dell_m6_pin_configs, | 1603 | [STAC_DELL_M6] = dell_m6_pin_configs, |
| 1604 | [STAC_DELL_EQ] = dell_m6_pin_configs, | ||
| 1605 | }; | 1605 | }; |
| 1606 | 1606 | ||
| 1607 | static const char *stac92hd73xx_models[STAC_92HD73XX_MODELS] = { | 1607 | static const char *stac92hd73xx_models[STAC_92HD73XX_MODELS] = { |
| 1608 | [STAC_92HD73XX_REF] = "ref", | 1608 | [STAC_92HD73XX_REF] = "ref", |
| 1609 | [STAC_DELL_M6] = "dell-m6", | 1609 | [STAC_DELL_M6] = "dell-m6", |
| 1610 | [STAC_DELL_EQ] = "dell-eq", | ||
| 1610 | }; | 1611 | }; |
| 1611 | 1612 | ||
| 1612 | static struct snd_pci_quirk stac92hd73xx_cfg_tbl[] = { | 1613 | static struct snd_pci_quirk stac92hd73xx_cfg_tbl[] = { |
| @@ -1687,6 +1688,10 @@ static struct snd_pci_quirk stac92hd71bxx_cfg_tbl[] = { | |||
| 1687 | /* SigmaTel reference board */ | 1688 | /* SigmaTel reference board */ |
| 1688 | SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x2668, | 1689 | SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x2668, |
| 1689 | "DFI LanParty", STAC_92HD71BXX_REF), | 1690 | "DFI LanParty", STAC_92HD71BXX_REF), |
| 1691 | SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x30f2, | ||
| 1692 | "HP dv5", STAC_HP_M4), | ||
| 1693 | SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x30f4, | ||
| 1694 | "HP dv7", STAC_HP_M4), | ||
| 1690 | SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x361a, | 1695 | SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x361a, |
| 1691 | "unknown HP", STAC_HP_M4), | 1696 | "unknown HP", STAC_HP_M4), |
| 1692 | SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x0233, | 1697 | SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x0233, |
| @@ -2444,7 +2449,7 @@ static int stac92xx_hp_switch_get(struct snd_kcontrol *kcontrol, | |||
| 2444 | struct hda_codec *codec = snd_kcontrol_chip(kcontrol); | 2449 | struct hda_codec *codec = snd_kcontrol_chip(kcontrol); |
| 2445 | struct sigmatel_spec *spec = codec->spec; | 2450 | struct sigmatel_spec *spec = codec->spec; |
| 2446 | 2451 | ||
| 2447 | ucontrol->value.integer.value[0] = spec->hp_switch; | 2452 | ucontrol->value.integer.value[0] = !!spec->hp_switch; |
| 2448 | return 0; | 2453 | return 0; |
| 2449 | } | 2454 | } |
| 2450 | 2455 | ||
| @@ -2453,8 +2458,9 @@ static int stac92xx_hp_switch_put(struct snd_kcontrol *kcontrol, | |||
| 2453 | { | 2458 | { |
| 2454 | struct hda_codec *codec = snd_kcontrol_chip(kcontrol); | 2459 | struct hda_codec *codec = snd_kcontrol_chip(kcontrol); |
| 2455 | struct sigmatel_spec *spec = codec->spec; | 2460 | struct sigmatel_spec *spec = codec->spec; |
| 2456 | 2461 | int nid = kcontrol->private_value; | |
| 2457 | spec->hp_switch = ucontrol->value.integer.value[0]; | 2462 | |
| 2463 | spec->hp_switch = ucontrol->value.integer.value[0] ? nid : 0; | ||
| 2458 | 2464 | ||
| 2459 | /* check to be sure that the ports are upto date with | 2465 | /* check to be sure that the ports are upto date with |
| 2460 | * switch changes | 2466 | * switch changes |
| @@ -2587,8 +2593,10 @@ static struct snd_kcontrol_new stac92xx_control_templates[] = { | |||
| 2587 | }; | 2593 | }; |
| 2588 | 2594 | ||
| 2589 | /* add dynamic controls */ | 2595 | /* add dynamic controls */ |
| 2590 | static int stac92xx_add_control_idx(struct sigmatel_spec *spec, int type, | 2596 | static int stac92xx_add_control_temp(struct sigmatel_spec *spec, |
| 2591 | int idx, const char *name, unsigned long val) | 2597 | struct snd_kcontrol_new *ktemp, |
| 2598 | int idx, const char *name, | ||
| 2599 | unsigned long val) | ||
| 2592 | { | 2600 | { |
| 2593 | struct snd_kcontrol_new *knew; | 2601 | struct snd_kcontrol_new *knew; |
| 2594 | 2602 | ||
| @@ -2607,20 +2615,29 @@ static int stac92xx_add_control_idx(struct sigmatel_spec *spec, int type, | |||
| 2607 | } | 2615 | } |
| 2608 | 2616 | ||
| 2609 | knew = &spec->kctl_alloc[spec->num_kctl_used]; | 2617 | knew = &spec->kctl_alloc[spec->num_kctl_used]; |
| 2610 | *knew = stac92xx_control_templates[type]; | 2618 | *knew = *ktemp; |
| 2611 | knew->index = idx; | 2619 | knew->index = idx; |
| 2612 | knew->name = kstrdup(name, GFP_KERNEL); | 2620 | knew->name = kstrdup(name, GFP_KERNEL); |
| 2613 | if (! knew->name) | 2621 | if (!knew->name) |
| 2614 | return -ENOMEM; | 2622 | return -ENOMEM; |
| 2615 | knew->private_value = val; | 2623 | knew->private_value = val; |
| 2616 | spec->num_kctl_used++; | 2624 | spec->num_kctl_used++; |
| 2617 | return 0; | 2625 | return 0; |
| 2618 | } | 2626 | } |
| 2619 | 2627 | ||
| 2628 | static inline int stac92xx_add_control_idx(struct sigmatel_spec *spec, | ||
| 2629 | int type, int idx, const char *name, | ||
| 2630 | unsigned long val) | ||
| 2631 | { | ||
| 2632 | return stac92xx_add_control_temp(spec, | ||
| 2633 | &stac92xx_control_templates[type], | ||
| 2634 | idx, name, val); | ||
| 2635 | } | ||
| 2636 | |||
| 2620 | 2637 | ||
| 2621 | /* add dynamic controls */ | 2638 | /* add dynamic controls */ |
| 2622 | static int stac92xx_add_control(struct sigmatel_spec *spec, int type, | 2639 | static inline int stac92xx_add_control(struct sigmatel_spec *spec, int type, |
| 2623 | const char *name, unsigned long val) | 2640 | const char *name, unsigned long val) |
| 2624 | { | 2641 | { |
| 2625 | return stac92xx_add_control_idx(spec, type, 0, name, val); | 2642 | return stac92xx_add_control_idx(spec, type, 0, name, val); |
| 2626 | } | 2643 | } |
| @@ -2863,7 +2880,8 @@ static int stac92xx_auto_create_multi_out_ctls(struct hda_codec *codec, | |||
| 2863 | if (cfg->hp_outs > 1) { | 2880 | if (cfg->hp_outs > 1) { |
| 2864 | err = stac92xx_add_control(spec, | 2881 | err = stac92xx_add_control(spec, |
| 2865 | STAC_CTL_WIDGET_HP_SWITCH, | 2882 | STAC_CTL_WIDGET_HP_SWITCH, |
| 2866 | "Headphone as Line Out Switch", 0); | 2883 | "Headphone as Line Out Switch", |
| 2884 | cfg->hp_pins[cfg->hp_outs - 1]); | ||
| 2867 | if (err < 0) | 2885 | if (err < 0) |
| 2868 | return err; | 2886 | return err; |
| 2869 | } | 2887 | } |
| @@ -3061,6 +3079,43 @@ static int stac92xx_auto_create_beep_ctls(struct hda_codec *codec, | |||
| 3061 | return 0; | 3079 | return 0; |
| 3062 | } | 3080 | } |
| 3063 | 3081 | ||
| 3082 | #ifdef CONFIG_SND_HDA_INPUT_BEEP | ||
| 3083 | #define stac92xx_dig_beep_switch_info snd_ctl_boolean_mono_info | ||
| 3084 | |||
| 3085 | static int stac92xx_dig_beep_switch_get(struct snd_kcontrol *kcontrol, | ||
| 3086 | struct snd_ctl_elem_value *ucontrol) | ||
| 3087 | { | ||
| 3088 | struct hda_codec *codec = snd_kcontrol_chip(kcontrol); | ||
| 3089 | ucontrol->value.integer.value[0] = codec->beep->enabled; | ||
| 3090 | return 0; | ||
| 3091 | } | ||
| 3092 | |||
| 3093 | static int stac92xx_dig_beep_switch_put(struct snd_kcontrol *kcontrol, | ||
| 3094 | struct snd_ctl_elem_value *ucontrol) | ||
| 3095 | { | ||
| 3096 | struct hda_codec *codec = snd_kcontrol_chip(kcontrol); | ||
| 3097 | int enabled = !!ucontrol->value.integer.value[0]; | ||
| 3098 | if (codec->beep->enabled != enabled) { | ||
| 3099 | codec->beep->enabled = enabled; | ||
| 3100 | return 1; | ||
| 3101 | } | ||
| 3102 | return 0; | ||
| 3103 | } | ||
| 3104 | |||
| 3105 | static struct snd_kcontrol_new stac92xx_dig_beep_ctrl = { | ||
| 3106 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, | ||
| 3107 | .info = stac92xx_dig_beep_switch_info, | ||
| 3108 | .get = stac92xx_dig_beep_switch_get, | ||
| 3109 | .put = stac92xx_dig_beep_switch_put, | ||
| 3110 | }; | ||
| 3111 | |||
| 3112 | static int stac92xx_beep_switch_ctl(struct hda_codec *codec) | ||
| 3113 | { | ||
| 3114 | return stac92xx_add_control_temp(codec->spec, &stac92xx_dig_beep_ctrl, | ||
| 3115 | 0, "PC Beep Playback Switch", 0); | ||
| 3116 | } | ||
| 3117 | #endif | ||
| 3118 | |||
| 3064 | static int stac92xx_auto_create_mux_input_ctls(struct hda_codec *codec) | 3119 | static int stac92xx_auto_create_mux_input_ctls(struct hda_codec *codec) |
| 3065 | { | 3120 | { |
| 3066 | struct sigmatel_spec *spec = codec->spec; | 3121 | struct sigmatel_spec *spec = codec->spec; |
| @@ -3367,6 +3422,7 @@ static int stac92xx_parse_auto_config(struct hda_codec *codec, hda_nid_t dig_out | |||
| 3367 | #ifdef CONFIG_SND_HDA_INPUT_BEEP | 3422 | #ifdef CONFIG_SND_HDA_INPUT_BEEP |
| 3368 | if (spec->digbeep_nid > 0) { | 3423 | if (spec->digbeep_nid > 0) { |
| 3369 | hda_nid_t nid = spec->digbeep_nid; | 3424 | hda_nid_t nid = spec->digbeep_nid; |
| 3425 | unsigned int caps; | ||
| 3370 | 3426 | ||
| 3371 | err = stac92xx_auto_create_beep_ctls(codec, nid); | 3427 | err = stac92xx_auto_create_beep_ctls(codec, nid); |
| 3372 | if (err < 0) | 3428 | if (err < 0) |
| @@ -3374,6 +3430,14 @@ static int stac92xx_parse_auto_config(struct hda_codec *codec, hda_nid_t dig_out | |||
| 3374 | err = snd_hda_attach_beep_device(codec, nid); | 3430 | err = snd_hda_attach_beep_device(codec, nid); |
| 3375 | if (err < 0) | 3431 | if (err < 0) |
| 3376 | return err; | 3432 | return err; |
| 3433 | /* if no beep switch is available, make its own one */ | ||
| 3434 | caps = query_amp_caps(codec, nid, HDA_OUTPUT); | ||
| 3435 | if (codec->beep && | ||
| 3436 | !((caps & AC_AMPCAP_MUTE) >> AC_AMPCAP_MUTE_SHIFT)) { | ||
| 3437 | err = stac92xx_beep_switch_ctl(codec); | ||
| 3438 | if (err < 0) | ||
| 3439 | return err; | ||
| 3440 | } | ||
| 3377 | } | 3441 | } |
| 3378 | #endif | 3442 | #endif |
| 3379 | 3443 | ||
| @@ -3531,6 +3595,12 @@ static int stac9200_parse_auto_config(struct hda_codec *codec) | |||
| 3531 | if ((err = stac9200_auto_create_lfe_ctls(codec, &spec->autocfg)) < 0) | 3595 | if ((err = stac9200_auto_create_lfe_ctls(codec, &spec->autocfg)) < 0) |
| 3532 | return err; | 3596 | return err; |
| 3533 | 3597 | ||
| 3598 | if (spec->num_muxes > 0) { | ||
| 3599 | err = stac92xx_auto_create_mux_input_ctls(codec); | ||
| 3600 | if (err < 0) | ||
| 3601 | return err; | ||
| 3602 | } | ||
| 3603 | |||
| 3534 | if (spec->autocfg.dig_out_pin) | 3604 | if (spec->autocfg.dig_out_pin) |
| 3535 | spec->multiout.dig_out_nid = 0x05; | 3605 | spec->multiout.dig_out_nid = 0x05; |
| 3536 | if (spec->autocfg.dig_in_pin) | 3606 | if (spec->autocfg.dig_in_pin) |
| @@ -3648,14 +3718,18 @@ static int stac92xx_init(struct hda_codec *codec) | |||
| 3648 | for (i = 0; i < AUTO_PIN_LAST; i++) { | 3718 | for (i = 0; i < AUTO_PIN_LAST; i++) { |
| 3649 | hda_nid_t nid = cfg->input_pins[i]; | 3719 | hda_nid_t nid = cfg->input_pins[i]; |
| 3650 | if (nid) { | 3720 | if (nid) { |
| 3651 | unsigned int pinctl = snd_hda_codec_read(codec, nid, | 3721 | unsigned int pinctl; |
| 3652 | 0, AC_VERB_GET_PIN_WIDGET_CONTROL, 0); | 3722 | if (i == AUTO_PIN_MIC || i == AUTO_PIN_FRONT_MIC) { |
| 3653 | /* if PINCTL already set then skip */ | 3723 | /* for mic pins, force to initialize */ |
| 3654 | if (pinctl & AC_PINCAP_IN) | 3724 | pinctl = stac92xx_get_vref(codec, nid); |
| 3655 | continue; | 3725 | } else { |
| 3656 | pinctl = AC_PINCTL_IN_EN; | 3726 | pinctl = snd_hda_codec_read(codec, nid, 0, |
| 3657 | if (i == AUTO_PIN_MIC || i == AUTO_PIN_FRONT_MIC) | 3727 | AC_VERB_GET_PIN_WIDGET_CONTROL, 0); |
| 3658 | pinctl |= stac92xx_get_vref(codec, nid); | 3728 | /* if PINCTL already set then skip */ |
| 3729 | if (pinctl & AC_PINCTL_IN_EN) | ||
| 3730 | continue; | ||
| 3731 | } | ||
| 3732 | pinctl |= AC_PINCTL_IN_EN; | ||
| 3659 | stac92xx_auto_set_pinctl(codec, nid, pinctl); | 3733 | stac92xx_auto_set_pinctl(codec, nid, pinctl); |
| 3660 | } | 3734 | } |
| 3661 | } | 3735 | } |
| @@ -3777,11 +3851,30 @@ static int get_hp_pin_presence(struct hda_codec *codec, hda_nid_t nid) | |||
| 3777 | return 0; | 3851 | return 0; |
| 3778 | } | 3852 | } |
| 3779 | 3853 | ||
| 3854 | /* return non-zero if the hp-pin of the given array index isn't | ||
| 3855 | * a jack-detection target | ||
| 3856 | */ | ||
| 3857 | static int no_hp_sensing(struct sigmatel_spec *spec, int i) | ||
| 3858 | { | ||
| 3859 | struct auto_pin_cfg *cfg = &spec->autocfg; | ||
| 3860 | |||
| 3861 | /* ignore sensing of shared line and mic jacks */ | ||
| 3862 | if (spec->line_switch && | ||
| 3863 | cfg->hp_pins[i] == cfg->input_pins[AUTO_PIN_LINE]) | ||
| 3864 | return 1; | ||
| 3865 | if (spec->mic_switch && | ||
| 3866 | cfg->hp_pins[i] == cfg->input_pins[AUTO_PIN_MIC]) | ||
| 3867 | return 1; | ||
| 3868 | /* ignore if the pin is set as line-out */ | ||
| 3869 | if (cfg->hp_pins[i] == spec->hp_switch) | ||
| 3870 | return 1; | ||
| 3871 | return 0; | ||
| 3872 | } | ||
| 3873 | |||
| 3780 | static void stac92xx_hp_detect(struct hda_codec *codec, unsigned int res) | 3874 | static void stac92xx_hp_detect(struct hda_codec *codec, unsigned int res) |
| 3781 | { | 3875 | { |
| 3782 | struct sigmatel_spec *spec = codec->spec; | 3876 | struct sigmatel_spec *spec = codec->spec; |
| 3783 | struct auto_pin_cfg *cfg = &spec->autocfg; | 3877 | struct auto_pin_cfg *cfg = &spec->autocfg; |
| 3784 | int nid = cfg->hp_pins[cfg->hp_outs - 1]; | ||
| 3785 | int i, presence; | 3878 | int i, presence; |
| 3786 | 3879 | ||
| 3787 | presence = 0; | 3880 | presence = 0; |
| @@ -3792,15 +3885,16 @@ static void stac92xx_hp_detect(struct hda_codec *codec, unsigned int res) | |||
| 3792 | for (i = 0; i < cfg->hp_outs; i++) { | 3885 | for (i = 0; i < cfg->hp_outs; i++) { |
| 3793 | if (presence) | 3886 | if (presence) |
| 3794 | break; | 3887 | break; |
| 3795 | if (spec->hp_switch && cfg->hp_pins[i] == nid) | 3888 | if (no_hp_sensing(spec, i)) |
| 3796 | break; | 3889 | continue; |
| 3797 | presence = get_hp_pin_presence(codec, cfg->hp_pins[i]); | 3890 | presence = get_hp_pin_presence(codec, cfg->hp_pins[i]); |
| 3798 | } | 3891 | } |
| 3799 | 3892 | ||
| 3800 | if (presence) { | 3893 | if (presence) { |
| 3801 | /* disable lineouts, enable hp */ | 3894 | /* disable lineouts */ |
| 3802 | if (spec->hp_switch) | 3895 | if (spec->hp_switch) |
| 3803 | stac92xx_reset_pinctl(codec, nid, AC_PINCTL_OUT_EN); | 3896 | stac92xx_reset_pinctl(codec, spec->hp_switch, |
| 3897 | AC_PINCTL_OUT_EN); | ||
| 3804 | for (i = 0; i < cfg->line_outs; i++) | 3898 | for (i = 0; i < cfg->line_outs; i++) |
| 3805 | stac92xx_reset_pinctl(codec, cfg->line_out_pins[i], | 3899 | stac92xx_reset_pinctl(codec, cfg->line_out_pins[i], |
| 3806 | AC_PINCTL_OUT_EN); | 3900 | AC_PINCTL_OUT_EN); |
| @@ -3812,9 +3906,10 @@ static void stac92xx_hp_detect(struct hda_codec *codec, unsigned int res) | |||
| 3812 | spec->gpio_dir, spec->gpio_data & | 3906 | spec->gpio_dir, spec->gpio_data & |
| 3813 | ~spec->eapd_mask); | 3907 | ~spec->eapd_mask); |
| 3814 | } else { | 3908 | } else { |
| 3815 | /* enable lineouts, disable hp */ | 3909 | /* enable lineouts */ |
| 3816 | if (spec->hp_switch) | 3910 | if (spec->hp_switch) |
| 3817 | stac92xx_set_pinctl(codec, nid, AC_PINCTL_OUT_EN); | 3911 | stac92xx_set_pinctl(codec, spec->hp_switch, |
| 3912 | AC_PINCTL_OUT_EN); | ||
| 3818 | for (i = 0; i < cfg->line_outs; i++) | 3913 | for (i = 0; i < cfg->line_outs; i++) |
| 3819 | stac92xx_set_pinctl(codec, cfg->line_out_pins[i], | 3914 | stac92xx_set_pinctl(codec, cfg->line_out_pins[i], |
| 3820 | AC_PINCTL_OUT_EN); | 3915 | AC_PINCTL_OUT_EN); |
| @@ -3826,8 +3921,16 @@ static void stac92xx_hp_detect(struct hda_codec *codec, unsigned int res) | |||
| 3826 | spec->gpio_dir, spec->gpio_data | | 3921 | spec->gpio_dir, spec->gpio_data | |
| 3827 | spec->eapd_mask); | 3922 | spec->eapd_mask); |
| 3828 | } | 3923 | } |
| 3829 | if (!spec->hp_switch && cfg->hp_outs > 1 && presence) | 3924 | /* toggle hp outs */ |
| 3830 | stac92xx_set_pinctl(codec, nid, AC_PINCTL_OUT_EN); | 3925 | for (i = 0; i < cfg->hp_outs; i++) { |
| 3926 | unsigned int val = AC_PINCTL_OUT_EN | AC_PINCTL_HP_EN; | ||
| 3927 | if (no_hp_sensing(spec, i)) | ||
| 3928 | continue; | ||
| 3929 | if (presence) | ||
| 3930 | stac92xx_set_pinctl(codec, cfg->hp_pins[i], val); | ||
| 3931 | else | ||
| 3932 | stac92xx_reset_pinctl(codec, cfg->hp_pins[i], val); | ||
| 3933 | } | ||
| 3831 | } | 3934 | } |
| 3832 | 3935 | ||
| 3833 | static void stac92xx_pin_sense(struct hda_codec *codec, int idx) | 3936 | static void stac92xx_pin_sense(struct hda_codec *codec, int idx) |
| @@ -4133,12 +4236,17 @@ again: | |||
| 4133 | sizeof(stac92hd73xx_dmux)); | 4236 | sizeof(stac92hd73xx_dmux)); |
| 4134 | 4237 | ||
| 4135 | switch (spec->board_config) { | 4238 | switch (spec->board_config) { |
| 4136 | case STAC_DELL_M6: | 4239 | case STAC_DELL_EQ: |
| 4137 | spec->init = dell_eq_core_init; | 4240 | spec->init = dell_eq_core_init; |
| 4241 | /* fallthru */ | ||
| 4242 | case STAC_DELL_M6: | ||
| 4138 | spec->num_smuxes = 0; | 4243 | spec->num_smuxes = 0; |
| 4139 | spec->mixer = &stac92hd73xx_6ch_mixer[DELL_M6_MIXER]; | 4244 | spec->mixer = &stac92hd73xx_6ch_mixer[DELL_M6_MIXER]; |
| 4140 | spec->amp_nids = &stac92hd73xx_amp_nids[DELL_M6_AMP]; | 4245 | spec->amp_nids = &stac92hd73xx_amp_nids[DELL_M6_AMP]; |
| 4141 | spec->num_amps = 1; | 4246 | spec->num_amps = 1; |
| 4247 | |||
| 4248 | if (!spec->init) | ||
| 4249 | spec->init = dell_m6_core_init; | ||
| 4142 | switch (codec->subsystem_id) { | 4250 | switch (codec->subsystem_id) { |
| 4143 | case 0x1028025e: /* Analog Mics */ | 4251 | case 0x1028025e: /* Analog Mics */ |
| 4144 | case 0x1028025f: | 4252 | case 0x1028025f: |
| @@ -4148,8 +4256,6 @@ again: | |||
| 4148 | break; | 4256 | break; |
| 4149 | case 0x10280271: /* Digital Mics */ | 4257 | case 0x10280271: /* Digital Mics */ |
| 4150 | case 0x10280272: | 4258 | case 0x10280272: |
| 4151 | spec->init = dell_m6_core_init; | ||
| 4152 | /* fall-through */ | ||
| 4153 | case 0x10280254: | 4259 | case 0x10280254: |
| 4154 | case 0x10280255: | 4260 | case 0x10280255: |
| 4155 | stac92xx_set_config_reg(codec, 0x13, 0x90A60160); | 4261 | stac92xx_set_config_reg(codec, 0x13, 0x90A60160); |
| @@ -4376,6 +4482,13 @@ again: | |||
| 4376 | stac92xx_set_config_regs(codec); | 4482 | stac92xx_set_config_regs(codec); |
| 4377 | } | 4483 | } |
| 4378 | 4484 | ||
| 4485 | if (spec->board_config > STAC_92HD71BXX_REF) { | ||
| 4486 | /* GPIO0 = EAPD */ | ||
| 4487 | spec->gpio_mask = 0x01; | ||
| 4488 | spec->gpio_dir = 0x01; | ||
| 4489 | spec->gpio_data = 0x01; | ||
| 4490 | } | ||
| 4491 | |||
| 4379 | switch (codec->vendor_id) { | 4492 | switch (codec->vendor_id) { |
| 4380 | case 0x111d76b6: /* 4 Port without Analog Mixer */ | 4493 | case 0x111d76b6: /* 4 Port without Analog Mixer */ |
| 4381 | case 0x111d76b7: | 4494 | case 0x111d76b7: |
| @@ -4386,10 +4499,10 @@ again: | |||
| 4386 | codec->slave_dig_outs = stac92hd71bxx_slave_dig_outs; | 4499 | codec->slave_dig_outs = stac92hd71bxx_slave_dig_outs; |
| 4387 | break; | 4500 | break; |
| 4388 | case 0x111d7608: /* 5 Port with Analog Mixer */ | 4501 | case 0x111d7608: /* 5 Port with Analog Mixer */ |
| 4389 | switch (codec->subsystem_id) { | 4502 | switch (spec->board_config) { |
| 4390 | case 0x103c361a: | 4503 | case STAC_HP_M4: |
| 4391 | /* Enable VREF power saving on GPIO1 detect */ | 4504 | /* Enable VREF power saving on GPIO1 detect */ |
| 4392 | snd_hda_codec_write(codec, codec->afg, 0, | 4505 | snd_hda_codec_write_cache(codec, codec->afg, 0, |
| 4393 | AC_VERB_SET_GPIO_UNSOLICITED_RSP_MASK, 0x02); | 4506 | AC_VERB_SET_GPIO_UNSOLICITED_RSP_MASK, 0x02); |
| 4394 | snd_hda_codec_write_cache(codec, codec->afg, 0, | 4507 | snd_hda_codec_write_cache(codec, codec->afg, 0, |
| 4395 | AC_VERB_SET_UNSOLICITED_ENABLE, | 4508 | AC_VERB_SET_UNSOLICITED_ENABLE, |
| @@ -4435,13 +4548,6 @@ again: | |||
| 4435 | spec->aloopback_mask = 0x50; | 4548 | spec->aloopback_mask = 0x50; |
| 4436 | spec->aloopback_shift = 0; | 4549 | spec->aloopback_shift = 0; |
| 4437 | 4550 | ||
| 4438 | if (spec->board_config > STAC_92HD71BXX_REF) { | ||
| 4439 | /* GPIO0 = EAPD */ | ||
| 4440 | spec->gpio_mask = 0x01; | ||
| 4441 | spec->gpio_dir = 0x01; | ||
| 4442 | spec->gpio_data = 0x01; | ||
| 4443 | } | ||
| 4444 | |||
| 4445 | spec->powerdown_adcs = 1; | 4551 | spec->powerdown_adcs = 1; |
| 4446 | spec->digbeep_nid = 0x26; | 4552 | spec->digbeep_nid = 0x26; |
| 4447 | spec->mux_nids = stac92hd71bxx_mux_nids; | 4553 | spec->mux_nids = stac92hd71bxx_mux_nids; |
| @@ -4789,7 +4895,7 @@ static int patch_stac9205(struct hda_codec *codec) | |||
| 4789 | stac92xx_set_config_reg(codec, 0x20, 0x1c410030); | 4895 | stac92xx_set_config_reg(codec, 0x20, 0x1c410030); |
| 4790 | 4896 | ||
| 4791 | /* Enable unsol response for GPIO4/Dock HP connection */ | 4897 | /* Enable unsol response for GPIO4/Dock HP connection */ |
| 4792 | snd_hda_codec_write(codec, codec->afg, 0, | 4898 | snd_hda_codec_write_cache(codec, codec->afg, 0, |
| 4793 | AC_VERB_SET_GPIO_UNSOLICITED_RSP_MASK, 0x10); | 4899 | AC_VERB_SET_GPIO_UNSOLICITED_RSP_MASK, 0x10); |
| 4794 | snd_hda_codec_write_cache(codec, codec->afg, 0, | 4900 | snd_hda_codec_write_cache(codec, codec->afg, 0, |
| 4795 | AC_VERB_SET_UNSOLICITED_ENABLE, | 4901 | AC_VERB_SET_UNSOLICITED_ENABLE, |
diff --git a/sound/pci/ice1712/ice1712.c b/sound/pci/ice1712/ice1712.c index 5b442383fcd..58d7cda03de 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 c88d1eace1c..19d3391e229 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/pcxhr/pcxhr.c b/sound/pci/pcxhr/pcxhr.c index 0e06c6c9fcc..73de6e989b3 100644 --- a/sound/pci/pcxhr/pcxhr.c +++ b/sound/pci/pcxhr/pcxhr.c | |||
| @@ -1229,8 +1229,11 @@ static int __devinit pcxhr_probe(struct pci_dev *pci, const struct pci_device_id | |||
| 1229 | return -ENOMEM; | 1229 | return -ENOMEM; |
| 1230 | } | 1230 | } |
| 1231 | 1231 | ||
| 1232 | if (snd_BUG_ON(pci_id->driver_data >= PCI_ID_LAST)) | 1232 | if (snd_BUG_ON(pci_id->driver_data >= PCI_ID_LAST)) { |
| 1233 | kfree(mgr); | ||
| 1234 | pci_disable_device(pci); | ||
| 1233 | return -ENODEV; | 1235 | return -ENODEV; |
| 1236 | } | ||
| 1234 | card_name = pcxhr_board_params[pci_id->driver_data].board_name; | 1237 | card_name = pcxhr_board_params[pci_id->driver_data].board_name; |
| 1235 | mgr->playback_chips = pcxhr_board_params[pci_id->driver_data].playback_chips; | 1238 | mgr->playback_chips = pcxhr_board_params[pci_id->driver_data].playback_chips; |
| 1236 | mgr->capture_chips = pcxhr_board_params[pci_id->driver_data].capture_chips; | 1239 | mgr->capture_chips = pcxhr_board_params[pci_id->driver_data].capture_chips; |
diff --git a/sound/pci/rme9652/hdsp.c b/sound/pci/rme9652/hdsp.c index d723543bead..736246f98ac 100644 --- a/sound/pci/rme9652/hdsp.c +++ b/sound/pci/rme9652/hdsp.c | |||
| @@ -4548,11 +4548,20 @@ static int snd_hdsp_hwdep_ioctl(struct snd_hwdep *hw, struct file *file, unsigne | |||
| 4548 | { | 4548 | { |
| 4549 | struct hdsp *hdsp = (struct hdsp *)hw->private_data; | 4549 | struct hdsp *hdsp = (struct hdsp *)hw->private_data; |
| 4550 | void __user *argp = (void __user *)arg; | 4550 | void __user *argp = (void __user *)arg; |
| 4551 | int err; | ||
| 4551 | 4552 | ||
| 4552 | switch (cmd) { | 4553 | switch (cmd) { |
| 4553 | case SNDRV_HDSP_IOCTL_GET_PEAK_RMS: { | 4554 | case SNDRV_HDSP_IOCTL_GET_PEAK_RMS: { |
| 4554 | struct hdsp_peak_rms __user *peak_rms = (struct hdsp_peak_rms __user *)arg; | 4555 | struct hdsp_peak_rms __user *peak_rms = (struct hdsp_peak_rms __user *)arg; |
| 4555 | 4556 | ||
| 4557 | err = hdsp_check_for_iobox(hdsp); | ||
| 4558 | if (err < 0) | ||
| 4559 | return err; | ||
| 4560 | |||
| 4561 | err = hdsp_check_for_firmware(hdsp, 1); | ||
| 4562 | if (err < 0) | ||
| 4563 | return err; | ||
| 4564 | |||
| 4556 | if (!(hdsp->state & HDSP_FirmwareLoaded)) { | 4565 | if (!(hdsp->state & HDSP_FirmwareLoaded)) { |
| 4557 | snd_printk(KERN_ERR "Hammerfall-DSP: firmware needs to be uploaded to the card.\n"); | 4566 | snd_printk(KERN_ERR "Hammerfall-DSP: firmware needs to be uploaded to the card.\n"); |
| 4558 | return -EINVAL; | 4567 | return -EINVAL; |
| @@ -4572,10 +4581,14 @@ static int snd_hdsp_hwdep_ioctl(struct snd_hwdep *hw, struct file *file, unsigne | |||
| 4572 | unsigned long flags; | 4581 | unsigned long flags; |
| 4573 | int i; | 4582 | int i; |
| 4574 | 4583 | ||
| 4575 | if (!(hdsp->state & HDSP_FirmwareLoaded)) { | 4584 | err = hdsp_check_for_iobox(hdsp); |
| 4576 | snd_printk(KERN_ERR "Hammerfall-DSP: Firmware needs to be uploaded to the card.\n"); | 4585 | if (err < 0) |
| 4577 | return -EINVAL; | 4586 | return err; |
| 4578 | } | 4587 | |
| 4588 | err = hdsp_check_for_firmware(hdsp, 1); | ||
| 4589 | if (err < 0) | ||
| 4590 | return err; | ||
| 4591 | |||
| 4579 | spin_lock_irqsave(&hdsp->lock, flags); | 4592 | spin_lock_irqsave(&hdsp->lock, flags); |
| 4580 | info.pref_sync_ref = (unsigned char)hdsp_pref_sync_ref(hdsp); | 4593 | info.pref_sync_ref = (unsigned char)hdsp_pref_sync_ref(hdsp); |
| 4581 | info.wordclock_sync_check = (unsigned char)hdsp_wc_sync_check(hdsp); | 4594 | info.wordclock_sync_check = (unsigned char)hdsp_wc_sync_check(hdsp); |
| @@ -5045,6 +5058,10 @@ static int __devinit snd_hdsp_create(struct snd_card *card, | |||
| 5045 | /* we wait 2 seconds to let freshly inserted cardbus cards do their hardware init */ | 5058 | /* we wait 2 seconds to let freshly inserted cardbus cards do their hardware init */ |
| 5046 | ssleep(2); | 5059 | ssleep(2); |
| 5047 | 5060 | ||
| 5061 | err = hdsp_check_for_iobox(hdsp); | ||
| 5062 | if (err < 0) | ||
| 5063 | return err; | ||
| 5064 | |||
| 5048 | if ((hdsp_read (hdsp, HDSP_statusRegister) & HDSP_DllError) != 0) { | 5065 | if ((hdsp_read (hdsp, HDSP_statusRegister) & HDSP_DllError) != 0) { |
| 5049 | #ifdef HDSP_FW_LOADER | 5066 | #ifdef HDSP_FW_LOADER |
| 5050 | if ((err = hdsp_request_fw_loader(hdsp)) < 0) | 5067 | if ((err = hdsp_request_fw_loader(hdsp)) < 0) |
| @@ -5057,7 +5074,7 @@ static int __devinit snd_hdsp_create(struct snd_card *card, | |||
| 5057 | /* init is complete, we return */ | 5074 | /* init is complete, we return */ |
| 5058 | return 0; | 5075 | return 0; |
| 5059 | #endif | 5076 | #endif |
| 5060 | /* no iobox connected, we defer initialization */ | 5077 | /* we defer initialization */ |
| 5061 | snd_printk(KERN_INFO "Hammerfall-DSP: card initialization pending : waiting for firmware\n"); | 5078 | snd_printk(KERN_INFO "Hammerfall-DSP: card initialization pending : waiting for firmware\n"); |
| 5062 | if ((err = snd_hdsp_create_hwdep(card, hdsp)) < 0) | 5079 | if ((err = snd_hdsp_create_hwdep(card, hdsp)) < 0) |
| 5063 | return err; | 5080 | return err; |
diff --git a/sound/soc/codecs/wm9713.c b/sound/soc/codecs/wm9713.c index aba402b3c99..945b32ed988 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 | ||
| 141 | SOC_SINGLE("ALC Target Volume", AC97_CODEC_CLASS_REV, 12, 15, 0), | 141 | SOC_SINGLE("ALC Target Volume", AC97_CODEC_CLASS_REV, 12, 15, 0), |
| 142 | SOC_SINGLE("ALC Hold Time", AC97_CODEC_CLASS_REV, 8, 15, 0), | 142 | SOC_SINGLE("ALC Hold Time", AC97_CODEC_CLASS_REV, 8, 15, 0), |
| 143 | SOC_SINGLE("ALC Decay Time ", AC97_CODEC_CLASS_REV, 4, 15, 0), | 143 | SOC_SINGLE("ALC Decay Time", AC97_CODEC_CLASS_REV, 4, 15, 0), |
| 144 | SOC_SINGLE("ALC Attack Time", AC97_CODEC_CLASS_REV, 0, 15, 0), | 144 | SOC_SINGLE("ALC Attack Time", AC97_CODEC_CLASS_REV, 0, 15, 0), |
| 145 | SOC_ENUM("ALC Function", wm9713_enum[6]), | 145 | SOC_ENUM("ALC Function", wm9713_enum[6]), |
| 146 | SOC_SINGLE("ALC Max Volume", AC97_PCI_SVID, 11, 7, 0), | 146 | SOC_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 86923299bc1..94a02eaa482 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 | ||
| 702 | DEVICE_ATTR(status, 0644, psc_i2s_status_show, NULL); | 702 | static DEVICE_ATTR(status, 0644, psc_i2s_status_show, NULL); |
| 703 | DEVICE_ATTR(playback_underrun, 0644, psc_i2s_stat_show, psc_i2s_stat_store); | 703 | static DEVICE_ATTR(playback_underrun, 0644, psc_i2s_stat_show, |
| 704 | DEVICE_ATTR(capture_overrun, 0644, psc_i2s_stat_show, psc_i2s_stat_store); | 704 | psc_i2s_stat_store); |
| 705 | static 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 462e635dfc7..16c7453f494 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/sparc/dbri.c b/sound/sparc/dbri.c index c257ad8bdfb..23ed6f04a71 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 69689e79bf7..92115755d98 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 | { |
