diff options
author | Hui Wang <hui.wang@canonical.com> | 2020-03-29 16:20:18 +0800 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2020-03-29 10:41:22 +0200 |
commit | 476c02e0b4fd9071d158f6a1a1dfea1d36ee0ffd (patch) | |
tree | 318de011e95075573427e00bc0d8ddf9dbc4ffc4 /kernel/workqueue.c | |
parent | f5a88b0accc24c4a9021247d7a3124f90aa4c586 (diff) | |
download | linux-476c02e0b4fd9071d158f6a1a1dfea1d36ee0ffd.tar.bz2 |
ALSA: hda/realtek - a fake key event is triggered by running shutup
On the Lenovo X1C7 machines, after we plug the headset, the rt_resume()
and rt_suspend() of the codec driver will be called periodically, the
driver can't stay in the rt_suspend state even users doen't use the
sound card.
Through debugging, I found when running rt_suspend(), it will call
alc225_shutup(), in this function, it will change 3k pull down control
by alc_update_coef_idx(codec, 0x4a, 0, 3 << 10), this will trigger a
fake key event and that event will resume the codec, when codec
suspend agin, it will trigger the fake key event one more time, this
process will repeat.
If disable the key event before changing the pull down control, it
will not trigger fake key event. It also needs to restore the pull
down control and re-enable the key event, otherwise the system can't
get key event when codec is in rt_suspend state.
Also move some functions ahead of alc225_shutup(), this can save the
function declaration.
Fixes: 76f7dec08fd6 (ALSA: hda/realtek - Add Headset Button supported for ThinkPad X1)
Cc: Kailang Yang <kailang@realtek.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Hui Wang <hui.wang@canonical.com>
Link: https://lore.kernel.org/r/20200329082018.20486-1-hui.wang@canonical.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'kernel/workqueue.c')
0 files changed, 0 insertions, 0 deletions