diff options
Diffstat (limited to 'sound/pci/hda/hda_i915.c')
-rw-r--r-- | sound/pci/hda/hda_i915.c | 28 |
1 files changed, 22 insertions, 6 deletions
diff --git a/sound/pci/hda/hda_i915.c b/sound/pci/hda/hda_i915.c index 76c13d5..9e136be 100644 --- a/sound/pci/hda/hda_i915.c +++ b/sound/pci/hda/hda_i915.c @@ -22,20 +22,28 @@ #include <drm/i915_powerwell.h> #include "hda_i915.h" -static void (*get_power)(void); -static void (*put_power)(void); +static int (*get_power)(void); +static int (*put_power)(void); +static int (*get_cdclk)(void); -void hda_display_power(bool enable) +int hda_display_power(bool enable) { if (!get_power || !put_power) - return; + return -ENODEV; snd_printdd("HDA display power %s \n", enable ? "Enable" : "Disable"); if (enable) - get_power(); + return get_power(); else - put_power(); + return put_power(); +} + +int haswell_get_cdclk(void) +{ + if (!get_cdclk) + return -EINVAL; + return get_cdclk(); } int hda_i915_init(void) @@ -55,6 +63,10 @@ int hda_i915_init(void) return -ENODEV; } + get_cdclk = symbol_request(i915_get_cdclk_freq); + if (!get_cdclk) /* may have abnormal BCLK and audio playback rate */ + snd_printd("hda-i915: get_cdclk symbol get fail\n"); + snd_printd("HDA driver get symbol successfully from i915 module\n"); return err; @@ -70,6 +82,10 @@ int hda_i915_exit(void) symbol_put(i915_release_power_well); put_power = NULL; } + if (get_cdclk) { + symbol_put(i915_get_cdclk_freq); + get_cdclk = NULL; + } return 0; } |