diff mbox series

[v2,1/2] ALSA: hda/hdmi - Read the pin sense from register when repolling

Message ID 20190506140932.7942-1-hui.wang@canonical.com (mailing list archive)
State New, archived
Headers show
Series [v2,1/2] ALSA: hda/hdmi - Read the pin sense from register when repolling | expand

Commit Message

Hui Wang May 6, 2019, 2:09 p.m. UTC
The driver will check the monitor presence when resuming from suspend,
starting poll or interrupt triggers. In these 3 situations, the
jack_dirty will be set to 1 first, then the hda_jack.c reads the
pin_sense from register, after reading the register, the jack_dirty
will be set to 0. But hdmi_repoll_work() is enabled in these 3
situations, It will read the pin_sense a couple of times subsequently,
since the jack_dirty is 0 now, It does not read the register anymore,
instead it uses the shadow pin_sense which is read at the first time.

It is meaningless to check the shadow pin_sense a couple of times,
we need to read the register to check the real plugging state, so
we set the jack_dirty to 1 in the hdmi_repoll_work().

Signed-off-by: Hui Wang <hui.wang@canonical.com>
---
 sound/pci/hda/patch_hdmi.c | 5 +++++
 1 file changed, 5 insertions(+)

Comments

Hui Wang May 6, 2019, 11:29 p.m. UTC | #1
On 2019/5/6 下午10:31, Takashi Iwai wrote:
> On Mon, 06 May 2019 16:09:31 +0200,
> Hui Wang wrote:
>> @@ -1663,6 +1663,11 @@ static void hdmi_repoll_eld(struct work_struct *work)
>>   	container_of(to_delayed_work(work), struct hdmi_spec_per_pin, work);
>>   	struct hda_codec *codec = per_pin->codec;
>>   	struct hdmi_spec *spec = codec->spec;
>> +	struct hda_jack_tbl *jack;
>> +
>> +	jack = snd_hda_jack_tbl_get(codec, per_pin->pin_nid);
>> +	if (jack)
>> +		jack = jack->jack_dirty = 1;
> Oh, and I corrected the obvious typo above manually while applying.
> We don't need to substitute jack twice.

Oh, sorry.

>
>
> Takashi
> _______________________________________________
> Alsa-devel mailing list
> Alsa-devel@alsa-project.org
> https://mailman.alsa-project.org/mailman/listinfo/alsa-devel
>
diff mbox series

Patch

diff --git a/sound/pci/hda/patch_hdmi.c b/sound/pci/hda/patch_hdmi.c
index 8b3ac690efa3..410d94301941 100644
--- a/sound/pci/hda/patch_hdmi.c
+++ b/sound/pci/hda/patch_hdmi.c
@@ -1663,6 +1663,11 @@  static void hdmi_repoll_eld(struct work_struct *work)
 	container_of(to_delayed_work(work), struct hdmi_spec_per_pin, work);
 	struct hda_codec *codec = per_pin->codec;
 	struct hdmi_spec *spec = codec->spec;
+	struct hda_jack_tbl *jack;
+
+	jack = snd_hda_jack_tbl_get(codec, per_pin->pin_nid);
+	if (jack)
+		jack = jack->jack_dirty = 1;
 
 	if (per_pin->repoll_count++ > 6)
 		per_pin->repoll_count = 0;