Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 193278
b: refs/heads/master
c: ad35879
h: refs/heads/master
v: v3
  • Loading branch information
Takashi Iwai committed Mar 30, 2010
1 parent 03aef43 commit e8daca9
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 9 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 7a2e38a555f2b1a20aaaf30f3d8ecad8faa97ea7
refs/heads/master: ad35879aa192e783db2d41c196f48f3fc059ce22
8 changes: 0 additions & 8 deletions trunk/sound/pci/hda/patch_analog.c
Original file line number Diff line number Diff line change
Expand Up @@ -1904,14 +1904,6 @@ static int patch_ad1981(struct hda_codec *codec)
case AD1981_THINKPAD:
spec->mixers[0] = ad1981_thinkpad_mixers;
spec->input_mux = &ad1981_thinkpad_capture_source;
/* set the upper-limit for mixer amp to 0dB for avoiding the
* possible damage by overloading
*/
snd_hda_override_amp_caps(codec, 0x11, HDA_INPUT,
(0x17 << AC_AMPCAP_OFFSET_SHIFT) |
(0x17 << AC_AMPCAP_NUM_STEPS_SHIFT) |
(0x05 << AC_AMPCAP_STEP_SIZE_SHIFT) |
(1 << AC_AMPCAP_MUTE_SHIFT));
break;
case AD1981_TOSHIBA:
spec->mixers[0] = ad1981_hp_mixers;
Expand Down
38 changes: 38 additions & 0 deletions trunk/sound/pci/hda/patch_realtek.c
Original file line number Diff line number Diff line change
Expand Up @@ -3467,6 +3467,10 @@ static int alc_init(struct hda_codec *codec)
if (spec->init_hook)
spec->init_hook(codec);

#ifdef CONFIG_SND_HDA_POWER_SAVE
if (codec->patch_ops.check_power_status)
codec->patch_ops.check_power_status(codec, 0x01);
#endif
return 0;
}

Expand Down Expand Up @@ -3827,6 +3831,10 @@ static int alc_resume(struct hda_codec *codec)
codec->patch_ops.init(codec);
snd_hda_codec_resume_amp(codec);
snd_hda_codec_resume_cache(codec);
#ifdef CONFIG_SND_HDA_POWER_SAVE
if (codec->patch_ops.check_power_status)
codec->patch_ops.check_power_status(codec, 0x01);
#endif
return 0;
}
#endif
Expand Down Expand Up @@ -13983,6 +13991,34 @@ static struct hda_pcm_stream alc269_44k_pcm_analog_capture = {
/* NID is set in alc_build_pcms */
};

#ifdef CONFIG_SND_HDA_POWER_SAVE
static int alc269_mic2_for_mute_led(struct hda_codec *codec)
{
switch (codec->subsystem_id) {
case 0x103c1586:
return 1;
}
return 0;
}

static int alc269_mic2_mute_check_ps(struct hda_codec *codec, hda_nid_t nid)
{
/* update mute-LED according to the speaker mute state */
if (nid == 0x01 || nid == 0x14) {
int pinval;
if (snd_hda_codec_amp_read(codec, 0x14, 0, HDA_OUTPUT, 0) &
HDA_AMP_MUTE)
pinval = 0x24;
else
pinval = 0x20;
/* mic2 vref pin is used for mute LED control */
snd_hda_codec_write(codec, 0x19, 0,
AC_VERB_SET_PIN_WIDGET_CONTROL, pinval);
}
return alc_check_power_status(codec, nid);
}
#endif /* CONFIG_SND_HDA_POWER_SAVE */

/*
* BIOS auto configuration
*/
Expand Down Expand Up @@ -14330,6 +14366,8 @@ static int patch_alc269(struct hda_codec *codec)
#ifdef CONFIG_SND_HDA_POWER_SAVE
if (!spec->loopback.amplist)
spec->loopback.amplist = alc269_loopbacks;
if (alc269_mic2_for_mute_led(codec))
codec->patch_ops.check_power_status = alc269_mic2_mute_check_ps;
#endif

return 0;
Expand Down

0 comments on commit e8daca9

Please sign in to comment.