aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci/hda/hda_codec.c
diff options
context:
space:
mode:
authorWang Xingchao <xingchao.wang@linux.intel.com>2013-07-25 23:34:45 -0400
committerTakashi Iwai <tiwai@suse.de>2013-07-29 08:19:10 -0400
commit18e606275691726cce06ad803072ac54315740f7 (patch)
tree7c2b615b6a7c3312ac96ca00f141d2e25ae668e0 /sound/pci/hda/hda_codec.c
parent7eaa9161edd1bb41c026db252bb7e7dfe97ab90a (diff)
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: Wang Xingchao <xingchao.wang@linux.intel.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci/hda/hda_codec.c')
-rw-r--r--sound/pci/hda/hda_codec.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/sound/pci/hda/hda_codec.c b/sound/pci/hda/hda_codec.c
index 8a005f0e5ca4..fdbb09a9b9e5 100644
--- a/sound/pci/hda/hda_codec.c
+++ b/sound/pci/hda/hda_codec.c
@@ -1216,11 +1216,13 @@ static void hda_jackpoll_work(struct work_struct *work)
1216{ 1216{
1217 struct hda_codec *codec = 1217 struct hda_codec *codec =
1218 container_of(work, struct hda_codec, jackpoll_work.work); 1218 container_of(work, struct hda_codec, jackpoll_work.work);
1219 if (!codec->jackpoll_interval)
1220 return;
1221 1219
1222 snd_hda_jack_set_dirty_all(codec); 1220 snd_hda_jack_set_dirty_all(codec);
1223 snd_hda_jack_poll_all(codec); 1221 snd_hda_jack_poll_all(codec);
1222
1223 if (!codec->jackpoll_interval)
1224 return;
1225
1224 queue_delayed_work(codec->bus->workq, &codec->jackpoll_work, 1226 queue_delayed_work(codec->bus->workq, &codec->jackpoll_work,
1225 codec->jackpoll_interval); 1227 codec->jackpoll_interval);
1226} 1228}