aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci/hda/patch_realtek.c
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2007-08-10 11:21:45 -0400
committerJaroslav Kysela <perex@perex.cz>2007-10-16 09:58:46 -0400
commitcb53c626e1145edf1d619bc4953f6293d3a77ace (patch)
tree715c2ef3d56a5ac7c79498800e888f562c1aa961 /sound/pci/hda/patch_realtek.c
parentcca3b3718ca96dca51daf1129ac03003bcede751 (diff)
[ALSA] hda-intel - Add POWER_SAVE option
Added CONFIG_SND_HDA_POWER_SAVE kconfig. It's an experimental option to achieve an aggressive power-saving. With this option, the driver will turn on/off the power of each codec and controller chip dynamically on demand. The patch introduces a new module option 'power_save'. It specifies the second of time-out for automatic power-down. As default, it's 10 seconds. Setting 0 means to suppress the power-saving feature. The codec may have analog-input loopbacks, which are usually represented by mixer elements such as 'Mic Playback Switch' or 'CD Playback Switch'. When these are on, we cannot turn off the mixer and the codec chip has to be kept on. For bookkeeping these states, a new codec-callback is introduced. For the bus-controller side, a new callback pm_notify is introduced, which can be used to turn on/off the contoller appropriately. Note that this power-saving might cause slight click-noise at power-on/off. Also, it might take some time to wake up the codec, and might even drop some tones at the very beginning. This seems to be the side-effect of turning off the controller chip. This turn-off of the controller can be disabled by undefining HDA_POWER_SAVE_RESET_CONTOLLER in hda_intel.c. Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Jaroslav Kysela <perex@suse.cz>
Diffstat (limited to 'sound/pci/hda/patch_realtek.c')
-rw-r--r--sound/pci/hda/patch_realtek.c307
1 files changed, 215 insertions, 92 deletions
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
index ebbabeb32930..b3d3916c8eca 100644
--- a/sound/pci/hda/patch_realtek.c
+++ b/sound/pci/hda/patch_realtek.c
@@ -240,6 +240,10 @@ struct alc_spec {
240 /* for pin sensing */ 240 /* for pin sensing */
241 unsigned int sense_updated: 1; 241 unsigned int sense_updated: 1;
242 unsigned int jack_present: 1; 242 unsigned int jack_present: 1;
243
244#ifdef CONFIG_SND_HDA_POWER_SAVE
245 struct hda_loopback_check loopback;
246#endif
243}; 247};
244 248
245/* 249/*
@@ -264,6 +268,9 @@ struct alc_config_preset {
264 const struct hda_input_mux *input_mux; 268 const struct hda_input_mux *input_mux;
265 void (*unsol_event)(struct hda_codec *, unsigned int); 269 void (*unsol_event)(struct hda_codec *, unsigned int);
266 void (*init_hook)(struct hda_codec *); 270 void (*init_hook)(struct hda_codec *);
271#ifdef CONFIG_SND_HDA_POWER_SAVE
272 struct hda_amp_list *loopbacks;
273#endif
267}; 274};
268 275
269 276
@@ -621,6 +628,9 @@ static void setup_preset(struct alc_spec *spec,
621 628
622 spec->unsol_event = preset->unsol_event; 629 spec->unsol_event = preset->unsol_event;
623 spec->init_hook = preset->init_hook; 630 spec->init_hook = preset->init_hook;
631#ifdef CONFIG_SND_HDA_POWER_SAVE
632 spec->loopback.amplist = preset->loopbacks;
633#endif
624} 634}
625 635
626/* Enable GPIO mask and set output */ 636/* Enable GPIO mask and set output */
@@ -1287,11 +1297,13 @@ static struct hda_verb alc880_volume_init_verbs[] = {
1287 * panel mic (mic 2) 1297 * panel mic (mic 2)
1288 */ 1298 */
1289 /* Amp Indices: Mic1 = 0, Mic2 = 1, Line1 = 2, Line2 = 3, CD = 4 */ 1299 /* Amp Indices: Mic1 = 0, Mic2 = 1, Line1 = 2, Line2 = 3, CD = 4 */
1290 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)}, 1300 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
1291 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)}, 1301 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)},
1292 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(2)}, 1302 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(2)},
1293 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(3)}, 1303 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(3)},
1294 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(4)}, 1304 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(4)},
1305 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(6)},
1306 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(7)},
1295 1307
1296 /* 1308 /*
1297 * Set up output mixers (0x0c - 0x0f) 1309 * Set up output mixers (0x0c - 0x0f)
@@ -1836,8 +1848,8 @@ static struct hda_verb alc880_lg_init_verbs[] = {
1836 {0x09, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)}, 1848 {0x09, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)},
1837 /* mute all amp mixer inputs */ 1849 /* mute all amp mixer inputs */
1838 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(5)}, 1850 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(5)},
1839 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(6)}, 1851 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(6)},
1840 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(7)}, 1852 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(7)},
1841 /* line-in to input */ 1853 /* line-in to input */
1842 {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN}, 1854 {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN},
1843 {0x14, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE}, 1855 {0x14, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
@@ -1939,7 +1951,7 @@ static struct hda_verb alc880_lg_lw_init_verbs[] = {
1939 {0x07, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)}, 1951 {0x07, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
1940 {0x08, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)}, 1952 {0x08, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
1941 {0x09, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)}, 1953 {0x09, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
1942 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(7)}, 1954 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(7)},
1943 /* speaker-out */ 1955 /* speaker-out */
1944 {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP}, 1956 {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP},
1945 {0x14, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE}, 1957 {0x14, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
@@ -1979,6 +1991,24 @@ static void alc880_lg_lw_unsol_event(struct hda_codec *codec, unsigned int res)
1979 alc880_lg_lw_automute(codec); 1991 alc880_lg_lw_automute(codec);
1980} 1992}
1981 1993
1994#ifdef CONFIG_SND_HDA_POWER_SAVE
1995static struct hda_amp_list alc880_loopbacks[] = {
1996 { 0x0b, HDA_INPUT, 0 },
1997 { 0x0b, HDA_INPUT, 1 },
1998 { 0x0b, HDA_INPUT, 2 },
1999 { 0x0b, HDA_INPUT, 3 },
2000 { 0x0b, HDA_INPUT, 4 },
2001 { } /* end */
2002};
2003
2004static struct hda_amp_list alc880_lg_loopbacks[] = {
2005 { 0x0b, HDA_INPUT, 1 },
2006 { 0x0b, HDA_INPUT, 6 },
2007 { 0x0b, HDA_INPUT, 7 },
2008 { } /* end */
2009};
2010#endif
2011
1982/* 2012/*
1983 * Common callbacks 2013 * Common callbacks
1984 */ 2014 */
@@ -2005,6 +2035,14 @@ static void alc_unsol_event(struct hda_codec *codec, unsigned int res)
2005 spec->unsol_event(codec, res); 2035 spec->unsol_event(codec, res);
2006} 2036}
2007 2037
2038#ifdef CONFIG_SND_HDA_POWER_SAVE
2039static int alc_check_power_status(struct hda_codec *codec, hda_nid_t nid)
2040{
2041 struct alc_spec *spec = codec->spec;
2042 return snd_hda_check_amp_list_power(codec, &spec->loopback, nid);
2043}
2044#endif
2045
2008/* 2046/*
2009 * Analog playback callbacks 2047 * Analog playback callbacks
2010 */ 2048 */
@@ -2236,6 +2274,9 @@ static struct hda_codec_ops alc_patch_ops = {
2236 .init = alc_init, 2274 .init = alc_init,
2237 .free = alc_free, 2275 .free = alc_free,
2238 .unsol_event = alc_unsol_event, 2276 .unsol_event = alc_unsol_event,
2277#ifdef CONFIG_SND_HDA_POWER_SAVE
2278 .check_power_status = alc_check_power_status,
2279#endif
2239}; 2280};
2240 2281
2241 2282
@@ -2860,6 +2901,9 @@ static struct alc_config_preset alc880_presets[] = {
2860 .input_mux = &alc880_lg_capture_source, 2901 .input_mux = &alc880_lg_capture_source,
2861 .unsol_event = alc880_lg_unsol_event, 2902 .unsol_event = alc880_lg_unsol_event,
2862 .init_hook = alc880_lg_automute, 2903 .init_hook = alc880_lg_automute,
2904#ifdef CONFIG_SND_HDA_POWER_SAVE
2905 .loopbacks = alc880_lg_loopbacks,
2906#endif
2863 }, 2907 },
2864 [ALC880_LG_LW] = { 2908 [ALC880_LG_LW] = {
2865 .mixers = { alc880_lg_lw_mixer }, 2909 .mixers = { alc880_lg_lw_mixer },
@@ -3343,6 +3387,10 @@ static int patch_alc880(struct hda_codec *codec)
3343 codec->patch_ops = alc_patch_ops; 3387 codec->patch_ops = alc_patch_ops;
3344 if (board_config == ALC880_AUTO) 3388 if (board_config == ALC880_AUTO)
3345 spec->init_hook = alc880_auto_init; 3389 spec->init_hook = alc880_auto_init;
3390#ifdef CONFIG_SND_HDA_POWER_SAVE
3391 if (!spec->loopback.amplist)
3392 spec->loopback.amplist = alc880_loopbacks;
3393#endif
3346 3394
3347 return 0; 3395 return 0;
3348} 3396}
@@ -3691,12 +3739,12 @@ static struct hda_verb alc260_init_verbs[] = {
3691 /* Amp Indexes: CD = 0x04, Line In 1 = 0x02, Mic 1 = 0x00 & 3739 /* Amp Indexes: CD = 0x04, Line In 1 = 0x02, Mic 1 = 0x00 &
3692 * Line In 2 = 0x03 3740 * Line In 2 = 0x03
3693 */ 3741 */
3694 /* mute CD */ 3742 /* mute analog inputs */
3695 {0x07, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(4)}, 3743 {0x07, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
3696 /* mute Line In */ 3744 {0x07, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)},
3697 {0x07, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(2)}, 3745 {0x07, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(2)},
3698 /* mute Mic */ 3746 {0x07, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(3)},
3699 {0x07, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)}, 3747 {0x07, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(4)},
3700 /* Amp Indexes: DAC = 0x01 & mixer = 0x00 */ 3748 /* Amp Indexes: DAC = 0x01 & mixer = 0x00 */
3701 /* mute Front out path */ 3749 /* mute Front out path */
3702 {0x08, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)}, 3750 {0x08, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
@@ -3741,12 +3789,12 @@ static struct hda_verb alc260_hp_init_verbs[] = {
3741 /* Amp Indexes: CD = 0x04, Line In 1 = 0x02, Mic 1 = 0x00 & 3789 /* Amp Indexes: CD = 0x04, Line In 1 = 0x02, Mic 1 = 0x00 &
3742 * Line In 2 = 0x03 3790 * Line In 2 = 0x03
3743 */ 3791 */
3744 /* unmute CD */ 3792 /* mute analog inputs */
3745 {0x07, AC_VERB_SET_AMP_GAIN_MUTE, (0x7000 | (0x04 << 8))}, 3793 {0x07, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
3746 /* unmute Line In */ 3794 {0x07, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)},
3747 {0x07, AC_VERB_SET_AMP_GAIN_MUTE, (0x7000 | (0x02 << 8))}, 3795 {0x07, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(2)},
3748 /* unmute Mic */ 3796 {0x07, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(3)},
3749 {0x07, AC_VERB_SET_AMP_GAIN_MUTE, (0x7000 | (0x00 << 8))}, 3797 {0x07, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(4)},
3750 /* Amp Indexes: DAC = 0x01 & mixer = 0x00 */ 3798 /* Amp Indexes: DAC = 0x01 & mixer = 0x00 */
3751 /* Unmute Front out path */ 3799 /* Unmute Front out path */
3752 {0x08, AC_VERB_SET_AMP_GAIN_MUTE, (0x7000 | (0x00 << 8))}, 3800 {0x08, AC_VERB_SET_AMP_GAIN_MUTE, (0x7000 | (0x00 << 8))},
@@ -3791,12 +3839,12 @@ static struct hda_verb alc260_hp_3013_init_verbs[] = {
3791 /* Amp Indexes: CD = 0x04, Line In 1 = 0x02, Mic 1 = 0x00 & 3839 /* Amp Indexes: CD = 0x04, Line In 1 = 0x02, Mic 1 = 0x00 &
3792 * Line In 2 = 0x03 3840 * Line In 2 = 0x03
3793 */ 3841 */
3794 /* unmute CD */ 3842 /* mute analog inputs */
3795 {0x07, AC_VERB_SET_AMP_GAIN_MUTE, (0x7000 | (0x04 << 8))}, 3843 {0x07, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
3796 /* unmute Line In */ 3844 {0x07, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)},
3797 {0x07, AC_VERB_SET_AMP_GAIN_MUTE, (0x7000 | (0x02 << 8))}, 3845 {0x07, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(2)},
3798 /* unmute Mic */ 3846 {0x07, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(3)},
3799 {0x07, AC_VERB_SET_AMP_GAIN_MUTE, (0x7000 | (0x00 << 8))}, 3847 {0x07, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(4)},
3800 /* Amp Indexes: DAC = 0x01 & mixer = 0x00 */ 3848 /* Amp Indexes: DAC = 0x01 & mixer = 0x00 */
3801 /* Unmute Front out path */ 3849 /* Unmute Front out path */
3802 {0x08, AC_VERB_SET_AMP_GAIN_MUTE, (0x7000 | (0x00 << 8))}, 3850 {0x08, AC_VERB_SET_AMP_GAIN_MUTE, (0x7000 | (0x00 << 8))},
@@ -4418,11 +4466,12 @@ static struct hda_verb alc260_volume_init_verbs[] = {
4418 * front panel mic (mic 2) 4466 * front panel mic (mic 2)
4419 */ 4467 */
4420 /* Amp Indices: Mic1 = 0, Mic2 = 1, Line1 = 2, Line2 = 3, CD = 4 */ 4468 /* Amp Indices: Mic1 = 0, Mic2 = 1, Line1 = 2, Line2 = 3, CD = 4 */
4421 {0x07, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)}, 4469 /* mute analog inputs */
4422 {0x07, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)}, 4470 {0x07, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
4423 {0x07, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(2)}, 4471 {0x07, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)},
4424 {0x07, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(3)}, 4472 {0x07, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(2)},
4425 {0x07, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(4)}, 4473 {0x07, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(3)},
4474 {0x07, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(4)},
4426 4475
4427 /* 4476 /*
4428 * Set up output mixers (0x08 - 0x0a) 4477 * Set up output mixers (0x08 - 0x0a)
@@ -4499,6 +4548,17 @@ static void alc260_auto_init(struct hda_codec *codec)
4499 alc260_auto_init_analog_input(codec); 4548 alc260_auto_init_analog_input(codec);
4500} 4549}
4501 4550
4551#ifdef CONFIG_SND_HDA_POWER_SAVE
4552static struct hda_amp_list alc260_loopbacks[] = {
4553 { 0x07, HDA_INPUT, 0 },
4554 { 0x07, HDA_INPUT, 1 },
4555 { 0x07, HDA_INPUT, 2 },
4556 { 0x07, HDA_INPUT, 3 },
4557 { 0x07, HDA_INPUT, 4 },
4558 { } /* end */
4559};
4560#endif
4561
4502/* 4562/*
4503 * ALC260 configurations 4563 * ALC260 configurations
4504 */ 4564 */
@@ -4698,6 +4758,10 @@ static int patch_alc260(struct hda_codec *codec)
4698 codec->patch_ops = alc_patch_ops; 4758 codec->patch_ops = alc_patch_ops;
4699 if (board_config == ALC260_AUTO) 4759 if (board_config == ALC260_AUTO)
4700 spec->init_hook = alc260_auto_init; 4760 spec->init_hook = alc260_auto_init;
4761#ifdef CONFIG_SND_HDA_POWER_SAVE
4762 if (!spec->loopback.amplist)
4763 spec->loopback.amplist = alc260_loopbacks;
4764#endif
4701 4765
4702 return 0; 4766 return 0;
4703} 4767}
@@ -5223,17 +5287,17 @@ static struct hda_verb alc882_auto_init_verbs[] = {
5223 {0x09, AC_VERB_SET_CONNECT_SEL, 0x00}, 5287 {0x09, AC_VERB_SET_CONNECT_SEL, 0x00},
5224 {0x09, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)}, 5288 {0x09, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
5225 5289
5226 /* Unmute input amps (CD, Line In, Mic 1 & Mic 2) of the analog-loopback 5290 /* Mute input amps (CD, Line In, Mic 1 & Mic 2) of the analog-loopback
5227 * mixer widget 5291 * mixer widget
5228 * Note: PASD motherboards uses the Line In 2 as the input for 5292 * Note: PASD motherboards uses the Line In 2 as the input for
5229 * front panel mic (mic 2) 5293 * front panel mic (mic 2)
5230 */ 5294 */
5231 /* Amp Indices: Mic1 = 0, Mic2 = 1, Line1 = 2, Line2 = 3, CD = 4 */ 5295 /* Amp Indices: Mic1 = 0, Mic2 = 1, Line1 = 2, Line2 = 3, CD = 4 */
5232 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)}, 5296 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
5233 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)}, 5297 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)},
5234 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(2)}, 5298 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(2)},
5235 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(3)}, 5299 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(3)},
5236 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(4)}, 5300 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(4)},
5237 5301
5238 /* 5302 /*
5239 * Set up output mixers (0x0c - 0x0f) 5303 * Set up output mixers (0x0c - 0x0f)
@@ -5322,6 +5386,10 @@ static struct snd_kcontrol_new alc882_capture_mixer[] = {
5322 { } /* end */ 5386 { } /* end */
5323}; 5387};
5324 5388
5389#ifdef CONFIG_SND_HDA_POWER_SAVE
5390#define alc882_loopbacks alc880_loopbacks
5391#endif
5392
5325/* pcm configuration: identiacal with ALC880 */ 5393/* pcm configuration: identiacal with ALC880 */
5326#define alc882_pcm_analog_playback alc880_pcm_analog_playback 5394#define alc882_pcm_analog_playback alc880_pcm_analog_playback
5327#define alc882_pcm_analog_capture alc880_pcm_analog_capture 5395#define alc882_pcm_analog_capture alc880_pcm_analog_capture
@@ -5659,6 +5727,10 @@ static int patch_alc882(struct hda_codec *codec)
5659 codec->patch_ops = alc_patch_ops; 5727 codec->patch_ops = alc_patch_ops;
5660 if (board_config == ALC882_AUTO) 5728 if (board_config == ALC882_AUTO)
5661 spec->init_hook = alc882_auto_init; 5729 spec->init_hook = alc882_auto_init;
5730#ifdef CONFIG_SND_HDA_POWER_SAVE
5731 if (!spec->loopback.amplist)
5732 spec->loopback.amplist = alc882_loopbacks;
5733#endif
5662 5734
5663 return 0; 5735 return 0;
5664} 5736}
@@ -6242,11 +6314,12 @@ static struct hda_verb alc883_init_verbs[] = {
6242 {0x0f, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)}, 6314 {0x0f, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
6243 {0x0f, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)}, 6315 {0x0f, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)},
6244 6316
6245 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)}, 6317 /* mute analog input loopbacks */
6246 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)}, 6318 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
6247 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(2)}, 6319 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)},
6248 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(3)}, 6320 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(2)},
6249 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(4)}, 6321 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(3)},
6322 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(4)},
6250 6323
6251 /* Front Pin: output 0 (0x0c) */ 6324 /* Front Pin: output 0 (0x0c) */
6252 {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT}, 6325 {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
@@ -6515,17 +6588,17 @@ static struct hda_verb alc883_auto_init_verbs[] = {
6515 {0x09, AC_VERB_SET_CONNECT_SEL, 0x00}, 6588 {0x09, AC_VERB_SET_CONNECT_SEL, 0x00},
6516 {0x09, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)}, 6589 {0x09, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
6517 6590
6518 /* Unmute input amps (CD, Line In, Mic 1 & Mic 2) of the analog-loopback 6591 /* Mute input amps (CD, Line In, Mic 1 & Mic 2) of the analog-loopback
6519 * mixer widget 6592 * mixer widget
6520 * Note: PASD motherboards uses the Line In 2 as the input for 6593 * Note: PASD motherboards uses the Line In 2 as the input for
6521 * front panel mic (mic 2) 6594 * front panel mic (mic 2)
6522 */ 6595 */
6523 /* Amp Indices: Mic1 = 0, Mic2 = 1, Line1 = 2, Line2 = 3, CD = 4 */ 6596 /* Amp Indices: Mic1 = 0, Mic2 = 1, Line1 = 2, Line2 = 3, CD = 4 */
6524 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)}, 6597 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
6525 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)}, 6598 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)},
6526 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(2)}, 6599 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(2)},
6527 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(3)}, 6600 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(3)},
6528 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(4)}, 6601 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(4)},
6529 6602
6530 /* 6603 /*
6531 * Set up output mixers (0x0c - 0x0f) 6604 * Set up output mixers (0x0c - 0x0f)
@@ -6588,6 +6661,10 @@ static struct snd_kcontrol_new alc883_capture_mixer[] = {
6588 { } /* end */ 6661 { } /* end */
6589}; 6662};
6590 6663
6664#ifdef CONFIG_SND_HDA_POWER_SAVE
6665#define alc883_loopbacks alc880_loopbacks
6666#endif
6667
6591/* pcm configuration: identiacal with ALC880 */ 6668/* pcm configuration: identiacal with ALC880 */
6592#define alc883_pcm_analog_playback alc880_pcm_analog_playback 6669#define alc883_pcm_analog_playback alc880_pcm_analog_playback
6593#define alc883_pcm_analog_capture alc880_pcm_analog_capture 6670#define alc883_pcm_analog_capture alc880_pcm_analog_capture
@@ -7029,6 +7106,10 @@ static int patch_alc883(struct hda_codec *codec)
7029 codec->patch_ops = alc_patch_ops; 7106 codec->patch_ops = alc_patch_ops;
7030 if (board_config == ALC883_AUTO) 7107 if (board_config == ALC883_AUTO)
7031 spec->init_hook = alc883_auto_init; 7108 spec->init_hook = alc883_auto_init;
7109#ifdef CONFIG_SND_HDA_POWER_SAVE
7110 if (!spec->loopback.amplist)
7111 spec->loopback.amplist = alc883_loopbacks;
7112#endif
7032 7113
7033 return 0; 7114 return 0;
7034} 7115}
@@ -7186,17 +7267,17 @@ static struct hda_verb alc262_init_verbs[] = {
7186 {0x09, AC_VERB_SET_CONNECT_SEL, 0x00}, 7267 {0x09, AC_VERB_SET_CONNECT_SEL, 0x00},
7187 {0x09, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)}, 7268 {0x09, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
7188 7269
7189 /* Unmute input amps (CD, Line In, Mic 1 & Mic 2) of the analog-loopback 7270 /* Mute input amps (CD, Line In, Mic 1 & Mic 2) of the analog-loopback
7190 * mixer widget 7271 * mixer widget
7191 * Note: PASD motherboards uses the Line In 2 as the input for 7272 * Note: PASD motherboards uses the Line In 2 as the input for
7192 * front panel mic (mic 2) 7273 * front panel mic (mic 2)
7193 */ 7274 */
7194 /* Amp Indices: Mic1 = 0, Mic2 = 1, Line1 = 2, Line2 = 3, CD = 4 */ 7275 /* Amp Indices: Mic1 = 0, Mic2 = 1, Line1 = 2, Line2 = 3, CD = 4 */
7195 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)}, 7276 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
7196 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)}, 7277 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)},
7197 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(2)}, 7278 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(2)},
7198 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(3)}, 7279 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(3)},
7199 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(4)}, 7280 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(4)},
7200 7281
7201 /* 7282 /*
7202 * Set up output mixers (0x0c - 0x0e) 7283 * Set up output mixers (0x0c - 0x0e)
@@ -7565,17 +7646,17 @@ static struct hda_verb alc262_volume_init_verbs[] = {
7565 {0x09, AC_VERB_SET_CONNECT_SEL, 0x00}, 7646 {0x09, AC_VERB_SET_CONNECT_SEL, 0x00},
7566 {0x09, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)}, 7647 {0x09, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
7567 7648
7568 /* Unmute input amps (CD, Line In, Mic 1 & Mic 2) of the analog-loopback 7649 /* Mute input amps (CD, Line In, Mic 1 & Mic 2) of the analog-loopback
7569 * mixer widget 7650 * mixer widget
7570 * Note: PASD motherboards uses the Line In 2 as the input for 7651 * Note: PASD motherboards uses the Line In 2 as the input for
7571 * front panel mic (mic 2) 7652 * front panel mic (mic 2)
7572 */ 7653 */
7573 /* Amp Indices: Mic1 = 0, Mic2 = 1, Line1 = 2, Line2 = 3, CD = 4 */ 7654 /* Amp Indices: Mic1 = 0, Mic2 = 1, Line1 = 2, Line2 = 3, CD = 4 */
7574 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)}, 7655 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
7575 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)}, 7656 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)},
7576 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(2)}, 7657 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(2)},
7577 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(3)}, 7658 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(3)},
7578 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(4)}, 7659 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(4)},
7579 7660
7580 /* 7661 /*
7581 * Set up output mixers (0x0c - 0x0f) 7662 * Set up output mixers (0x0c - 0x0f)
@@ -7626,19 +7707,19 @@ static struct hda_verb alc262_HP_BPC_init_verbs[] = {
7626 {0x09, AC_VERB_SET_CONNECT_SEL, 0x00}, 7707 {0x09, AC_VERB_SET_CONNECT_SEL, 0x00},
7627 {0x09, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)}, 7708 {0x09, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
7628 7709
7629 /* Unmute input amps (CD, Line In, Mic 1 & Mic 2) of the analog-loopback 7710 /* Mute input amps (CD, Line In, Mic 1 & Mic 2) of the analog-loopback
7630 * mixer widget 7711 * mixer widget
7631 * Note: PASD motherboards uses the Line In 2 as the input for 7712 * Note: PASD motherboards uses the Line In 2 as the input for
7632 * front panel mic (mic 2) 7713 * front panel mic (mic 2)
7633 */ 7714 */
7634 /* Amp Indices: Mic1 = 0, Mic2 = 1, Line1 = 2, Line2 = 3, CD = 4 */ 7715 /* Amp Indices: Mic1 = 0, Mic2 = 1, Line1 = 2, Line2 = 3, CD = 4 */
7635 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)}, 7716 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
7636 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)}, 7717 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)},
7637 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(2)}, 7718 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(2)},
7638 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(3)}, 7719 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(3)},
7639 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(4)}, 7720 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(4)},
7640 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(5)}, 7721 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(5)},
7641 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(6)}, 7722 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(6)},
7642 7723
7643 /* 7724 /*
7644 * Set up output mixers (0x0c - 0x0e) 7725 * Set up output mixers (0x0c - 0x0e)
@@ -7713,20 +7794,20 @@ static struct hda_verb alc262_HP_BPC_WildWest_init_verbs[] = {
7713 {0x09, AC_VERB_SET_CONNECT_SEL, 0x00}, 7794 {0x09, AC_VERB_SET_CONNECT_SEL, 0x00},
7714 {0x09, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)}, 7795 {0x09, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
7715 7796
7716 /* Unmute input amps (CD, Line In, Mic 1 & Mic 2) of the analog-loopback 7797 /* Mute input amps (CD, Line In, Mic 1 & Mic 2) of the analog-loopback
7717 * mixer widget 7798 * mixer widget
7718 * Note: PASD motherboards uses the Line In 2 as the input for front 7799 * Note: PASD motherboards uses the Line In 2 as the input for front
7719 * panel mic (mic 2) 7800 * panel mic (mic 2)
7720 */ 7801 */
7721 /* Amp Indices: Mic1 = 0, Mic2 = 1, Line1 = 2, Line2 = 3, CD = 4 */ 7802 /* Amp Indices: Mic1 = 0, Mic2 = 1, Line1 = 2, Line2 = 3, CD = 4 */
7722 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)}, 7803 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
7723 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)}, 7804 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)},
7724 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(2)}, 7805 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(2)},
7725 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(3)}, 7806 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(3)},
7726 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(4)}, 7807 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(4)},
7727 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(5)}, 7808 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(5)},
7728 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(6)}, 7809 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(6)},
7729 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(7)}, 7810 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(7)},
7730 /* 7811 /*
7731 * Set up output mixers (0x0c - 0x0e) 7812 * Set up output mixers (0x0c - 0x0e)
7732 */ 7813 */
@@ -7796,6 +7877,10 @@ static struct hda_verb alc262_HP_BPC_WildWest_init_verbs[] = {
7796 { } 7877 { }
7797}; 7878};
7798 7879
7880#ifdef CONFIG_SND_HDA_POWER_SAVE
7881#define alc262_loopbacks alc880_loopbacks
7882#endif
7883
7799/* pcm configuration: identiacal with ALC880 */ 7884/* pcm configuration: identiacal with ALC880 */
7800#define alc262_pcm_analog_playback alc880_pcm_analog_playback 7885#define alc262_pcm_analog_playback alc880_pcm_analog_playback
7801#define alc262_pcm_analog_capture alc880_pcm_analog_capture 7886#define alc262_pcm_analog_capture alc880_pcm_analog_capture
@@ -8098,6 +8183,10 @@ static int patch_alc262(struct hda_codec *codec)
8098 codec->patch_ops = alc_patch_ops; 8183 codec->patch_ops = alc_patch_ops;
8099 if (board_config == ALC262_AUTO) 8184 if (board_config == ALC262_AUTO)
8100 spec->init_hook = alc262_auto_init; 8185 spec->init_hook = alc262_auto_init;
8186#ifdef CONFIG_SND_HDA_POWER_SAVE
8187 if (!spec->loopback.amplist)
8188 spec->loopback.amplist = alc262_loopbacks;
8189#endif
8101 8190
8102 return 0; 8191 return 0;
8103} 8192}
@@ -8507,6 +8596,10 @@ static void alc268_auto_init(struct hda_codec *codec)
8507 alc268_auto_init_analog_input(codec); 8596 alc268_auto_init_analog_input(codec);
8508} 8597}
8509 8598
8599#ifdef CONFIG_SND_HDA_POWER_SAVE
8600#define alc883_loopbacks alc880_loopbacks
8601#endif
8602
8510/* 8603/*
8511 * configuration and preset 8604 * configuration and preset
8512 */ 8605 */
@@ -9556,6 +9649,16 @@ static void alc861_auto_init(struct hda_codec *codec)
9556 alc861_auto_init_analog_input(codec); 9649 alc861_auto_init_analog_input(codec);
9557} 9650}
9558 9651
9652#ifdef CONFIG_SND_HDA_POWER_SAVE
9653static struct hda_amp_list alc861_loopbacks[] = {
9654 { 0x15, HDA_INPUT, 0 },
9655 { 0x15, HDA_INPUT, 1 },
9656 { 0x15, HDA_INPUT, 2 },
9657 { 0x15, HDA_INPUT, 3 },
9658 { } /* end */
9659};
9660#endif
9661
9559 9662
9560/* 9663/*
9561 * configuration and preset 9664 * configuration and preset
@@ -9753,6 +9856,10 @@ static int patch_alc861(struct hda_codec *codec)
9753 codec->patch_ops = alc_patch_ops; 9856 codec->patch_ops = alc_patch_ops;
9754 if (board_config == ALC861_AUTO) 9857 if (board_config == ALC861_AUTO)
9755 spec->init_hook = alc861_auto_init; 9858 spec->init_hook = alc861_auto_init;
9859#ifdef CONFIG_SND_HDA_POWER_SAVE
9860 if (!spec->loopback.amplist)
9861 spec->loopback.amplist = alc861_loopbacks;
9862#endif
9756 9863
9757 return 0; 9864 return 0;
9758} 9865}
@@ -10035,11 +10142,11 @@ static struct hda_verb alc861vd_volume_init_verbs[] = {
10035 * the analog-loopback mixer widget 10142 * the analog-loopback mixer widget
10036 */ 10143 */
10037 /* Amp Indices: Mic1 = 0, Mic2 = 1, Line1 = 2, Line2 = 3, CD = 4 */ 10144 /* Amp Indices: Mic1 = 0, Mic2 = 1, Line1 = 2, Line2 = 3, CD = 4 */
10038 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)}, 10145 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
10039 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)}, 10146 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)},
10040 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(2)}, 10147 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(2)},
10041 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(3)}, 10148 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(3)},
10042 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(4)}, 10149 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(4)},
10043 10150
10044 /* Capture mixer: unmute Mic, F-Mic, Line, CD inputs */ 10151 /* Capture mixer: unmute Mic, F-Mic, Line, CD inputs */
10045 {0x22, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)}, 10152 {0x22, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
@@ -10266,6 +10373,10 @@ static void alc861vd_dallas_unsol_event(struct hda_codec *codec, unsigned int re
10266 alc861vd_dallas_automute(codec); 10373 alc861vd_dallas_automute(codec);
10267} 10374}
10268 10375
10376#ifdef CONFIG_SND_HDA_POWER_SAVE
10377#define alc861vd_loopbacks alc880_loopbacks
10378#endif
10379
10269/* pcm configuration: identiacal with ALC880 */ 10380/* pcm configuration: identiacal with ALC880 */
10270#define alc861vd_pcm_analog_playback alc880_pcm_analog_playback 10381#define alc861vd_pcm_analog_playback alc880_pcm_analog_playback
10271#define alc861vd_pcm_analog_capture alc880_pcm_analog_capture 10382#define alc861vd_pcm_analog_capture alc880_pcm_analog_capture
@@ -10688,6 +10799,10 @@ static int patch_alc861vd(struct hda_codec *codec)
10688 10799
10689 if (board_config == ALC861VD_AUTO) 10800 if (board_config == ALC861VD_AUTO)
10690 spec->init_hook = alc861vd_auto_init; 10801 spec->init_hook = alc861vd_auto_init;
10802#ifdef CONFIG_SND_HDA_POWER_SAVE
10803 if (!spec->loopback.amplist)
10804 spec->loopback.amplist = alc861vd_loopbacks;
10805#endif
10691 10806
10692 return 0; 10807 return 0;
10693} 10808}
@@ -10968,11 +11083,11 @@ static struct hda_verb alc662_init_verbs[] = {
10968 {0x09, AC_VERB_SET_CONNECT_SEL, 0x00}, 11083 {0x09, AC_VERB_SET_CONNECT_SEL, 0x00},
10969 /* Front mixer: unmute input/output amp left and right (volume = 0) */ 11084 /* Front mixer: unmute input/output amp left and right (volume = 0) */
10970 11085
10971 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)}, 11086 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
10972 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)}, 11087 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)},
10973 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(2)}, 11088 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(2)},
10974 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(3)}, 11089 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(3)},
10975 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(4)}, 11090 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(4)},
10976 11091
10977 {0x02, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)}, 11092 {0x02, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
10978 {0x02, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)}, 11093 {0x02, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)},
@@ -11041,11 +11156,11 @@ static struct hda_verb alc662_auto_init_verbs[] = {
11041 * panel mic (mic 2) 11156 * panel mic (mic 2)
11042 */ 11157 */
11043 /* Amp Indices: Mic1 = 0, Mic2 = 1, Line1 = 2, Line2 = 3, CD = 4 */ 11158 /* Amp Indices: Mic1 = 0, Mic2 = 1, Line1 = 2, Line2 = 3, CD = 4 */
11044 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)}, 11159 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
11045 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)}, 11160 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)},
11046 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(2)}, 11161 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(2)},
11047 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(3)}, 11162 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(3)},
11048 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(4)}, 11163 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(4)},
11049 11164
11050 /* 11165 /*
11051 * Set up output mixers (0x0c - 0x0f) 11166 * Set up output mixers (0x0c - 0x0f)
@@ -11132,6 +11247,10 @@ static void alc662_lenovo_101e_unsol_event(struct hda_codec *codec,
11132 alc662_lenovo_101e_ispeaker_automute(codec); 11247 alc662_lenovo_101e_ispeaker_automute(codec);
11133} 11248}
11134 11249
11250#ifdef CONFIG_SND_HDA_POWER_SAVE
11251#define alc662_loopbacks alc880_loopbacks
11252#endif
11253
11135 11254
11136/* pcm configuration: identiacal with ALC880 */ 11255/* pcm configuration: identiacal with ALC880 */
11137#define alc662_pcm_analog_playback alc880_pcm_analog_playback 11256#define alc662_pcm_analog_playback alc880_pcm_analog_playback
@@ -11534,6 +11653,10 @@ static int patch_alc662(struct hda_codec *codec)
11534 codec->patch_ops = alc_patch_ops; 11653 codec->patch_ops = alc_patch_ops;
11535 if (board_config == ALC662_AUTO) 11654 if (board_config == ALC662_AUTO)
11536 spec->init_hook = alc662_auto_init; 11655 spec->init_hook = alc662_auto_init;
11656#ifdef CONFIG_SND_HDA_POWER_SAVE
11657 if (!spec->loopback.amplist)
11658 spec->loopback.amplist = alc662_loopbacks;
11659#endif
11537 11660
11538 return 0; 11661 return 0;
11539} 11662}