diff options
author | Takashi Iwai <tiwai@suse.de> | 2017-06-28 16:42:50 +0200 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2017-06-28 16:42:50 +0200 |
commit | 4032da5ffe266fc781a15bd7b24295c433002ab5 (patch) | |
tree | bd92a7153328b25dae2e153854ea8cf4c3fb23b5 /sound/pci/hda/hda_intel.c | |
parent | f03293d8fc97f07dbe4c54ce495c8dac172dc6e1 (diff) | |
parent | 43f6c8d97bbdc05858b3d64e4c683821ce46c2db (diff) | |
download | linux-4032da5ffe266fc781a15bd7b24295c433002ab5.tar.bz2 |
Merge branch 'topic/hda-fix' into for-next
Diffstat (limited to 'sound/pci/hda/hda_intel.c')
-rw-r--r-- | sound/pci/hda/hda_intel.c | 35 |
1 files changed, 21 insertions, 14 deletions
diff --git a/sound/pci/hda/hda_intel.c b/sound/pci/hda/hda_intel.c index 07ea7f48aa01..a157582b8f2c 100644 --- a/sound/pci/hda/hda_intel.c +++ b/sound/pci/hda/hda_intel.c @@ -1379,8 +1379,10 @@ static int azx_free(struct azx *chip) if (chip->driver_caps & AZX_DCAPS_I915_POWERWELL) { if (hda->need_i915_power) snd_hdac_display_power(bus, false); - snd_hdac_i915_exit(bus); } + if (chip->driver_type == AZX_DRIVER_PCH || + (chip->driver_caps & AZX_DCAPS_I915_POWERWELL)) + snd_hdac_i915_exit(bus); kfree(hda); return 0; @@ -2196,16 +2198,9 @@ static int azx_probe_continue(struct azx *chip) hda->probe_continued = 1; - /* Request display power well for the HDA controller or codec. For - * Haswell/Broadwell, both the display HDA controller and codec need - * this power. For other platforms, like Baytrail/Braswell, only the - * display codec needs the power and it can be released after probe. - */ - if (chip->driver_caps & AZX_DCAPS_I915_POWERWELL) { - /* HSW/BDW controllers need this power */ - if (CONTROLLER_IN_GPU(pci)) - hda->need_i915_power = 1; - + /* bind with i915 if needed */ + if (chip->driver_type == AZX_DRIVER_PCH || + (chip->driver_caps & AZX_DCAPS_I915_POWERWELL)) { err = snd_hdac_i915_init(bus); if (err < 0) { /* if the controller is bound only with HDMI/DP @@ -2217,9 +2212,22 @@ static int azx_probe_continue(struct azx *chip) dev_err(chip->card->dev, "HSW/BDW HD-audio HDMI/DP requires binding with gfx driver\n"); goto out_free; - } else - goto skip_i915; + } else { + /* don't bother any longer */ + chip->driver_caps &= ~AZX_DCAPS_I915_POWERWELL; + } } + } + + /* Request display power well for the HDA controller or codec. For + * Haswell/Broadwell, both the display HDA controller and codec need + * this power. For other platforms, like Baytrail/Braswell, only the + * display codec needs the power and it can be released after probe. + */ + if (chip->driver_caps & AZX_DCAPS_I915_POWERWELL) { + /* HSW/BDW controllers need this power */ + if (CONTROLLER_IN_GPU(pci)) + hda->need_i915_power = 1; err = snd_hdac_display_power(bus, true); if (err < 0) { @@ -2229,7 +2237,6 @@ static int azx_probe_continue(struct azx *chip) } } - skip_i915: err = azx_first_init(chip); if (err < 0) goto out_free; |