Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 293098
b: refs/heads/master
c: 164f73e
h: refs/heads/master
v: v3
  • Loading branch information
Takashi Iwai committed Feb 21, 2012
1 parent dd1f5e9 commit 440f08f
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 83 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: 1a97b7f22774b454531f013638b181803fba470f
refs/heads/master: 164f73ee93131f67a61eaca6a6f6180580c39445
104 changes: 22 additions & 82 deletions trunk/sound/pci/hda/patch_realtek.c
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,8 @@ struct alc_spec {
hda_nid_t vmaster_nid;
#ifdef CONFIG_SND_HDA_POWER_SAVE
struct hda_loopback_check loopback;
int num_loopbacks;
struct hda_amp_list loopback_list[8];
#endif

/* for PLL fix */
Expand Down Expand Up @@ -2690,6 +2692,25 @@ static const char *alc_get_line_out_pfx(struct alc_spec *spec, int ch,
return channel_name[ch];
}

#ifdef CONFIG_SND_HDA_POWER_SAVE
/* add the powersave loopback-list entry */
static void add_loopback_list(struct alc_spec *spec, hda_nid_t mix, int idx)
{
struct hda_amp_list *list;

if (spec->num_loopbacks >= ARRAY_SIZE(spec->loopback_list) - 1)
return;
list = spec->loopback_list + spec->num_loopbacks;
list->nid = mix;
list->dir = HDA_INPUT;
list->idx = idx;
spec->num_loopbacks++;
spec->loopback.amplist = spec->loopback_list;
}
#else
#define add_loopback_list(spec, mix, idx) /* NOP */
#endif

/* create input playback/capture controls for the given pin */
static int new_analog_input(struct alc_spec *spec, hda_nid_t pin,
const char *ctlname, int ctlidx,
Expand All @@ -2705,6 +2726,7 @@ static int new_analog_input(struct alc_spec *spec, hda_nid_t pin,
HDA_COMPOSE_AMP_VAL(mix_nid, 3, idx, HDA_INPUT));
if (err < 0)
return err;
add_loopback_list(spec, mix_nid, idx);
return 0;
}

Expand Down Expand Up @@ -4430,17 +4452,6 @@ static int alc880_parse_auto_config(struct hda_codec *codec)
return alc_parse_auto_config(codec, alc880_ignore, alc880_ssids);
}

#ifdef CONFIG_SND_HDA_POWER_SAVE
static const struct hda_amp_list alc880_loopbacks[] = {
{ 0x0b, HDA_INPUT, 0 },
{ 0x0b, HDA_INPUT, 1 },
{ 0x0b, HDA_INPUT, 2 },
{ 0x0b, HDA_INPUT, 3 },
{ 0x0b, HDA_INPUT, 4 },
{ } /* end */
};
#endif

/*
* ALC880 fix-ups
*/
Expand Down Expand Up @@ -4851,10 +4862,6 @@ static int patch_alc880(struct hda_codec *codec)

codec->patch_ops = alc_patch_ops;
spec->init_hook = alc_auto_init_std;
#ifdef CONFIG_SND_HDA_POWER_SAVE
if (!spec->loopback.amplist)
spec->loopback.amplist = alc880_loopbacks;
#endif

alc_apply_fixup(codec, ALC_FIXUP_ACT_PROBE);

Expand All @@ -4876,17 +4883,6 @@ static int alc260_parse_auto_config(struct hda_codec *codec)
return alc_parse_auto_config(codec, alc260_ignore, alc260_ssids);
}

#ifdef CONFIG_SND_HDA_POWER_SAVE
static const struct hda_amp_list alc260_loopbacks[] = {
{ 0x07, HDA_INPUT, 0 },
{ 0x07, HDA_INPUT, 1 },
{ 0x07, HDA_INPUT, 2 },
{ 0x07, HDA_INPUT, 3 },
{ 0x07, HDA_INPUT, 4 },
{ } /* end */
};
#endif

/*
* Pin config fixes
*/
Expand Down Expand Up @@ -5032,10 +5028,6 @@ static int patch_alc260(struct hda_codec *codec)
codec->patch_ops = alc_patch_ops;
spec->init_hook = alc_auto_init_std;
spec->shutup = alc_eapd_shutup;
#ifdef CONFIG_SND_HDA_POWER_SAVE
if (!spec->loopback.amplist)
spec->loopback.amplist = alc260_loopbacks;
#endif

alc_apply_fixup(codec, ALC_FIXUP_ACT_PROBE);

Expand All @@ -5058,9 +5050,6 @@ static int patch_alc260(struct hda_codec *codec)
* In addition, an independent DAC for the multi-playback (not used in this
* driver yet).
*/
#ifdef CONFIG_SND_HDA_POWER_SAVE
#define alc882_loopbacks alc880_loopbacks
#endif

/*
* Pin config fixes
Expand Down Expand Up @@ -5507,11 +5496,6 @@ static int patch_alc882(struct hda_codec *codec)
codec->patch_ops = alc_patch_ops;
spec->init_hook = alc_auto_init_std;

#ifdef CONFIG_SND_HDA_POWER_SAVE
if (!spec->loopback.amplist)
spec->loopback.amplist = alc882_loopbacks;
#endif

alc_apply_fixup(codec, ALC_FIXUP_ACT_PROBE);

return 0;
Expand Down Expand Up @@ -5608,10 +5592,6 @@ static const struct snd_pci_quirk alc262_fixup_tbl[] = {
};


#ifdef CONFIG_SND_HDA_POWER_SAVE
#define alc262_loopbacks alc880_loopbacks
#endif

/*
*/
static int patch_alc262(struct hda_codec *codec)
Expand Down Expand Up @@ -5671,11 +5651,6 @@ static int patch_alc262(struct hda_codec *codec)
spec->init_hook = alc_auto_init_std;
spec->shutup = alc_eapd_shutup;

#ifdef CONFIG_SND_HDA_POWER_SAVE
if (!spec->loopback.amplist)
spec->loopback.amplist = alc262_loopbacks;
#endif

alc_apply_fixup(codec, ALC_FIXUP_ACT_PROBE);

return 0;
Expand Down Expand Up @@ -5793,10 +5768,6 @@ static int patch_alc268(struct hda_codec *codec)
/*
* ALC269
*/
#ifdef CONFIG_SND_HDA_POWER_SAVE
#define alc269_loopbacks alc880_loopbacks
#endif

static const struct hda_pcm_stream alc269_44k_pcm_analog_playback = {
.substreams = 1,
.channels_min = 2,
Expand Down Expand Up @@ -6336,8 +6307,6 @@ static int patch_alc269(struct hda_codec *codec)
spec->shutup = alc269_shutup;

#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
Expand All @@ -6362,17 +6331,6 @@ static int alc861_parse_auto_config(struct hda_codec *codec)
return alc_parse_auto_config(codec, alc861_ignore, alc861_ssids);
}

#ifdef CONFIG_SND_HDA_POWER_SAVE
static const struct hda_amp_list alc861_loopbacks[] = {
{ 0x15, HDA_INPUT, 0 },
{ 0x15, HDA_INPUT, 1 },
{ 0x15, HDA_INPUT, 2 },
{ 0x15, HDA_INPUT, 3 },
{ } /* end */
};
#endif


/* Pin config fixes */
enum {
ALC861_FIXUP_FSC_AMILO_PI1505,
Expand Down Expand Up @@ -6486,8 +6444,6 @@ static int patch_alc861(struct hda_codec *codec)
spec->init_hook = alc_auto_init_std;
#ifdef CONFIG_SND_HDA_POWER_SAVE
spec->power_hook = alc_power_eapd;
if (!spec->loopback.amplist)
spec->loopback.amplist = alc861_loopbacks;
#endif

alc_apply_fixup(codec, ALC_FIXUP_ACT_PROBE);
Expand All @@ -6506,10 +6462,6 @@ static int patch_alc861(struct hda_codec *codec)
*
* In addition, an independent DAC
*/
#ifdef CONFIG_SND_HDA_POWER_SAVE
#define alc861vd_loopbacks alc880_loopbacks
#endif

static int alc861vd_parse_auto_config(struct hda_codec *codec)
{
static const hda_nid_t alc861vd_ignore[] = { 0x1d, 0 };
Expand Down Expand Up @@ -6610,10 +6562,6 @@ static int patch_alc861vd(struct hda_codec *codec)

spec->init_hook = alc_auto_init_std;
spec->shutup = alc_eapd_shutup;
#ifdef CONFIG_SND_HDA_POWER_SAVE
if (!spec->loopback.amplist)
spec->loopback.amplist = alc861vd_loopbacks;
#endif

alc_apply_fixup(codec, ALC_FIXUP_ACT_PROBE);

Expand All @@ -6635,9 +6583,6 @@ static int patch_alc861vd(struct hda_codec *codec)
* In addition, an independent DAC for the multi-playback (not used in this
* driver yet).
*/
#ifdef CONFIG_SND_HDA_POWER_SAVE
#define alc662_loopbacks alc880_loopbacks
#endif

/*
* BIOS auto configuration
Expand Down Expand Up @@ -6999,11 +6944,6 @@ static int patch_alc662(struct hda_codec *codec)
spec->init_hook = alc_auto_init_std;
spec->shutup = alc_eapd_shutup;

#ifdef CONFIG_SND_HDA_POWER_SAVE
if (!spec->loopback.amplist)
spec->loopback.amplist = alc662_loopbacks;
#endif

alc_apply_fixup(codec, ALC_FIXUP_ACT_PROBE);

return 0;
Expand Down

0 comments on commit 440f08f

Please sign in to comment.