Commit 7aeb6d7d authored by Takashi Iwai's avatar Takashi Iwai

Merge branches 'topic/fix/misc' and 'topic/fix/hda' into for-linus

...@@ -176,7 +176,7 @@ int soundbus_add_one(struct soundbus_dev *dev) ...@@ -176,7 +176,7 @@ int soundbus_add_one(struct soundbus_dev *dev)
return -EINVAL; return -EINVAL;
} }
snprintf(dev->ofdev.dev.bus_id, BUS_ID_SIZE, "soundbus:%x", ++devcount); dev_set_name(&dev->ofdev.dev, "soundbus:%x", ++devcount);
dev->ofdev.dev.bus = &soundbus_bus_type; dev->ofdev.dev.bus = &soundbus_bus_type;
return of_device_register(&dev->ofdev); return of_device_register(&dev->ofdev);
} }
......
...@@ -148,6 +148,8 @@ static int snd_rawmidi_runtime_free(struct snd_rawmidi_substream *substream) ...@@ -148,6 +148,8 @@ static int snd_rawmidi_runtime_free(struct snd_rawmidi_substream *substream)
static inline void snd_rawmidi_output_trigger(struct snd_rawmidi_substream *substream,int up) static inline void snd_rawmidi_output_trigger(struct snd_rawmidi_substream *substream,int up)
{ {
if (!substream->opened)
return;
if (up) { if (up) {
tasklet_hi_schedule(&substream->runtime->tasklet); tasklet_hi_schedule(&substream->runtime->tasklet);
} else { } else {
...@@ -158,6 +160,8 @@ static inline void snd_rawmidi_output_trigger(struct snd_rawmidi_substream *subs ...@@ -158,6 +160,8 @@ static inline void snd_rawmidi_output_trigger(struct snd_rawmidi_substream *subs
static void snd_rawmidi_input_trigger(struct snd_rawmidi_substream *substream, int up) static void snd_rawmidi_input_trigger(struct snd_rawmidi_substream *substream, int up)
{ {
if (!substream->opened)
return;
substream->ops->trigger(substream, up); substream->ops->trigger(substream, up);
if (!up && substream->runtime->event) if (!up && substream->runtime->event)
tasklet_kill(&substream->runtime->tasklet); tasklet_kill(&substream->runtime->tasklet);
...@@ -857,6 +861,8 @@ int snd_rawmidi_receive(struct snd_rawmidi_substream *substream, ...@@ -857,6 +861,8 @@ int snd_rawmidi_receive(struct snd_rawmidi_substream *substream,
int result = 0, count1; int result = 0, count1;
struct snd_rawmidi_runtime *runtime = substream->runtime; struct snd_rawmidi_runtime *runtime = substream->runtime;
if (!substream->opened)
return -EBADFD;
if (runtime->buffer == NULL) { if (runtime->buffer == NULL) {
snd_printd("snd_rawmidi_receive: input is not active!!!\n"); snd_printd("snd_rawmidi_receive: input is not active!!!\n");
return -EINVAL; return -EINVAL;
...@@ -1126,6 +1132,8 @@ int snd_rawmidi_transmit_ack(struct snd_rawmidi_substream *substream, int count) ...@@ -1126,6 +1132,8 @@ int snd_rawmidi_transmit_ack(struct snd_rawmidi_substream *substream, int count)
int snd_rawmidi_transmit(struct snd_rawmidi_substream *substream, int snd_rawmidi_transmit(struct snd_rawmidi_substream *substream,
unsigned char *buffer, int count) unsigned char *buffer, int count)
{ {
if (!substream->opened)
return -EBADFD;
count = snd_rawmidi_transmit_peek(substream, buffer, count); count = snd_rawmidi_transmit_peek(substream, buffer, count);
if (count < 0) if (count < 0)
return count; return count;
......
...@@ -1153,7 +1153,7 @@ snd_ml403_ac97cr_create(struct snd_card *card, struct platform_device *pfdev, ...@@ -1153,7 +1153,7 @@ snd_ml403_ac97cr_create(struct snd_card *card, struct platform_device *pfdev,
/* get irq */ /* get irq */
irq = platform_get_irq(pfdev, 0); irq = platform_get_irq(pfdev, 0);
if (request_irq(irq, snd_ml403_ac97cr_irq, IRQF_DISABLED, if (request_irq(irq, snd_ml403_ac97cr_irq, IRQF_DISABLED,
pfdev->dev.bus_id, (void *)ml403_ac97cr)) { dev_name(&pfdev->dev), (void *)ml403_ac97cr)) {
snd_printk(KERN_ERR SND_ML403_AC97CR_DRIVER ": " snd_printk(KERN_ERR SND_ML403_AC97CR_DRIVER ": "
"unable to grab IRQ %d\n", "unable to grab IRQ %d\n",
irq); irq);
...@@ -1166,7 +1166,7 @@ snd_ml403_ac97cr_create(struct snd_card *card, struct platform_device *pfdev, ...@@ -1166,7 +1166,7 @@ snd_ml403_ac97cr_create(struct snd_card *card, struct platform_device *pfdev,
ml403_ac97cr->irq); ml403_ac97cr->irq);
irq = platform_get_irq(pfdev, 1); irq = platform_get_irq(pfdev, 1);
if (request_irq(irq, snd_ml403_ac97cr_irq, IRQF_DISABLED, if (request_irq(irq, snd_ml403_ac97cr_irq, IRQF_DISABLED,
pfdev->dev.bus_id, (void *)ml403_ac97cr)) { dev_name(&pfdev->dev), (void *)ml403_ac97cr)) {
snd_printk(KERN_ERR SND_ML403_AC97CR_DRIVER ": " snd_printk(KERN_ERR SND_ML403_AC97CR_DRIVER ": "
"unable to grab IRQ %d\n", "unable to grab IRQ %d\n",
irq); irq);
......
...@@ -24,13 +24,13 @@ static void pcspkr_do_sound(unsigned int count) ...@@ -24,13 +24,13 @@ static void pcspkr_do_sound(unsigned int count)
spin_lock_irqsave(&i8253_lock, flags); spin_lock_irqsave(&i8253_lock, flags);
if (count) { if (count) {
/* enable counter 2 */
outb_p(inb_p(0x61) | 3, 0x61);
/* set command for counter 2, 2 byte write */ /* set command for counter 2, 2 byte write */
outb_p(0xB6, 0x43); outb_p(0xB6, 0x43);
/* select desired HZ */ /* select desired HZ */
outb_p(count & 0xff, 0x42); outb_p(count & 0xff, 0x42);
outb((count >> 8) & 0xff, 0x42); outb((count >> 8) & 0xff, 0x42);
/* enable counter 2 */
outb_p(inb_p(0x61) | 3, 0x61);
} else { } else {
/* disable counter 2 */ /* disable counter 2 */
outb(inb_p(0x61) & 0xFC, 0x61); outb(inb_p(0x61) & 0xFC, 0x61);
......
...@@ -70,15 +70,15 @@ static int __devinit snd_ad1848_match(struct device *dev, unsigned int n) ...@@ -70,15 +70,15 @@ static int __devinit snd_ad1848_match(struct device *dev, unsigned int n)
return 0; return 0;
if (port[n] == SNDRV_AUTO_PORT) { if (port[n] == SNDRV_AUTO_PORT) {
snd_printk(KERN_ERR "%s: please specify port\n", dev->bus_id); dev_err(dev, "please specify port\n");
return 0; return 0;
} }
if (irq[n] == SNDRV_AUTO_IRQ) { if (irq[n] == SNDRV_AUTO_IRQ) {
snd_printk(KERN_ERR "%s: please specify irq\n", dev->bus_id); dev_err(dev, "please specify irq\n");
return 0; return 0;
} }
if (dma1[n] == SNDRV_AUTO_DMA) { if (dma1[n] == SNDRV_AUTO_DMA) {
snd_printk(KERN_ERR "%s: please specify dma1\n", dev->bus_id); dev_err(dev, "please specify dma1\n");
return 0; return 0;
} }
return 1; return 1;
......
...@@ -36,7 +36,7 @@ static int __devinit snd_adlib_match(struct device *dev, unsigned int n) ...@@ -36,7 +36,7 @@ static int __devinit snd_adlib_match(struct device *dev, unsigned int n)
return 0; return 0;
if (port[n] == SNDRV_AUTO_PORT) { if (port[n] == SNDRV_AUTO_PORT) {
snd_printk(KERN_ERR "%s: please specify port\n", dev->bus_id); dev_err(dev, "please specify port\n");
return 0; return 0;
} }
return 1; return 1;
...@@ -55,13 +55,13 @@ static int __devinit snd_adlib_probe(struct device *dev, unsigned int n) ...@@ -55,13 +55,13 @@ static int __devinit snd_adlib_probe(struct device *dev, unsigned int n)
card = snd_card_new(index[n], id[n], THIS_MODULE, 0); card = snd_card_new(index[n], id[n], THIS_MODULE, 0);
if (!card) { if (!card) {
snd_printk(KERN_ERR "%s: could not create card\n", dev->bus_id); dev_err(dev, "could not create card\n");
return -EINVAL; return -EINVAL;
} }
card->private_data = request_region(port[n], 4, CRD_NAME); card->private_data = request_region(port[n], 4, CRD_NAME);
if (!card->private_data) { if (!card->private_data) {
snd_printk(KERN_ERR "%s: could not grab ports\n", dev->bus_id); dev_err(dev, "could not grab ports\n");
error = -EBUSY; error = -EBUSY;
goto out; goto out;
} }
...@@ -73,13 +73,13 @@ static int __devinit snd_adlib_probe(struct device *dev, unsigned int n) ...@@ -73,13 +73,13 @@ static int __devinit snd_adlib_probe(struct device *dev, unsigned int n)
error = snd_opl3_create(card, port[n], port[n] + 2, OPL3_HW_AUTO, 1, &opl3); error = snd_opl3_create(card, port[n], port[n] + 2, OPL3_HW_AUTO, 1, &opl3);
if (error < 0) { if (error < 0) {
snd_printk(KERN_ERR "%s: could not create OPL\n", dev->bus_id); dev_err(dev, "could not create OPL\n");
goto out; goto out;
} }
error = snd_opl3_hwdep_new(opl3, 0, 0, NULL); error = snd_opl3_hwdep_new(opl3, 0, 0, NULL);
if (error < 0) { if (error < 0) {
snd_printk(KERN_ERR "%s: could not create FM\n", dev->bus_id); dev_err(dev, "could not create FM\n");
goto out; goto out;
} }
...@@ -87,7 +87,7 @@ static int __devinit snd_adlib_probe(struct device *dev, unsigned int n) ...@@ -87,7 +87,7 @@ static int __devinit snd_adlib_probe(struct device *dev, unsigned int n)
error = snd_card_register(card); error = snd_card_register(card);
if (error < 0) { if (error < 0) {
snd_printk(KERN_ERR "%s: could not register card\n", dev->bus_id); dev_err(dev, "could not register card\n");
goto out; goto out;
} }
......
...@@ -74,15 +74,15 @@ static int __devinit snd_cs4231_match(struct device *dev, unsigned int n) ...@@ -74,15 +74,15 @@ static int __devinit snd_cs4231_match(struct device *dev, unsigned int n)
return 0; return 0;
if (port[n] == SNDRV_AUTO_PORT) { if (port[n] == SNDRV_AUTO_PORT) {
snd_printk(KERN_ERR "%s: please specify port\n", dev->bus_id); dev_err(dev, "please specify port\n");
return 0; return 0;
} }
if (irq[n] == SNDRV_AUTO_IRQ) { if (irq[n] == SNDRV_AUTO_IRQ) {
snd_printk(KERN_ERR "%s: please specify irq\n", dev->bus_id); dev_err(dev, "please specify irq\n");
return 0; return 0;
} }
if (dma1[n] == SNDRV_AUTO_DMA) { if (dma1[n] == SNDRV_AUTO_DMA) {
snd_printk(KERN_ERR "%s: please specify dma1\n", dev->bus_id); dev_err(dev, "please specify dma1\n");
return 0; return 0;
} }
return 1; return 1;
...@@ -133,7 +133,7 @@ static int __devinit snd_cs4231_probe(struct device *dev, unsigned int n) ...@@ -133,7 +133,7 @@ static int __devinit snd_cs4231_probe(struct device *dev, unsigned int n)
mpu_port[n], 0, mpu_irq[n], mpu_port[n], 0, mpu_irq[n],
mpu_irq[n] >= 0 ? IRQF_DISABLED : 0, mpu_irq[n] >= 0 ? IRQF_DISABLED : 0,
NULL) < 0) NULL) < 0)
printk(KERN_WARNING "%s: MPU401 not detected\n", dev->bus_id); dev_warn(dev, "MPU401 not detected\n");
} }
snd_card_set_dev(card, dev); snd_card_set_dev(card, dev);
......
...@@ -488,19 +488,19 @@ static int __devinit snd_cs423x_isa_match(struct device *pdev, ...@@ -488,19 +488,19 @@ static int __devinit snd_cs423x_isa_match(struct device *pdev,
return 0; return 0;
if (port[dev] == SNDRV_AUTO_PORT) { if (port[dev] == SNDRV_AUTO_PORT) {
snd_printk(KERN_ERR "%s: please specify port\n", pdev->bus_id); dev_err(pdev, "please specify port\n");
return 0; return 0;
} }
if (cport[dev] == SNDRV_AUTO_PORT) { if (cport[dev] == SNDRV_AUTO_PORT) {
snd_printk(KERN_ERR "%s: please specify cport\n", pdev->bus_id); dev_err(pdev, "please specify cport\n");
return 0; return 0;
} }
if (irq[dev] == SNDRV_AUTO_IRQ) { if (irq[dev] == SNDRV_AUTO_IRQ) {
snd_printk(KERN_ERR "%s: please specify irq\n", pdev->bus_id); dev_err(pdev, "please specify irq\n");
return 0; return 0;
} }
if (dma1[dev] == SNDRV_AUTO_DMA) { if (dma1[dev] == SNDRV_AUTO_DMA) {
snd_printk(KERN_ERR "%s: please specify dma1\n", pdev->bus_id); dev_err(pdev, "please specify dma1\n");
return 0; return 0;
} }
return 1; return 1;
......
...@@ -88,16 +88,14 @@ static int __devinit snd_es1688_legacy_create(struct snd_card *card, ...@@ -88,16 +88,14 @@ static int __devinit snd_es1688_legacy_create(struct snd_card *card,
if (irq[n] == SNDRV_AUTO_IRQ) { if (irq[n] == SNDRV_AUTO_IRQ) {
irq[n] = snd_legacy_find_free_irq(possible_irqs); irq[n] = snd_legacy_find_free_irq(possible_irqs);
if (irq[n] < 0) { if (irq[n] < 0) {
snd_printk(KERN_ERR "%s: unable to find a free IRQ\n", dev_err(dev, "unable to find a free IRQ\n");
dev->bus_id);
return -EBUSY; return -EBUSY;
} }
} }
if (dma8[n] == SNDRV_AUTO_DMA) { if (dma8[n] == SNDRV_AUTO_DMA) {
dma8[n] = snd_legacy_find_free_dma(possible_dmas); dma8[n] = snd_legacy_find_free_dma(possible_dmas);
if (dma8[n] < 0) { if (dma8[n] < 0) {
snd_printk(KERN_ERR "%s: unable to find a free DMA\n", dev_err(dev, "unable to find a free DMA\n");
dev->bus_id);
return -EBUSY; return -EBUSY;
} }
} }
...@@ -147,8 +145,7 @@ static int __devinit snd_es1688_probe(struct device *dev, unsigned int n) ...@@ -147,8 +145,7 @@ static int __devinit snd_es1688_probe(struct device *dev, unsigned int n)
if (snd_opl3_create(card, chip->port, chip->port + 2, if (snd_opl3_create(card, chip->port, chip->port + 2,
OPL3_HW_OPL3, 0, &opl3) < 0) OPL3_HW_OPL3, 0, &opl3) < 0)
printk(KERN_WARNING "%s: opl3 not detected at 0x%lx\n", dev_warn(dev, "opl3 not detected at 0x%lx\n", chip->port);
dev->bus_id, chip->port);
else { else {
error = snd_opl3_hwdep_new(opl3, 0, 1, NULL); error = snd_opl3_hwdep_new(opl3, 0, 1, NULL);
if (error < 0) if (error < 0)
......
...@@ -90,24 +90,21 @@ static int __devinit snd_gusclassic_create(struct snd_card *card, ...@@ -90,24 +90,21 @@ static int __devinit snd_gusclassic_create(struct snd_card *card,
if (irq[n] == SNDRV_AUTO_IRQ) { if (irq[n] == SNDRV_AUTO_IRQ) {
irq[n] = snd_legacy_find_free_irq(possible_irqs); irq[n] = snd_legacy_find_free_irq(possible_irqs);
if (irq[n] < 0) { if (irq[n] < 0) {
snd_printk(KERN_ERR "%s: unable to find a free IRQ\n", dev_err(dev, "unable to find a free IRQ\n");
dev->bus_id);
return -EBUSY; return -EBUSY;
} }
} }
if (dma1[n] == SNDRV_AUTO_DMA) { if (dma1[n] == SNDRV_AUTO_DMA) {
dma1[n] = snd_legacy_find_free_dma(possible_dmas); dma1[n] = snd_legacy_find_free_dma(possible_dmas);
if (dma1[n] < 0) { if (dma1[n] < 0) {
snd_printk(KERN_ERR "%s: unable to find a free DMA1\n", dev_err(dev, "unable to find a free DMA1\n");
dev->bus_id);
return -EBUSY; return -EBUSY;
} }
} }
if (dma2[n] == SNDRV_AUTO_DMA) { if (dma2[n] == SNDRV_AUTO_DMA) {
dma2[n] = snd_legacy_find_free_dma(possible_dmas); dma2[n] = snd_legacy_find_free_dma(possible_dmas);
if (dma2[n] < 0) { if (dma2[n] < 0) {
snd_printk(KERN_ERR "%s: unable to find a free DMA2\n", dev_err(dev, "unable to find a free DMA2\n");
dev->bus_id);
return -EBUSY; return -EBUSY;
} }
} }
...@@ -174,8 +171,8 @@ static int __devinit snd_gusclassic_probe(struct device *dev, unsigned int n) ...@@ -174,8 +171,8 @@ static int __devinit snd_gusclassic_probe(struct device *dev, unsigned int n)
error = -ENODEV; error = -ENODEV;
if (gus->max_flag || gus->ess_flag) { if (gus->max_flag || gus->ess_flag) {
snd_printk(KERN_ERR "%s: GUS Classic or ACE soundcard was " dev_err(dev, "GUS Classic or ACE soundcard was "
"not detected at 0x%lx\n", dev->bus_id, gus->gf1.port); "not detected at 0x%lx\n", gus->gf1.port);
goto out; goto out;
} }
......
...@@ -106,16 +106,14 @@ static int __devinit snd_gusextreme_es1688_create(struct snd_card *card, ...@@ -106,16 +106,14 @@ static int __devinit snd_gusextreme_es1688_create(struct snd_card *card,
if (irq[n] == SNDRV_AUTO_IRQ) { if (irq[n] == SNDRV_AUTO_IRQ) {
irq[n] = snd_legacy_find_free_irq(possible_irqs); irq[n] = snd_legacy_find_free_irq(possible_irqs);
if (irq[n] < 0) { if (irq[n] < 0) {
snd_printk(KERN_ERR "%s: unable to find a free IRQ " dev_err(dev, "unable to find a free IRQ for ES1688\n");
"for ES1688\n", dev->bus_id);
return -EBUSY; return -EBUSY;
} }
} }
if (dma8[n] == SNDRV_AUTO_DMA) { if (dma8[n] == SNDRV_AUTO_DMA) {
dma8[n] = snd_legacy_find_free_dma(possible_dmas); dma8[n] = snd_legacy_find_free_dma(possible_dmas);
if (dma8[n] < 0) { if (dma8[n] < 0) {
snd_printk(KERN_ERR "%s: unable to find a free DMA " dev_err(dev, "unable to find a free DMA for ES1688\n");
"for ES1688\n", dev->bus_id);
return -EBUSY; return -EBUSY;
} }
} }
...@@ -143,16 +141,14 @@ static int __devinit snd_gusextreme_gus_card_create(struct snd_card *card, ...@@ -143,16 +141,14 @@ static int __devinit snd_gusextreme_gus_card_create(struct snd_card *card,
if (gf1_irq[n] == SNDRV_AUTO_IRQ) { if (gf1_irq[n] == SNDRV_AUTO_IRQ) {
gf1_irq[n] = snd_legacy_find_free_irq(possible_irqs); gf1_irq[n] = snd_legacy_find_free_irq(possible_irqs);
if (gf1_irq[n] < 0) { if (gf1_irq[n] < 0) {
snd_printk(KERN_ERR "%s: unable to find a free IRQ " dev_err(dev, "unable to find a free IRQ for GF1\n");
"for GF1\n", dev->bus_id);
return -EBUSY; return -EBUSY;
} }
} }
if (dma1[n] == SNDRV_AUTO_DMA) { if (dma1[n] == SNDRV_AUTO_DMA) {
dma1[n] = snd_legacy_find_free_dma(possible_dmas); dma1[n] = snd_legacy_find_free_dma(possible_dmas);
if (dma1[n] < 0) { if (dma1[n] < 0) {
snd_printk(KERN_ERR "%s: unable to find a free DMA " dev_err(dev, "unable to find a free DMA for GF1\n");
"for GF1\n", dev->bus_id);
return -EBUSY; return -EBUSY;
} }
} }
...@@ -278,8 +274,8 @@ static int __devinit snd_gusextreme_probe(struct device *dev, unsigned int n) ...@@ -278,8 +274,8 @@ static int __devinit snd_gusextreme_probe(struct device *dev, unsigned int n)
error = -ENODEV; error = -ENODEV;
if (!gus->ess_flag) { if (!gus->ess_flag) {
snd_printk(KERN_ERR "%s: GUS Extreme soundcard was not " dev_err(dev, "GUS Extreme soundcard was not "
"detected at 0x%lx\n", dev->bus_id, gus->gf1.port); "detected at 0x%lx\n", gus->gf1.port);
goto out; goto out;
} }
gus->codec_flag = 1; gus->codec_flag = 1;
...@@ -310,8 +306,7 @@ static int __devinit snd_gusextreme_probe(struct device *dev, unsigned int n) ...@@ -310,8 +306,7 @@ static int __devinit snd_gusextreme_probe(struct device *dev, unsigned int n)
if (snd_opl3_create(card, es1688->port, es1688->port + 2, if (snd_opl3_create(card, es1688->port, es1688->port + 2,
OPL3_HW_OPL3, 0, &opl3) < 0) OPL3_HW_OPL3, 0, &opl3) < 0)
printk(KERN_ERR "%s: opl3 not detected at 0x%lx\n", dev_warn(dev, "opl3 not detected at 0x%lx\n", es1688->port);
dev->bus_id, es1688->port);
else { else {
error = snd_opl3_hwdep_new(opl3, 0, 2, NULL); error = snd_opl3_hwdep_new(opl3, 0, 2, NULL);
if (error < 0) if (error < 0)
......
...@@ -85,11 +85,11 @@ static int __devinit snd_sb8_match(struct device *pdev, unsigned int dev) ...@@ -85,11 +85,11 @@ static int __devinit snd_sb8_match(struct device *pdev, unsigned int dev)
if (!enable[dev]) if (!enable[dev])
return 0; return 0;
if (irq[dev] == SNDRV_AUTO_IRQ) { if (irq[dev] == SNDRV_AUTO_IRQ) {
snd_printk(KERN_ERR "%s: please specify irq\n", pdev->bus_id); dev_err(pdev, "please specify irq\n");
return 0; return 0;
} }
if (dma8[dev] == SNDRV_AUTO_DMA) { if (dma8[dev] == SNDRV_AUTO_DMA) {
snd_printk(KERN_ERR "%s: please specify dma8\n", pdev->bus_id); dev_err(pdev, "please specify dma8\n");
return 0; return 0;
} }
return 1; return 1;
......
...@@ -1464,6 +1464,7 @@ static struct snd_emu_chip_details emu_chip_details[] = { ...@@ -1464,6 +1464,7 @@ static struct snd_emu_chip_details emu_chip_details[] = {
.ca0151_chip = 1, .ca0151_chip = 1,
.spk71 = 1, .spk71 = 1,
.spdif_bug = 1, .spdif_bug = 1,
.invert_shared_spdif = 1, /* digital/analog switch swapped */
.ac97_chip = 1} , .ac97_chip = 1} ,
{.vendor = 0x1102, .device = 0x0004, .subsystem = 0x20021102, {.vendor = 0x1102, .device = 0x0004, .subsystem = 0x20021102,
.driver = "Audigy2", .name = "Audigy 2 ZS [SB0350]", .driver = "Audigy2", .name = "Audigy 2 ZS [SB0350]",
...@@ -1473,6 +1474,7 @@ static struct snd_emu_chip_details emu_chip_details[] = { ...@@ -1473,6 +1474,7 @@ static struct snd_emu_chip_details emu_chip_details[] = {
.ca0151_chip = 1, .ca0151_chip = 1,
.spk71 = 1, .spk71 = 1,
.spdif_bug = 1, .spdif_bug = 1,
.invert_shared_spdif = 1, /* digital/analog switch swapped */
.ac97_chip = 1} , .ac97_chip = 1} ,
{.vendor = 0x1102, .device = 0x0004, .subsystem = 0x20011102, {.vendor = 0x1102, .device = 0x0004, .subsystem = 0x20011102,
.driver = "Audigy2", .name = "Audigy 2 ZS [2001]", .driver = "Audigy2", .name = "Audigy 2 ZS [2001]",
...@@ -1482,6 +1484,7 @@ static struct snd_emu_chip_details emu_chip_details[] = { ...@@ -1482,6 +1484,7 @@ static struct snd_emu_chip_details emu_chip_details[] = {
.ca0151_chip = 1, .ca0151_chip = 1,
.spk71 = 1, .spk71 = 1,
.spdif_bug = 1, .spdif_bug = 1,
.invert_shared_spdif = 1, /* digital/analog switch swapped */
.ac97_chip = 1} , .ac97_chip = 1} ,
/* Audigy 2 */ /* Audigy 2 */
/* Tested by James@superbug.co.uk 3rd July 2005 */ /* Tested by James@superbug.co.uk 3rd July 2005 */
......
...@@ -829,6 +829,7 @@ static void alc_sku_automute(struct hda_codec *codec) ...@@ -829,6 +829,7 @@ static void alc_sku_automute(struct hda_codec *codec)
spec->jack_present ? 0 : PIN_OUT); spec->jack_present ? 0 : PIN_OUT);
} }
#if 0 /* it's broken in some acses -- temporarily disabled */
static void alc_mic_automute(struct hda_codec *codec) static void alc_mic_automute(struct hda_codec *codec)
{ {
struct alc_spec *spec = codec->spec; struct alc_spec *spec = codec->spec;
...@@ -849,6 +850,9 @@ static void alc_mic_automute(struct hda_codec *codec) ...@@ -849,6 +850,9 @@ static void alc_mic_automute(struct hda_codec *codec)
snd_hda_codec_amp_stereo(codec, 0x0b, HDA_INPUT, capsrc_idx_fmic, snd_hda_codec_amp_stereo(codec, 0x0b, HDA_INPUT, capsrc_idx_fmic,
HDA_AMP_MUTE, present ? HDA_AMP_MUTE : 0); HDA_AMP_MUTE, present ? HDA_AMP_MUTE : 0);
} }
#else
#define alc_mic_automute(codec) /* NOP */
#endif /* disabled */
/* unsolicited event for HP jack sensing */ /* unsolicited event for HP jack sensing */
static void alc_sku_unsol_event(struct hda_codec *codec, unsigned int res) static void alc_sku_unsol_event(struct hda_codec *codec, unsigned int res)
...@@ -1058,12 +1062,14 @@ static void alc_subsystem_id(struct hda_codec *codec, ...@@ -1058,12 +1062,14 @@ static void alc_subsystem_id(struct hda_codec *codec,
AC_VERB_SET_UNSOLICITED_ENABLE, AC_VERB_SET_UNSOLICITED_ENABLE,
AC_USRSP_EN | ALC880_HP_EVENT); AC_USRSP_EN | ALC880_HP_EVENT);
#if 0 /* it's broken in some acses -- temporarily disabled */
if (spec->autocfg.input_pins[AUTO_PIN_MIC] && if (spec->autocfg.input_pins[AUTO_PIN_MIC] &&
spec->autocfg.input_pins[AUTO_PIN_FRONT_MIC]) spec->autocfg.input_pins[AUTO_PIN_FRONT_MIC])
snd_hda_codec_write(codec, snd_hda_codec_write(codec,
spec->autocfg.input_pins[AUTO_PIN_MIC], 0, spec->autocfg.input_pins[AUTO_PIN_MIC], 0,
AC_VERB_SET_UNSOLICITED_ENABLE, AC_VERB_SET_UNSOLICITED_ENABLE,
AC_USRSP_EN | ALC880_MIC_EVENT); AC_USRSP_EN | ALC880_MIC_EVENT);
#endif /* disabled */
spec->unsol_event = alc_sku_unsol_event; spec->unsol_event = alc_sku_unsol_event;
} }
...@@ -8408,6 +8414,7 @@ static const char *alc883_models[ALC883_MODEL_LAST] = { ...@@ -8408,6 +8414,7 @@ static const char *alc883_models[ALC883_MODEL_LAST] = {
static struct snd_pci_quirk alc883_cfg_tbl[] = { static struct snd_pci_quirk alc883_cfg_tbl[] = {
SND_PCI_QUIRK(0x1019, 0x6668, "ECS", ALC883_3ST_6ch_DIG), SND_PCI_QUIRK(0x1019, 0x6668, "ECS", ALC883_3ST_6ch_DIG),
SND_PCI_QUIRK(0x1025, 0x006c, "Acer Aspire 9810", ALC883_ACER_ASPIRE), SND_PCI_QUIRK(0x1025, 0x006c, "Acer Aspire 9810", ALC883_ACER_ASPIRE),
SND_PCI_QUIRK(0x1025, 0x0090, "Acer Aspire", ALC883_ACER_ASPIRE),
SND_PCI_QUIRK(0x1025, 0x0110, "Acer Aspire", ALC883_ACER_ASPIRE), SND_PCI_QUIRK(0x1025, 0x0110, "Acer Aspire", ALC883_ACER_ASPIRE),
SND_PCI_QUIRK(0x1025, 0x0112, "Acer Aspire 9303", ALC883_ACER_ASPIRE), SND_PCI_QUIRK(0x1025, 0x0112, "Acer Aspire 9303", ALC883_ACER_ASPIRE),
SND_PCI_QUIRK(0x1025, 0x0121, "Acer Aspire 5920G", ALC883_ACER_ASPIRE), SND_PCI_QUIRK(0x1025, 0x0121, "Acer Aspire 5920G", ALC883_ACER_ASPIRE),
...@@ -12238,8 +12245,26 @@ static int alc269_auto_create_multi_out_ctls(struct alc_spec *spec, ...@@ -12238,8 +12245,26 @@ static int alc269_auto_create_multi_out_ctls(struct alc_spec *spec,
return 0; return 0;
} }
#define alc269_auto_create_analog_input_ctls \ static int alc269_auto_create_analog_input_ctls(struct alc_spec *spec,
alc880_auto_create_analog_input_ctls const struct auto_pin_cfg *cfg)
{
int err;
err = alc880_auto_create_analog_input_ctls(spec, cfg);
if (err < 0)
return err;
/* digital-mic input pin is excluded in alc880_auto_create..()
* because it's under 0x18
*/
if (cfg->input_pins[AUTO_PIN_MIC] == 0x12 ||
cfg->input_pins[AUTO_PIN_FRONT_MIC] == 0x12) {
struct hda_input_mux *imux = &spec->private_imux;
imux->items[imux->num_items].label = "Int Mic";
imux->items[imux->num_items].index = 0x05;
imux->num_items++;
}
return 0;
}
#ifdef CONFIG_SND_HDA_POWER_SAVE #ifdef CONFIG_SND_HDA_POWER_SAVE
#define alc269_loopbacks alc880_loopbacks #define alc269_loopbacks alc880_loopbacks
......
...@@ -69,6 +69,7 @@ enum { ...@@ -69,6 +69,7 @@ enum {
enum { enum {
STAC_92HD73XX_REF, STAC_92HD73XX_REF,
STAC_DELL_M6, STAC_DELL_M6,
STAC_DELL_EQ,
STAC_92HD73XX_MODELS STAC_92HD73XX_MODELS
}; };
...@@ -773,9 +774,7 @@ static struct hda_verb dell_eq_core_init[] = { ...@@ -773,9 +774,7 @@ static struct hda_verb dell_eq_core_init[] = {
}; };
static struct hda_verb dell_m6_core_init[] = { static struct hda_verb dell_m6_core_init[] = {
/* set master volume to max value without distortion { 0x1f, AC_VERB_SET_VOLUME_KNOB_CONTROL, 0xff},
* and direct control */
{ 0x1f, AC_VERB_SET_VOLUME_KNOB_CONTROL, 0xec},
/* setup audio connections */ /* setup audio connections */
{ 0x0d, AC_VERB_SET_CONNECT_SEL, 0x00}, { 0x0d, AC_VERB_SET_CONNECT_SEL, 0x00},
{ 0x0a, AC_VERB_SET_CONNECT_SEL, 0x01}, { 0x0a, AC_VERB_SET_CONNECT_SEL, 0x01},
...@@ -1600,11 +1599,13 @@ static unsigned int dell_m6_pin_configs[13] = { ...@@ -1600,11 +1599,13 @@ static unsigned int dell_m6_pin_configs[13] = {
static unsigned int *stac92hd73xx_brd_tbl[STAC_92HD73XX_MODELS] = { static unsigned int *stac92hd73xx_brd_tbl[STAC_92HD73XX_MODELS] = {
[STAC_92HD73XX_REF] = ref92hd73xx_pin_configs, [STAC_92HD73XX_REF] = ref92hd73xx_pin_configs,
[STAC_DELL_M6] = dell_m6_pin_configs, [STAC_DELL_M6] = dell_m6_pin_configs,
[STAC_DELL_EQ] = dell_m6_pin_configs,
}; };
static const char *stac92hd73xx_models[STAC_92HD73XX_MODELS] = { static const char *stac92hd73xx_models[STAC_92HD73XX_MODELS] = {
[STAC_92HD73XX_REF] = "ref", [STAC_92HD73XX_REF] = "ref",
[STAC_DELL_M6] = "dell-m6", [STAC_DELL_M6] = "dell-m6",
[STAC_DELL_EQ] = "dell-eq",
}; };
static struct snd_pci_quirk stac92hd73xx_cfg_tbl[] = { static struct snd_pci_quirk stac92hd73xx_cfg_tbl[] = {
...@@ -4131,12 +4132,17 @@ static int patch_stac92hd73xx(struct hda_codec *codec) ...@@ -4131,12 +4132,17 @@ static int patch_stac92hd73xx(struct hda_codec *codec)
sizeof(stac92hd73xx_dmux)); sizeof(stac92hd73xx_dmux));
switch (spec->board_config) { switch (spec->board_config) {
case STAC_DELL_M6: case STAC_DELL_EQ:
spec->init = dell_eq_core_init; spec->init = dell_eq_core_init;
/* fallthru */
case STAC_DELL_M6:
spec->num_smuxes = 0; spec->num_smuxes = 0;
spec->mixer = &stac92hd73xx_6ch_mixer[DELL_M6_MIXER]; spec->mixer = &stac92hd73xx_6ch_mixer[DELL_M6_MIXER];
spec->amp_nids = &stac92hd73xx_amp_nids[DELL_M6_AMP]; spec->amp_nids = &stac92hd73xx_amp_nids[DELL_M6_AMP];
spec->num_amps = 1; spec->num_amps = 1;
if (!spec->init)
spec->init = dell_m6_core_init;
switch (codec->subsystem_id) { switch (codec->subsystem_id) {
case 0x1028025e: /* Analog Mics */ case 0x1028025e: /* Analog Mics */
case 0x1028025f: case 0x1028025f:
...@@ -4146,8 +4152,6 @@ static int patch_stac92hd73xx(struct hda_codec *codec) ...@@ -4146,8 +4152,6 @@ static int patch_stac92hd73xx(struct hda_codec *codec)
break; break;
case 0x10280271: /* Digital Mics */ case 0x10280271: /* Digital Mics */
case 0x10280272: case 0x10280272:
spec->init = dell_m6_core_init;
/* fall-through */
case 0x10280254: case 0x10280254:
case 0x10280255: case 0x10280255:
stac92xx_set_config_reg(codec, 0x13, 0x90A60160); stac92xx_set_config_reg(codec, 0x13, 0x90A60160);
......
...@@ -95,7 +95,7 @@ static int soc_ac97_dev_register(struct snd_soc_codec *codec) ...@@ -95,7 +95,7 @@ static int soc_ac97_dev_register(struct snd_soc_codec *codec)
codec->ac97->dev.parent = NULL; codec->ac97->dev.parent = NULL;
codec->ac97->dev.release = soc_ac97_device_release; codec->ac97->dev.release = soc_ac97_device_release;
snprintf(codec->ac97->dev.bus_id, BUS_ID_SIZE, "%d-%d:%s", dev_set_name(&codec->ac97->dev, "%d-%d:%s",
codec->card->number, 0, codec->name); codec->card->number, 0, codec->name);
err = device_register(&codec->ac97->dev); err = device_register(&codec->ac97->dev);
if (err < 0) { if (err < 0) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment