linux/sound/pci/hda
Lukas Wunner 009f8c90f5 ALSA: hda - Fix runtime PM
Before commit 3b5b899ca6 ("ALSA: hda: Make use of core codec functions
to sync power state"), hda_set_power_state() returned the response to
the Get Power State verb, a 32-bit unsigned integer whose expected value
is 0x233 after transitioning a codec to D3, and 0x0 after transitioning
it to D0.

The response value is significant because hda_codec_runtime_suspend()
does not clear the codec's bit in the codec_powered bitmask unless the
AC_PWRST_CLK_STOP_OK bit (0x200) is set in the response value.  That in
turn prevents the HDA controller from runtime suspending because
azx_runtime_idle() checks that the codec_powered bitmask is zero.

Since commit 3b5b899ca6, hda_set_power_state() only returns 0x0 or
0x1, thereby breaking runtime PM for any HDA controller.  That's because
an inline function introduced by the commit returns a bool instead of a
32-bit unsigned int.  The change was likely erroneous and resulted from
copying and pasting snd_hda_check_power_state(), which is immediately
preceding the newly introduced inline function.  Fix it.

Link: https://bugs.freedesktop.org/show_bug.cgi?id=106597
Fixes: 3b5b899ca6 ("ALSA: hda: Make use of core codec functions to sync power state")
Cc: Alex Deucher <alexander.deucher@amd.com>
Cc: Abhijeet Kumar <abhijeet.kumar@intel.com>
Reported-and-tested-by: Gunnar Krüger <taijian@posteo.de>
Signed-off-by: Lukas Wunner <lukas@wunner.de>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-05-24 20:16:47 +02: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 License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
hda_auto_parser.c ALSA: hda - A new flag to enforce prefix to each pin 2017-04-10 17:44:39 +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: Make use of core codec functions to sync power state 2018-02-12 13:59:48 +01:00
hda_codec.h ALSA: hda: Fix regression of hdmi eld control created based on invalid pcm 2017-09-03 16:33:42 +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_controller.c ALSA: hda - Skip card registration when no codec is found 2017-06-28 12:45:34 +02:00
hda_controller.h ALSA: hda - Fix doubly initialization of i915 component 2017-06-30 08:58:53 +02: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 - silence uninitialized variable warning in activate_amp_in() 2017-10-13 15:14:44 +02:00
hda_generic.h ALSA: hda - Allow to enable/disable vmaster build explicitly 2017-04-10 17:45:27 +02:00
hda_hwdep.c ALSA: hda: Hardening for potential Spectre v1 2018-04-25 10:37:46 +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_intel.c ALSA: hda: Add Lenovo C50 All in one to the power_save blacklist 2018-05-13 16:44:35 +02:00
hda_intel.h vga_switcheroo: Use device link for HDA controller 2018-03-13 22:58:09 +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 ALSA: hda/proc - Fix racy string access for power states 2015-08-17 15:12:04 +02:00
hda_sysfs.c ALSA: hda: constify attribute_group structures. 2017-06-29 18:20:21 +02:00
hda_tegra.c ALSA: hda/tegra: iomem fixups for sparse warnings 2016-06-22 15:19:10 +02:00
Kconfig ALSA: hda - Use IS_REACHABLE() for dependency on input 2018-01-15 20:16:54 +01:00
local.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01: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 ALSA: hda: make snd_kcontrol_new const 2017-08-16 14:29:08 +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 - use ARRAY_SIZE 2017-10-13 15:14:08 +02:00
patch_cirrus.c ALSA: hda - Apply the existing quirk to iMac 14,1 2018-01-10 11:11:54 +01:00
patch_cmedia.c ALSA: hda - convert to hda_device_id 2015-10-20 10:15:20 +02:00
patch_conexant.c ALSA: hda: add dock and led support for HP ProBook 640 G2 2018-03-08 17:37:10 +01:00
patch_hdmi.c ALSA: hda - Skip jack and others for non-existing PCM streams 2018-04-25 16:37:19 +02:00
patch_realtek.c ALSA: hda/realtek - Clevo P950ER ALC1220 Fixup 2018-05-13 18:55:46 +02:00
patch_si3054.c ALSA: hda: Constify hw_constraints 2017-06-09 10:42:52 +02:00
patch_sigmatel.c ALSA: hda: make snd_kcontrol_new const 2017-08-16 14:29:08 +02:00
patch_via.c ALSA: hda - convert to hda_device_id 2015-10-20 10:15:20 +02:00
thinkpad_helper.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00