Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 133065
b: refs/heads/master
c: 0e8a21b
h: refs/heads/master
i:
  133063: 37a7587
v: v3
  • Loading branch information
Takashi Iwai committed Feb 20, 2009
1 parent 4ba4c1a commit 6091b1a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 76 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: 3be141494a080a9189b51fa78154c975ad8d9806
refs/heads/master: 0e8a21b59d48a63f45b3e6d2aca7fb91c5aec882
78 changes: 3 additions & 75 deletions trunk/sound/pci/hda/patch_realtek.c
Original file line number Diff line number Diff line change
Expand Up @@ -329,13 +329,6 @@ struct alc_spec {
/* for PLL fix */
hda_nid_t pll_nid;
unsigned int pll_coef_idx, pll_coef_bit;

#ifdef SND_HDA_NEEDS_RESUME
#define ALC_MAX_PINS 16
unsigned int num_pins;
hda_nid_t pin_nids[ALC_MAX_PINS];
unsigned int pin_cfgs[ALC_MAX_PINS];
#endif
};

/*
Expand Down Expand Up @@ -1009,8 +1002,7 @@ static void alc_subsystem_id(struct hda_codec *codec,
nid = 0x1d;
if (codec->vendor_id == 0x10ec0260)
nid = 0x17;
ass = snd_hda_codec_read(codec, nid, 0,
AC_VERB_GET_CONFIG_DEFAULT, 0);
ass = snd_hda_codec_get_pincfg(codec, nid);
if (!(ass & 1) && !(ass & 0x100000))
return;
if ((ass >> 30) != 1) /* no physical connection */
Expand Down Expand Up @@ -1184,16 +1176,8 @@ static void alc_fix_pincfg(struct hda_codec *codec,
return;

cfg = pinfix[quirk->value];
for (; cfg->nid; cfg++) {
int i;
u32 val = cfg->val;
for (i = 0; i < 4; i++) {
snd_hda_codec_write(codec, cfg->nid, 0,
AC_VERB_SET_CONFIG_DEFAULT_BYTES_0 + i,
val & 0xff);
val >>= 8;
}
}
for (; cfg->nid; cfg++)
snd_hda_codec_set_pincfg(codec, cfg->nid, cfg->val);
}

/*
Expand Down Expand Up @@ -3215,61 +3199,13 @@ static void alc_free(struct hda_codec *codec)
}

#ifdef SND_HDA_NEEDS_RESUME
static void store_pin_configs(struct hda_codec *codec)
{
struct alc_spec *spec = codec->spec;
hda_nid_t nid, end_nid;

end_nid = codec->start_nid + codec->num_nodes;
for (nid = codec->start_nid; nid < end_nid; nid++) {
unsigned int wid_caps = get_wcaps(codec, nid);
unsigned int wid_type =
(wid_caps & AC_WCAP_TYPE) >> AC_WCAP_TYPE_SHIFT;
if (wid_type != AC_WID_PIN)
continue;
if (spec->num_pins >= ARRAY_SIZE(spec->pin_nids))
break;
spec->pin_nids[spec->num_pins] = nid;
spec->pin_cfgs[spec->num_pins] =
snd_hda_codec_read(codec, nid, 0,
AC_VERB_GET_CONFIG_DEFAULT, 0);
spec->num_pins++;
}
}

static void resume_pin_configs(struct hda_codec *codec)
{
struct alc_spec *spec = codec->spec;
int i;

for (i = 0; i < spec->num_pins; i++) {
hda_nid_t pin_nid = spec->pin_nids[i];
unsigned int pin_config = spec->pin_cfgs[i];
snd_hda_codec_write(codec, pin_nid, 0,
AC_VERB_SET_CONFIG_DEFAULT_BYTES_0,
pin_config & 0x000000ff);
snd_hda_codec_write(codec, pin_nid, 0,
AC_VERB_SET_CONFIG_DEFAULT_BYTES_1,
(pin_config & 0x0000ff00) >> 8);
snd_hda_codec_write(codec, pin_nid, 0,
AC_VERB_SET_CONFIG_DEFAULT_BYTES_2,
(pin_config & 0x00ff0000) >> 16);
snd_hda_codec_write(codec, pin_nid, 0,
AC_VERB_SET_CONFIG_DEFAULT_BYTES_3,
pin_config >> 24);
}
}

static int alc_resume(struct hda_codec *codec)
{
resume_pin_configs(codec);
codec->patch_ops.init(codec);
snd_hda_codec_resume_amp(codec);
snd_hda_codec_resume_cache(codec);
return 0;
}
#else
#define store_pin_configs(codec)
#endif

/*
Expand Down Expand Up @@ -4329,7 +4265,6 @@ static int alc880_parse_auto_config(struct hda_codec *codec)
spec->num_mux_defs = 1;
spec->input_mux = &spec->private_imux[0];

store_pin_configs(codec);
return 1;
}

Expand Down Expand Up @@ -5693,7 +5628,6 @@ static int alc260_parse_auto_config(struct hda_codec *codec)
spec->num_mux_defs = 1;
spec->input_mux = &spec->private_imux[0];

store_pin_configs(codec);
return 1;
}

Expand Down Expand Up @@ -10688,7 +10622,6 @@ static int alc262_parse_auto_config(struct hda_codec *codec)
if (err < 0)
return err;

store_pin_configs(codec);
return 1;
}

Expand Down Expand Up @@ -11861,7 +11794,6 @@ static int alc268_parse_auto_config(struct hda_codec *codec)
if (err < 0)
return err;

store_pin_configs(codec);
return 1;
}

Expand Down Expand Up @@ -12774,7 +12706,6 @@ static int alc269_parse_auto_config(struct hda_codec *codec)
if (!spec->cap_mixer && !spec->no_analog)
set_capture_mixer(spec);

store_pin_configs(codec);
return 1;
}

Expand Down Expand Up @@ -13825,7 +13756,6 @@ static int alc861_parse_auto_config(struct hda_codec *codec)
spec->num_adc_nids = ARRAY_SIZE(alc861_adc_nids);
set_capture_mixer(spec);

store_pin_configs(codec);
return 1;
}

Expand Down Expand Up @@ -14927,7 +14857,6 @@ static int alc861vd_parse_auto_config(struct hda_codec *codec)
if (err < 0)
return err;

store_pin_configs(codec);
return 1;
}

Expand Down Expand Up @@ -16737,7 +16666,6 @@ static int alc662_parse_auto_config(struct hda_codec *codec)
if (err < 0)
return err;

store_pin_configs(codec);
return 1;
}

Expand Down

0 comments on commit 6091b1a

Please sign in to comment.