Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 193264
b: refs/heads/master
c: c027ddc
h: refs/heads/master
v: v3
  • Loading branch information
Kailang Yang authored and Takashi Iwai committed Mar 19, 2010
1 parent 2f1cd71 commit 6b096d5
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 18 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: da00c24493bf6ae3772dfe7343dca033ebc75955
refs/heads/master: c027ddcd01c852dfa5880862e47f022d7d9402f5
42 changes: 25 additions & 17 deletions trunk/sound/pci/hda/patch_realtek.c
Original file line number Diff line number Diff line change
Expand Up @@ -3848,6 +3848,18 @@ static struct hda_codec_ops alc_patch_ops = {
.reboot_notify = alc_shutup,
};

/* replace the codec chip_name with the given string */
static int alc_codec_rename(struct hda_codec *codec, const char *name)
{
kfree(codec->chip_name);
codec->chip_name = kstrdup(name, GFP_KERNEL);
if (!codec->chip_name) {
alc_free(codec);
return -ENOMEM;
}
return 0;
}

/*
* Test configuration for debugging
*
Expand Down Expand Up @@ -14169,17 +14181,15 @@ static int patch_alc269(struct hda_codec *codec)

alc_auto_parse_customize_define(codec);

alc_fix_pll_init(codec, 0x20, 0x04, 15);

if ((alc_read_coef_idx(codec, 0) & 0x00f0) == 0x0010){
kfree(codec->chip_name);
codec->chip_name = kstrdup("ALC259", GFP_KERNEL);
if (!codec->chip_name) {
alc_free(codec);
return -ENOMEM;
}
if (codec->bus->pci->subsystem_vendor == 0x1025 &&
spec->cdefine.platform_type == 1)
alc_codec_rename(codec, "ALC271X");
else
alc_codec_rename(codec, "ALC259");
is_alc269vb = 1;
}
} else
alc_fix_pll_init(codec, 0x20, 0x04, 15);

board_config = snd_hda_check_board_config(codec, ALC269_MODEL_LAST,
alc269_models,
Expand Down Expand Up @@ -18394,14 +18404,12 @@ static int patch_alc662(struct hda_codec *codec)

alc_fix_pll_init(codec, 0x20, 0x04, 15);

if (alc_read_coef_idx(codec, 0)==0x8020){
kfree(codec->chip_name);
codec->chip_name = kstrdup("ALC661", GFP_KERNEL);
if (!codec->chip_name) {
alc_free(codec);
return -ENOMEM;
}
}
if (alc_read_coef_idx(codec, 0) == 0x8020)
alc_codec_rename(codec, "ALC661");
else if ((alc_read_coef_idx(codec, 0) & (1 << 14)) &&
codec->bus->pci->subsystem_vendor == 0x1025 &&
spec->cdefine.platform_type == 1)
alc_codec_rename(codec, "ALC272X");

board_config = snd_hda_check_board_config(codec, ALC662_MODEL_LAST,
alc662_models,
Expand Down

0 comments on commit 6b096d5

Please sign in to comment.