diff options
author | Takashi Iwai <tiwai@suse.de> | 2009-12-25 16:49:01 -0500 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2009-12-25 16:49:01 -0500 |
commit | 729d55ba972348234759f8e40abf8de020f0d505 (patch) | |
tree | 3550e86c5937ec88033932782fafda7f631ffe3c | |
parent | ef18beded8ddbaafdf4914bab209f77e60ae3a18 (diff) |
ALSA: hda - Disable tigger at pin-sensing on AD codecs
Analog Device codecs seem to have problems with the triggering of
pin-sensing although their pincaps give the trigger requirements.
Some reported that constant CPU load on HP laptops with AD codecs.
For avoiding this regression, add a flag to codec struct to notify
explicitly that the codec doesn't suppot the trigger at pin-sensing.
Tested-by: Maciej Rutecki <maciej.rutecki@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
-rw-r--r-- | sound/pci/hda/hda_codec.c | 10 | ||||
-rw-r--r-- | sound/pci/hda/hda_codec.h | 1 | ||||
-rw-r--r-- | sound/pci/hda/patch_analog.c | 16 |
3 files changed, 23 insertions, 4 deletions
diff --git a/sound/pci/hda/hda_codec.c b/sound/pci/hda/hda_codec.c index 950ee5cfcacf..f98b47cd6cfb 100644 --- a/sound/pci/hda/hda_codec.c +++ b/sound/pci/hda/hda_codec.c | |||
@@ -1327,11 +1327,13 @@ EXPORT_SYMBOL_HDA(snd_hda_query_pin_caps); | |||
1327 | */ | 1327 | */ |
1328 | u32 snd_hda_pin_sense(struct hda_codec *codec, hda_nid_t nid) | 1328 | u32 snd_hda_pin_sense(struct hda_codec *codec, hda_nid_t nid) |
1329 | { | 1329 | { |
1330 | u32 pincap = snd_hda_query_pin_caps(codec, nid); | 1330 | u32 pincap; |
1331 | |||
1332 | if (pincap & AC_PINCAP_TRIG_REQ) /* need trigger? */ | ||
1333 | snd_hda_codec_read(codec, nid, 0, AC_VERB_SET_PIN_SENSE, 0); | ||
1334 | 1331 | ||
1332 | if (!codec->no_trigger_sense) { | ||
1333 | pincap = snd_hda_query_pin_caps(codec, nid); | ||
1334 | if (pincap & AC_PINCAP_TRIG_REQ) /* need trigger? */ | ||
1335 | snd_hda_codec_read(codec, nid, 0, AC_VERB_SET_PIN_SENSE, 0); | ||
1336 | } | ||
1335 | return snd_hda_codec_read(codec, nid, 0, | 1337 | return snd_hda_codec_read(codec, nid, 0, |
1336 | AC_VERB_GET_PIN_SENSE, 0); | 1338 | AC_VERB_GET_PIN_SENSE, 0); |
1337 | } | 1339 | } |
diff --git a/sound/pci/hda/hda_codec.h b/sound/pci/hda/hda_codec.h index 1d541b7f5547..0a770a28e71f 100644 --- a/sound/pci/hda/hda_codec.h +++ b/sound/pci/hda/hda_codec.h | |||
@@ -817,6 +817,7 @@ struct hda_codec { | |||
817 | unsigned int pin_amp_workaround:1; /* pin out-amp takes index | 817 | unsigned int pin_amp_workaround:1; /* pin out-amp takes index |
818 | * (e.g. Conexant codecs) | 818 | * (e.g. Conexant codecs) |
819 | */ | 819 | */ |
820 | unsigned int no_trigger_sense:1; /* don't trigger at pin-sensing */ | ||
820 | #ifdef CONFIG_SND_HDA_POWER_SAVE | 821 | #ifdef CONFIG_SND_HDA_POWER_SAVE |
821 | unsigned int power_on :1; /* current (global) power-state */ | 822 | unsigned int power_on :1; /* current (global) power-state */ |
822 | unsigned int power_transition :1; /* power-state in transition */ | 823 | unsigned int power_transition :1; /* power-state in transition */ |
diff --git a/sound/pci/hda/patch_analog.c b/sound/pci/hda/patch_analog.c index 1a36137e13ec..69a941c7b158 100644 --- a/sound/pci/hda/patch_analog.c +++ b/sound/pci/hda/patch_analog.c | |||
@@ -1186,6 +1186,8 @@ static int patch_ad1986a(struct hda_codec *codec) | |||
1186 | */ | 1186 | */ |
1187 | spec->multiout.no_share_stream = 1; | 1187 | spec->multiout.no_share_stream = 1; |
1188 | 1188 | ||
1189 | codec->no_trigger_sense = 1; | ||
1190 | |||
1189 | return 0; | 1191 | return 0; |
1190 | } | 1192 | } |
1191 | 1193 | ||
@@ -1371,6 +1373,8 @@ static int patch_ad1983(struct hda_codec *codec) | |||
1371 | 1373 | ||
1372 | codec->patch_ops = ad198x_patch_ops; | 1374 | codec->patch_ops = ad198x_patch_ops; |
1373 | 1375 | ||
1376 | codec->no_trigger_sense = 1; | ||
1377 | |||
1374 | return 0; | 1378 | return 0; |
1375 | } | 1379 | } |
1376 | 1380 | ||
@@ -1813,6 +1817,9 @@ static int patch_ad1981(struct hda_codec *codec) | |||
1813 | codec->patch_ops.unsol_event = ad1981_hp_unsol_event; | 1817 | codec->patch_ops.unsol_event = ad1981_hp_unsol_event; |
1814 | break; | 1818 | break; |
1815 | } | 1819 | } |
1820 | |||
1821 | codec->no_trigger_sense = 1; | ||
1822 | |||
1816 | return 0; | 1823 | return 0; |
1817 | } | 1824 | } |
1818 | 1825 | ||
@@ -3118,6 +3125,8 @@ static int patch_ad1988(struct hda_codec *codec) | |||
3118 | #endif | 3125 | #endif |
3119 | spec->vmaster_nid = 0x04; | 3126 | spec->vmaster_nid = 0x04; |
3120 | 3127 | ||
3128 | codec->no_trigger_sense = 1; | ||
3129 | |||
3121 | return 0; | 3130 | return 0; |
3122 | } | 3131 | } |
3123 | 3132 | ||
@@ -3330,6 +3339,8 @@ static int patch_ad1884(struct hda_codec *codec) | |||
3330 | 3339 | ||
3331 | codec->patch_ops = ad198x_patch_ops; | 3340 | codec->patch_ops = ad198x_patch_ops; |
3332 | 3341 | ||
3342 | codec->no_trigger_sense = 1; | ||
3343 | |||
3333 | return 0; | 3344 | return 0; |
3334 | } | 3345 | } |
3335 | 3346 | ||
@@ -4287,6 +4298,8 @@ static int patch_ad1884a(struct hda_codec *codec) | |||
4287 | break; | 4298 | break; |
4288 | } | 4299 | } |
4289 | 4300 | ||
4301 | codec->no_trigger_sense = 1; | ||
4302 | |||
4290 | return 0; | 4303 | return 0; |
4291 | } | 4304 | } |
4292 | 4305 | ||
@@ -4623,6 +4636,9 @@ static int patch_ad1882(struct hda_codec *codec) | |||
4623 | spec->mixers[2] = ad1882_6stack_mixers; | 4636 | spec->mixers[2] = ad1882_6stack_mixers; |
4624 | break; | 4637 | break; |
4625 | } | 4638 | } |
4639 | |||
4640 | codec->no_trigger_sense = 1; | ||
4641 | |||
4626 | return 0; | 4642 | return 0; |
4627 | } | 4643 | } |
4628 | 4644 | ||