diff options
Diffstat (limited to 'sound/pci/hda/hda_intel.c')
-rw-r--r-- | sound/pci/hda/hda_intel.c | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/sound/pci/hda/hda_intel.c b/sound/pci/hda/hda_intel.c index f8fd586ae02..6fe07d1c9de 100644 --- a/sound/pci/hda/hda_intel.c +++ b/sound/pci/hda/hda_intel.c | |||
@@ -84,7 +84,7 @@ module_param_array(bdl_pos_adj, int, NULL, 0644); | |||
84 | MODULE_PARM_DESC(bdl_pos_adj, "BDL position adjustment offset."); | 84 | MODULE_PARM_DESC(bdl_pos_adj, "BDL position adjustment offset."); |
85 | module_param_array(probe_mask, int, NULL, 0444); | 85 | module_param_array(probe_mask, int, NULL, 0444); |
86 | MODULE_PARM_DESC(probe_mask, "Bitmask to probe codecs (default = -1)."); | 86 | MODULE_PARM_DESC(probe_mask, "Bitmask to probe codecs (default = -1)."); |
87 | module_param_array(probe_only, bool, NULL, 0444); | 87 | module_param_array(probe_only, int, NULL, 0444); |
88 | MODULE_PARM_DESC(probe_only, "Only probing and no codec initialization."); | 88 | MODULE_PARM_DESC(probe_only, "Only probing and no codec initialization."); |
89 | module_param(single_cmd, bool, 0444); | 89 | module_param(single_cmd, bool, 0444); |
90 | MODULE_PARM_DESC(single_cmd, "Use single command to communicate with codecs " | 90 | MODULE_PARM_DESC(single_cmd, "Use single command to communicate with codecs " |
@@ -858,10 +858,13 @@ static void azx_power_notify(struct hda_bus *bus); | |||
858 | #endif | 858 | #endif |
859 | 859 | ||
860 | /* reset codec link */ | 860 | /* reset codec link */ |
861 | static int azx_reset(struct azx *chip) | 861 | static int azx_reset(struct azx *chip, int full_reset) |
862 | { | 862 | { |
863 | int count; | 863 | int count; |
864 | 864 | ||
865 | if (!full_reset) | ||
866 | goto __skip; | ||
867 | |||
865 | /* clear STATESTS */ | 868 | /* clear STATESTS */ |
866 | azx_writeb(chip, STATESTS, STATESTS_INT_MASK); | 869 | azx_writeb(chip, STATESTS, STATESTS_INT_MASK); |
867 | 870 | ||
@@ -887,6 +890,7 @@ static int azx_reset(struct azx *chip) | |||
887 | /* Brent Chartrand said to wait >= 540us for codecs to initialize */ | 890 | /* Brent Chartrand said to wait >= 540us for codecs to initialize */ |
888 | msleep(1); | 891 | msleep(1); |
889 | 892 | ||
893 | __skip: | ||
890 | /* check to see if controller is ready */ | 894 | /* check to see if controller is ready */ |
891 | if (!azx_readb(chip, GCTL)) { | 895 | if (!azx_readb(chip, GCTL)) { |
892 | snd_printd(SFX "azx_reset: controller not ready!\n"); | 896 | snd_printd(SFX "azx_reset: controller not ready!\n"); |
@@ -998,13 +1002,13 @@ static void azx_stream_stop(struct azx *chip, struct azx_dev *azx_dev) | |||
998 | /* | 1002 | /* |
999 | * reset and start the controller registers | 1003 | * reset and start the controller registers |
1000 | */ | 1004 | */ |
1001 | static void azx_init_chip(struct azx *chip) | 1005 | static void azx_init_chip(struct azx *chip, int full_reset) |
1002 | { | 1006 | { |
1003 | if (chip->initialized) | 1007 | if (chip->initialized) |
1004 | return; | 1008 | return; |
1005 | 1009 | ||
1006 | /* reset controller */ | 1010 | /* reset controller */ |
1007 | azx_reset(chip); | 1011 | azx_reset(chip, full_reset); |
1008 | 1012 | ||
1009 | /* initialize interrupts */ | 1013 | /* initialize interrupts */ |
1010 | azx_int_clear(chip); | 1014 | azx_int_clear(chip); |
@@ -1348,7 +1352,7 @@ static void azx_bus_reset(struct hda_bus *bus) | |||
1348 | 1352 | ||
1349 | bus->in_reset = 1; | 1353 | bus->in_reset = 1; |
1350 | azx_stop_chip(chip); | 1354 | azx_stop_chip(chip); |
1351 | azx_init_chip(chip); | 1355 | azx_init_chip(chip, 1); |
1352 | #ifdef CONFIG_PM | 1356 | #ifdef CONFIG_PM |
1353 | if (chip->initialized) { | 1357 | if (chip->initialized) { |
1354 | int i; | 1358 | int i; |
@@ -1422,7 +1426,7 @@ static int __devinit azx_codec_create(struct azx *chip, const char *model) | |||
1422 | * get back to the sanity state. | 1426 | * get back to the sanity state. |
1423 | */ | 1427 | */ |
1424 | azx_stop_chip(chip); | 1428 | azx_stop_chip(chip); |
1425 | azx_init_chip(chip); | 1429 | azx_init_chip(chip, 1); |
1426 | } | 1430 | } |
1427 | } | 1431 | } |
1428 | } | 1432 | } |
@@ -2112,7 +2116,7 @@ static void azx_power_notify(struct hda_bus *bus) | |||
2112 | } | 2116 | } |
2113 | } | 2117 | } |
2114 | if (power_on) | 2118 | if (power_on) |
2115 | azx_init_chip(chip); | 2119 | azx_init_chip(chip, 1); |
2116 | else if (chip->running && power_save_controller && | 2120 | else if (chip->running && power_save_controller && |
2117 | !bus->power_keep_link_on) | 2121 | !bus->power_keep_link_on) |
2118 | azx_stop_chip(chip); | 2122 | azx_stop_chip(chip); |
@@ -2182,7 +2186,7 @@ static int azx_resume(struct pci_dev *pci) | |||
2182 | azx_init_pci(chip); | 2186 | azx_init_pci(chip); |
2183 | 2187 | ||
2184 | if (snd_hda_codecs_inuse(chip->bus)) | 2188 | if (snd_hda_codecs_inuse(chip->bus)) |
2185 | azx_init_chip(chip); | 2189 | azx_init_chip(chip, 1); |
2186 | 2190 | ||
2187 | snd_hda_resume(chip->bus); | 2191 | snd_hda_resume(chip->bus); |
2188 | snd_power_change_state(card, SNDRV_CTL_POWER_D0); | 2192 | snd_power_change_state(card, SNDRV_CTL_POWER_D0); |
@@ -2575,7 +2579,7 @@ static int __devinit azx_create(struct snd_card *card, struct pci_dev *pci, | |||
2575 | 2579 | ||
2576 | /* initialize chip */ | 2580 | /* initialize chip */ |
2577 | azx_init_pci(chip); | 2581 | azx_init_pci(chip); |
2578 | azx_init_chip(chip); | 2582 | azx_init_chip(chip, (probe_only[dev] & 2) == 0); |
2579 | 2583 | ||
2580 | /* codec detection */ | 2584 | /* codec detection */ |
2581 | if (!chip->codec_mask) { | 2585 | if (!chip->codec_mask) { |
@@ -2664,7 +2668,7 @@ static int __devinit azx_probe(struct pci_dev *pci, | |||
2664 | goto out_free; | 2668 | goto out_free; |
2665 | } | 2669 | } |
2666 | #endif | 2670 | #endif |
2667 | if (!probe_only[dev]) { | 2671 | if ((probe_only[dev] & 1) == 0) { |
2668 | err = azx_codec_configure(chip); | 2672 | err = azx_codec_configure(chip); |
2669 | if (err < 0) | 2673 | if (err < 0) |
2670 | goto out_free; | 2674 | goto out_free; |