ALSA: hda - Cache the jack-detection value
authorTakashi Iwai <tiwai@suse.de>
Thu, 27 Oct 2011 20:12:46 +0000 (22:12 +0200)
committerLeann Ogasawara <leann.ogasawara@canonical.com>
Mon, 2 Apr 2012 20:18:09 +0000 (13:18 -0700)
commitf41eb00232b22ffd9672817ca601f6f13b0b31bf
tree27e4beb6fc306008b071e72eb3f1a36169018f80
parent08a4577cfee05c0ec9b32d3ab7d954287f1f7b07
ALSA: hda - Cache the jack-detection value

Introduce a table containing the pins and their jack-detection states
for avoiding the unnecessary verbs to check the pin status at each time.

When the unsol event is enabled via snd_hda_jack_detect_enable(), it
automatically adds the given NID to the table.  Then the driver supposes
that the codec driver will set the dirty flag appropariately when an
unsolicited event is invoked for that pin.

The behavior for reading other pins that aren't registered in the table
doesn't change.  Only the pins assigned to the table are cached, so far.

In near futre, this table can be extended to use the central place for
the unsolicited events of all pins, etc, and eventually include the
jack-detect kcontrols that replace the current input-jack stuff.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
(backported from commit 1835a0f9a2121ce3198dab67507d4d3e960cc09e,
Conflicts:
sound/pci/hda/patch_hdmi.c)
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
Signed-off-by: Leann Ogasawara <leann.ogasawara@canonical.com>
13 files changed:
sound/pci/hda/Makefile
sound/pci/hda/hda_codec.c
sound/pci/hda/hda_codec.h
sound/pci/hda/hda_jack.c [new file with mode: 0644]
sound/pci/hda/hda_jack.h [new file with mode: 0644]
sound/pci/hda/hda_local.h
sound/pci/hda/patch_analog.c
sound/pci/hda/patch_cirrus.c
sound/pci/hda/patch_conexant.c
sound/pci/hda/patch_hdmi.c
sound/pci/hda/patch_realtek.c
sound/pci/hda/patch_sigmatel.c
sound/pci/hda/patch_via.c