aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci/hda/hda_codec.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/pci/hda/hda_codec.c')
-rw-r--r--sound/pci/hda/hda_codec.c40
1 files changed, 3 insertions, 37 deletions
diff --git a/sound/pci/hda/hda_codec.c b/sound/pci/hda/hda_codec.c
index c6ff9b9de553..8217ff7ff7b5 100644
--- a/sound/pci/hda/hda_codec.c
+++ b/sound/pci/hda/hda_codec.c
@@ -33,6 +33,7 @@
33#include <sound/jack.h> 33#include <sound/jack.h>
34#include "hda_local.h" 34#include "hda_local.h"
35#include "hda_beep.h" 35#include "hda_beep.h"
36#include "hda_jack.h"
36#include <sound/hda_hwdep.h> 37#include <sound/hda_hwdep.h>
37 38
38#define CREATE_TRACE_POINTS 39#define CREATE_TRACE_POINTS
@@ -1723,43 +1724,6 @@ int snd_hda_override_pin_caps(struct hda_codec *codec, hda_nid_t nid,
1723} 1724}
1724EXPORT_SYMBOL_HDA(snd_hda_override_pin_caps); 1725EXPORT_SYMBOL_HDA(snd_hda_override_pin_caps);
1725 1726
1726/**
1727 * snd_hda_pin_sense - execute pin sense measurement
1728 * @codec: the CODEC to sense
1729 * @nid: the pin NID to sense
1730 *
1731 * Execute necessary pin sense measurement and return its Presence Detect,
1732 * Impedance, ELD Valid etc. status bits.
1733 */
1734u32 snd_hda_pin_sense(struct hda_codec *codec, hda_nid_t nid)
1735{
1736 u32 pincap;
1737
1738 if (!codec->no_trigger_sense) {
1739 pincap = snd_hda_query_pin_caps(codec, nid);
1740 if (pincap & AC_PINCAP_TRIG_REQ) /* need trigger? */
1741 snd_hda_codec_read(codec, nid, 0,
1742 AC_VERB_SET_PIN_SENSE, 0);
1743 }
1744 return snd_hda_codec_read(codec, nid, 0,
1745 AC_VERB_GET_PIN_SENSE, 0);
1746}
1747EXPORT_SYMBOL_HDA(snd_hda_pin_sense);
1748
1749/**
1750 * snd_hda_jack_detect - query pin Presence Detect status
1751 * @codec: the CODEC to sense
1752 * @nid: the pin NID to sense
1753 *
1754 * Query and return the pin's Presence Detect status.
1755 */
1756int snd_hda_jack_detect(struct hda_codec *codec, hda_nid_t nid)
1757{
1758 u32 sense = snd_hda_pin_sense(codec, nid);
1759 return !!(sense & AC_PINSENSE_PRESENCE);
1760}
1761EXPORT_SYMBOL_HDA(snd_hda_jack_detect);
1762
1763/* 1727/*
1764 * read the current volume to info 1728 * read the current volume to info
1765 * if the cache exists, read the cache value. 1729 * if the cache exists, read the cache value.
@@ -2308,6 +2272,7 @@ int snd_hda_codec_reset(struct hda_codec *codec)
2308 } 2272 }
2309 if (codec->patch_ops.free) 2273 if (codec->patch_ops.free)
2310 codec->patch_ops.free(codec); 2274 codec->patch_ops.free(codec);
2275 snd_hda_jack_tbl_clear(codec);
2311 codec->proc_widget_hook = NULL; 2276 codec->proc_widget_hook = NULL;
2312 codec->spec = NULL; 2277 codec->spec = NULL;
2313 free_hda_cache(&codec->amp_cache); 2278 free_hda_cache(&codec->amp_cache);
@@ -3364,6 +3329,7 @@ static void hda_call_codec_resume(struct hda_codec *codec)
3364 restore_pincfgs(codec); /* restore all current pin configs */ 3329 restore_pincfgs(codec); /* restore all current pin configs */
3365 restore_shutup_pins(codec); 3330 restore_shutup_pins(codec);
3366 hda_exec_init_verbs(codec); 3331 hda_exec_init_verbs(codec);
3332 snd_hda_jack_set_dirty_all(codec);
3367 if (codec->patch_ops.resume) 3333 if (codec->patch_ops.resume)
3368 codec->patch_ops.resume(codec); 3334 codec->patch_ops.resume(codec);
3369 else { 3335 else {