]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob - releases/4.19.45/alsa-hda-hdmi-read-the-pin-sense-from-register-when-repolling.patch
Linux 4.14.121
[thirdparty/kernel/stable-queue.git] / releases / 4.19.45 / alsa-hda-hdmi-read-the-pin-sense-from-register-when-repolling.patch
1 From 8c2e6728c2bf95765b724e07d0278ae97cd1ee0d Mon Sep 17 00:00:00 2001
2 From: Hui Wang <hui.wang@canonical.com>
3 Date: Mon, 6 May 2019 22:09:31 +0800
4 Subject: ALSA: hda/hdmi - Read the pin sense from register when repolling
5
6 From: Hui Wang <hui.wang@canonical.com>
7
8 commit 8c2e6728c2bf95765b724e07d0278ae97cd1ee0d upstream.
9
10 The driver will check the monitor presence when resuming from suspend,
11 starting poll or interrupt triggers. In these 3 situations, the
12 jack_dirty will be set to 1 first, then the hda_jack.c reads the
13 pin_sense from register, after reading the register, the jack_dirty
14 will be set to 0. But hdmi_repoll_work() is enabled in these 3
15 situations, It will read the pin_sense a couple of times subsequently,
16 since the jack_dirty is 0 now, It does not read the register anymore,
17 instead it uses the shadow pin_sense which is read at the first time.
18
19 It is meaningless to check the shadow pin_sense a couple of times,
20 we need to read the register to check the real plugging state, so
21 we set the jack_dirty to 1 in the hdmi_repoll_work().
22
23 Signed-off-by: Hui Wang <hui.wang@canonical.com>
24 Cc: <stable@vger.kernel.org>
25 Signed-off-by: Takashi Iwai <tiwai@suse.de>
26 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
27
28 ---
29 sound/pci/hda/patch_hdmi.c | 5 +++++
30 1 file changed, 5 insertions(+)
31
32 --- a/sound/pci/hda/patch_hdmi.c
33 +++ b/sound/pci/hda/patch_hdmi.c
34 @@ -1660,6 +1660,11 @@ static void hdmi_repoll_eld(struct work_
35 container_of(to_delayed_work(work), struct hdmi_spec_per_pin, work);
36 struct hda_codec *codec = per_pin->codec;
37 struct hdmi_spec *spec = codec->spec;
38 + struct hda_jack_tbl *jack;
39 +
40 + jack = snd_hda_jack_tbl_get(codec, per_pin->pin_nid);
41 + if (jack)
42 + jack->jack_dirty = 1;
43
44 if (per_pin->repoll_count++ > 6)
45 per_pin->repoll_count = 0;