diff --git a/drivers/gpu/drm/i915/intel_pm.c b/drivers/gpu/drm/i915/intel_pm.c index ad58ce3..521a5e5 100644 --- a/drivers/gpu/drm/i915/intel_pm.c +++ b/drivers/gpu/drm/i915/intel_pm.c @@ -5653,6 +5653,21 @@ void i915_release_power_well(void) } EXPORT_SYMBOL_GPL(i915_release_power_well); +static void intel_power_domains_resume(struct drm_i915_private *dev_priv); + +void i915_resume_power_well(void) +{ + struct drm_i915_private *dev_priv; + + if (WARN_ON(!hsw_pwr)) + return; + + dev_priv = container_of(hsw_pwr, struct drm_i915_private, + power_domains); + intel_power_domains_resume(dev_priv); +} +EXPORT_SYMBOL_GPL(i915_resume_power_well); + #define POWER_DOMAIN_MASK (BIT(POWER_DOMAIN_NUM) - 1) #define HSW_ALWAYS_ON_POWER_DOMAINS ( \ diff --git a/include/drm/i915_powerwell.h b/include/drm/i915_powerwell.h index cfdc884..5032007 100644 --- a/include/drm/i915_powerwell.h +++ b/include/drm/i915_powerwell.h @@ -32,5 +32,6 @@ /* For use by hda_i915 driver */ extern void i915_request_power_well(void); extern void i915_release_power_well(void); +extern void i915_resume_power_well(void); #endif /* _I915_POWERWELL_H_ */ diff --git a/sound/pci/hda/hda_i915.c b/sound/pci/hda/hda_i915.c index 76c13d5..8931acd 100644 --- a/sound/pci/hda/hda_i915.c +++ b/sound/pci/hda/hda_i915.c @@ -24,6 +24,7 @@ static void (*get_power)(void); static void (*put_power)(void); +static void (*resume_power)(void); void hda_display_power(bool enable) { @@ -38,38 +39,54 @@ void hda_display_power(bool enable) put_power(); } +void hda_display_power_resume(void) +{ + if (!resume_power) + return; + + resume_power(); +} + int hda_i915_init(void) { - int err = 0; - get_power = symbol_request(i915_request_power_well); - if (!get_power) { - snd_printk(KERN_WARNING "hda-i915: get_power symbol get fail\n"); - return -ENODEV; - } + if (!get_power) + goto err1; put_power = symbol_request(i915_release_power_well); - if (!put_power) { - symbol_put(i915_request_power_well); - get_power = NULL; - return -ENODEV; - } + if (!put_power) + goto err2; + + resume_power = symbol_request(i915_resume_power_well); + if (!resume_power) + goto err3; snd_printd("HDA driver get symbol successfully from i915 module\n"); - return err; + return 0; + +err3: + symbol_put(i915_release_power_well); +err2: + symbol_put(i915_request_power_well); +err1: + get_power = NULL; + + snd_printk(KERN_WARNING "hda-i915: power well symbol get fail\n"); + + return -ENODEV; } int hda_i915_exit(void) { - if (get_power) { + if (resume_power) + symbol_put(i915_resume_power_well); + if (get_power) symbol_put(i915_request_power_well); - get_power = NULL; - } - if (put_power) { + if (put_power) symbol_put(i915_release_power_well); - put_power = NULL; - } + + get_power = NULL; return 0; } diff --git a/sound/pci/hda/hda_i915.h b/sound/pci/hda/hda_i915.h index 5a63da2..608780d 100644 --- a/sound/pci/hda/hda_i915.h +++ b/sound/pci/hda/hda_i915.h @@ -18,6 +18,7 @@ #ifdef CONFIG_SND_HDA_I915 void hda_display_power(bool enable); +void hda_display_power_resume(void); int hda_i915_init(void); int hda_i915_exit(void); #else diff --git a/sound/pci/hda/hda_intel.c b/sound/pci/hda/hda_intel.c index e354ab1..d171286 100644 --- a/sound/pci/hda/hda_intel.c +++ b/sound/pci/hda/hda_intel.c @@ -2964,8 +2964,10 @@ static int azx_resume(struct device *dev) if (chip->disabled) return 0; - if (chip->driver_caps & AZX_DCAPS_I915_POWERWELL) + if (chip->driver_caps & AZX_DCAPS_I915_POWERWELL) { + hda_display_power_resume(); hda_display_power(true); + } pci_set_power_state(pci, PCI_D0); pci_restore_state(pci); if (pci_enable_device(pci) < 0) {