aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci/hda/hda_codec.c
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2008-07-30 09:01:46 -0400
committerTakashi Iwai <tiwai@suse.de>2008-10-12 20:43:03 -0400
commit11aeff082ad9bd00e8475bf1630c3264344d3764 (patch)
treefc00a9f4ccaa392032f09acbbd7d460f2e4d17de /sound/pci/hda/hda_codec.c
parentd7ffba19ce4c1b153d502a89d829400bf76d6c11 (diff)
ALSA: hda - Add init_verbs entries
This patch enables the additional init verbs for each codec. The verbs can be entered via hwdep sysfs file. These verbs are executed at reconfiguring the codec for non-standard setups like overriding the pin-defcfg. Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci/hda/hda_codec.c')
-rw-r--r--sound/pci/hda/hda_codec.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/sound/pci/hda/hda_codec.c b/sound/pci/hda/hda_codec.c
index 0741eda78a5e..9a8adc600a57 100644
--- a/sound/pci/hda/hda_codec.c
+++ b/sound/pci/hda/hda_codec.c
@@ -1941,6 +1941,17 @@ static void hda_set_power_state(struct hda_codec *codec, hda_nid_t fg,
1941 } 1941 }
1942} 1942}
1943 1943
1944#ifdef CONFIG_SND_HDA_HWDEP
1945/* execute additional init verbs */
1946static void hda_exec_init_verbs(struct hda_codec *codec)
1947{
1948 if (codec->init_verbs.list)
1949 snd_hda_sequence_write(codec, codec->init_verbs.list);
1950}
1951#else
1952static inline void hda_exec_init_verbs(struct hda_codec *codec) {}
1953#endif
1954
1944#ifdef SND_HDA_NEEDS_RESUME 1955#ifdef SND_HDA_NEEDS_RESUME
1945/* 1956/*
1946 * call suspend and power-down; used both from PM and power-save 1957 * call suspend and power-down; used both from PM and power-save
@@ -1967,6 +1978,7 @@ static void hda_call_codec_resume(struct hda_codec *codec)
1967 hda_set_power_state(codec, 1978 hda_set_power_state(codec,
1968 codec->afg ? codec->afg : codec->mfg, 1979 codec->afg ? codec->afg : codec->mfg,
1969 AC_PWRST_D0); 1980 AC_PWRST_D0);
1981 hda_exec_init_verbs(codec);
1970 if (codec->patch_ops.resume) 1982 if (codec->patch_ops.resume)
1971 codec->patch_ops.resume(codec); 1983 codec->patch_ops.resume(codec);
1972 else { 1984 else {
@@ -2008,6 +2020,7 @@ int snd_hda_codec_build_controls(struct hda_codec *codec)
2008 hda_set_power_state(codec, 2020 hda_set_power_state(codec,
2009 codec->afg ? codec->afg : codec->mfg, 2021 codec->afg ? codec->afg : codec->mfg,
2010 AC_PWRST_D0); 2022 AC_PWRST_D0);
2023 hda_exec_init_verbs(codec);
2011 /* continue to initialize... */ 2024 /* continue to initialize... */
2012 if (codec->patch_ops.init) 2025 if (codec->patch_ops.init)
2013 err = codec->patch_ops.init(codec); 2026 err = codec->patch_ops.init(codec);