diff options
author | Wu Fengguang <fengguang.wu@intel.com> | 2009-08-01 07:17:14 -0400 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2009-08-03 02:27:39 -0400 |
commit | feb273404f15d86098cb0e81e46330d5c1e22b1b (patch) | |
tree | affd262499584b92c791ccbc92b2c09431cd8975 | |
parent | c32649feb4573b31f0a2bfdf35cbe1351256c764 (diff) |
ALSA: hda: remember last command for each codec
Signed-off-by: Wu Fengguang <fengguang.wu@intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
-rw-r--r-- | sound/pci/hda/hda_intel.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/sound/pci/hda/hda_intel.c b/sound/pci/hda/hda_intel.c index df6d9820efad..7c43f92de2fa 100644 --- a/sound/pci/hda/hda_intel.c +++ b/sound/pci/hda/hda_intel.c | |||
@@ -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; |
@@ -668,7 +668,8 @@ static unsigned int azx_rirb_get_response(struct hda_bus *bus, | |||
668 | 668 | ||
669 | if (chip->msi) { | 669 | if (chip->msi) { |
670 | snd_printk(KERN_WARNING SFX "No response from codec, " | 670 | snd_printk(KERN_WARNING SFX "No response from codec, " |
671 | "disabling MSI: last cmd=0x%08x\n", chip->last_cmd); | 671 | "disabling MSI: last cmd=0x%08x\n", |
672 | chip->last_cmd[addr]); | ||
672 | free_irq(chip->irq, chip); | 673 | free_irq(chip->irq, chip); |
673 | chip->irq = -1; | 674 | chip->irq = -1; |
674 | pci_disable_msi(chip->pci); | 675 | pci_disable_msi(chip->pci); |
@@ -683,7 +684,7 @@ static unsigned int azx_rirb_get_response(struct hda_bus *bus, | |||
683 | if (!chip->polling_mode) { | 684 | if (!chip->polling_mode) { |
684 | snd_printk(KERN_WARNING SFX "azx_get_response timeout, " | 685 | snd_printk(KERN_WARNING SFX "azx_get_response timeout, " |
685 | "switching to polling mode: last cmd=0x%08x\n", | 686 | "switching to polling mode: last cmd=0x%08x\n", |
686 | chip->last_cmd); | 687 | chip->last_cmd[addr]); |
687 | chip->polling_mode = 1; | 688 | chip->polling_mode = 1; |
688 | goto again; | 689 | goto again; |
689 | } | 690 | } |
@@ -707,7 +708,7 @@ static unsigned int azx_rirb_get_response(struct hda_bus *bus, | |||
707 | 708 | ||
708 | snd_printk(KERN_ERR "hda_intel: azx_get_response timeout, " | 709 | snd_printk(KERN_ERR "hda_intel: azx_get_response timeout, " |
709 | "switching to single_cmd mode: last cmd=0x%08x\n", | 710 | "switching to single_cmd mode: last cmd=0x%08x\n", |
710 | chip->last_cmd); | 711 | chip->last_cmd[addr]); |
711 | chip->single_cmd = 1; | 712 | chip->single_cmd = 1; |
712 | bus->response_reset = 0; | 713 | bus->response_reset = 0; |
713 | /* re-initialize CORB/RIRB */ | 714 | /* re-initialize CORB/RIRB */ |
@@ -794,7 +795,7 @@ static int azx_send_cmd(struct hda_bus *bus, unsigned int val) | |||
794 | { | 795 | { |
795 | struct azx *chip = bus->private_data; | 796 | struct azx *chip = bus->private_data; |
796 | 797 | ||
797 | chip->last_cmd = val; | 798 | chip->last_cmd[azx_command_addr(val)] = val; |
798 | if (chip->single_cmd) | 799 | if (chip->single_cmd) |
799 | return azx_single_send_cmd(bus, val); | 800 | return azx_single_send_cmd(bus, val); |
800 | else | 801 | else |