diff options
author | Takashi Iwai <tiwai@suse.de> | 2009-12-25 16:56:20 -0500 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2009-12-25 16:56:20 -0500 |
commit | a252c81a69c4f9a5a8782f33b91bd837e9dcd406 (patch) | |
tree | c5e3d4059540d14451790ad69a6f951e287f4e94 | |
parent | 729d55ba972348234759f8e40abf8de020f0d505 (diff) |
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>
-rw-r--r-- | sound/pci/hda/patch_sigmatel.c | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/sound/pci/hda/patch_sigmatel.c b/sound/pci/hda/patch_sigmatel.c index eeda7beeb57a..2291a8396817 100644 --- a/sound/pci/hda/patch_sigmatel.c +++ b/sound/pci/hda/patch_sigmatel.c | |||
@@ -4453,14 +4453,7 @@ static inline int get_pin_presence(struct hda_codec *codec, hda_nid_t nid) | |||
4453 | { | 4453 | { |
4454 | if (!nid) | 4454 | if (!nid) |
4455 | return 0; | 4455 | return 0; |
4456 | /* NOTE: we can't use snd_hda_jack_detect() here because STAC/IDT | 4456 | return snd_hda_jack_detect(codec, nid); |
4457 | * codecs behave wrongly when SET_PIN_SENSE is triggered, although | ||
4458 | * the pincap gives TRIG_REQ bit. | ||
4459 | */ | ||
4460 | if (snd_hda_codec_read(codec, nid, 0, AC_VERB_GET_PIN_SENSE, 0) & | ||
4461 | AC_PINSENSE_PRESENCE) | ||
4462 | return 1; | ||
4463 | return 0; | ||
4464 | } | 4457 | } |
4465 | 4458 | ||
4466 | static void stac92xx_line_out_detect(struct hda_codec *codec, | 4459 | static void stac92xx_line_out_detect(struct hda_codec *codec, |
@@ -4962,6 +4955,7 @@ static int patch_stac9200(struct hda_codec *codec) | |||
4962 | if (spec == NULL) | 4955 | if (spec == NULL) |
4963 | return -ENOMEM; | 4956 | return -ENOMEM; |
4964 | 4957 | ||
4958 | codec->no_trigger_sense = 1; | ||
4965 | codec->spec = spec; | 4959 | codec->spec = spec; |
4966 | spec->num_pins = ARRAY_SIZE(stac9200_pin_nids); | 4960 | spec->num_pins = ARRAY_SIZE(stac9200_pin_nids); |
4967 | spec->pin_nids = stac9200_pin_nids; | 4961 | spec->pin_nids = stac9200_pin_nids; |
@@ -5024,6 +5018,7 @@ static int patch_stac925x(struct hda_codec *codec) | |||
5024 | if (spec == NULL) | 5018 | if (spec == NULL) |
5025 | return -ENOMEM; | 5019 | return -ENOMEM; |
5026 | 5020 | ||
5021 | codec->no_trigger_sense = 1; | ||
5027 | codec->spec = spec; | 5022 | codec->spec = spec; |
5028 | spec->num_pins = ARRAY_SIZE(stac925x_pin_nids); | 5023 | spec->num_pins = ARRAY_SIZE(stac925x_pin_nids); |
5029 | spec->pin_nids = stac925x_pin_nids; | 5024 | spec->pin_nids = stac925x_pin_nids; |
@@ -5108,6 +5103,7 @@ static int patch_stac92hd73xx(struct hda_codec *codec) | |||
5108 | if (spec == NULL) | 5103 | if (spec == NULL) |
5109 | return -ENOMEM; | 5104 | return -ENOMEM; |
5110 | 5105 | ||
5106 | codec->no_trigger_sense = 1; | ||
5111 | codec->spec = spec; | 5107 | codec->spec = spec; |
5112 | codec->slave_dig_outs = stac92hd73xx_slave_dig_outs; | 5108 | codec->slave_dig_outs = stac92hd73xx_slave_dig_outs; |
5113 | spec->num_pins = ARRAY_SIZE(stac92hd73xx_pin_nids); | 5109 | spec->num_pins = ARRAY_SIZE(stac92hd73xx_pin_nids); |
@@ -5255,6 +5251,7 @@ static int patch_stac92hd83xxx(struct hda_codec *codec) | |||
5255 | if (spec == NULL) | 5251 | if (spec == NULL) |
5256 | return -ENOMEM; | 5252 | return -ENOMEM; |
5257 | 5253 | ||
5254 | codec->no_trigger_sense = 1; | ||
5258 | codec->spec = spec; | 5255 | codec->spec = spec; |
5259 | codec->slave_dig_outs = stac92hd83xxx_slave_dig_outs; | 5256 | codec->slave_dig_outs = stac92hd83xxx_slave_dig_outs; |
5260 | spec->digbeep_nid = 0x21; | 5257 | spec->digbeep_nid = 0x21; |
@@ -5418,6 +5415,7 @@ static int patch_stac92hd71bxx(struct hda_codec *codec) | |||
5418 | if (spec == NULL) | 5415 | if (spec == NULL) |
5419 | return -ENOMEM; | 5416 | return -ENOMEM; |
5420 | 5417 | ||
5418 | codec->no_trigger_sense = 1; | ||
5421 | codec->spec = spec; | 5419 | codec->spec = spec; |
5422 | codec->patch_ops = stac92xx_patch_ops; | 5420 | codec->patch_ops = stac92xx_patch_ops; |
5423 | spec->num_pins = STAC92HD71BXX_NUM_PINS; | 5421 | spec->num_pins = STAC92HD71BXX_NUM_PINS; |
@@ -5661,6 +5659,7 @@ static int patch_stac922x(struct hda_codec *codec) | |||
5661 | if (spec == NULL) | 5659 | if (spec == NULL) |
5662 | return -ENOMEM; | 5660 | return -ENOMEM; |
5663 | 5661 | ||
5662 | codec->no_trigger_sense = 1; | ||
5664 | codec->spec = spec; | 5663 | codec->spec = spec; |
5665 | spec->num_pins = ARRAY_SIZE(stac922x_pin_nids); | 5664 | spec->num_pins = ARRAY_SIZE(stac922x_pin_nids); |
5666 | spec->pin_nids = stac922x_pin_nids; | 5665 | spec->pin_nids = stac922x_pin_nids; |
@@ -5764,6 +5763,7 @@ static int patch_stac927x(struct hda_codec *codec) | |||
5764 | if (spec == NULL) | 5763 | if (spec == NULL) |
5765 | return -ENOMEM; | 5764 | return -ENOMEM; |
5766 | 5765 | ||
5766 | codec->no_trigger_sense = 1; | ||
5767 | codec->spec = spec; | 5767 | codec->spec = spec; |
5768 | codec->slave_dig_outs = stac927x_slave_dig_outs; | 5768 | codec->slave_dig_outs = stac927x_slave_dig_outs; |
5769 | spec->num_pins = ARRAY_SIZE(stac927x_pin_nids); | 5769 | spec->num_pins = ARRAY_SIZE(stac927x_pin_nids); |
@@ -5898,6 +5898,7 @@ static int patch_stac9205(struct hda_codec *codec) | |||
5898 | if (spec == NULL) | 5898 | if (spec == NULL) |
5899 | return -ENOMEM; | 5899 | return -ENOMEM; |
5900 | 5900 | ||
5901 | codec->no_trigger_sense = 1; | ||
5901 | codec->spec = spec; | 5902 | codec->spec = spec; |
5902 | spec->num_pins = ARRAY_SIZE(stac9205_pin_nids); | 5903 | spec->num_pins = ARRAY_SIZE(stac9205_pin_nids); |
5903 | spec->pin_nids = stac9205_pin_nids; | 5904 | spec->pin_nids = stac9205_pin_nids; |
@@ -6053,6 +6054,7 @@ static int patch_stac9872(struct hda_codec *codec) | |||
6053 | spec = kzalloc(sizeof(*spec), GFP_KERNEL); | 6054 | spec = kzalloc(sizeof(*spec), GFP_KERNEL); |
6054 | if (spec == NULL) | 6055 | if (spec == NULL) |
6055 | return -ENOMEM; | 6056 | return -ENOMEM; |
6057 | codec->no_trigger_sense = 1; | ||
6056 | codec->spec = spec; | 6058 | codec->spec = spec; |
6057 | spec->num_pins = ARRAY_SIZE(stac9872_pin_nids); | 6059 | spec->num_pins = ARRAY_SIZE(stac9872_pin_nids); |
6058 | spec->pin_nids = stac9872_pin_nids; | 6060 | spec->pin_nids = stac9872_pin_nids; |