linux/sound/pci/hda
Takashi Iwai 37a3a98ef6 ALSA: hda - Enable runtime PM only for discrete GPU
The recent change of vga_switcheroo allowed the runtime PM for
HD-audio on AMD GPUs, but this also resulted in a regression.  When
the HD-audio controller driver gets runtime-suspended, HD-audio link
is turned off, and the hotplug notification is ignored.  This leads to
the inconsistent audio state (the connection isn't notified and ELD is
ignored).

The best fix would be to implement the proper ELD notification via the
audio component, but it's still not ready.  As a quick workaround,
this patch adds the check of runtime_idle and allows the runtime
suspend only when the vga_switcheroo is bound with discrete GPU.
That is, a system with a single GPU and APU would be again without
runtime PM to keep the HD-audio link for the hotplug notification and
ELD read out.

Also, the codec->auto_runtime_pm flag is set only for the discrete GPU
at the time GPU gets bound via vga_switcheroo (i.e. only dGPU is
forcibly runtime-PM enabled), so that APU can still get the ELD
notification.

For identifying which GPU is bound, a new vga_switcheroo client
callback, gpu_bound, is implemented.  The vga_switcheroo simply calls
this when GPU is bound, and tells whether it's dGPU or APU.

Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=200945
Fixes: 07f4f97d7b ("vga_switcheroo: Use device link for HDA controller")
Reported-by: Jian-Hong Pan <jian-hong@endlessm.com>
Tested-by: Jian-Hong Pan <jian-hong@endlessm.com>
Acked-by: Lukas Wunner <lukas@wunner.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-09-13 17:58:30 +02:00
..
Kconfig ALSA: hda - Enforce CONFIG_SND_DYNAMIC_MINORS for HDMI/DP codec 2018-05-02 09:08:16 +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
ca0132_regs.h ALSA: hda: ca0132_regs.h: Fix typo in include guard 2014-08-22 11:24:11 +02:00
dell_wmi_helper.c ALSA: update dell-wmi mic-mute registration to new world order 2018-08-15 19:08:10 -07:00
hda_auto_parser.c ALSA: hda - Use a macro for snd_array iteration loops 2018-04-24 13:41:53 +02:00
hda_auto_parser.h ALSA: hda - Sort input pins depending on amp caps 2014-09-23 15:57:32 +02:00
hda_beep.c ALSA: hda-beep: add SPDX identifiers 2018-02-20 16:49:59 +01:00
hda_beep.h ALSA: hda-beep: add SPDX identifiers 2018-02-20 16:49:59 +01:00
hda_bind.c ALSA: hda: Fix forget to free resource in error handling code path in hda_codec_driver_probe 2017-09-04 17:33:53 +02:00
hda_codec.c ALSA: hda - Fix cancel_work_sync() stall from jackpoll work 2018-08-30 15:21:57 +02:00
hda_codec.h Merge branch 'for-linus' into for-next 2018-07-17 22:27:03 +02:00
hda_controller.c ALSA: hda - Handle kzalloc() failure in snd_hda_attach_pcm_stream() 2018-06-01 09:38:54 +02:00
hda_controller.h ALSA: hda - Fix doubly initialization of i915 component 2017-06-30 08:58:53 +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 ALSA: hda - Use snd_hdac namespace prefix for chmap exported APIs 2016-03-07 15:46:06 +01:00
hda_generic.c ALSA: hda - Kill snd_hda_codec_update_cache() 2018-06-27 11:43:09 +02:00
hda_generic.h ALSA: hda - Move mic mute LED helper to the generic parser 2018-06-21 13:51:26 +02:00
hda_hwdep.c ALSA: hda: Hardening for potential Spectre v1 2018-04-25 10:37:46 +02:00
hda_intel.c ALSA: hda - Enable runtime PM only for discrete GPU 2018-09-13 17:58:30 +02:00
hda_intel.h ALSA: hda - Enable runtime PM only for discrete GPU 2018-09-13 17:58:30 +02: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 ALSA: hda - Fix bad dereference of jack object 2016-02-09 12:16:31 +01:00
hda_jack.h ALSA: hda - Fix bad dereference of jack object 2016-02-09 12:16:31 +01:00
hda_local.h ALSA: hda - Fix runtime PM 2018-05-24 20:16:47 +02:00
hda_proc.c treewide: kmalloc() -> kmalloc_array() 2018-06-12 16:19:22 -07:00
hda_sysfs.c ALSA: hda - Use a macro for snd_array iteration loops 2018-04-24 13:41:53 +02:00
hda_tegra.c ALSA: hda/tegra: iomem fixups for sparse warnings 2016-06-22 15:19:10 +02: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
patch_analog.c ALSA: hda - Kill snd_hda_codec_update_cache() 2018-06-27 11:43:09 +02:00
patch_ca0110.c ALSA: hda - convert to hda_device_id 2015-10-20 10:15:20 +02:00
patch_ca0132.c ALSA: hda/ca0132 - Add exit commands for Recon3D 2018-08-08 20:41:02 +02:00
patch_cirrus.c ALSA: hda/cirrus - Simplify creation of new controls 2018-06-25 10:04:26 +02:00
patch_cmedia.c ALSA: hda - convert to hda_device_id 2015-10-20 10:15:20 +02:00
patch_conexant.c Merge branch 'for-linus' into topic/virmidi 2018-07-29 22:39:29 +02:00
patch_hdmi.c ALSA: hda/hdmi: Use single mutex unlock in error paths 2018-07-29 09:28:12 +02:00
patch_realtek.c ALSA: hda/realtek - Fix HP Headset Mic can't record 2018-08-21 11:53:17 +02:00
patch_si3054.c ALSA: hda: Constify hw_constraints 2017-06-09 10:42:52 +02:00
patch_sigmatel.c ALSA: hda/sigmatel - Use common helper for mic mute LED 2018-06-21 13:54:36 +02:00
patch_via.c ALSA: hda/via - Use standard verb containers 2018-06-25 10:04:27 +02:00
thinkpad_helper.c ALSA: hda - Use the common helper for thinkpad_acpi mic mute LED handling 2018-06-21 13:52:24 +02:00