// SPDX-License-Identifier: GPL-2.0-or-later /* * hdac_i915.c - routines for sync between HD-A core and i915 display driver */ #include <linux/init.h> #include <linux/module.h> #include <linux/pci.h> #include <sound/core.h> #include <sound/hdaudio.h> #include <sound/hda_i915.h> #include <sound/hda_register.h> #include <video/nomodeset.h> static int gpu_bind = …; module_param(gpu_bind, int, 0644); MODULE_PARM_DESC(…) …; /** * snd_hdac_i915_set_bclk - Reprogram BCLK for HSW/BDW * @bus: HDA core bus * * Intel HSW/BDW display HDA controller is in GPU. Both its power and link BCLK * depends on GPU. Two Extended Mode registers EM4 (M value) and EM5 (N Value) * are used to convert CDClk (Core Display Clock) to 24MHz BCLK: * BCLK = CDCLK * M / N * The values will be lost when the display power well is disabled and need to * be restored to avoid abnormal playback speed. * * Call this function at initializing and changing power well, as well as * at ELD notifier for the hotplug. */ void snd_hdac_i915_set_bclk(struct hdac_bus *bus) { … } EXPORT_SYMBOL_GPL(…); /* returns true if the devices can be connected for audio */ static bool connectivity_check(struct pci_dev *i915, struct pci_dev *hdac) { … } static int i915_component_master_match(struct device *dev, int subcomponent, void *data) { … } /* check whether Intel graphics is present and reachable */ static int i915_gfx_present(struct pci_dev *hdac_pci) { … } /** * snd_hdac_i915_init - Initialize i915 audio component * @bus: HDA core bus * * This function is supposed to be used only by a HD-audio controller * driver that needs the interaction with i915 graphics. * * This function initializes and sets up the audio component to communicate * with i915 graphics driver. * * Returns zero for success or a negative error code. */ int snd_hdac_i915_init(struct hdac_bus *bus) { … } EXPORT_SYMBOL_GPL(…);