diff options
author | Kailang Yang <kailang@realtek.com> | 2011-07-06 03:51:29 -0400 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2011-07-06 03:53:28 -0400 |
commit | b68785714b67079385188323631b05a8f9093675 (patch) | |
tree | 04ba3ecefd658a358534372a89514069dc8bb213 /sound | |
parent | bac4b92cf7a444c0af8dd7b269c8791595c44052 (diff) |
ALSA: hda - Add Realtek ALC269VC codec support
Add the support of ALC269VC codec.
Also delete the unnecessary codec_variant type enum list:
now only three variants (ALC269VA ALC269VB ALC269VC) are needed.
In addition, added some aliases:
- Add ALC269VB alias name ALC277
- Add ALC269VC alias name ALC259 ALC281X
- Add ALC269VC for Lenovo device 0x21f3 name ALC3202
Signed-off-by: Kailang Yang <kailang@realtek.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound')
-rw-r--r-- | sound/pci/hda/patch_realtek.c | 34 |
1 files changed, 20 insertions, 14 deletions
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c index 757a8a3d1e52..575ffc9fedbd 100644 --- a/sound/pci/hda/patch_realtek.c +++ b/sound/pci/hda/patch_realtek.c | |||
@@ -14650,12 +14650,9 @@ static int alc275_setup_dual_adc(struct hda_codec *codec) | |||
14650 | 14650 | ||
14651 | /* different alc269-variants */ | 14651 | /* different alc269-variants */ |
14652 | enum { | 14652 | enum { |
14653 | ALC269_TYPE_NORMAL, | 14653 | ALC269_TYPE_ALC269VA, |
14654 | ALC269_TYPE_ALC258, | ||
14655 | ALC269_TYPE_ALC259, | ||
14656 | ALC269_TYPE_ALC269VB, | 14654 | ALC269_TYPE_ALC269VB, |
14657 | ALC269_TYPE_ALC270, | 14655 | ALC269_TYPE_ALC269VC, |
14658 | ALC269_TYPE_ALC271X, | ||
14659 | }; | 14656 | }; |
14660 | 14657 | ||
14661 | /* | 14658 | /* |
@@ -14675,7 +14672,7 @@ static int alc269_parse_auto_config(struct hda_codec *codec) | |||
14675 | err = alc269_auto_create_multi_out_ctls(spec, &spec->autocfg); | 14672 | err = alc269_auto_create_multi_out_ctls(spec, &spec->autocfg); |
14676 | if (err < 0) | 14673 | if (err < 0) |
14677 | return err; | 14674 | return err; |
14678 | if (spec->codec_variant == ALC269_TYPE_NORMAL) | 14675 | if (spec->codec_variant == ALC269_TYPE_ALC269VA) |
14679 | err = alc269_auto_create_input_ctls(codec, &spec->autocfg); | 14676 | err = alc269_auto_create_input_ctls(codec, &spec->autocfg); |
14680 | else | 14677 | else |
14681 | err = alc_auto_create_input_ctls(codec, &spec->autocfg, 0, | 14678 | err = alc_auto_create_input_ctls(codec, &spec->autocfg, 0, |
@@ -14690,7 +14687,7 @@ static int alc269_parse_auto_config(struct hda_codec *codec) | |||
14690 | if (spec->kctls.list) | 14687 | if (spec->kctls.list) |
14691 | add_mixer(spec, spec->kctls.list); | 14688 | add_mixer(spec, spec->kctls.list); |
14692 | 14689 | ||
14693 | if (spec->codec_variant != ALC269_TYPE_NORMAL) | 14690 | if (spec->codec_variant != ALC269_TYPE_ALC269VA) |
14694 | alc_ssid_check(codec, 0, 0x1b, 0x14, 0x21); | 14691 | alc_ssid_check(codec, 0, 0x1b, 0x14, 0x21); |
14695 | else | 14692 | else |
14696 | alc_ssid_check(codec, 0x15, 0x1b, 0x14, 0); | 14693 | alc_ssid_check(codec, 0x15, 0x1b, 0x14, 0); |
@@ -15148,24 +15145,33 @@ static int patch_alc269(struct hda_codec *codec) | |||
15148 | alc_auto_parse_customize_define(codec); | 15145 | alc_auto_parse_customize_define(codec); |
15149 | 15146 | ||
15150 | if (codec->vendor_id == 0x10ec0269) { | 15147 | if (codec->vendor_id == 0x10ec0269) { |
15148 | spec->codec_variant = ALC269_TYPE_ALC269VA; | ||
15151 | coef = alc_read_coef_idx(codec, 0); | 15149 | coef = alc_read_coef_idx(codec, 0); |
15152 | if ((coef & 0x00f0) == 0x0010) { | 15150 | if ((coef & 0x00f0) == 0x0010) { |
15153 | if (codec->bus->pci->subsystem_vendor == 0x1025 && | 15151 | if (codec->bus->pci->subsystem_vendor == 0x1025 && |
15154 | spec->cdefine.platform_type == 1) { | 15152 | spec->cdefine.platform_type == 1) { |
15155 | alc_codec_rename(codec, "ALC271X"); | 15153 | alc_codec_rename(codec, "ALC271X"); |
15156 | spec->codec_variant = ALC269_TYPE_ALC271X; | ||
15157 | } else if ((coef & 0xf000) == 0x1000) { | ||
15158 | spec->codec_variant = ALC269_TYPE_ALC270; | ||
15159 | } else if ((coef & 0xf000) == 0x2000) { | 15154 | } else if ((coef & 0xf000) == 0x2000) { |
15160 | alc_codec_rename(codec, "ALC259"); | 15155 | alc_codec_rename(codec, "ALC259"); |
15161 | spec->codec_variant = ALC269_TYPE_ALC259; | ||
15162 | } else if ((coef & 0xf000) == 0x3000) { | 15156 | } else if ((coef & 0xf000) == 0x3000) { |
15163 | alc_codec_rename(codec, "ALC258"); | 15157 | alc_codec_rename(codec, "ALC258"); |
15164 | spec->codec_variant = ALC269_TYPE_ALC258; | 15158 | } else if ((coef & 0xfff0) == 0x3010) { |
15159 | alc_codec_rename(codec, "ALC277"); | ||
15165 | } else { | 15160 | } else { |
15166 | alc_codec_rename(codec, "ALC269VB"); | 15161 | alc_codec_rename(codec, "ALC269VB"); |
15167 | spec->codec_variant = ALC269_TYPE_ALC269VB; | ||
15168 | } | 15162 | } |
15163 | spec->codec_variant = ALC269_TYPE_ALC269VB; | ||
15164 | } else if ((coef & 0x00f0) == 0x0020) { | ||
15165 | if (coef == 0xa023) | ||
15166 | alc_codec_rename(codec, "ALC259"); | ||
15167 | else if (coef == 0x6023) | ||
15168 | alc_codec_rename(codec, "ALC281X"); | ||
15169 | else if (codec->bus->pci->subsystem_vendor == 0x17aa && | ||
15170 | codec->bus->pci->subsystem_device == 0x21f3) | ||
15171 | alc_codec_rename(codec, "ALC3202"); | ||
15172 | else | ||
15173 | alc_codec_rename(codec, "ALC269VC"); | ||
15174 | spec->codec_variant = ALC269_TYPE_ALC269VC; | ||
15169 | } else | 15175 | } else |
15170 | alc_fix_pll_init(codec, 0x20, 0x04, 15); | 15176 | alc_fix_pll_init(codec, 0x20, 0x04, 15); |
15171 | alc269_fill_coef(codec); | 15177 | alc269_fill_coef(codec); |
@@ -15229,7 +15235,7 @@ static int patch_alc269(struct hda_codec *codec) | |||
15229 | spec->stream_digital_capture = &alc269_pcm_digital_capture; | 15235 | spec->stream_digital_capture = &alc269_pcm_digital_capture; |
15230 | 15236 | ||
15231 | if (!spec->adc_nids) { /* wasn't filled automatically? use default */ | 15237 | if (!spec->adc_nids) { /* wasn't filled automatically? use default */ |
15232 | if (spec->codec_variant == ALC269_TYPE_NORMAL) { | 15238 | if (spec->codec_variant == ALC269_TYPE_ALC269VA) { |
15233 | spec->adc_nids = alc269_adc_nids; | 15239 | spec->adc_nids = alc269_adc_nids; |
15234 | spec->num_adc_nids = ARRAY_SIZE(alc269_adc_nids); | 15240 | spec->num_adc_nids = ARRAY_SIZE(alc269_adc_nids); |
15235 | spec->capsrc_nids = alc269_capsrc_nids; | 15241 | spec->capsrc_nids = alc269_capsrc_nids; |