diff options
Diffstat (limited to 'sound/pci/hda')
-rw-r--r-- | sound/pci/hda/hda_codec.c | 8 | ||||
-rw-r--r-- | sound/pci/hda/hda_codec.h | 2 | ||||
-rw-r--r-- | sound/pci/hda/hda_eld.c | 4 | ||||
-rw-r--r-- | sound/pci/hda/hda_intel.c | 103 | ||||
-rw-r--r-- | sound/pci/hda/patch_analog.c | 2 | ||||
-rw-r--r-- | sound/pci/hda/patch_realtek.c | 41 | ||||
-rw-r--r-- | sound/pci/hda/patch_sigmatel.c | 20 |
7 files changed, 121 insertions, 59 deletions
diff --git a/sound/pci/hda/hda_codec.c b/sound/pci/hda/hda_codec.c index 26d255de6beb..c7df01b72cac 100644 --- a/sound/pci/hda/hda_codec.c +++ b/sound/pci/hda/hda_codec.c | |||
@@ -174,7 +174,7 @@ static int codec_exec_verb(struct hda_codec *codec, unsigned int cmd, | |||
174 | mutex_lock(&bus->cmd_mutex); | 174 | mutex_lock(&bus->cmd_mutex); |
175 | err = bus->ops.command(bus, cmd); | 175 | err = bus->ops.command(bus, cmd); |
176 | if (!err && res) | 176 | if (!err && res) |
177 | *res = bus->ops.get_response(bus); | 177 | *res = bus->ops.get_response(bus, codec->addr); |
178 | mutex_unlock(&bus->cmd_mutex); | 178 | mutex_unlock(&bus->cmd_mutex); |
179 | snd_hda_power_down(codec); | 179 | snd_hda_power_down(codec); |
180 | if (res && *res == -1 && bus->rirb_error) { | 180 | if (res && *res == -1 && bus->rirb_error) { |
@@ -332,6 +332,12 @@ int snd_hda_get_connections(struct hda_codec *codec, hda_nid_t nid, | |||
332 | AC_VERB_GET_CONNECT_LIST, i); | 332 | AC_VERB_GET_CONNECT_LIST, i); |
333 | range_val = !!(parm & (1 << (shift-1))); /* ranges */ | 333 | range_val = !!(parm & (1 << (shift-1))); /* ranges */ |
334 | val = parm & mask; | 334 | val = parm & mask; |
335 | if (val == 0) { | ||
336 | snd_printk(KERN_WARNING "hda_codec: " | ||
337 | "invalid CONNECT_LIST verb %x[%i]:%x\n", | ||
338 | nid, i, parm); | ||
339 | return 0; | ||
340 | } | ||
335 | parm >>= shift; | 341 | parm >>= shift; |
336 | if (range_val) { | 342 | if (range_val) { |
337 | /* ranges between the previous and this one */ | 343 | /* ranges between the previous and this one */ |
diff --git a/sound/pci/hda/hda_codec.h b/sound/pci/hda/hda_codec.h index cad79efaabc9..1b75f28ed092 100644 --- a/sound/pci/hda/hda_codec.h +++ b/sound/pci/hda/hda_codec.h | |||
@@ -568,7 +568,7 @@ struct hda_bus_ops { | |||
568 | /* send a single command */ | 568 | /* send a single command */ |
569 | int (*command)(struct hda_bus *bus, unsigned int cmd); | 569 | int (*command)(struct hda_bus *bus, unsigned int cmd); |
570 | /* get a response from the last command */ | 570 | /* get a response from the last command */ |
571 | unsigned int (*get_response)(struct hda_bus *bus); | 571 | unsigned int (*get_response)(struct hda_bus *bus, unsigned int addr); |
572 | /* free the private data */ | 572 | /* free the private data */ |
573 | void (*private_free)(struct hda_bus *); | 573 | void (*private_free)(struct hda_bus *); |
574 | /* attach a PCM stream */ | 574 | /* attach a PCM stream */ |
diff --git a/sound/pci/hda/hda_eld.c b/sound/pci/hda/hda_eld.c index fcad5ec31773..9446a5abea13 100644 --- a/sound/pci/hda/hda_eld.c +++ b/sound/pci/hda/hda_eld.c | |||
@@ -508,7 +508,7 @@ static void hdmi_write_eld_info(struct snd_info_entry *entry, | |||
508 | char name[64]; | 508 | char name[64]; |
509 | char *sname; | 509 | char *sname; |
510 | long long val; | 510 | long long val; |
511 | int n; | 511 | unsigned int n; |
512 | 512 | ||
513 | while (!snd_info_get_line(buffer, line, sizeof(line))) { | 513 | while (!snd_info_get_line(buffer, line, sizeof(line))) { |
514 | if (sscanf(line, "%s %llx", name, &val) != 2) | 514 | if (sscanf(line, "%s %llx", name, &val) != 2) |
@@ -539,7 +539,7 @@ static void hdmi_write_eld_info(struct snd_info_entry *entry, | |||
539 | sname++; | 539 | sname++; |
540 | n = 10 * n + name[4] - '0'; | 540 | n = 10 * n + name[4] - '0'; |
541 | } | 541 | } |
542 | if (n < 0 || n > 31) /* double the CEA limit */ | 542 | if (n >= ELD_MAX_SAD) |
543 | continue; | 543 | continue; |
544 | if (!strcmp(sname, "_coding_type")) | 544 | if (!strcmp(sname, "_coding_type")) |
545 | e->sad[n].format = val; | 545 | e->sad[n].format = val; |
diff --git a/sound/pci/hda/hda_intel.c b/sound/pci/hda/hda_intel.c index 77c1b840ca8b..175f07a381ba 100644 --- a/sound/pci/hda/hda_intel.c +++ b/sound/pci/hda/hda_intel.c | |||
@@ -253,7 +253,7 @@ enum { SDI0, SDI1, SDI2, SDI3, SDO0, SDO1, SDO2, SDO3 }; | |||
253 | 253 | ||
254 | /* STATESTS int mask: S3,SD2,SD1,SD0 */ | 254 | /* STATESTS int mask: S3,SD2,SD1,SD0 */ |
255 | #define AZX_MAX_CODECS 4 | 255 | #define AZX_MAX_CODECS 4 |
256 | #define STATESTS_INT_MASK 0x0f | 256 | #define STATESTS_INT_MASK ((1 << AZX_MAX_CODECS) - 1) |
257 | 257 | ||
258 | /* SD_CTL bits */ | 258 | /* SD_CTL bits */ |
259 | #define SD_CTL_STREAM_RESET 0x01 /* stream reset bit */ | 259 | #define SD_CTL_STREAM_RESET 0x01 /* stream reset bit */ |
@@ -361,8 +361,8 @@ struct azx_rb { | |||
361 | dma_addr_t addr; /* physical address of CORB/RIRB buffer */ | 361 | dma_addr_t addr; /* physical address of CORB/RIRB buffer */ |
362 | /* for RIRB */ | 362 | /* for RIRB */ |
363 | unsigned short rp, wp; /* read/write pointers */ | 363 | unsigned short rp, wp; /* read/write pointers */ |
364 | int cmds; /* number of pending requests */ | 364 | int cmds[AZX_MAX_CODECS]; /* number of pending requests */ |
365 | u32 res; /* last read value */ | 365 | u32 res[AZX_MAX_CODECS]; /* last read value */ |
366 | }; | 366 | }; |
367 | 367 | ||
368 | struct azx { | 368 | struct azx { |
@@ -418,7 +418,7 @@ struct azx { | |||
418 | unsigned int probing :1; /* codec probing phase */ | 418 | unsigned int probing :1; /* codec probing phase */ |
419 | 419 | ||
420 | /* for debugging */ | 420 | /* for debugging */ |
421 | unsigned int last_cmd; /* last issued command (to sync) */ | 421 | unsigned int last_cmd[AZX_MAX_CODECS]; |
422 | 422 | ||
423 | /* for pending irqs */ | 423 | /* for pending irqs */ |
424 | struct work_struct irq_pending_work; | 424 | struct work_struct irq_pending_work; |
@@ -513,6 +513,7 @@ static int azx_alloc_cmd_io(struct azx *chip) | |||
513 | 513 | ||
514 | static void azx_init_cmd_io(struct azx *chip) | 514 | static void azx_init_cmd_io(struct azx *chip) |
515 | { | 515 | { |
516 | spin_lock_irq(&chip->reg_lock); | ||
516 | /* CORB set up */ | 517 | /* CORB set up */ |
517 | chip->corb.addr = chip->rb.addr; | 518 | chip->corb.addr = chip->rb.addr; |
518 | chip->corb.buf = (u32 *)chip->rb.area; | 519 | chip->corb.buf = (u32 *)chip->rb.area; |
@@ -531,7 +532,8 @@ static void azx_init_cmd_io(struct azx *chip) | |||
531 | /* RIRB set up */ | 532 | /* RIRB set up */ |
532 | chip->rirb.addr = chip->rb.addr + 2048; | 533 | chip->rirb.addr = chip->rb.addr + 2048; |
533 | chip->rirb.buf = (u32 *)(chip->rb.area + 2048); | 534 | chip->rirb.buf = (u32 *)(chip->rb.area + 2048); |
534 | chip->rirb.wp = chip->rirb.rp = chip->rirb.cmds = 0; | 535 | chip->rirb.wp = chip->rirb.rp = 0; |
536 | memset(chip->rirb.cmds, 0, sizeof(chip->rirb.cmds)); | ||
535 | azx_writel(chip, RIRBLBASE, (u32)chip->rirb.addr); | 537 | azx_writel(chip, RIRBLBASE, (u32)chip->rirb.addr); |
536 | azx_writel(chip, RIRBUBASE, upper_32_bits(chip->rirb.addr)); | 538 | azx_writel(chip, RIRBUBASE, upper_32_bits(chip->rirb.addr)); |
537 | 539 | ||
@@ -543,30 +545,60 @@ static void azx_init_cmd_io(struct azx *chip) | |||
543 | azx_writew(chip, RINTCNT, 1); | 545 | azx_writew(chip, RINTCNT, 1); |
544 | /* enable rirb dma and response irq */ | 546 | /* enable rirb dma and response irq */ |
545 | azx_writeb(chip, RIRBCTL, ICH6_RBCTL_DMA_EN | ICH6_RBCTL_IRQ_EN); | 547 | azx_writeb(chip, RIRBCTL, ICH6_RBCTL_DMA_EN | ICH6_RBCTL_IRQ_EN); |
548 | spin_unlock_irq(&chip->reg_lock); | ||
546 | } | 549 | } |
547 | 550 | ||
548 | static void azx_free_cmd_io(struct azx *chip) | 551 | static void azx_free_cmd_io(struct azx *chip) |
549 | { | 552 | { |
553 | spin_lock_irq(&chip->reg_lock); | ||
550 | /* disable ringbuffer DMAs */ | 554 | /* disable ringbuffer DMAs */ |
551 | azx_writeb(chip, RIRBCTL, 0); | 555 | azx_writeb(chip, RIRBCTL, 0); |
552 | azx_writeb(chip, CORBCTL, 0); | 556 | azx_writeb(chip, CORBCTL, 0); |
557 | spin_unlock_irq(&chip->reg_lock); | ||
558 | } | ||
559 | |||
560 | static unsigned int azx_command_addr(u32 cmd) | ||
561 | { | ||
562 | unsigned int addr = cmd >> 28; | ||
563 | |||
564 | if (addr >= AZX_MAX_CODECS) { | ||
565 | snd_BUG(); | ||
566 | addr = 0; | ||
567 | } | ||
568 | |||
569 | return addr; | ||
570 | } | ||
571 | |||
572 | static unsigned int azx_response_addr(u32 res) | ||
573 | { | ||
574 | unsigned int addr = res & 0xf; | ||
575 | |||
576 | if (addr >= AZX_MAX_CODECS) { | ||
577 | snd_BUG(); | ||
578 | addr = 0; | ||
579 | } | ||
580 | |||
581 | return addr; | ||
553 | } | 582 | } |
554 | 583 | ||
555 | /* send a command */ | 584 | /* send a command */ |
556 | static int azx_corb_send_cmd(struct hda_bus *bus, u32 val) | 585 | static int azx_corb_send_cmd(struct hda_bus *bus, u32 val) |
557 | { | 586 | { |
558 | struct azx *chip = bus->private_data; | 587 | struct azx *chip = bus->private_data; |
588 | unsigned int addr = azx_command_addr(val); | ||
559 | unsigned int wp; | 589 | unsigned int wp; |
560 | 590 | ||
591 | spin_lock_irq(&chip->reg_lock); | ||
592 | |||
561 | /* add command to corb */ | 593 | /* add command to corb */ |
562 | wp = azx_readb(chip, CORBWP); | 594 | wp = azx_readb(chip, CORBWP); |
563 | wp++; | 595 | wp++; |
564 | wp %= ICH6_MAX_CORB_ENTRIES; | 596 | wp %= ICH6_MAX_CORB_ENTRIES; |
565 | 597 | ||
566 | spin_lock_irq(&chip->reg_lock); | 598 | chip->rirb.cmds[addr]++; |
567 | chip->rirb.cmds++; | ||
568 | chip->corb.buf[wp] = cpu_to_le32(val); | 599 | chip->corb.buf[wp] = cpu_to_le32(val); |
569 | azx_writel(chip, CORBWP, wp); | 600 | azx_writel(chip, CORBWP, wp); |
601 | |||
570 | spin_unlock_irq(&chip->reg_lock); | 602 | spin_unlock_irq(&chip->reg_lock); |
571 | 603 | ||
572 | return 0; | 604 | return 0; |
@@ -578,13 +610,14 @@ static int azx_corb_send_cmd(struct hda_bus *bus, u32 val) | |||
578 | static void azx_update_rirb(struct azx *chip) | 610 | static void azx_update_rirb(struct azx *chip) |
579 | { | 611 | { |
580 | unsigned int rp, wp; | 612 | unsigned int rp, wp; |
613 | unsigned int addr; | ||
581 | u32 res, res_ex; | 614 | u32 res, res_ex; |
582 | 615 | ||
583 | wp = azx_readb(chip, RIRBWP); | 616 | wp = azx_readb(chip, RIRBWP); |
584 | if (wp == chip->rirb.wp) | 617 | if (wp == chip->rirb.wp) |
585 | return; | 618 | return; |
586 | chip->rirb.wp = wp; | 619 | chip->rirb.wp = wp; |
587 | 620 | ||
588 | while (chip->rirb.rp != wp) { | 621 | while (chip->rirb.rp != wp) { |
589 | chip->rirb.rp++; | 622 | chip->rirb.rp++; |
590 | chip->rirb.rp %= ICH6_MAX_RIRB_ENTRIES; | 623 | chip->rirb.rp %= ICH6_MAX_RIRB_ENTRIES; |
@@ -592,18 +625,24 @@ static void azx_update_rirb(struct azx *chip) | |||
592 | rp = chip->rirb.rp << 1; /* an RIRB entry is 8-bytes */ | 625 | rp = chip->rirb.rp << 1; /* an RIRB entry is 8-bytes */ |
593 | res_ex = le32_to_cpu(chip->rirb.buf[rp + 1]); | 626 | res_ex = le32_to_cpu(chip->rirb.buf[rp + 1]); |
594 | res = le32_to_cpu(chip->rirb.buf[rp]); | 627 | res = le32_to_cpu(chip->rirb.buf[rp]); |
628 | addr = azx_response_addr(res_ex); | ||
595 | if (res_ex & ICH6_RIRB_EX_UNSOL_EV) | 629 | if (res_ex & ICH6_RIRB_EX_UNSOL_EV) |
596 | snd_hda_queue_unsol_event(chip->bus, res, res_ex); | 630 | snd_hda_queue_unsol_event(chip->bus, res, res_ex); |
597 | else if (chip->rirb.cmds) { | 631 | else if (chip->rirb.cmds[addr]) { |
598 | chip->rirb.res = res; | 632 | chip->rirb.res[addr] = res; |
599 | smp_wmb(); | 633 | smp_wmb(); |
600 | chip->rirb.cmds--; | 634 | chip->rirb.cmds[addr]--; |
601 | } | 635 | } else |
636 | snd_printk(KERN_ERR SFX "spurious response %#x:%#x, " | ||
637 | "last cmd=%#08x\n", | ||
638 | res, res_ex, | ||
639 | chip->last_cmd[addr]); | ||
602 | } | 640 | } |
603 | } | 641 | } |
604 | 642 | ||
605 | /* receive a response */ | 643 | /* receive a response */ |
606 | static unsigned int azx_rirb_get_response(struct hda_bus *bus) | 644 | static unsigned int azx_rirb_get_response(struct hda_bus *bus, |
645 | unsigned int addr) | ||
607 | { | 646 | { |
608 | struct azx *chip = bus->private_data; | 647 | struct azx *chip = bus->private_data; |
609 | unsigned long timeout; | 648 | unsigned long timeout; |
@@ -616,10 +655,10 @@ static unsigned int azx_rirb_get_response(struct hda_bus *bus) | |||
616 | azx_update_rirb(chip); | 655 | azx_update_rirb(chip); |
617 | spin_unlock_irq(&chip->reg_lock); | 656 | spin_unlock_irq(&chip->reg_lock); |
618 | } | 657 | } |
619 | if (!chip->rirb.cmds) { | 658 | if (!chip->rirb.cmds[addr]) { |
620 | smp_rmb(); | 659 | smp_rmb(); |
621 | bus->rirb_error = 0; | 660 | bus->rirb_error = 0; |
622 | return chip->rirb.res; /* the last value */ | 661 | return chip->rirb.res[addr]; /* the last value */ |
623 | } | 662 | } |
624 | if (time_after(jiffies, timeout)) | 663 | if (time_after(jiffies, timeout)) |
625 | break; | 664 | break; |
@@ -633,7 +672,8 @@ static unsigned int azx_rirb_get_response(struct hda_bus *bus) | |||
633 | 672 | ||
634 | if (chip->msi) { | 673 | if (chip->msi) { |
635 | snd_printk(KERN_WARNING SFX "No response from codec, " | 674 | snd_printk(KERN_WARNING SFX "No response from codec, " |
636 | "disabling MSI: last cmd=0x%08x\n", chip->last_cmd); | 675 | "disabling MSI: last cmd=0x%08x\n", |
676 | chip->last_cmd[addr]); | ||
637 | free_irq(chip->irq, chip); | 677 | free_irq(chip->irq, chip); |
638 | chip->irq = -1; | 678 | chip->irq = -1; |
639 | pci_disable_msi(chip->pci); | 679 | pci_disable_msi(chip->pci); |
@@ -648,7 +688,7 @@ static unsigned int azx_rirb_get_response(struct hda_bus *bus) | |||
648 | if (!chip->polling_mode) { | 688 | if (!chip->polling_mode) { |
649 | snd_printk(KERN_WARNING SFX "azx_get_response timeout, " | 689 | snd_printk(KERN_WARNING SFX "azx_get_response timeout, " |
650 | "switching to polling mode: last cmd=0x%08x\n", | 690 | "switching to polling mode: last cmd=0x%08x\n", |
651 | chip->last_cmd); | 691 | chip->last_cmd[addr]); |
652 | chip->polling_mode = 1; | 692 | chip->polling_mode = 1; |
653 | goto again; | 693 | goto again; |
654 | } | 694 | } |
@@ -672,7 +712,7 @@ static unsigned int azx_rirb_get_response(struct hda_bus *bus) | |||
672 | 712 | ||
673 | snd_printk(KERN_ERR "hda_intel: azx_get_response timeout, " | 713 | snd_printk(KERN_ERR "hda_intel: azx_get_response timeout, " |
674 | "switching to single_cmd mode: last cmd=0x%08x\n", | 714 | "switching to single_cmd mode: last cmd=0x%08x\n", |
675 | chip->last_cmd); | 715 | chip->last_cmd[addr]); |
676 | chip->single_cmd = 1; | 716 | chip->single_cmd = 1; |
677 | bus->response_reset = 0; | 717 | bus->response_reset = 0; |
678 | /* re-initialize CORB/RIRB */ | 718 | /* re-initialize CORB/RIRB */ |
@@ -692,7 +732,7 @@ static unsigned int azx_rirb_get_response(struct hda_bus *bus) | |||
692 | */ | 732 | */ |
693 | 733 | ||
694 | /* receive a response */ | 734 | /* receive a response */ |
695 | static int azx_single_wait_for_response(struct azx *chip) | 735 | static int azx_single_wait_for_response(struct azx *chip, unsigned int addr) |
696 | { | 736 | { |
697 | int timeout = 50; | 737 | int timeout = 50; |
698 | 738 | ||
@@ -700,7 +740,7 @@ static int azx_single_wait_for_response(struct azx *chip) | |||
700 | /* check IRV busy bit */ | 740 | /* check IRV busy bit */ |
701 | if (azx_readw(chip, IRS) & ICH6_IRS_VALID) { | 741 | if (azx_readw(chip, IRS) & ICH6_IRS_VALID) { |
702 | /* reuse rirb.res as the response return value */ | 742 | /* reuse rirb.res as the response return value */ |
703 | chip->rirb.res = azx_readl(chip, IR); | 743 | chip->rirb.res[addr] = azx_readl(chip, IR); |
704 | return 0; | 744 | return 0; |
705 | } | 745 | } |
706 | udelay(1); | 746 | udelay(1); |
@@ -708,7 +748,7 @@ static int azx_single_wait_for_response(struct azx *chip) | |||
708 | if (printk_ratelimit()) | 748 | if (printk_ratelimit()) |
709 | snd_printd(SFX "get_response timeout: IRS=0x%x\n", | 749 | snd_printd(SFX "get_response timeout: IRS=0x%x\n", |
710 | azx_readw(chip, IRS)); | 750 | azx_readw(chip, IRS)); |
711 | chip->rirb.res = -1; | 751 | chip->rirb.res[addr] = -1; |
712 | return -EIO; | 752 | return -EIO; |
713 | } | 753 | } |
714 | 754 | ||
@@ -716,6 +756,7 @@ static int azx_single_wait_for_response(struct azx *chip) | |||
716 | static int azx_single_send_cmd(struct hda_bus *bus, u32 val) | 756 | static int azx_single_send_cmd(struct hda_bus *bus, u32 val) |
717 | { | 757 | { |
718 | struct azx *chip = bus->private_data; | 758 | struct azx *chip = bus->private_data; |
759 | unsigned int addr = azx_command_addr(val); | ||
719 | int timeout = 50; | 760 | int timeout = 50; |
720 | 761 | ||
721 | bus->rirb_error = 0; | 762 | bus->rirb_error = 0; |
@@ -728,7 +769,7 @@ static int azx_single_send_cmd(struct hda_bus *bus, u32 val) | |||
728 | azx_writel(chip, IC, val); | 769 | azx_writel(chip, IC, val); |
729 | azx_writew(chip, IRS, azx_readw(chip, IRS) | | 770 | azx_writew(chip, IRS, azx_readw(chip, IRS) | |
730 | ICH6_IRS_BUSY); | 771 | ICH6_IRS_BUSY); |
731 | return azx_single_wait_for_response(chip); | 772 | return azx_single_wait_for_response(chip, addr); |
732 | } | 773 | } |
733 | udelay(1); | 774 | udelay(1); |
734 | } | 775 | } |
@@ -739,10 +780,11 @@ static int azx_single_send_cmd(struct hda_bus *bus, u32 val) | |||
739 | } | 780 | } |
740 | 781 | ||
741 | /* receive a response */ | 782 | /* receive a response */ |
742 | static unsigned int azx_single_get_response(struct hda_bus *bus) | 783 | static unsigned int azx_single_get_response(struct hda_bus *bus, |
784 | unsigned int addr) | ||
743 | { | 785 | { |
744 | struct azx *chip = bus->private_data; | 786 | struct azx *chip = bus->private_data; |
745 | return chip->rirb.res; | 787 | return chip->rirb.res[addr]; |
746 | } | 788 | } |
747 | 789 | ||
748 | /* | 790 | /* |
@@ -757,7 +799,7 @@ static int azx_send_cmd(struct hda_bus *bus, unsigned int val) | |||
757 | { | 799 | { |
758 | struct azx *chip = bus->private_data; | 800 | struct azx *chip = bus->private_data; |
759 | 801 | ||
760 | chip->last_cmd = val; | 802 | chip->last_cmd[azx_command_addr(val)] = val; |
761 | if (chip->single_cmd) | 803 | if (chip->single_cmd) |
762 | return azx_single_send_cmd(bus, val); | 804 | return azx_single_send_cmd(bus, val); |
763 | else | 805 | else |
@@ -765,13 +807,14 @@ static int azx_send_cmd(struct hda_bus *bus, unsigned int val) | |||
765 | } | 807 | } |
766 | 808 | ||
767 | /* get a response */ | 809 | /* get a response */ |
768 | static unsigned int azx_get_response(struct hda_bus *bus) | 810 | static unsigned int azx_get_response(struct hda_bus *bus, |
811 | unsigned int addr) | ||
769 | { | 812 | { |
770 | struct azx *chip = bus->private_data; | 813 | struct azx *chip = bus->private_data; |
771 | if (chip->single_cmd) | 814 | if (chip->single_cmd) |
772 | return azx_single_get_response(bus); | 815 | return azx_single_get_response(bus, addr); |
773 | else | 816 | else |
774 | return azx_rirb_get_response(bus); | 817 | return azx_rirb_get_response(bus, addr); |
775 | } | 818 | } |
776 | 819 | ||
777 | #ifdef CONFIG_SND_HDA_POWER_SAVE | 820 | #ifdef CONFIG_SND_HDA_POWER_SAVE |
@@ -1243,10 +1286,12 @@ static int probe_codec(struct azx *chip, int addr) | |||
1243 | (AC_VERB_PARAMETERS << 8) | AC_PAR_VENDOR_ID; | 1286 | (AC_VERB_PARAMETERS << 8) | AC_PAR_VENDOR_ID; |
1244 | unsigned int res; | 1287 | unsigned int res; |
1245 | 1288 | ||
1289 | mutex_lock(&chip->bus->cmd_mutex); | ||
1246 | chip->probing = 1; | 1290 | chip->probing = 1; |
1247 | azx_send_cmd(chip->bus, cmd); | 1291 | azx_send_cmd(chip->bus, cmd); |
1248 | res = azx_get_response(chip->bus); | 1292 | res = azx_get_response(chip->bus, addr); |
1249 | chip->probing = 0; | 1293 | chip->probing = 0; |
1294 | mutex_unlock(&chip->bus->cmd_mutex); | ||
1250 | if (res == -1) | 1295 | if (res == -1) |
1251 | return -EIO; | 1296 | return -EIO; |
1252 | snd_printdd(SFX "codec #%d probed OK\n", addr); | 1297 | snd_printdd(SFX "codec #%d probed OK\n", addr); |
diff --git a/sound/pci/hda/patch_analog.c b/sound/pci/hda/patch_analog.c index be7d25fa7f35..3da85caf8af1 100644 --- a/sound/pci/hda/patch_analog.c +++ b/sound/pci/hda/patch_analog.c | |||
@@ -3754,7 +3754,7 @@ static int ad1884a_mobile_master_sw_put(struct snd_kcontrol *kcontrol, | |||
3754 | int mute = (!ucontrol->value.integer.value[0] && | 3754 | int mute = (!ucontrol->value.integer.value[0] && |
3755 | !ucontrol->value.integer.value[1]); | 3755 | !ucontrol->value.integer.value[1]); |
3756 | /* toggle GPIO1 according to the mute state */ | 3756 | /* toggle GPIO1 according to the mute state */ |
3757 | snd_hda_codec_write(codec, 0x01, 0, AC_VERB_SET_GPIO_DATA, | 3757 | snd_hda_codec_write_cache(codec, 0x01, 0, AC_VERB_SET_GPIO_DATA, |
3758 | mute ? 0x02 : 0x0); | 3758 | mute ? 0x02 : 0x0); |
3759 | return ret; | 3759 | return ret; |
3760 | } | 3760 | } |
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c index 7e99763ca527..51c44fdbc0f0 100644 --- a/sound/pci/hda/patch_realtek.c +++ b/sound/pci/hda/patch_realtek.c | |||
@@ -275,13 +275,13 @@ struct alc_spec { | |||
275 | */ | 275 | */ |
276 | unsigned int num_init_verbs; | 276 | unsigned int num_init_verbs; |
277 | 277 | ||
278 | char stream_name_analog[16]; /* analog PCM stream */ | 278 | char stream_name_analog[32]; /* analog PCM stream */ |
279 | struct hda_pcm_stream *stream_analog_playback; | 279 | struct hda_pcm_stream *stream_analog_playback; |
280 | struct hda_pcm_stream *stream_analog_capture; | 280 | struct hda_pcm_stream *stream_analog_capture; |
281 | struct hda_pcm_stream *stream_analog_alt_playback; | 281 | struct hda_pcm_stream *stream_analog_alt_playback; |
282 | struct hda_pcm_stream *stream_analog_alt_capture; | 282 | struct hda_pcm_stream *stream_analog_alt_capture; |
283 | 283 | ||
284 | char stream_name_digital[16]; /* digital PCM stream */ | 284 | char stream_name_digital[32]; /* digital PCM stream */ |
285 | struct hda_pcm_stream *stream_digital_playback; | 285 | struct hda_pcm_stream *stream_digital_playback; |
286 | struct hda_pcm_stream *stream_digital_capture; | 286 | struct hda_pcm_stream *stream_digital_capture; |
287 | 287 | ||
@@ -559,7 +559,7 @@ static int alc_pin_mode_get(struct snd_kcontrol *kcontrol, | |||
559 | 559 | ||
560 | /* Find enumerated value for current pinctl setting */ | 560 | /* Find enumerated value for current pinctl setting */ |
561 | i = alc_pin_mode_min(dir); | 561 | i = alc_pin_mode_min(dir); |
562 | while (alc_pin_mode_values[i] != pinctl && i <= alc_pin_mode_max(dir)) | 562 | while (i <= alc_pin_mode_max(dir) && alc_pin_mode_values[i] != pinctl) |
563 | i++; | 563 | i++; |
564 | *valp = i <= alc_pin_mode_max(dir) ? i: alc_pin_mode_min(dir); | 564 | *valp = i <= alc_pin_mode_max(dir) ? i: alc_pin_mode_min(dir); |
565 | return 0; | 565 | return 0; |
@@ -10631,6 +10631,18 @@ static void alc262_lenovo_3000_unsol_event(struct hda_codec *codec, | |||
10631 | alc262_lenovo_3000_automute(codec, 1); | 10631 | alc262_lenovo_3000_automute(codec, 1); |
10632 | } | 10632 | } |
10633 | 10633 | ||
10634 | static int amp_stereo_mute_update(struct hda_codec *codec, hda_nid_t nid, | ||
10635 | int dir, int idx, long *valp) | ||
10636 | { | ||
10637 | int i, change = 0; | ||
10638 | |||
10639 | for (i = 0; i < 2; i++, valp++) | ||
10640 | change |= snd_hda_codec_amp_update(codec, nid, i, dir, idx, | ||
10641 | HDA_AMP_MUTE, | ||
10642 | *valp ? 0 : HDA_AMP_MUTE); | ||
10643 | return change; | ||
10644 | } | ||
10645 | |||
10634 | /* bind hp and internal speaker mute (with plug check) */ | 10646 | /* bind hp and internal speaker mute (with plug check) */ |
10635 | static int alc262_fujitsu_master_sw_put(struct snd_kcontrol *kcontrol, | 10647 | static int alc262_fujitsu_master_sw_put(struct snd_kcontrol *kcontrol, |
10636 | struct snd_ctl_elem_value *ucontrol) | 10648 | struct snd_ctl_elem_value *ucontrol) |
@@ -10639,13 +10651,8 @@ static int alc262_fujitsu_master_sw_put(struct snd_kcontrol *kcontrol, | |||
10639 | long *valp = ucontrol->value.integer.value; | 10651 | long *valp = ucontrol->value.integer.value; |
10640 | int change; | 10652 | int change; |
10641 | 10653 | ||
10642 | change = snd_hda_codec_amp_stereo(codec, 0x14, HDA_OUTPUT, 0, | 10654 | change = amp_stereo_mute_update(codec, 0x14, HDA_OUTPUT, 0, valp); |
10643 | HDA_AMP_MUTE, | 10655 | change |= amp_stereo_mute_update(codec, 0x1b, HDA_OUTPUT, 0, valp); |
10644 | valp ? 0 : HDA_AMP_MUTE); | ||
10645 | change |= snd_hda_codec_amp_stereo(codec, 0x1b, HDA_OUTPUT, 0, | ||
10646 | HDA_AMP_MUTE, | ||
10647 | valp ? 0 : HDA_AMP_MUTE); | ||
10648 | |||
10649 | if (change) | 10656 | if (change) |
10650 | alc262_fujitsu_automute(codec, 0); | 10657 | alc262_fujitsu_automute(codec, 0); |
10651 | return change; | 10658 | return change; |
@@ -10680,10 +10687,7 @@ static int alc262_lenovo_3000_master_sw_put(struct snd_kcontrol *kcontrol, | |||
10680 | long *valp = ucontrol->value.integer.value; | 10687 | long *valp = ucontrol->value.integer.value; |
10681 | int change; | 10688 | int change; |
10682 | 10689 | ||
10683 | change = snd_hda_codec_amp_stereo(codec, 0x1b, HDA_OUTPUT, 0, | 10690 | change = amp_stereo_mute_update(codec, 0x1b, HDA_OUTPUT, 0, valp); |
10684 | HDA_AMP_MUTE, | ||
10685 | valp ? 0 : HDA_AMP_MUTE); | ||
10686 | |||
10687 | if (change) | 10691 | if (change) |
10688 | alc262_lenovo_3000_automute(codec, 0); | 10692 | alc262_lenovo_3000_automute(codec, 0); |
10689 | return change; | 10693 | return change; |
@@ -11854,12 +11858,7 @@ static int alc268_acer_master_sw_put(struct snd_kcontrol *kcontrol, | |||
11854 | long *valp = ucontrol->value.integer.value; | 11858 | long *valp = ucontrol->value.integer.value; |
11855 | int change; | 11859 | int change; |
11856 | 11860 | ||
11857 | change = snd_hda_codec_amp_update(codec, 0x14, 0, HDA_OUTPUT, 0, | 11861 | change = amp_stereo_mute_update(codec, 0x14, HDA_OUTPUT, 0, valp); |
11858 | HDA_AMP_MUTE, | ||
11859 | valp[0] ? 0 : HDA_AMP_MUTE); | ||
11860 | change |= snd_hda_codec_amp_update(codec, 0x14, 1, HDA_OUTPUT, 0, | ||
11861 | HDA_AMP_MUTE, | ||
11862 | valp[1] ? 0 : HDA_AMP_MUTE); | ||
11863 | if (change) | 11862 | if (change) |
11864 | alc268_acer_automute(codec, 0); | 11863 | alc268_acer_automute(codec, 0); |
11865 | return change; | 11864 | return change; |
@@ -15158,7 +15157,7 @@ static struct snd_pci_quirk alc861vd_cfg_tbl[] = { | |||
15158 | SND_PCI_QUIRK(0x10de, 0x03f0, "Realtek ALC660 demo", ALC660VD_3ST), | 15157 | SND_PCI_QUIRK(0x10de, 0x03f0, "Realtek ALC660 demo", ALC660VD_3ST), |
15159 | SND_PCI_QUIRK(0x1179, 0xff00, "Toshiba A135", ALC861VD_LENOVO), | 15158 | SND_PCI_QUIRK(0x1179, 0xff00, "Toshiba A135", ALC861VD_LENOVO), |
15160 | /*SND_PCI_QUIRK(0x1179, 0xff00, "DALLAS", ALC861VD_DALLAS),*/ /*lenovo*/ | 15159 | /*SND_PCI_QUIRK(0x1179, 0xff00, "DALLAS", ALC861VD_DALLAS),*/ /*lenovo*/ |
15161 | SND_PCI_QUIRK(0x1179, 0xff01, "DALLAS", ALC861VD_DALLAS), | 15160 | SND_PCI_QUIRK(0x1179, 0xff01, "Toshiba A135", ALC861VD_LENOVO), |
15162 | SND_PCI_QUIRK(0x1179, 0xff03, "Toshiba P205", ALC861VD_LENOVO), | 15161 | SND_PCI_QUIRK(0x1179, 0xff03, "Toshiba P205", ALC861VD_LENOVO), |
15163 | SND_PCI_QUIRK(0x1179, 0xff31, "Toshiba L30-149", ALC861VD_DALLAS), | 15162 | SND_PCI_QUIRK(0x1179, 0xff31, "Toshiba L30-149", ALC861VD_DALLAS), |
15164 | SND_PCI_QUIRK(0x1565, 0x820d, "Biostar NF61S SE", ALC861VD_6ST_DIG), | 15163 | SND_PCI_QUIRK(0x1565, 0x820d, "Biostar NF61S SE", ALC861VD_6ST_DIG), |
diff --git a/sound/pci/hda/patch_sigmatel.c b/sound/pci/hda/patch_sigmatel.c index 41b5b3a18c1e..456ef6ac12e4 100644 --- a/sound/pci/hda/patch_sigmatel.c +++ b/sound/pci/hda/patch_sigmatel.c | |||
@@ -1809,6 +1809,8 @@ static struct snd_pci_quirk stac92hd73xx_cfg_tbl[] = { | |||
1809 | "Dell Studio 1537", STAC_DELL_M6_DMIC), | 1809 | "Dell Studio 1537", STAC_DELL_M6_DMIC), |
1810 | SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x02a0, | 1810 | SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x02a0, |
1811 | "Dell Studio 17", STAC_DELL_M6_DMIC), | 1811 | "Dell Studio 17", STAC_DELL_M6_DMIC), |
1812 | SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x02be, | ||
1813 | "Dell Studio 1555", STAC_DELL_M6_DMIC), | ||
1812 | {} /* terminator */ | 1814 | {} /* terminator */ |
1813 | }; | 1815 | }; |
1814 | 1816 | ||
@@ -2264,7 +2266,7 @@ static struct snd_pci_quirk stac927x_cfg_tbl[] = { | |||
2264 | SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x01f3, "Dell Inspiron 1420", STAC_DELL_BIOS), | 2266 | SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x01f3, "Dell Inspiron 1420", STAC_DELL_BIOS), |
2265 | SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x0227, "Dell Vostro 1400 ", STAC_DELL_BIOS), | 2267 | SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x0227, "Dell Vostro 1400 ", STAC_DELL_BIOS), |
2266 | SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x022e, "Dell ", STAC_DELL_BIOS), | 2268 | SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x022e, "Dell ", STAC_DELL_BIOS), |
2267 | SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x022f, "Dell Inspiron 1525", STAC_DELL_3ST), | 2269 | SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x022f, "Dell Inspiron 1525", STAC_DELL_BIOS), |
2268 | SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x0242, "Dell ", STAC_DELL_BIOS), | 2270 | SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x0242, "Dell ", STAC_DELL_BIOS), |
2269 | SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x0243, "Dell ", STAC_DELL_BIOS), | 2271 | SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x0243, "Dell ", STAC_DELL_BIOS), |
2270 | SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x02ff, "Dell ", STAC_DELL_BIOS), | 2272 | SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x02ff, "Dell ", STAC_DELL_BIOS), |
@@ -2378,6 +2380,7 @@ static struct snd_pci_quirk stac9205_cfg_tbl[] = { | |||
2378 | SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x0228, | 2380 | SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x0228, |
2379 | "Dell Vostro 1500", STAC_9205_DELL_M42), | 2381 | "Dell Vostro 1500", STAC_9205_DELL_M42), |
2380 | /* Gateway */ | 2382 | /* Gateway */ |
2383 | SND_PCI_QUIRK(0x107b, 0x0560, "Gateway T6834c", STAC_9205_EAPD), | ||
2381 | SND_PCI_QUIRK(0x107b, 0x0565, "Gateway T1616", STAC_9205_EAPD), | 2384 | SND_PCI_QUIRK(0x107b, 0x0565, "Gateway T1616", STAC_9205_EAPD), |
2382 | {} /* terminator */ | 2385 | {} /* terminator */ |
2383 | }; | 2386 | }; |
@@ -4065,7 +4068,7 @@ static int stac92xx_add_jack(struct hda_codec *codec, | |||
4065 | jack->nid = nid; | 4068 | jack->nid = nid; |
4066 | jack->type = type; | 4069 | jack->type = type; |
4067 | 4070 | ||
4068 | sprintf(name, "%s at %s %s Jack", | 4071 | snprintf(name, sizeof(name), "%s at %s %s Jack", |
4069 | snd_hda_get_jack_type(def_conf), | 4072 | snd_hda_get_jack_type(def_conf), |
4070 | snd_hda_get_jack_connectivity(def_conf), | 4073 | snd_hda_get_jack_connectivity(def_conf), |
4071 | snd_hda_get_jack_location(def_conf)); | 4074 | snd_hda_get_jack_location(def_conf)); |
@@ -5642,6 +5645,13 @@ static int patch_stac927x(struct hda_codec *codec) | |||
5642 | /* GPIO2 High = Enable EAPD */ | 5645 | /* GPIO2 High = Enable EAPD */ |
5643 | spec->eapd_mask = spec->gpio_mask = spec->gpio_dir = 0x04; | 5646 | spec->eapd_mask = spec->gpio_mask = spec->gpio_dir = 0x04; |
5644 | spec->gpio_data = 0x04; | 5647 | spec->gpio_data = 0x04; |
5648 | switch (codec->subsystem_id) { | ||
5649 | case 0x1028022f: | ||
5650 | /* correct EAPD to be GPIO0 */ | ||
5651 | spec->eapd_mask = spec->gpio_mask = 0x01; | ||
5652 | spec->gpio_dir = spec->gpio_data = 0x01; | ||
5653 | break; | ||
5654 | }; | ||
5645 | spec->dmic_nids = stac927x_dmic_nids; | 5655 | spec->dmic_nids = stac927x_dmic_nids; |
5646 | spec->num_dmics = STAC927X_NUM_DMICS; | 5656 | spec->num_dmics = STAC927X_NUM_DMICS; |
5647 | 5657 | ||
@@ -5854,6 +5864,8 @@ static unsigned int *stac9872_brd_tbl[STAC_9872_MODELS] = { | |||
5854 | }; | 5864 | }; |
5855 | 5865 | ||
5856 | static struct snd_pci_quirk stac9872_cfg_tbl[] = { | 5866 | static struct snd_pci_quirk stac9872_cfg_tbl[] = { |
5867 | SND_PCI_QUIRK_MASK(0x104d, 0xfff0, 0x81e0, | ||
5868 | "Sony VAIO F/S", STAC_9872_VAIO), | ||
5857 | {} /* terminator */ | 5869 | {} /* terminator */ |
5858 | }; | 5870 | }; |
5859 | 5871 | ||
@@ -5866,6 +5878,8 @@ static int patch_stac9872(struct hda_codec *codec) | |||
5866 | if (spec == NULL) | 5878 | if (spec == NULL) |
5867 | return -ENOMEM; | 5879 | return -ENOMEM; |
5868 | codec->spec = spec; | 5880 | codec->spec = spec; |
5881 | spec->num_pins = ARRAY_SIZE(stac9872_pin_nids); | ||
5882 | spec->pin_nids = stac9872_pin_nids; | ||
5869 | 5883 | ||
5870 | spec->board_config = snd_hda_check_board_config(codec, STAC_9872_MODELS, | 5884 | spec->board_config = snd_hda_check_board_config(codec, STAC_9872_MODELS, |
5871 | stac9872_models, | 5885 | stac9872_models, |
@@ -5877,8 +5891,6 @@ static int patch_stac9872(struct hda_codec *codec) | |||
5877 | stac92xx_set_config_regs(codec, | 5891 | stac92xx_set_config_regs(codec, |
5878 | stac9872_brd_tbl[spec->board_config]); | 5892 | stac9872_brd_tbl[spec->board_config]); |
5879 | 5893 | ||
5880 | spec->num_pins = ARRAY_SIZE(stac9872_pin_nids); | ||
5881 | spec->pin_nids = stac9872_pin_nids; | ||
5882 | spec->multiout.dac_nids = spec->dac_nids; | 5894 | spec->multiout.dac_nids = spec->dac_nids; |
5883 | spec->num_adcs = ARRAY_SIZE(stac9872_adc_nids); | 5895 | spec->num_adcs = ARRAY_SIZE(stac9872_adc_nids); |
5884 | spec->adc_nids = stac9872_adc_nids; | 5896 | spec->adc_nids = stac9872_adc_nids; |