]> git.baikalelectronics.ru Git - kernel.git/commit
ALSA: hda/cs8409: Set PMSG_ON earlier inside cs8409 driver
authorStefan Binding <sbinding@opensource.cirrus.com>
Sun, 28 Nov 2021 11:55:58 +0000 (11:55 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 8 Dec 2021 08:04:41 +0000 (09:04 +0100)
commit210ff8c9ac4e7734e2d10abc6801c6eee69037b6
tree23d1e806c1ad5537ecb1edd5fd00d8d13314fe43
parent701388746bdd23b9fbb78b271a7060bf5c4abba4
ALSA: hda/cs8409: Set PMSG_ON earlier inside cs8409 driver

commit e914cee50fac6558c048e58c3698e235a8ce512b upstream.

For cs8409, it is required to run Jack Detect on resume.
Jack Detect on cs8409+cs42l42 requires an interrupt from
cs42l42 to be sent to cs8409 which is propogated to the driver
via an unsolicited event.
However, the hda_codec drops unsolicited events if the power_state
is not set to PMSG_ON. Which is set at the end of the resume call.
This means there is a race condition between setting power_state
to PMSG_ON and receiving the interrupt.
To solve this, we can add an API to set the power_state earlier
and call that before we start Jack Detect.
This does not cause issues, since we know inside our driver that
we are already initialized, and ready to handle the unsolicited
events.

Signed-off-by: Stefan Binding <sbinding@opensource.cirrus.com>
Signed-off-by: Vitaly Rodionov <vitalyr@opensource.cirrus.com>
Cc: <stable@vger.kernel.org> # v5.15+
Link: https://lore.kernel.org/r/20211128115558.71683-1-vitalyr@opensource.cirrus.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
sound/pci/hda/hda_local.h
sound/pci/hda/patch_cs8409.c