aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci/hda/hda_intel.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/pci/hda/hda_intel.c')
-rw-r--r--sound/pci/hda/hda_intel.c50
1 files changed, 34 insertions, 16 deletions
diff --git a/sound/pci/hda/hda_intel.c b/sound/pci/hda/hda_intel.c
index 6517f589d01d..d822bfc6cad6 100644
--- a/sound/pci/hda/hda_intel.c
+++ b/sound/pci/hda/hda_intel.c
@@ -60,10 +60,14 @@ static int bdl_pos_adj[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS-1)] = -1};
60static int probe_mask[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS-1)] = -1}; 60static int probe_mask[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS-1)] = -1};
61static int probe_only[SNDRV_CARDS]; 61static int probe_only[SNDRV_CARDS];
62static int single_cmd; 62static int single_cmd;
63static int enable_msi; 63static int enable_msi = -1;
64#ifdef CONFIG_SND_HDA_PATCH_LOADER 64#ifdef CONFIG_SND_HDA_PATCH_LOADER
65static char *patch[SNDRV_CARDS]; 65static char *patch[SNDRV_CARDS];
66#endif 66#endif
67#ifdef CONFIG_SND_HDA_INPUT_BEEP
68static int beep_mode[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS-1)] =
69 CONFIG_SND_HDA_INPUT_BEEP_MODE};
70#endif
67 71
68module_param_array(index, int, NULL, 0444); 72module_param_array(index, int, NULL, 0444);
69MODULE_PARM_DESC(index, "Index value for Intel HD audio interface."); 73MODULE_PARM_DESC(index, "Index value for Intel HD audio interface.");
@@ -91,6 +95,11 @@ MODULE_PARM_DESC(enable_msi, "Enable Message Signaled Interrupt (MSI)");
91module_param_array(patch, charp, NULL, 0444); 95module_param_array(patch, charp, NULL, 0444);
92MODULE_PARM_DESC(patch, "Patch file for Intel HD audio interface."); 96MODULE_PARM_DESC(patch, "Patch file for Intel HD audio interface.");
93#endif 97#endif
98#ifdef CONFIG_SND_HDA_INPUT_BEEP
99module_param_array(beep_mode, int, NULL, 0444);
100MODULE_PARM_DESC(beep_mode, "Select HDA Beep registration mode "
101 "(0=off, 1=on, 2=mute switch on/off) (default=1).");
102#endif
94 103
95#ifdef CONFIG_SND_HDA_POWER_SAVE 104#ifdef CONFIG_SND_HDA_POWER_SAVE
96static int power_save = CONFIG_SND_HDA_POWER_SAVE_DEFAULT; 105static int power_save = CONFIG_SND_HDA_POWER_SAVE_DEFAULT;
@@ -404,6 +413,7 @@ struct azx {
404 unsigned short codec_mask; 413 unsigned short codec_mask;
405 int codec_probe_mask; /* copied from probe_mask option */ 414 int codec_probe_mask; /* copied from probe_mask option */
406 struct hda_bus *bus; 415 struct hda_bus *bus;
416 unsigned int beep_mode;
407 417
408 /* CORB/RIRB */ 418 /* CORB/RIRB */
409 struct azx_rb corb; 419 struct azx_rb corb;
@@ -677,6 +687,14 @@ static unsigned int azx_rirb_get_response(struct hda_bus *bus,
677 } 687 }
678 } 688 }
679 689
690 if (!chip->polling_mode) {
691 snd_printk(KERN_WARNING SFX "azx_get_response timeout, "
692 "switching to polling mode: last cmd=0x%08x\n",
693 chip->last_cmd[addr]);
694 chip->polling_mode = 1;
695 goto again;
696 }
697
680 if (chip->msi) { 698 if (chip->msi) {
681 snd_printk(KERN_WARNING SFX "No response from codec, " 699 snd_printk(KERN_WARNING SFX "No response from codec, "
682 "disabling MSI: last cmd=0x%08x\n", 700 "disabling MSI: last cmd=0x%08x\n",
@@ -692,14 +710,6 @@ static unsigned int azx_rirb_get_response(struct hda_bus *bus,
692 goto again; 710 goto again;
693 } 711 }
694 712
695 if (!chip->polling_mode) {
696 snd_printk(KERN_WARNING SFX "azx_get_response timeout, "
697 "switching to polling mode: last cmd=0x%08x\n",
698 chip->last_cmd[addr]);
699 chip->polling_mode = 1;
700 goto again;
701 }
702
703 if (chip->probing) { 713 if (chip->probing) {
704 /* If this critical timeout happens during the codec probing 714 /* If this critical timeout happens during the codec probing
705 * phase, this is likely an access to a non-existing codec 715 * phase, this is likely an access to a non-existing codec
@@ -1404,6 +1414,7 @@ static int __devinit azx_codec_create(struct azx *chip, const char *model)
1404 err = snd_hda_codec_new(chip->bus, c, &codec); 1414 err = snd_hda_codec_new(chip->bus, c, &codec);
1405 if (err < 0) 1415 if (err < 0)
1406 continue; 1416 continue;
1417 codec->beep_mode = chip->beep_mode;
1407 codecs++; 1418 codecs++;
1408 } 1419 }
1409 } 1420 }
@@ -2154,6 +2165,7 @@ static int azx_resume(struct pci_dev *pci)
2154static int azx_halt(struct notifier_block *nb, unsigned long event, void *buf) 2165static int azx_halt(struct notifier_block *nb, unsigned long event, void *buf)
2155{ 2166{
2156 struct azx *chip = container_of(nb, struct azx, reboot_notifier); 2167 struct azx *chip = container_of(nb, struct azx, reboot_notifier);
2168 snd_hda_bus_reboot_notify(chip->bus);
2157 azx_stop_chip(chip); 2169 azx_stop_chip(chip);
2158 return NOTIFY_OK; 2170 return NOTIFY_OK;
2159} 2171}
@@ -2221,7 +2233,9 @@ static int azx_dev_free(struct snd_device *device)
2221static struct snd_pci_quirk position_fix_list[] __devinitdata = { 2233static struct snd_pci_quirk position_fix_list[] __devinitdata = {
2222 SND_PCI_QUIRK(0x1028, 0x01cc, "Dell D820", POS_FIX_LPIB), 2234 SND_PCI_QUIRK(0x1028, 0x01cc, "Dell D820", POS_FIX_LPIB),
2223 SND_PCI_QUIRK(0x1028, 0x01de, "Dell Precision 390", POS_FIX_LPIB), 2235 SND_PCI_QUIRK(0x1028, 0x01de, "Dell Precision 390", POS_FIX_LPIB),
2236 SND_PCI_QUIRK(0x103c, 0x306d, "HP dv3", POS_FIX_LPIB),
2224 SND_PCI_QUIRK(0x1043, 0x813d, "ASUS P5AD2", POS_FIX_LPIB), 2237 SND_PCI_QUIRK(0x1043, 0x813d, "ASUS P5AD2", POS_FIX_LPIB),
2238 SND_PCI_QUIRK(0x1462, 0x1002, "MSI Wind U115", POS_FIX_LPIB),
2225 {} 2239 {}
2226}; 2240};
2227 2241
@@ -2304,11 +2318,9 @@ static void __devinit check_probe_mask(struct azx *chip, int dev)
2304} 2318}
2305 2319
2306/* 2320/*
2307 * white-list for enable_msi 2321 * white/black-list for enable_msi
2308 */ 2322 */
2309static struct snd_pci_quirk msi_white_list[] __devinitdata = { 2323static struct snd_pci_quirk msi_black_list[] __devinitdata = {
2310 SND_PCI_QUIRK(0x103c, 0x30f7, "HP Pavilion dv4t-1300", 1),
2311 SND_PCI_QUIRK(0x103c, 0x3607, "HP Compa CQ40", 1),
2312 {} 2324 {}
2313}; 2325};
2314 2326
@@ -2316,10 +2328,12 @@ static void __devinit check_msi(struct azx *chip)
2316{ 2328{
2317 const struct snd_pci_quirk *q; 2329 const struct snd_pci_quirk *q;
2318 2330
2319 chip->msi = enable_msi; 2331 if (enable_msi >= 0) {
2320 if (chip->msi) 2332 chip->msi = !!enable_msi;
2321 return; 2333 return;
2322 q = snd_pci_quirk_lookup(chip->pci, msi_white_list); 2334 }
2335 chip->msi = 1; /* enable MSI as default */
2336 q = snd_pci_quirk_lookup(chip->pci, msi_black_list);
2323 if (q) { 2337 if (q) {
2324 printk(KERN_INFO 2338 printk(KERN_INFO
2325 "hda_intel: msi for device %04x:%04x set to %d\n", 2339 "hda_intel: msi for device %04x:%04x set to %d\n",
@@ -2578,6 +2592,10 @@ static int __devinit azx_probe(struct pci_dev *pci,
2578 goto out_free; 2592 goto out_free;
2579 card->private_data = chip; 2593 card->private_data = chip;
2580 2594
2595#ifdef CONFIG_SND_HDA_INPUT_BEEP
2596 chip->beep_mode = beep_mode[dev];
2597#endif
2598
2581 /* create codec instances */ 2599 /* create codec instances */
2582 err = azx_codec_create(chip, model[dev]); 2600 err = azx_codec_create(chip, model[dev]);
2583 if (err < 0) 2601 if (err < 0)