Commit 18e60627 authored by Wang Xingchao's avatar Wang Xingchao Committed by Takashi Iwai

ALSA: hda - jack poll once if jackpoll_interval==0

With jackpoll_interval != 0, it's used to poll jack event periodically
in a delayed work. if it's 0, give the caller chance to probe jack status
but will not restart the delayed work.

In the next patch which enable WAKEEN feature, HDA controller was able to wake
up system when it's in D3, it's useful to detect Jack hotplug event and notify
userspace. By default the jackpoll_interval=0, this patch let jack poll once
without starting the delayed work.
Signed-off-by: default avatarWang Xingchao <xingchao.wang@linux.intel.com>
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent 7eaa9161
...@@ -1216,11 +1216,13 @@ static void hda_jackpoll_work(struct work_struct *work) ...@@ -1216,11 +1216,13 @@ static void hda_jackpoll_work(struct work_struct *work)
{ {
struct hda_codec *codec = struct hda_codec *codec =
container_of(work, struct hda_codec, jackpoll_work.work); container_of(work, struct hda_codec, jackpoll_work.work);
if (!codec->jackpoll_interval)
return;
snd_hda_jack_set_dirty_all(codec); snd_hda_jack_set_dirty_all(codec);
snd_hda_jack_poll_all(codec); snd_hda_jack_poll_all(codec);
if (!codec->jackpoll_interval)
return;
queue_delayed_work(codec->bus->workq, &codec->jackpoll_work, queue_delayed_work(codec->bus->workq, &codec->jackpoll_work,
codec->jackpoll_interval); codec->jackpoll_interval);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment