ALSA: hda - add Intel DG1 support
cover ALSA: hda - add Intel DG1 support
Series adding support for HDMI/DP audio for Intel DG1.
Kai Vehmanen (4):
ALSA: hda - add Intel DG1 PCI and HDMI ids
ALSA: hda - controller is in GPU on the DG1
ALSA: hda - handle multiple i915 device instances
ALSA: hda - fix CONTROLLER_IN_GPU macro name
sound/hda/hdac_i915.c | 48 ++++++++++++++++++++++++++++++++++---- sound/pci/hda/hda_intel.c | 6 ++++- sound/pci/hda/patch_hdmi.c | 1 + 3 files changed, 50 insertions(+), 5 deletions(-)
Signature · 1 line
2.27.0
PATCH 1/4 ALSA: hda - add Intel DG1 PCI and HDMI ids
Add Intel DG1 PCI id to list of supported HDA controllers and add its HDMI id as well.
--- sound/pci/hda/hda_intel.c | 3 +++ sound/pci/hda/patch_hdmi.c | 1 + 2 files changed, 4 insertions(+)
sound/pci/hda/hda_intel.c +3 -0
@@ -2493,6 +2493,9 @@ static const struct pci_device_id azx_ids[] = {/* Tigerlake-H */ { PCI_DEVICE(0x8086, 0x43c8), .driver_data = AZX_DRIVER_SKL | AZX_DCAPS_INTEL_SKYLAKE}, + /* DG1 */ + { PCI_DEVICE(0x8086, 0x490d), + .driver_data = AZX_DRIVER_SKL | AZX_DCAPS_INTEL_SKYLAKE}, /* Elkhart Lake */ { PCI_DEVICE(0x8086, 0x4b55), .driver_data = AZX_DRIVER_SKL | AZX_DCAPS_INTEL_SKYLAKE},
sound/pci/hda/patch_hdmi.c +1 -0
@@ -4269,6 +4269,7 @@ HDA_CODEC_ENTRY(0x8086280c, "Cannonlake HDMI", patch_i915_glk_hdmi),HDA_CODEC_ENTRY (0x8086280d ,"Geminilake HDMI" , patch_i915_glk_hdmi),HDA_CODEC_ENTRY (0x8086280f ,"Icelake HDMI" , patch_i915_icl_hdmi),HDA_CODEC_ENTRY (0x80862812 ,"Tigerlake HDMI" , patch_i915_tgl_hdmi), +HDA_CODEC_ENTRY (0x80862814 ,"DG1 HDMI" , patch_i915_tgl_hdmi),HDA_CODEC_ENTRY (0x80862816 ,"Rocketlake HDMI" , patch_i915_tgl_hdmi),HDA_CODEC_ENTRY (0x8086281a ,"Jasperlake HDMI" , patch_i915_icl_hdmi), HDA_CODEC_ENTRY(0x8086281b, "Elkhartlake HDMI", patch_i915_icl_hdmi),
Signature · 1 line
2.27.0
PATCH 2/4 ALSA: hda - controller is in GPU on the DG1
In reply to Kai VehmanenAdd Intel DG1 to the CONTROLLER_IN_GPU list to ensure audio power is requested whenever programming the controller.
--- sound/pci/hda/hda_intel.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
sound/pci/hda/hda_intel.c +2 -1
@@ -368,7 +368,8 @@ enum {#define CONTROLLER_IN_GPU (pci) (((pci)->device == 0x0a0c) || \ ((pci)->device == 0x0c0c) || \ ((pci)->device == 0x0d0c) || \ - ((pci)->device == 0x160c)) + ((pci)->device == 0x160c) || \ + ((pci)->device == 0x490d))#define IS_BXT (pci) ((pci)->vendor == 0x8086 && (pci)->device == 0x5a98)
Signature · 1 line
2.27.0
PATCH 3/4 ALSA: hda - handle multiple i915 device instances
In reply to Kai VehmanenCurrently i915_component_master_match() will return the first matching i915 instance. This does not work in case system has multiple i915 and HDA audio controller instances.
Add a new connectivity check that handles following cases:
- i915 and HDA controller on same PCI bus
- discrete GPU with embedded HDA audio controller connected via PCI bridge
--- sound/hda/hdac_i915.c | 44 +++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 42 insertions(+), 2 deletions(-)
sound/hda/hdac_i915.c +42 -2
@@ -73,11 +73,51 @@ void snd_hdac_i915_set_bclk(struct hdac_bus *bus) }EXPORT_SYMBOL_GPL (snd_hdac_i915_set_bclk); +/** +* Returns true if the devices can be connected for audio. +*/ +static bool connectivity_check (struct pci_dev *i915,struct pci_dev *hdac) +{ +struct pci_bus *bus_a = i915->bus, *bus_b = hdac->bus; + +/* directly connected on the same bus */ +if (bus_a == bus_b) +return true; + +/* +* on i915 discrete GPUs with embedded HDA audio, the two +* devices are connected via 2nd level PCI bridge +*/ + bus_a = bus_a->parent; + bus_b = bus_b->parent; +if (!bus_a || !bus_b) +return false; + bus_a = bus_a->parent; + bus_b = bus_b->parent; +if (bus_a && bus_a == bus_b) +return true; + +return false; +} +static int i915_component_master_match (struct device *dev,int subcomponent,void *data) { -return !strcmp (dev->driver->name,"i915" ) && - subcomponent ==I915_COMPONENT_AUDIO ; +struct pci_dev *hdac_pci, *i915_pci; +struct hdac_bus *bus = data; + +if (!dev_is_pci (dev)) +return 0 ; + + hdac_pci =to_pci_dev (bus->dev); + i915_pci =to_pci_dev (dev); + +if (!strcmp (dev->driver->name,"i915" ) && + subcomponent ==I915_COMPONENT_AUDIO && +connectivity_check (i915_pci, hdac_pci)) +return 1 ; + +return 0 ; }/* check whether intel graphics is present */
Signature · 1 line
2.27.0
PATCH 4/4 ALSA: hda - fix CONTROLLER_IN_GPU macro name
In reply to Kai VehmanenThe CONTROLLER_IN_GPU() macro has different semantics than the similarly named macro in hda_intel.c. The name is also misleading as the macro is used to apply a Intel HSW/BDW programming logic for HDA controller clock configuration. Rename macro to reflect the actual implementation.
--- sound/hda/hdac_i915.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
sound/hda/hdac_i915.c +2 -2
@@ -13,7 +13,7 @@static struct completion bind_complete; -#define CONTROLLER_IN_GPU (pci) (((pci)->device == 0x0a0c) || \ +#define IS_HSW_CONTROLLER (pci) (((pci)->device == 0x0a0c) || \ ((pci)->device == 0x0c0c) || \ ((pci)->device == 0x0d0c) || \ ((pci)->device == 0x160c))
@@ -41,7 +41,7 @@ void snd_hdac_i915_set_bclk(struct hdac_bus *bus)if (!acomp || !acomp->ops || !acomp->ops->get_cdclk_freq)return ;/* only for i915 binding */ -if (!CONTROLLER_IN_GPU (pci)) +if (!IS_HSW_CONTROLLER (pci))return ;/* only HSW/BDW */ cdclk_freq = acomp->ops->get_cdclk_freq (acomp->dev);
Signature · 1 line
2.27.0
Takashi Iwai
AppliedQuoted 8 lines · Kai Vehmanen
Series adding support for HDMI/DP audio for Intel DG1.
Kai Vehmanen (4):
ALSA: hda - add Intel DG1 PCI and HDMI ids
ALSA: hda - controller is in GPU on the DG1
ALSA: hda - handle multiple i915 device instances
ALSA: hda - fixCONTROLLER_IN_GPUmacro name
Applied all four patches now to for-next branch.
thanks,
Takashi