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>

authored by Wu Fengguang and committed by Takashi Iwai feb27340 c32649fe

+6 -5
+6 -5
sound/pci/hda/hda_intel.c
··· 418 unsigned int probing :1; /* codec probing phase */ 419 420 /* for debugging */ 421 - unsigned int last_cmd; /* last issued command (to sync) */ 422 423 /* for pending irqs */ 424 struct work_struct irq_pending_work; ··· 668 669 if (chip->msi) { 670 snd_printk(KERN_WARNING SFX "No response from codec, " 671 - "disabling MSI: last cmd=0x%08x\n", chip->last_cmd); 672 free_irq(chip->irq, chip); 673 chip->irq = -1; 674 pci_disable_msi(chip->pci); ··· 684 if (!chip->polling_mode) { 685 snd_printk(KERN_WARNING SFX "azx_get_response timeout, " 686 "switching to polling mode: last cmd=0x%08x\n", 687 - chip->last_cmd); 688 chip->polling_mode = 1; 689 goto again; 690 } ··· 708 709 snd_printk(KERN_ERR "hda_intel: azx_get_response timeout, " 710 "switching to single_cmd mode: last cmd=0x%08x\n", 711 - chip->last_cmd); 712 chip->single_cmd = 1; 713 bus->response_reset = 0; 714 /* re-initialize CORB/RIRB */ ··· 795 { 796 struct azx *chip = bus->private_data; 797 798 - chip->last_cmd = val; 799 if (chip->single_cmd) 800 return azx_single_send_cmd(bus, val); 801 else
··· 418 unsigned int probing :1; /* codec probing phase */ 419 420 /* for debugging */ 421 + unsigned int last_cmd[AZX_MAX_CODECS]; 422 423 /* for pending irqs */ 424 struct work_struct irq_pending_work; ··· 668 669 if (chip->msi) { 670 snd_printk(KERN_WARNING SFX "No response from codec, " 671 + "disabling MSI: last cmd=0x%08x\n", 672 + chip->last_cmd[addr]); 673 free_irq(chip->irq, chip); 674 chip->irq = -1; 675 pci_disable_msi(chip->pci); ··· 683 if (!chip->polling_mode) { 684 snd_printk(KERN_WARNING SFX "azx_get_response timeout, " 685 "switching to polling mode: last cmd=0x%08x\n", 686 + chip->last_cmd[addr]); 687 chip->polling_mode = 1; 688 goto again; 689 } ··· 707 708 snd_printk(KERN_ERR "hda_intel: azx_get_response timeout, " 709 "switching to single_cmd mode: last cmd=0x%08x\n", 710 + chip->last_cmd[addr]); 711 chip->single_cmd = 1; 712 bus->response_reset = 0; 713 /* re-initialize CORB/RIRB */ ··· 794 { 795 struct azx *chip = bus->private_data; 796 797 + chip->last_cmd[azx_command_addr(val)] = val; 798 if (chip->single_cmd) 799 return azx_single_send_cmd(bus, val); 800 else