aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2012-02-16 10:43:09 -0500
committerTakashi Iwai <tiwai@suse.de>2012-02-16 10:43:09 -0500
commit00bc0ce9130551ef193c3f5db0b7b6e70dff28ac (patch)
treeb6b022250a08073e522ed1bba56586b534a3c77e /sound/pci
parenta7f3eedc88b547e0ec35ba4cc4ae61cd9bc760ac (diff)
parentc14c95f62ecb8710af14ae0d48e01991b70bb6f4 (diff)
Merge branch 'fix/hda' into topic/hda
The fix for bitmap-overflow in Realtek codec driver is needed for the further development of the auto-parser with badness evaluation.
Diffstat (limited to 'sound/pci')
-rw-r--r--sound/pci/hda/patch_realtek.c34
-rw-r--r--sound/pci/hda/patch_via.c3
-rw-r--r--sound/pci/intel8x0.c6
3 files changed, 40 insertions, 3 deletions
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
index b8e06eb96e11..0ffccc178957 100644
--- a/sound/pci/hda/patch_realtek.c
+++ b/sound/pci/hda/patch_realtek.c
@@ -80,6 +80,8 @@ enum {
80 ALC_AUTOMUTE_MIXER, /* mute/unmute mixer widget AMP */ 80 ALC_AUTOMUTE_MIXER, /* mute/unmute mixer widget AMP */
81}; 81};
82 82
83#define MAX_VOL_NIDS 0x40
84
83struct alc_spec { 85struct alc_spec {
84 /* codec parameterization */ 86 /* codec parameterization */
85 const struct snd_kcontrol_new *mixers[5]; /* mixer arrays */ 87 const struct snd_kcontrol_new *mixers[5]; /* mixer arrays */
@@ -118,8 +120,8 @@ struct alc_spec {
118 const hda_nid_t *capsrc_nids; 120 const hda_nid_t *capsrc_nids;
119 hda_nid_t dig_in_nid; /* digital-in NID; optional */ 121 hda_nid_t dig_in_nid; /* digital-in NID; optional */
120 hda_nid_t mixer_nid; /* analog-mixer NID */ 122 hda_nid_t mixer_nid; /* analog-mixer NID */
121 DECLARE_BITMAP(vol_ctls, 0x20 << 1); 123 DECLARE_BITMAP(vol_ctls, MAX_VOL_NIDS << 1);
122 DECLARE_BITMAP(sw_ctls, 0x20 << 1); 124 DECLARE_BITMAP(sw_ctls, MAX_VOL_NIDS << 1);
123 125
124 /* capture setup for dynamic dual-adc switch */ 126 /* capture setup for dynamic dual-adc switch */
125 hda_nid_t cur_adc; 127 hda_nid_t cur_adc;
@@ -3125,7 +3127,10 @@ static int alc_auto_fill_dac_nids(struct hda_codec *codec)
3125static inline unsigned int get_ctl_pos(unsigned int data) 3127static inline unsigned int get_ctl_pos(unsigned int data)
3126{ 3128{
3127 hda_nid_t nid = get_amp_nid_(data); 3129 hda_nid_t nid = get_amp_nid_(data);
3128 unsigned int dir = get_amp_direction_(data); 3130 unsigned int dir;
3131 if (snd_BUG_ON(nid >= MAX_VOL_NIDS))
3132 return 0;
3133 dir = get_amp_direction_(data);
3129 return (nid << 1) | dir; 3134 return (nid << 1) | dir;
3130} 3135}
3131 3136
@@ -4399,6 +4404,7 @@ enum {
4399 ALC882_FIXUP_ACER_ASPIRE_8930G, 4404 ALC882_FIXUP_ACER_ASPIRE_8930G,
4400 ALC882_FIXUP_ASPIRE_8930G_VERBS, 4405 ALC882_FIXUP_ASPIRE_8930G_VERBS,
4401 ALC885_FIXUP_MACPRO_GPIO, 4406 ALC885_FIXUP_MACPRO_GPIO,
4407 ALC889_FIXUP_DAC_ROUTE,
4402}; 4408};
4403 4409
4404static void alc889_fixup_coef(struct hda_codec *codec, 4410static void alc889_fixup_coef(struct hda_codec *codec,
@@ -4452,6 +4458,23 @@ static void alc885_fixup_macpro_gpio(struct hda_codec *codec,
4452 alc882_gpio_mute(codec, 1, 0); 4458 alc882_gpio_mute(codec, 1, 0);
4453} 4459}
4454 4460
4461/* Fix the connection of some pins for ALC889:
4462 * At least, Acer Aspire 5935 shows the connections to DAC3/4 don't
4463 * work correctly (bko#42740)
4464 */
4465static void alc889_fixup_dac_route(struct hda_codec *codec,
4466 const struct alc_fixup *fix, int action)
4467{
4468 if (action == ALC_FIXUP_ACT_PRE_PROBE) {
4469 hda_nid_t conn1[2] = { 0x0c, 0x0d };
4470 hda_nid_t conn2[2] = { 0x0e, 0x0f };
4471 snd_hda_override_conn_list(codec, 0x14, 2, conn1);
4472 snd_hda_override_conn_list(codec, 0x15, 2, conn1);
4473 snd_hda_override_conn_list(codec, 0x18, 2, conn2);
4474 snd_hda_override_conn_list(codec, 0x1a, 2, conn2);
4475 }
4476}
4477
4455static const struct alc_fixup alc882_fixups[] = { 4478static const struct alc_fixup alc882_fixups[] = {
4456 [ALC882_FIXUP_ABIT_AW9D_MAX] = { 4479 [ALC882_FIXUP_ABIT_AW9D_MAX] = {
4457 .type = ALC_FIXUP_PINS, 4480 .type = ALC_FIXUP_PINS,
@@ -4599,6 +4622,10 @@ static const struct alc_fixup alc882_fixups[] = {
4599 .type = ALC_FIXUP_FUNC, 4622 .type = ALC_FIXUP_FUNC,
4600 .v.func = alc885_fixup_macpro_gpio, 4623 .v.func = alc885_fixup_macpro_gpio,
4601 }, 4624 },
4625 [ALC889_FIXUP_DAC_ROUTE] = {
4626 .type = ALC_FIXUP_FUNC,
4627 .v.func = alc889_fixup_dac_route,
4628 },
4602}; 4629};
4603 4630
4604static const struct snd_pci_quirk alc882_fixup_tbl[] = { 4631static const struct snd_pci_quirk alc882_fixup_tbl[] = {
@@ -4623,6 +4650,7 @@ static const struct snd_pci_quirk alc882_fixup_tbl[] = {
4623 SND_PCI_QUIRK(0x1025, 0x0142, "Acer Aspire 7730G", 4650 SND_PCI_QUIRK(0x1025, 0x0142, "Acer Aspire 7730G",
4624 ALC882_FIXUP_ACER_ASPIRE_4930G), 4651 ALC882_FIXUP_ACER_ASPIRE_4930G),
4625 SND_PCI_QUIRK(0x1025, 0x0155, "Packard-Bell M5120", ALC882_FIXUP_PB_M5210), 4652 SND_PCI_QUIRK(0x1025, 0x0155, "Packard-Bell M5120", ALC882_FIXUP_PB_M5210),
4653 SND_PCI_QUIRK(0x1025, 0x0259, "Acer Aspire 5935", ALC889_FIXUP_DAC_ROUTE),
4626 SND_PCI_QUIRK(0x1025, 0x0296, "Acer Aspire 7736z", ALC882_FIXUP_ACER_ASPIRE_7736), 4654 SND_PCI_QUIRK(0x1025, 0x0296, "Acer Aspire 7736z", ALC882_FIXUP_ACER_ASPIRE_7736),
4627 SND_PCI_QUIRK(0x1043, 0x13c2, "Asus A7M", ALC882_FIXUP_EAPD), 4655 SND_PCI_QUIRK(0x1043, 0x13c2, "Asus A7M", ALC882_FIXUP_EAPD),
4628 SND_PCI_QUIRK(0x1043, 0x1873, "ASUS W90V", ALC882_FIXUP_ASUS_W90V), 4656 SND_PCI_QUIRK(0x1043, 0x1873, "ASUS W90V", ALC882_FIXUP_ASUS_W90V),
diff --git a/sound/pci/hda/patch_via.c b/sound/pci/hda/patch_via.c
index e5842fe1b1e8..c7eb4d7d05c0 100644
--- a/sound/pci/hda/patch_via.c
+++ b/sound/pci/hda/patch_via.c
@@ -666,6 +666,9 @@ static void via_auto_init_analog_input(struct hda_codec *codec)
666 /* init input-src */ 666 /* init input-src */
667 for (i = 0; i < spec->num_adc_nids; i++) { 667 for (i = 0; i < spec->num_adc_nids; i++) {
668 int adc_idx = spec->inputs[spec->cur_mux[i]].adc_idx; 668 int adc_idx = spec->inputs[spec->cur_mux[i]].adc_idx;
669 /* secondary ADCs must have the unique MUX */
670 if (i > 0 && !spec->mux_nids[i])
671 break;
669 if (spec->mux_nids[adc_idx]) { 672 if (spec->mux_nids[adc_idx]) {
670 int mux_idx = spec->inputs[spec->cur_mux[i]].mux_idx; 673 int mux_idx = spec->inputs[spec->cur_mux[i]].mux_idx;
671 snd_hda_codec_write(codec, spec->mux_nids[adc_idx], 0, 674 snd_hda_codec_write(codec, spec->mux_nids[adc_idx], 0,
diff --git a/sound/pci/intel8x0.c b/sound/pci/intel8x0.c
index 9f3b01bb72c8..e0a4263baa20 100644
--- a/sound/pci/intel8x0.c
+++ b/sound/pci/intel8x0.c
@@ -2102,6 +2102,12 @@ static struct ac97_quirk ac97_quirks[] __devinitdata = {
2102 }, 2102 },
2103 { 2103 {
2104 .subvendor = 0x161f, 2104 .subvendor = 0x161f,
2105 .subdevice = 0x202f,
2106 .name = "Gateway M520",
2107 .type = AC97_TUNE_INV_EAPD
2108 },
2109 {
2110 .subvendor = 0x161f,
2105 .subdevice = 0x203a, 2111 .subdevice = 0x203a,
2106 .name = "Gateway 4525GZ", /* AD1981B */ 2112 .name = "Gateway 4525GZ", /* AD1981B */
2107 .type = AC97_TUNE_INV_EAPD 2113 .type = AC97_TUNE_INV_EAPD