Commit a252c81a authored by Takashi Iwai's avatar Takashi Iwai

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: default avatarTakashi Iwai <tiwai@suse.de>
parent 729d55ba
...@@ -4453,14 +4453,7 @@ static inline int get_pin_presence(struct hda_codec *codec, hda_nid_t nid) ...@@ -4453,14 +4453,7 @@ static inline int get_pin_presence(struct hda_codec *codec, hda_nid_t nid)
{ {
if (!nid) if (!nid)
return 0; return 0;
/* NOTE: we can't use snd_hda_jack_detect() here because STAC/IDT return snd_hda_jack_detect(codec, nid);
* 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;
} }
static void stac92xx_line_out_detect(struct hda_codec *codec, static void stac92xx_line_out_detect(struct hda_codec *codec,
...@@ -4962,6 +4955,7 @@ static int patch_stac9200(struct hda_codec *codec) ...@@ -4962,6 +4955,7 @@ static int patch_stac9200(struct hda_codec *codec)
if (spec == NULL) if (spec == NULL)
return -ENOMEM; return -ENOMEM;
codec->no_trigger_sense = 1;
codec->spec = spec; codec->spec = spec;
spec->num_pins = ARRAY_SIZE(stac9200_pin_nids); spec->num_pins = ARRAY_SIZE(stac9200_pin_nids);
spec->pin_nids = stac9200_pin_nids; spec->pin_nids = stac9200_pin_nids;
...@@ -5024,6 +5018,7 @@ static int patch_stac925x(struct hda_codec *codec) ...@@ -5024,6 +5018,7 @@ static int patch_stac925x(struct hda_codec *codec)
if (spec == NULL) if (spec == NULL)
return -ENOMEM; return -ENOMEM;
codec->no_trigger_sense = 1;
codec->spec = spec; codec->spec = spec;
spec->num_pins = ARRAY_SIZE(stac925x_pin_nids); spec->num_pins = ARRAY_SIZE(stac925x_pin_nids);
spec->pin_nids = stac925x_pin_nids; spec->pin_nids = stac925x_pin_nids;
...@@ -5108,6 +5103,7 @@ static int patch_stac92hd73xx(struct hda_codec *codec) ...@@ -5108,6 +5103,7 @@ static int patch_stac92hd73xx(struct hda_codec *codec)
if (spec == NULL) if (spec == NULL)
return -ENOMEM; return -ENOMEM;
codec->no_trigger_sense = 1;
codec->spec = spec; codec->spec = spec;
codec->slave_dig_outs = stac92hd73xx_slave_dig_outs; codec->slave_dig_outs = stac92hd73xx_slave_dig_outs;
spec->num_pins = ARRAY_SIZE(stac92hd73xx_pin_nids); spec->num_pins = ARRAY_SIZE(stac92hd73xx_pin_nids);
...@@ -5255,6 +5251,7 @@ static int patch_stac92hd83xxx(struct hda_codec *codec) ...@@ -5255,6 +5251,7 @@ static int patch_stac92hd83xxx(struct hda_codec *codec)
if (spec == NULL) if (spec == NULL)
return -ENOMEM; return -ENOMEM;
codec->no_trigger_sense = 1;
codec->spec = spec; codec->spec = spec;
codec->slave_dig_outs = stac92hd83xxx_slave_dig_outs; codec->slave_dig_outs = stac92hd83xxx_slave_dig_outs;
spec->digbeep_nid = 0x21; spec->digbeep_nid = 0x21;
...@@ -5418,6 +5415,7 @@ static int patch_stac92hd71bxx(struct hda_codec *codec) ...@@ -5418,6 +5415,7 @@ static int patch_stac92hd71bxx(struct hda_codec *codec)
if (spec == NULL) if (spec == NULL)
return -ENOMEM; return -ENOMEM;
codec->no_trigger_sense = 1;
codec->spec = spec; codec->spec = spec;
codec->patch_ops = stac92xx_patch_ops; codec->patch_ops = stac92xx_patch_ops;
spec->num_pins = STAC92HD71BXX_NUM_PINS; spec->num_pins = STAC92HD71BXX_NUM_PINS;
...@@ -5661,6 +5659,7 @@ static int patch_stac922x(struct hda_codec *codec) ...@@ -5661,6 +5659,7 @@ static int patch_stac922x(struct hda_codec *codec)
if (spec == NULL) if (spec == NULL)
return -ENOMEM; return -ENOMEM;
codec->no_trigger_sense = 1;
codec->spec = spec; codec->spec = spec;
spec->num_pins = ARRAY_SIZE(stac922x_pin_nids); spec->num_pins = ARRAY_SIZE(stac922x_pin_nids);
spec->pin_nids = stac922x_pin_nids; spec->pin_nids = stac922x_pin_nids;
...@@ -5764,6 +5763,7 @@ static int patch_stac927x(struct hda_codec *codec) ...@@ -5764,6 +5763,7 @@ static int patch_stac927x(struct hda_codec *codec)
if (spec == NULL) if (spec == NULL)
return -ENOMEM; return -ENOMEM;
codec->no_trigger_sense = 1;
codec->spec = spec; codec->spec = spec;
codec->slave_dig_outs = stac927x_slave_dig_outs; codec->slave_dig_outs = stac927x_slave_dig_outs;
spec->num_pins = ARRAY_SIZE(stac927x_pin_nids); spec->num_pins = ARRAY_SIZE(stac927x_pin_nids);
...@@ -5898,6 +5898,7 @@ static int patch_stac9205(struct hda_codec *codec) ...@@ -5898,6 +5898,7 @@ static int patch_stac9205(struct hda_codec *codec)
if (spec == NULL) if (spec == NULL)
return -ENOMEM; return -ENOMEM;
codec->no_trigger_sense = 1;
codec->spec = spec; codec->spec = spec;
spec->num_pins = ARRAY_SIZE(stac9205_pin_nids); spec->num_pins = ARRAY_SIZE(stac9205_pin_nids);
spec->pin_nids = stac9205_pin_nids; spec->pin_nids = stac9205_pin_nids;
...@@ -6053,6 +6054,7 @@ static int patch_stac9872(struct hda_codec *codec) ...@@ -6053,6 +6054,7 @@ static int patch_stac9872(struct hda_codec *codec)
spec = kzalloc(sizeof(*spec), GFP_KERNEL); spec = kzalloc(sizeof(*spec), GFP_KERNEL);
if (spec == NULL) if (spec == NULL)
return -ENOMEM; return -ENOMEM;
codec->no_trigger_sense = 1;
codec->spec = spec; codec->spec = spec;
spec->num_pins = ARRAY_SIZE(stac9872_pin_nids); spec->num_pins = ARRAY_SIZE(stac9872_pin_nids);
spec->pin_nids = stac9872_pin_nids; spec->pin_nids = stac9872_pin_nids;
......
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