linux/sound/pci/hda
Takashi Iwai ade49db337 ALSA: hda/hdmi - Allow audio component for AMD/ATI and Nvidia HDMI
AMD/ATI and Nvidia HDMI codec drivers didn't have the audio component
binding like i915, but it worked only with the traditional HD-audio
unsolicited event for the HDMI hotplug detection and the ELD read-up
thereafter.  This has been a problem in many ways: first of all, it
goes through the hardware event transition (from GPU register write,
HD-audio controller trigger, and finally to HD-audio unsolicited event
handling), which is often unreliable and may miss some opportunities.
Second, each unsol event handling and ELD read-up need the explicit
power up / down when the codec is in the runtime suspend.  Last but
not least, which is the most important, the hotplug wakeup may be
missed when the HD-audio controller is in runtime suspend.  Especially
the last point is a big problem due to the recent change relevant with
vga_switcheroo that forcibly enables the runtime PM for AMD HDMI
controllers.

These issues are solved by introducing the audio component; the
hotplug notification is done by a direct function callback, which is
more accurate and reliable, and it can be processed without the actual
hardware access, i.e. no runtime PM trigger is needed, and the
HD-audio gets the event even if it's in runtime suspend.  The same for
ELD query, as it's read directly from the cached ELD bytes stored in
the DRM driver, hence the whole hardware access can be skipped.

So here it is: this patch implements the audio component binding with
AMD/ATI and Nouveau DRM drivers.  The biggest difference from i915
implementation is that this binding is fully optional and it can be
enabled asynchronously on the fly.  That is, the driver will switch
from the HD-audio unsolicited event to the notify callback once when
the DRM component gets bound.  Similarly, when DRM driver gets
unloaded, the HDMI event handling returns to the legacy mode, too.

Also, another difference from i915 is that the new code registers the
component in the codec driver, while i915 HDMI codec assumes the
component binding was already done in the HD-audio controller driver.
Hence the new code does need to de-register the component binding at
the codec exit, too.

Some other details:
- The match component ops assumes that both VGA and HD-audio
  controller PCI entries belong to the same PCI bus, and only accepts
  such an entry.

- The pin2port audio_ops is implemented with assumption of the fixed
  widget layout.  For AMD, it's starting from 3, with step 2 (3, 5, 7,
  ...), while for Nvidia, it's starting from 4, with step 1 (4, 5, 6,
  ...)

As of this patch, the corresponding component isn't implemented in DRM
side, so this change alone won't give any benefit.  By the following
changes in DRM sides, the mission will be completed.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2019-07-22 09:13:56 +02:00
..
ca0132_regs.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 32 2019-05-24 17:27:10 +02:00
hda_auto_parser.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 46 2019-05-24 17:27:12 +02:00
hda_auto_parser.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 46 2019-05-24 17:27:12 +02:00
hda_beep.c ALSA: hda - Use standard device registration for beep 2019-01-29 18:28:09 +01:00
hda_beep.h ALSA: hda - Use standard device registration for beep 2019-01-29 18:28:09 +01:00
hda_bind.c treewide: Add SPDX license identifier for missed files 2019-05-21 10:50:45 +02:00
hda_codec.c ALSA: hda - Don't resume forcibly i915 HDMI/DP codec 2019-07-16 22:46:13 +02:00
hda_controller.c ASoC: Updates for v5.3 2019-07-08 14:45:34 +02:00
hda_controller.h ASoC: Updates for v5.3 2019-07-08 14:45:34 +02:00
hda_controller_trace.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
hda_eld.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 32 2019-05-24 17:27:10 +02:00
hda_generic.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 32 2019-05-24 17:27:10 +02:00
hda_generic.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 46 2019-05-24 17:27:12 +02:00
hda_hwdep.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 32 2019-05-24 17:27:10 +02:00
hda_intel.c ASoC: Updates for v5.3 2019-07-08 14:45:34 +02:00
hda_intel.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 156 2019-05-30 11:26:35 -07:00
hda_intel_trace.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
hda_jack.c ASoC: Updates for v5.3 2019-07-08 14:45:34 +02:00
hda_jack.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 46 2019-05-24 17:27:12 +02:00
hda_local.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 156 2019-05-30 11:26:35 -07:00
hda_proc.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 32 2019-05-24 17:27:10 +02:00
hda_sysfs.c treewide: Add SPDX license identifier for missed files 2019-05-21 10:50:45 +02:00
hda_tegra.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 201 2019-05-30 11:29:52 -07:00
hp_x360_helper.c ALSA: hda/realtek - Fixup for HP x360 laptops with B&O speakers 2018-05-29 22:33:37 +02:00
Kconfig treewide: Add SPDX license identifier - Makefile/Kconfig 2019-05-21 10:50:46 +02:00
Makefile License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
patch_analog.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 32 2019-05-24 17:27:10 +02:00
patch_ca0110.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 32 2019-05-24 17:27:10 +02:00
patch_ca0132.c ASoC: Updates for v5.3 2019-07-08 14:45:34 +02:00
patch_cirrus.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 32 2019-05-24 17:27:10 +02:00
patch_cmedia.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 32 2019-05-24 17:27:10 +02:00
patch_conexant.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 32 2019-05-24 17:27:10 +02:00
patch_hdmi.c ALSA: hda/hdmi - Allow audio component for AMD/ATI and Nvidia HDMI 2019-07-22 09:13:56 +02:00
patch_realtek.c ALSA: hda/realtek: apply ALC891 headset fixup to one Dell machine 2019-07-16 09:34:57 +02:00
patch_si3054.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 32 2019-05-24 17:27:10 +02:00
patch_sigmatel.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 32 2019-05-24 17:27:10 +02:00
patch_via.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 32 2019-05-24 17:27:10 +02:00
thinkpad_helper.c ALSA: hda - Support led audio trigger 2018-11-28 23:25:22 +01:00