ALSA: hda - use snd_hda_jack_detect() again in patch_sigmatel.c

Use snd_hda_jack_detect() again for jack-sensing.
The triggering problem can be worked around with codec->no_trigger_sense
flag now.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
This commit is contained in:
Takashi Iwai 2009-12-25 22:56:20 +01:00
parent 729d55ba97
commit a252c81a69

View file

@ -4453,14 +4453,7 @@ static inline int get_pin_presence(struct hda_codec *codec, hda_nid_t nid)
{
if (!nid)
return 0;
/* NOTE: we can't use snd_hda_jack_detect() here because STAC/IDT
* codecs behave wrongly when SET_PIN_SENSE is triggered, although
* the pincap gives TRIG_REQ bit.
*/
if (snd_hda_codec_read(codec, nid, 0, AC_VERB_GET_PIN_SENSE, 0) &
AC_PINSENSE_PRESENCE)
return 1;
return 0;
return snd_hda_jack_detect(codec, nid);
}
static void stac92xx_line_out_detect(struct hda_codec *codec,
@ -4962,6 +4955,7 @@ static int patch_stac9200(struct hda_codec *codec)
if (spec == NULL)
return -ENOMEM;
codec->no_trigger_sense = 1;
codec->spec = spec;
spec->num_pins = ARRAY_SIZE(stac9200_pin_nids);
spec->pin_nids = stac9200_pin_nids;
@ -5024,6 +5018,7 @@ static int patch_stac925x(struct hda_codec *codec)
if (spec == NULL)
return -ENOMEM;
codec->no_trigger_sense = 1;
codec->spec = spec;
spec->num_pins = ARRAY_SIZE(stac925x_pin_nids);
spec->pin_nids = stac925x_pin_nids;
@ -5108,6 +5103,7 @@ static int patch_stac92hd73xx(struct hda_codec *codec)
if (spec == NULL)
return -ENOMEM;
codec->no_trigger_sense = 1;
codec->spec = spec;
codec->slave_dig_outs = stac92hd73xx_slave_dig_outs;
spec->num_pins = ARRAY_SIZE(stac92hd73xx_pin_nids);
@ -5255,6 +5251,7 @@ static int patch_stac92hd83xxx(struct hda_codec *codec)
if (spec == NULL)
return -ENOMEM;
codec->no_trigger_sense = 1;
codec->spec = spec;
codec->slave_dig_outs = stac92hd83xxx_slave_dig_outs;
spec->digbeep_nid = 0x21;
@ -5418,6 +5415,7 @@ static int patch_stac92hd71bxx(struct hda_codec *codec)
if (spec == NULL)
return -ENOMEM;
codec->no_trigger_sense = 1;
codec->spec = spec;
codec->patch_ops = stac92xx_patch_ops;
spec->num_pins = STAC92HD71BXX_NUM_PINS;
@ -5661,6 +5659,7 @@ static int patch_stac922x(struct hda_codec *codec)
if (spec == NULL)
return -ENOMEM;
codec->no_trigger_sense = 1;
codec->spec = spec;
spec->num_pins = ARRAY_SIZE(stac922x_pin_nids);
spec->pin_nids = stac922x_pin_nids;
@ -5764,6 +5763,7 @@ static int patch_stac927x(struct hda_codec *codec)
if (spec == NULL)
return -ENOMEM;
codec->no_trigger_sense = 1;
codec->spec = spec;
codec->slave_dig_outs = stac927x_slave_dig_outs;
spec->num_pins = ARRAY_SIZE(stac927x_pin_nids);
@ -5898,6 +5898,7 @@ static int patch_stac9205(struct hda_codec *codec)
if (spec == NULL)
return -ENOMEM;
codec->no_trigger_sense = 1;
codec->spec = spec;
spec->num_pins = ARRAY_SIZE(stac9205_pin_nids);
spec->pin_nids = stac9205_pin_nids;
@ -6053,6 +6054,7 @@ static int patch_stac9872(struct hda_codec *codec)
spec = kzalloc(sizeof(*spec), GFP_KERNEL);
if (spec == NULL)
return -ENOMEM;
codec->no_trigger_sense = 1;
codec->spec = spec;
spec->num_pins = ARRAY_SIZE(stac9872_pin_nids);
spec->pin_nids = stac9872_pin_nids;