diff options
Diffstat (limited to 'sound/pci/hda/hda_intel.c')
-rw-r--r-- | sound/pci/hda/hda_intel.c | 52 |
1 files changed, 31 insertions, 21 deletions
diff --git a/sound/pci/hda/hda_intel.c b/sound/pci/hda/hda_intel.c index 95dfb6874941..c19e71a94e1b 100644 --- a/sound/pci/hda/hda_intel.c +++ b/sound/pci/hda/hda_intel.c | |||
@@ -84,7 +84,7 @@ module_param_array(model, charp, NULL, 0444); | |||
84 | MODULE_PARM_DESC(model, "Use the given board model."); | 84 | MODULE_PARM_DESC(model, "Use the given board model."); |
85 | module_param_array(position_fix, int, NULL, 0444); | 85 | module_param_array(position_fix, int, NULL, 0444); |
86 | MODULE_PARM_DESC(position_fix, "DMA pointer read method." | 86 | MODULE_PARM_DESC(position_fix, "DMA pointer read method." |
87 | "(0 = auto, 1 = LPIB, 2 = POSBUF, 3 = VIACOMBO)."); | 87 | "(0 = auto, 1 = LPIB, 2 = POSBUF, 3 = VIACOMBO, 4 = COMBO)."); |
88 | module_param_array(bdl_pos_adj, int, NULL, 0644); | 88 | module_param_array(bdl_pos_adj, int, NULL, 0644); |
89 | MODULE_PARM_DESC(bdl_pos_adj, "BDL position adjustment offset."); | 89 | MODULE_PARM_DESC(bdl_pos_adj, "BDL position adjustment offset."); |
90 | module_param_array(probe_mask, int, NULL, 0444); | 90 | module_param_array(probe_mask, int, NULL, 0444); |
@@ -94,7 +94,7 @@ MODULE_PARM_DESC(probe_only, "Only probing and no codec initialization."); | |||
94 | module_param(single_cmd, bool, 0444); | 94 | module_param(single_cmd, bool, 0444); |
95 | MODULE_PARM_DESC(single_cmd, "Use single command to communicate with codecs " | 95 | MODULE_PARM_DESC(single_cmd, "Use single command to communicate with codecs " |
96 | "(for debugging only)."); | 96 | "(for debugging only)."); |
97 | module_param(enable_msi, int, 0444); | 97 | module_param(enable_msi, bint, 0444); |
98 | MODULE_PARM_DESC(enable_msi, "Enable Message Signaled Interrupt (MSI)"); | 98 | MODULE_PARM_DESC(enable_msi, "Enable Message Signaled Interrupt (MSI)"); |
99 | #ifdef CONFIG_SND_HDA_PATCH_LOADER | 99 | #ifdef CONFIG_SND_HDA_PATCH_LOADER |
100 | module_param_array(patch, charp, NULL, 0444); | 100 | module_param_array(patch, charp, NULL, 0444); |
@@ -121,8 +121,8 @@ module_param(power_save_controller, bool, 0644); | |||
121 | MODULE_PARM_DESC(power_save_controller, "Reset controller in power save mode."); | 121 | MODULE_PARM_DESC(power_save_controller, "Reset controller in power save mode."); |
122 | #endif | 122 | #endif |
123 | 123 | ||
124 | static bool align_buffer_size = 1; | 124 | static int align_buffer_size = -1; |
125 | module_param(align_buffer_size, bool, 0644); | 125 | module_param(align_buffer_size, bint, 0644); |
126 | MODULE_PARM_DESC(align_buffer_size, | 126 | MODULE_PARM_DESC(align_buffer_size, |
127 | "Force buffer and period sizes to be multiple of 128 bytes."); | 127 | "Force buffer and period sizes to be multiple of 128 bytes."); |
128 | 128 | ||
@@ -148,6 +148,7 @@ MODULE_SUPPORTED_DEVICE("{{Intel, ICH6}," | |||
148 | "{Intel, PCH}," | 148 | "{Intel, PCH}," |
149 | "{Intel, CPT}," | 149 | "{Intel, CPT}," |
150 | "{Intel, PPT}," | 150 | "{Intel, PPT}," |
151 | "{Intel, LPT}," | ||
151 | "{Intel, PBG}," | 152 | "{Intel, PBG}," |
152 | "{Intel, SCH}," | 153 | "{Intel, SCH}," |
153 | "{ATI, SB450}," | 154 | "{ATI, SB450}," |
@@ -329,6 +330,7 @@ enum { | |||
329 | POS_FIX_LPIB, | 330 | POS_FIX_LPIB, |
330 | POS_FIX_POSBUF, | 331 | POS_FIX_POSBUF, |
331 | POS_FIX_VIACOMBO, | 332 | POS_FIX_VIACOMBO, |
333 | POS_FIX_COMBO, | ||
332 | }; | 334 | }; |
333 | 335 | ||
334 | /* Defines for ATI HD Audio support in SB450 south bridge */ | 336 | /* Defines for ATI HD Audio support in SB450 south bridge */ |
@@ -515,6 +517,7 @@ enum { | |||
515 | #define AZX_DCAPS_SYNC_WRITE (1 << 19) /* sync each cmd write */ | 517 | #define AZX_DCAPS_SYNC_WRITE (1 << 19) /* sync each cmd write */ |
516 | #define AZX_DCAPS_OLD_SSYNC (1 << 20) /* Old SSYNC reg for ICH */ | 518 | #define AZX_DCAPS_OLD_SSYNC (1 << 20) /* Old SSYNC reg for ICH */ |
517 | #define AZX_DCAPS_BUFSIZE (1 << 21) /* no buffer size alignment */ | 519 | #define AZX_DCAPS_BUFSIZE (1 << 21) /* no buffer size alignment */ |
520 | #define AZX_DCAPS_ALIGN_BUFSIZE (1 << 22) /* buffer size alignment */ | ||
518 | 521 | ||
519 | /* quirks for ATI SB / AMD Hudson */ | 522 | /* quirks for ATI SB / AMD Hudson */ |
520 | #define AZX_DCAPS_PRESET_ATI_SB \ | 523 | #define AZX_DCAPS_PRESET_ATI_SB \ |
@@ -527,7 +530,8 @@ enum { | |||
527 | 530 | ||
528 | /* quirks for Nvidia */ | 531 | /* quirks for Nvidia */ |
529 | #define AZX_DCAPS_PRESET_NVIDIA \ | 532 | #define AZX_DCAPS_PRESET_NVIDIA \ |
530 | (AZX_DCAPS_NVIDIA_SNOOP | AZX_DCAPS_RIRB_DELAY | AZX_DCAPS_NO_MSI) | 533 | (AZX_DCAPS_NVIDIA_SNOOP | AZX_DCAPS_RIRB_DELAY | AZX_DCAPS_NO_MSI |\ |
534 | AZX_DCAPS_ALIGN_BUFSIZE) | ||
531 | 535 | ||
532 | static char *driver_short_names[] __devinitdata = { | 536 | static char *driver_short_names[] __devinitdata = { |
533 | [AZX_DRIVER_ICH] = "HDA Intel", | 537 | [AZX_DRIVER_ICH] = "HDA Intel", |
@@ -2347,17 +2351,6 @@ static void azx_power_notify(struct hda_bus *bus) | |||
2347 | * power management | 2351 | * power management |
2348 | */ | 2352 | */ |
2349 | 2353 | ||
2350 | static int snd_hda_codecs_inuse(struct hda_bus *bus) | ||
2351 | { | ||
2352 | struct hda_codec *codec; | ||
2353 | |||
2354 | list_for_each_entry(codec, &bus->codec_list, list) { | ||
2355 | if (snd_hda_codec_needs_resume(codec)) | ||
2356 | return 1; | ||
2357 | } | ||
2358 | return 0; | ||
2359 | } | ||
2360 | |||
2361 | static int azx_suspend(struct pci_dev *pci, pm_message_t state) | 2354 | static int azx_suspend(struct pci_dev *pci, pm_message_t state) |
2362 | { | 2355 | { |
2363 | struct snd_card *card = pci_get_drvdata(pci); | 2356 | struct snd_card *card = pci_get_drvdata(pci); |
@@ -2404,8 +2397,7 @@ static int azx_resume(struct pci_dev *pci) | |||
2404 | return -EIO; | 2397 | return -EIO; |
2405 | azx_init_pci(chip); | 2398 | azx_init_pci(chip); |
2406 | 2399 | ||
2407 | if (snd_hda_codecs_inuse(chip->bus)) | 2400 | azx_init_chip(chip, 1); |
2408 | azx_init_chip(chip, 1); | ||
2409 | 2401 | ||
2410 | snd_hda_resume(chip->bus); | 2402 | snd_hda_resume(chip->bus); |
2411 | snd_power_change_state(card, SNDRV_CTL_POWER_D0); | 2403 | snd_power_change_state(card, SNDRV_CTL_POWER_D0); |
@@ -2517,6 +2509,7 @@ static int __devinit check_position_fix(struct azx *chip, int fix) | |||
2517 | case POS_FIX_LPIB: | 2509 | case POS_FIX_LPIB: |
2518 | case POS_FIX_POSBUF: | 2510 | case POS_FIX_POSBUF: |
2519 | case POS_FIX_VIACOMBO: | 2511 | case POS_FIX_VIACOMBO: |
2512 | case POS_FIX_COMBO: | ||
2520 | return fix; | 2513 | return fix; |
2521 | } | 2514 | } |
2522 | 2515 | ||
@@ -2696,6 +2689,12 @@ static int __devinit azx_create(struct snd_card *card, struct pci_dev *pci, | |||
2696 | 2689 | ||
2697 | chip->position_fix[0] = chip->position_fix[1] = | 2690 | chip->position_fix[0] = chip->position_fix[1] = |
2698 | check_position_fix(chip, position_fix[dev]); | 2691 | check_position_fix(chip, position_fix[dev]); |
2692 | /* combo mode uses LPIB for playback */ | ||
2693 | if (chip->position_fix[0] == POS_FIX_COMBO) { | ||
2694 | chip->position_fix[0] = POS_FIX_LPIB; | ||
2695 | chip->position_fix[1] = POS_FIX_AUTO; | ||
2696 | } | ||
2697 | |||
2699 | check_probe_mask(chip, dev); | 2698 | check_probe_mask(chip, dev); |
2700 | 2699 | ||
2701 | chip->single_cmd = single_cmd; | 2700 | chip->single_cmd = single_cmd; |
@@ -2774,9 +2773,16 @@ static int __devinit azx_create(struct snd_card *card, struct pci_dev *pci, | |||
2774 | } | 2773 | } |
2775 | 2774 | ||
2776 | /* disable buffer size rounding to 128-byte multiples if supported */ | 2775 | /* disable buffer size rounding to 128-byte multiples if supported */ |
2777 | chip->align_buffer_size = align_buffer_size; | 2776 | if (align_buffer_size >= 0) |
2778 | if (chip->driver_caps & AZX_DCAPS_BUFSIZE) | 2777 | chip->align_buffer_size = !!align_buffer_size; |
2779 | chip->align_buffer_size = 0; | 2778 | else { |
2779 | if (chip->driver_caps & AZX_DCAPS_BUFSIZE) | ||
2780 | chip->align_buffer_size = 0; | ||
2781 | else if (chip->driver_caps & AZX_DCAPS_ALIGN_BUFSIZE) | ||
2782 | chip->align_buffer_size = 1; | ||
2783 | else | ||
2784 | chip->align_buffer_size = 1; | ||
2785 | } | ||
2780 | 2786 | ||
2781 | /* allow 64bit DMA address if supported by H/W */ | 2787 | /* allow 64bit DMA address if supported by H/W */ |
2782 | if ((gcap & ICH6_GCAP_64OK) && !pci_set_dma_mask(pci, DMA_BIT_MASK(64))) | 2788 | if ((gcap & ICH6_GCAP_64OK) && !pci_set_dma_mask(pci, DMA_BIT_MASK(64))) |
@@ -2992,6 +2998,10 @@ static DEFINE_PCI_DEVICE_TABLE(azx_ids) = { | |||
2992 | { PCI_DEVICE(0x8086, 0x1e20), | 2998 | { PCI_DEVICE(0x8086, 0x1e20), |
2993 | .driver_data = AZX_DRIVER_PCH | AZX_DCAPS_SCH_SNOOP | | 2999 | .driver_data = AZX_DRIVER_PCH | AZX_DCAPS_SCH_SNOOP | |
2994 | AZX_DCAPS_BUFSIZE}, | 3000 | AZX_DCAPS_BUFSIZE}, |
3001 | /* Lynx Point */ | ||
3002 | { PCI_DEVICE(0x8086, 0x8c20), | ||
3003 | .driver_data = AZX_DRIVER_PCH | AZX_DCAPS_SCH_SNOOP | | ||
3004 | AZX_DCAPS_BUFSIZE}, | ||
2995 | /* SCH */ | 3005 | /* SCH */ |
2996 | { PCI_DEVICE(0x8086, 0x811b), | 3006 | { PCI_DEVICE(0x8086, 0x811b), |
2997 | .driver_data = AZX_DRIVER_SCH | AZX_DCAPS_SCH_SNOOP | | 3007 | .driver_data = AZX_DRIVER_SCH | AZX_DCAPS_SCH_SNOOP | |