ALSA: hda - Manage unsol tags in hda_jack.c

Manage the tags assigned for unsolicited events dynamically together
with the jack-detection routines.  Basically this is almost same as what
we've done in patch_sigmatel.c.  Assign the new tag number for each new
unsol event, associate with the given NID and the action type, etc.

With this change, now all pins looked over in snd_hda_jack_add_kctls()
are actually enabled for detection now even if the pins aren't used for
jack-retasking by the driver.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Этот коммит содержится в:
Takashi Iwai
2011-10-28 01:16:55 +02:00
родитель 01a61e12b4
Коммит 3a93897ea3
8 изменённых файлов: 105 добавлений и 126 удалений

Просмотреть файл

@@ -1235,9 +1235,7 @@ static void cs_free(struct hda_codec *codec)
static void cs_unsol_event(struct hda_codec *codec, unsigned int res)
{
snd_hda_jack_set_dirty_all(codec); /* FIXME: to be more fine-grained */
switch ((res >> 26) & 0x7f) {
switch (snd_hda_jack_get_action(codec, res >> 26)) {
case HP_EVENT:
cs_automute(codec);
break;
@@ -1824,9 +1822,7 @@ static int cs421x_build_controls(struct hda_codec *codec)
static void cs421x_unsol_event(struct hda_codec *codec, unsigned int res)
{
snd_hda_jack_set_dirty_all(codec); /* FIXME: to be more fine-grained */
switch ((res >> 26) & 0x3f) {
switch (snd_hda_jack_get_action(codec, res >> 26)) {
case HP_EVENT:
case SPDIF_EVENT:
cs_automute(codec);