diff options
author | Takashi Iwai <tiwai@suse.de> | 2010-07-29 09:32:34 -0400 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2010-07-29 09:32:34 -0400 |
commit | b0485610d6715fd094703d96cf944fdbe1d30738 (patch) | |
tree | 93135ce145537bb5ad594af704e42430568fcf1a /sound/pci | |
parent | a39afc8eb47bc0d8b23fbdb930529171d1752203 (diff) | |
parent | dc1eae256cfac03bf17bf3eb016e3a6423d3f9d5 (diff) |
Merge branch 'fix/hda' into topic/hda
Diffstat (limited to 'sound/pci')
-rw-r--r-- | sound/pci/hda/patch_realtek.c | 62 |
1 files changed, 42 insertions, 20 deletions
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c index ca1a87a4812c..439d6e77040e 100644 --- a/sound/pci/hda/patch_realtek.c +++ b/sound/pci/hda/patch_realtek.c | |||
@@ -1309,11 +1309,11 @@ static int alc_auto_parse_customize_define(struct hda_codec *codec) | |||
1309 | unsigned nid = 0; | 1309 | unsigned nid = 0; |
1310 | struct alc_spec *spec = codec->spec; | 1310 | struct alc_spec *spec = codec->spec; |
1311 | 1311 | ||
1312 | spec->cdefine.enable_pcbeep = 1; /* assume always enabled */ | ||
1313 | |||
1312 | ass = codec->subsystem_id & 0xffff; | 1314 | ass = codec->subsystem_id & 0xffff; |
1313 | if (ass != codec->bus->pci->subsystem_device && (ass & 1)) { | 1315 | if (ass != codec->bus->pci->subsystem_device && (ass & 1)) |
1314 | spec->cdefine.enable_pcbeep = 1; /* assume always enabled */ | ||
1315 | goto do_sku; | 1316 | goto do_sku; |
1316 | } | ||
1317 | 1317 | ||
1318 | nid = 0x1d; | 1318 | nid = 0x1d; |
1319 | if (codec->vendor_id == 0x10ec0260) | 1319 | if (codec->vendor_id == 0x10ec0260) |
@@ -5280,8 +5280,24 @@ static void fillup_priv_adc_nids(struct hda_codec *codec, hda_nid_t *nids, | |||
5280 | #ifdef CONFIG_SND_HDA_INPUT_BEEP | 5280 | #ifdef CONFIG_SND_HDA_INPUT_BEEP |
5281 | #define set_beep_amp(spec, nid, idx, dir) \ | 5281 | #define set_beep_amp(spec, nid, idx, dir) \ |
5282 | ((spec)->beep_amp = HDA_COMPOSE_AMP_VAL(nid, 3, idx, dir)) | 5282 | ((spec)->beep_amp = HDA_COMPOSE_AMP_VAL(nid, 3, idx, dir)) |
5283 | |||
5284 | static struct snd_pci_quirk beep_white_list[] = { | ||
5285 | SND_PCI_QUIRK(0x1043, 0x829f, "ASUS", 1), | ||
5286 | {} | ||
5287 | }; | ||
5288 | |||
5289 | static inline int has_cdefine_beep(struct hda_codec *codec) | ||
5290 | { | ||
5291 | struct alc_spec *spec = codec->spec; | ||
5292 | const struct snd_pci_quirk *q; | ||
5293 | q = snd_pci_quirk_lookup(codec->bus->pci, beep_white_list); | ||
5294 | if (q) | ||
5295 | return q->value; | ||
5296 | return spec->cdefine.enable_pcbeep; | ||
5297 | } | ||
5283 | #else | 5298 | #else |
5284 | #define set_beep_amp(spec, nid, idx, dir) /* NOP */ | 5299 | #define set_beep_amp(spec, nid, idx, dir) /* NOP */ |
5300 | #define has_cdefine_beep(codec) 0 | ||
5285 | #endif | 5301 | #endif |
5286 | 5302 | ||
5287 | /* | 5303 | /* |
@@ -10666,10 +10682,12 @@ static int patch_alc882(struct hda_codec *codec) | |||
10666 | } | 10682 | } |
10667 | } | 10683 | } |
10668 | 10684 | ||
10669 | err = snd_hda_attach_beep_device(codec, 0x1); | 10685 | if (has_cdefine_beep(codec)) { |
10670 | if (err < 0) { | 10686 | err = snd_hda_attach_beep_device(codec, 0x1); |
10671 | alc_free(codec); | 10687 | if (err < 0) { |
10672 | return err; | 10688 | alc_free(codec); |
10689 | return err; | ||
10690 | } | ||
10673 | } | 10691 | } |
10674 | 10692 | ||
10675 | if (board_config != ALC882_AUTO) | 10693 | if (board_config != ALC882_AUTO) |
@@ -10719,7 +10737,7 @@ static int patch_alc882(struct hda_codec *codec) | |||
10719 | 10737 | ||
10720 | set_capture_mixer(codec); | 10738 | set_capture_mixer(codec); |
10721 | 10739 | ||
10722 | if (spec->cdefine.enable_pcbeep) | 10740 | if (has_cdefine_beep(codec)) |
10723 | set_beep_amp(spec, 0x0b, 0x05, HDA_INPUT); | 10741 | set_beep_amp(spec, 0x0b, 0x05, HDA_INPUT); |
10724 | 10742 | ||
10725 | if (board_config == ALC882_AUTO) | 10743 | if (board_config == ALC882_AUTO) |
@@ -12535,7 +12553,7 @@ static int patch_alc262(struct hda_codec *codec) | |||
12535 | } | 12553 | } |
12536 | } | 12554 | } |
12537 | 12555 | ||
12538 | if (!spec->no_analog) { | 12556 | if (!spec->no_analog && has_cdefine_beep(codec)) { |
12539 | err = snd_hda_attach_beep_device(codec, 0x1); | 12557 | err = snd_hda_attach_beep_device(codec, 0x1); |
12540 | if (err < 0) { | 12558 | if (err < 0) { |
12541 | alc_free(codec); | 12559 | alc_free(codec); |
@@ -12586,7 +12604,7 @@ static int patch_alc262(struct hda_codec *codec) | |||
12586 | } | 12604 | } |
12587 | if (!spec->cap_mixer && !spec->no_analog) | 12605 | if (!spec->cap_mixer && !spec->no_analog) |
12588 | set_capture_mixer(codec); | 12606 | set_capture_mixer(codec); |
12589 | if (!spec->no_analog && spec->cdefine.enable_pcbeep) | 12607 | if (!spec->no_analog && has_cdefine_beep(codec)) |
12590 | set_beep_amp(spec, 0x0b, 0x05, HDA_INPUT); | 12608 | set_beep_amp(spec, 0x0b, 0x05, HDA_INPUT); |
12591 | 12609 | ||
12592 | spec->vmaster_nid = 0x0c; | 12610 | spec->vmaster_nid = 0x0c; |
@@ -14591,10 +14609,12 @@ static int patch_alc269(struct hda_codec *codec) | |||
14591 | } | 14609 | } |
14592 | } | 14610 | } |
14593 | 14611 | ||
14594 | err = snd_hda_attach_beep_device(codec, 0x1); | 14612 | if (has_cdefine_beep(codec)) { |
14595 | if (err < 0) { | 14613 | err = snd_hda_attach_beep_device(codec, 0x1); |
14596 | alc_free(codec); | 14614 | if (err < 0) { |
14597 | return err; | 14615 | alc_free(codec); |
14616 | return err; | ||
14617 | } | ||
14598 | } | 14618 | } |
14599 | 14619 | ||
14600 | if (board_config != ALC269_AUTO) | 14620 | if (board_config != ALC269_AUTO) |
@@ -14631,7 +14651,7 @@ static int patch_alc269(struct hda_codec *codec) | |||
14631 | 14651 | ||
14632 | if (!spec->cap_mixer) | 14652 | if (!spec->cap_mixer) |
14633 | set_capture_mixer(codec); | 14653 | set_capture_mixer(codec); |
14634 | if (spec->cdefine.enable_pcbeep) | 14654 | if (has_cdefine_beep(codec)) |
14635 | set_beep_amp(spec, 0x0b, 0x04, HDA_INPUT); | 14655 | set_beep_amp(spec, 0x0b, 0x04, HDA_INPUT); |
14636 | 14656 | ||
14637 | if (board_config == ALC269_AUTO) | 14657 | if (board_config == ALC269_AUTO) |
@@ -18828,10 +18848,12 @@ static int patch_alc662(struct hda_codec *codec) | |||
18828 | } | 18848 | } |
18829 | } | 18849 | } |
18830 | 18850 | ||
18831 | err = snd_hda_attach_beep_device(codec, 0x1); | 18851 | if (has_cdefine_beep(codec)) { |
18832 | if (err < 0) { | 18852 | err = snd_hda_attach_beep_device(codec, 0x1); |
18833 | alc_free(codec); | 18853 | if (err < 0) { |
18834 | return err; | 18854 | alc_free(codec); |
18855 | return err; | ||
18856 | } | ||
18835 | } | 18857 | } |
18836 | 18858 | ||
18837 | if (board_config != ALC662_AUTO) | 18859 | if (board_config != ALC662_AUTO) |
@@ -18853,7 +18875,7 @@ static int patch_alc662(struct hda_codec *codec) | |||
18853 | if (!spec->cap_mixer) | 18875 | if (!spec->cap_mixer) |
18854 | set_capture_mixer(codec); | 18876 | set_capture_mixer(codec); |
18855 | 18877 | ||
18856 | if (spec->cdefine.enable_pcbeep) { | 18878 | if (has_cdefine_beep(codec)) { |
18857 | switch (codec->vendor_id) { | 18879 | switch (codec->vendor_id) { |
18858 | case 0x10ec0662: | 18880 | case 0x10ec0662: |
18859 | set_beep_amp(spec, 0x0b, 0x05, HDA_INPUT); | 18881 | set_beep_amp(spec, 0x0b, 0x05, HDA_INPUT); |