aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2009-12-09 22:52:13 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2009-12-09 22:52:13 -0500
commit78f1ae193d1662c22cfebb916e788e1ca896c0fe (patch)
tree0cca2c3d68c8ea48786cd3e9912f822fee7d1e17 /sound/pci
parentfa395aaec823b9d1a5800913a6b5d0e6d1c5ced2 (diff)
parent84194883bcf89383ea4230116bb0195af5ec5829 (diff)
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6: ALSA: ice1724 - aureon - modify WM8770 Master & DAC volume ALSA: hda/realtek: quirk for D945GCLF2 mainboard ALSA: hda - Terradici HDA controllers does not support 64-bit mode ALSA: document: Add direct git link to grub hda-analyzer ALSA: radio/sound/miro: fix build, cleanup depends/selects ALSA: hda - Generalize EAPD inversion check in patch_analog.c ASoC: Wrong variable returned on error ALSA: snd-usb-us122l: add product IDs of US-122MKII and US-144MKII ALSA: hda - Exclude unusable ADCs for ALC88x ALSA: hda - Add missing Line-Out and PCM switches as slave ALSA: hda - iMac 9,1 sound patch. ALSA: opti93x: set MC indirect registers base from PnP data
Diffstat (limited to 'sound/pci')
-rw-r--r--sound/pci/hda/hda_intel.c5
-rw-r--r--sound/pci/hda/patch_analog.c17
-rw-r--r--sound/pci/hda/patch_realtek.c127
-rw-r--r--sound/pci/ice1712/aureon.c31
4 files changed, 147 insertions, 33 deletions
diff --git a/sound/pci/hda/hda_intel.c b/sound/pci/hda/hda_intel.c
index d822bfc6cad6..efcc4f7c57f2 100644
--- a/sound/pci/hda/hda_intel.c
+++ b/sound/pci/hda/hda_intel.c
@@ -2450,6 +2450,11 @@ static int __devinit azx_create(struct snd_card *card, struct pci_dev *pci,
2450 } 2450 }
2451 } 2451 }
2452 2452
2453 /* disable 64bit DMA address for Teradici */
2454 /* it does not work with device 6549:1200 subsys e4a2:040b */
2455 if (chip->driver_type == AZX_DRIVER_TERA)
2456 gcap &= ~ICH6_GCAP_64OK;
2457
2453 /* allow 64bit DMA address if supported by H/W */ 2458 /* allow 64bit DMA address if supported by H/W */
2454 if ((gcap & ICH6_GCAP_64OK) && !pci_set_dma_mask(pci, DMA_BIT_MASK(64))) 2459 if ((gcap & ICH6_GCAP_64OK) && !pci_set_dma_mask(pci, DMA_BIT_MASK(64)))
2455 pci_set_consistent_dma_mask(pci, DMA_BIT_MASK(64)); 2460 pci_set_consistent_dma_mask(pci, DMA_BIT_MASK(64));
diff --git a/sound/pci/hda/patch_analog.c b/sound/pci/hda/patch_analog.c
index 455a0494f907..447eda1f6770 100644
--- a/sound/pci/hda/patch_analog.c
+++ b/sound/pci/hda/patch_analog.c
@@ -72,7 +72,8 @@ struct ad198x_spec {
72 hda_nid_t private_dac_nids[AUTO_CFG_MAX_OUTS]; 72 hda_nid_t private_dac_nids[AUTO_CFG_MAX_OUTS];
73 73
74 unsigned int jack_present :1; 74 unsigned int jack_present :1;
75 unsigned int inv_jack_detect:1; 75 unsigned int inv_jack_detect:1; /* inverted jack-detection */
76 unsigned int inv_eapd:1; /* inverted EAPD implementation */
76 77
77#ifdef CONFIG_SND_HDA_POWER_SAVE 78#ifdef CONFIG_SND_HDA_POWER_SAVE
78 struct hda_loopback_check loopback; 79 struct hda_loopback_check loopback;
@@ -458,7 +459,7 @@ static struct hda_codec_ops ad198x_patch_ops = {
458 459
459/* 460/*
460 * EAPD control 461 * EAPD control
461 * the private value = nid | (invert << 8) 462 * the private value = nid
462 */ 463 */
463#define ad198x_eapd_info snd_ctl_boolean_mono_info 464#define ad198x_eapd_info snd_ctl_boolean_mono_info
464 465
@@ -467,8 +468,7 @@ static int ad198x_eapd_get(struct snd_kcontrol *kcontrol,
467{ 468{
468 struct hda_codec *codec = snd_kcontrol_chip(kcontrol); 469 struct hda_codec *codec = snd_kcontrol_chip(kcontrol);
469 struct ad198x_spec *spec = codec->spec; 470 struct ad198x_spec *spec = codec->spec;
470 int invert = (kcontrol->private_value >> 8) & 1; 471 if (spec->inv_eapd)
471 if (invert)
472 ucontrol->value.integer.value[0] = ! spec->cur_eapd; 472 ucontrol->value.integer.value[0] = ! spec->cur_eapd;
473 else 473 else
474 ucontrol->value.integer.value[0] = spec->cur_eapd; 474 ucontrol->value.integer.value[0] = spec->cur_eapd;
@@ -480,11 +480,10 @@ static int ad198x_eapd_put(struct snd_kcontrol *kcontrol,
480{ 480{
481 struct hda_codec *codec = snd_kcontrol_chip(kcontrol); 481 struct hda_codec *codec = snd_kcontrol_chip(kcontrol);
482 struct ad198x_spec *spec = codec->spec; 482 struct ad198x_spec *spec = codec->spec;
483 int invert = (kcontrol->private_value >> 8) & 1;
484 hda_nid_t nid = kcontrol->private_value & 0xff; 483 hda_nid_t nid = kcontrol->private_value & 0xff;
485 unsigned int eapd; 484 unsigned int eapd;
486 eapd = !!ucontrol->value.integer.value[0]; 485 eapd = !!ucontrol->value.integer.value[0];
487 if (invert) 486 if (spec->inv_eapd)
488 eapd = !eapd; 487 eapd = !eapd;
489 if (eapd == spec->cur_eapd) 488 if (eapd == spec->cur_eapd)
490 return 0; 489 return 0;
@@ -705,7 +704,7 @@ static struct snd_kcontrol_new ad1986a_laptop_eapd_mixers[] = {
705 .info = ad198x_eapd_info, 704 .info = ad198x_eapd_info,
706 .get = ad198x_eapd_get, 705 .get = ad198x_eapd_get,
707 .put = ad198x_eapd_put, 706 .put = ad198x_eapd_put,
708 .private_value = 0x1b | (1 << 8), /* port-D, inversed */ 707 .private_value = 0x1b, /* port-D */
709 }, 708 },
710 { } /* end */ 709 { } /* end */
711}; 710};
@@ -1074,6 +1073,7 @@ static int patch_ad1986a(struct hda_codec *codec)
1074 spec->loopback.amplist = ad1986a_loopbacks; 1073 spec->loopback.amplist = ad1986a_loopbacks;
1075#endif 1074#endif
1076 spec->vmaster_nid = 0x1b; 1075 spec->vmaster_nid = 0x1b;
1076 spec->inv_eapd = 1; /* AD1986A has the inverted EAPD implementation */
1077 1077
1078 codec->patch_ops = ad198x_patch_ops; 1078 codec->patch_ops = ad198x_patch_ops;
1079 1079
@@ -2124,7 +2124,7 @@ static struct snd_kcontrol_new ad1988_laptop_mixers[] = {
2124 .info = ad198x_eapd_info, 2124 .info = ad198x_eapd_info,
2125 .get = ad198x_eapd_get, 2125 .get = ad198x_eapd_get,
2126 .put = ad198x_eapd_put, 2126 .put = ad198x_eapd_put,
2127 .private_value = 0x12 | (1 << 8), /* port-D, inversed */ 2127 .private_value = 0x12, /* port-D */
2128 }, 2128 },
2129 2129
2130 { } /* end */ 2130 { } /* end */
@@ -3065,6 +3065,7 @@ static int patch_ad1988(struct hda_codec *codec)
3065 spec->input_mux = &ad1988_laptop_capture_source; 3065 spec->input_mux = &ad1988_laptop_capture_source;
3066 spec->num_mixers = 1; 3066 spec->num_mixers = 1;
3067 spec->mixers[0] = ad1988_laptop_mixers; 3067 spec->mixers[0] = ad1988_laptop_mixers;
3068 spec->inv_eapd = 1; /* inverted EAPD */
3068 spec->num_init_verbs = 1; 3069 spec->num_init_verbs = 1;
3069 spec->init_verbs[0] = ad1988_laptop_init_verbs; 3070 spec->init_verbs[0] = ad1988_laptop_init_verbs;
3070 if (board_config == AD1988_LAPTOP_DIG) 3071 if (board_config == AD1988_LAPTOP_DIG)
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
index db4a7367b625..888b6313eeca 100644
--- a/sound/pci/hda/patch_realtek.c
+++ b/sound/pci/hda/patch_realtek.c
@@ -208,6 +208,7 @@ enum {
208 ALC885_MBP3, 208 ALC885_MBP3,
209 ALC885_MB5, 209 ALC885_MB5,
210 ALC885_IMAC24, 210 ALC885_IMAC24,
211 ALC885_IMAC91,
211 ALC883_3ST_2ch_DIG, 212 ALC883_3ST_2ch_DIG,
212 ALC883_3ST_6ch_DIG, 213 ALC883_3ST_6ch_DIG,
213 ALC883_3ST_6ch, 214 ALC883_3ST_6ch,
@@ -2400,6 +2401,8 @@ static const char *alc_slave_sws[] = {
2400 "Speaker Playback Switch", 2401 "Speaker Playback Switch",
2401 "Mono Playback Switch", 2402 "Mono Playback Switch",
2402 "IEC958 Playback Switch", 2403 "IEC958 Playback Switch",
2404 "Line-Out Playback Switch",
2405 "PCM Playback Switch",
2403 NULL, 2406 NULL,
2404}; 2407};
2405 2408
@@ -7050,6 +7053,20 @@ static struct snd_kcontrol_new alc885_mb5_mixer[] = {
7050 { } /* end */ 7053 { } /* end */
7051}; 7054};
7052 7055
7056static struct snd_kcontrol_new alc885_imac91_mixer[] = {
7057 HDA_CODEC_VOLUME("Line-Out Playback Volume", 0x0c, 0x00, HDA_OUTPUT),
7058 HDA_BIND_MUTE ("Line-Out Playback Switch", 0x0c, 0x02, HDA_INPUT),
7059 HDA_CODEC_MUTE ("Speaker Playback Switch", 0x14, 0x00, HDA_OUTPUT),
7060 HDA_CODEC_VOLUME("Speaker Playback Volume", 0x0d, 0x00, HDA_OUTPUT),
7061 HDA_CODEC_VOLUME("Line Playback Volume", 0x0b, 0x02, HDA_INPUT),
7062 HDA_CODEC_MUTE ("Line Playback Switch", 0x0b, 0x02, HDA_INPUT),
7063 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x00, HDA_INPUT),
7064 HDA_CODEC_MUTE ("Mic Playback Switch", 0x0b, 0x00, HDA_INPUT),
7065 HDA_CODEC_VOLUME("Mic Boost", 0x18, 0x00, HDA_INPUT),
7066 { } /* end */
7067};
7068
7069
7053static struct snd_kcontrol_new alc882_w2jc_mixer[] = { 7070static struct snd_kcontrol_new alc882_w2jc_mixer[] = {
7054 HDA_CODEC_VOLUME("Front Playback Volume", 0x0c, 0x0, HDA_OUTPUT), 7071 HDA_CODEC_VOLUME("Front Playback Volume", 0x0c, 0x0, HDA_OUTPUT),
7055 HDA_BIND_MUTE("Front Playback Switch", 0x0c, 2, HDA_INPUT), 7072 HDA_BIND_MUTE("Front Playback Switch", 0x0c, 2, HDA_INPUT),
@@ -7505,6 +7522,66 @@ static struct hda_verb alc885_mbp3_init_verbs[] = {
7505 { } 7522 { }
7506}; 7523};
7507 7524
7525/* iMac 9,1 */
7526static struct hda_verb alc885_imac91_init_verbs[] = {
7527 /* Line-Out mixer: unmute input/output amp left and right (volume = 0) */
7528 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO},
7529 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
7530 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)},
7531 /* Rear mixer */
7532 {0x0d, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO},
7533 {0x0d, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
7534 {0x0d, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)},
7535 /* HP Pin: output 0 (0x0c) */
7536 {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP},
7537 {0x14, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
7538 {0x14, AC_VERB_SET_CONNECT_SEL, 0x00},
7539 {0x14, AC_VERB_SET_UNSOLICITED_ENABLE, ALC880_HP_EVENT | AC_USRSP_EN},
7540 /* Internal Speakers: output 0 (0x0d) */
7541 {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
7542 {0x15, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
7543 {0x15, AC_VERB_SET_CONNECT_SEL, 0x00},
7544 /* Mic (rear) pin: input vref at 80% */
7545 {0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80},
7546 {0x18, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
7547 /* Front Mic pin: input vref at 80% */
7548 {0x19, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80},
7549 {0x19, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
7550 /* Line In pin: use output 1 when in LineOut mode */
7551 {0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN},
7552 {0x1a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
7553 {0x1a, AC_VERB_SET_CONNECT_SEL, 0x01},
7554
7555 /* FIXME: use matrix-type input source selection */
7556 /* Mixer elements: 0x18, 19, 1a, 1b, 1c, 1d, 14, 15, 16, 17, 0b */
7557 /* Input mixer1: unmute Mic, F-Mic, Line, CD inputs */
7558 {0x24, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
7559 {0x24, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(3)},
7560 {0x24, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(2)},
7561 {0x24, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(4)},
7562 /* Input mixer2 */
7563 {0x23, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
7564 {0x23, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(3)},
7565 {0x23, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(2)},
7566 {0x23, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(4)},
7567 /* Input mixer3 */
7568 {0x22, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
7569 {0x22, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(3)},
7570 {0x22, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(2)},
7571 {0x22, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(4)},
7572 /* ADC1: mute amp left and right */
7573 {0x07, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
7574 {0x07, AC_VERB_SET_CONNECT_SEL, 0x00},
7575 /* ADC2: mute amp left and right */
7576 {0x08, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
7577 {0x08, AC_VERB_SET_CONNECT_SEL, 0x00},
7578 /* ADC3: mute amp left and right */
7579 {0x09, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
7580 {0x09, AC_VERB_SET_CONNECT_SEL, 0x00},
7581
7582 { }
7583};
7584
7508/* iMac 24 mixer. */ 7585/* iMac 24 mixer. */
7509static struct snd_kcontrol_new alc885_imac24_mixer[] = { 7586static struct snd_kcontrol_new alc885_imac24_mixer[] = {
7510 HDA_CODEC_VOLUME("Master Playback Volume", 0x0c, 0x00, HDA_OUTPUT), 7587 HDA_CODEC_VOLUME("Master Playback Volume", 0x0c, 0x00, HDA_OUTPUT),
@@ -7551,6 +7628,26 @@ static void alc885_mbp3_setup(struct hda_codec *codec)
7551 spec->autocfg.speaker_pins[0] = 0x14; 7628 spec->autocfg.speaker_pins[0] = 0x14;
7552} 7629}
7553 7630
7631static void alc885_imac91_automute(struct hda_codec *codec)
7632{
7633 unsigned int present;
7634
7635 present = snd_hda_codec_read(codec, 0x14, 0,
7636 AC_VERB_GET_PIN_SENSE, 0) & 0x80000000;
7637 snd_hda_codec_amp_stereo(codec, 0x15, HDA_OUTPUT, 0,
7638 HDA_AMP_MUTE, present ? HDA_AMP_MUTE : 0);
7639 snd_hda_codec_amp_stereo(codec, 0x1a, HDA_OUTPUT, 0,
7640 HDA_AMP_MUTE, present ? HDA_AMP_MUTE : 0);
7641
7642}
7643
7644static void alc885_imac91_unsol_event(struct hda_codec *codec,
7645 unsigned int res)
7646{
7647 /* Headphone insertion or removal. */
7648 if ((res >> 26) == ALC880_HP_EVENT)
7649 alc885_imac91_automute(codec);
7650}
7554 7651
7555static struct hda_verb alc882_targa_verbs[] = { 7652static struct hda_verb alc882_targa_verbs[] = {
7556 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)}, 7653 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
@@ -8718,6 +8815,7 @@ static const char *alc882_models[ALC882_MODEL_LAST] = {
8718 [ALC885_MB5] = "mb5", 8815 [ALC885_MB5] = "mb5",
8719 [ALC885_MBP3] = "mbp3", 8816 [ALC885_MBP3] = "mbp3",
8720 [ALC885_IMAC24] = "imac24", 8817 [ALC885_IMAC24] = "imac24",
8818 [ALC885_IMAC91] = "imac91",
8721 [ALC883_3ST_2ch_DIG] = "3stack-2ch-dig", 8819 [ALC883_3ST_2ch_DIG] = "3stack-2ch-dig",
8722 [ALC883_3ST_6ch_DIG] = "3stack-6ch-dig", 8820 [ALC883_3ST_6ch_DIG] = "3stack-6ch-dig",
8723 [ALC883_3ST_6ch] = "3stack-6ch", 8821 [ALC883_3ST_6ch] = "3stack-6ch",
@@ -8891,6 +8989,7 @@ static struct snd_pci_quirk alc882_ssid_cfg_tbl[] = {
8891 SND_PCI_QUIRK(0x106b, 0x3600, "Macbook 3,1", ALC889A_MB31), 8989 SND_PCI_QUIRK(0x106b, 0x3600, "Macbook 3,1", ALC889A_MB31),
8892 SND_PCI_QUIRK(0x106b, 0x3800, "MacbookPro 4,1", ALC885_MBP3), 8990 SND_PCI_QUIRK(0x106b, 0x3800, "MacbookPro 4,1", ALC885_MBP3),
8893 SND_PCI_QUIRK(0x106b, 0x3e00, "iMac 24 Aluminum", ALC885_IMAC24), 8991 SND_PCI_QUIRK(0x106b, 0x3e00, "iMac 24 Aluminum", ALC885_IMAC24),
8992 SND_PCI_QUIRK(0x106b, 0x4900, "iMac 9,1 Aluminum", ALC885_IMAC91),
8894 SND_PCI_QUIRK(0x106b, 0x3f00, "Macbook 5,1", ALC885_MB5), 8993 SND_PCI_QUIRK(0x106b, 0x3f00, "Macbook 5,1", ALC885_MB5),
8895 /* FIXME: HP jack sense seems not working for MBP 5,1 or 5,2, 8994 /* FIXME: HP jack sense seems not working for MBP 5,1 or 5,2,
8896 * so apparently no perfect solution yet 8995 * so apparently no perfect solution yet
@@ -9002,6 +9101,20 @@ static struct alc_config_preset alc882_presets[] = {
9002 .setup = alc885_imac24_setup, 9101 .setup = alc885_imac24_setup,
9003 .init_hook = alc885_imac24_init_hook, 9102 .init_hook = alc885_imac24_init_hook,
9004 }, 9103 },
9104 [ALC885_IMAC91] = {
9105 .mixers = { alc885_imac91_mixer, alc882_chmode_mixer },
9106 .init_verbs = { alc885_imac91_init_verbs,
9107 alc880_gpio1_init_verbs },
9108 .num_dacs = ARRAY_SIZE(alc882_dac_nids),
9109 .dac_nids = alc882_dac_nids,
9110 .channel_mode = alc885_mbp_4ch_modes,
9111 .num_channel_mode = ARRAY_SIZE(alc885_mbp_4ch_modes),
9112 .input_mux = &alc882_capture_source,
9113 .dig_out_nid = ALC882_DIGOUT_NID,
9114 .dig_in_nid = ALC882_DIGIN_NID,
9115 .unsol_event = alc885_imac91_unsol_event,
9116 .init_hook = alc885_imac91_automute,
9117 },
9005 [ALC882_TARGA] = { 9118 [ALC882_TARGA] = {
9006 .mixers = { alc882_targa_mixer, alc882_chmode_mixer }, 9119 .mixers = { alc882_targa_mixer, alc882_chmode_mixer },
9007 .init_verbs = { alc882_base_init_verbs, alc882_adc1_init_verbs, 9120 .init_verbs = { alc882_base_init_verbs, alc882_adc1_init_verbs,
@@ -9908,10 +10021,12 @@ static int patch_alc882(struct hda_codec *codec)
9908 spec->init_amp = ALC_INIT_DEFAULT; /* always initialize */ 10021 spec->init_amp = ALC_INIT_DEFAULT; /* always initialize */
9909 10022
9910 if (!spec->adc_nids && spec->input_mux) { 10023 if (!spec->adc_nids && spec->input_mux) {
9911 int i; 10024 int i, j;
9912 spec->num_adc_nids = 0; 10025 spec->num_adc_nids = 0;
9913 for (i = 0; i < ARRAY_SIZE(alc882_adc_nids); i++) { 10026 for (i = 0; i < ARRAY_SIZE(alc882_adc_nids); i++) {
10027 const struct hda_input_mux *imux = spec->input_mux;
9914 hda_nid_t cap; 10028 hda_nid_t cap;
10029 hda_nid_t items[16];
9915 hda_nid_t nid = alc882_adc_nids[i]; 10030 hda_nid_t nid = alc882_adc_nids[i];
9916 unsigned int wcap = get_wcaps(codec, nid); 10031 unsigned int wcap = get_wcaps(codec, nid);
9917 /* get type */ 10032 /* get type */
@@ -9922,6 +10037,15 @@ static int patch_alc882(struct hda_codec *codec)
9922 err = snd_hda_get_connections(codec, nid, &cap, 1); 10037 err = snd_hda_get_connections(codec, nid, &cap, 1);
9923 if (err < 0) 10038 if (err < 0)
9924 continue; 10039 continue;
10040 err = snd_hda_get_connections(codec, cap, items,
10041 ARRAY_SIZE(items));
10042 if (err < 0)
10043 continue;
10044 for (j = 0; j < imux->num_items; j++)
10045 if (imux->items[j].index >= err)
10046 break;
10047 if (j < imux->num_items)
10048 continue;
9925 spec->private_capsrc_nids[spec->num_adc_nids] = cap; 10049 spec->private_capsrc_nids[spec->num_adc_nids] = cap;
9926 spec->num_adc_nids++; 10050 spec->num_adc_nids++;
9927 } 10051 }
@@ -16846,6 +16970,7 @@ static struct snd_pci_quirk alc662_cfg_tbl[] = {
16846 ALC662_3ST_6ch_DIG), 16970 ALC662_3ST_6ch_DIG),
16847 SND_PCI_QUIRK_MASK(0x1854, 0xf000, 0x2000, "ASUS H13-200x", 16971 SND_PCI_QUIRK_MASK(0x1854, 0xf000, 0x2000, "ASUS H13-200x",
16848 ALC663_ASUS_H13), 16972 ALC663_ASUS_H13),
16973 SND_PCI_QUIRK(0x8086, 0xd604, "Intel mobo", ALC662_3ST_2ch_DIG),
16849 {} 16974 {}
16850}; 16975};
16851 16976
diff --git a/sound/pci/ice1712/aureon.c b/sound/pci/ice1712/aureon.c
index 110d16e52733..765d7bd4c3d4 100644
--- a/sound/pci/ice1712/aureon.c
+++ b/sound/pci/ice1712/aureon.c
@@ -689,32 +689,14 @@ static int aureon_ac97_mmute_put(struct snd_kcontrol *kcontrol, struct snd_ctl_e
689 return change; 689 return change;
690} 690}
691 691
692static const DECLARE_TLV_DB_SCALE(db_scale_wm_dac, -12700, 100, 1); 692static const DECLARE_TLV_DB_SCALE(db_scale_wm_dac, -10000, 100, 1);
693static const DECLARE_TLV_DB_SCALE(db_scale_wm_pcm, -6400, 50, 1); 693static const DECLARE_TLV_DB_SCALE(db_scale_wm_pcm, -6400, 50, 1);
694static const DECLARE_TLV_DB_SCALE(db_scale_wm_adc, -1200, 100, 0); 694static const DECLARE_TLV_DB_SCALE(db_scale_wm_adc, -1200, 100, 0);
695static const DECLARE_TLV_DB_SCALE(db_scale_ac97_master, -4650, 150, 0); 695static const DECLARE_TLV_DB_SCALE(db_scale_ac97_master, -4650, 150, 0);
696static const DECLARE_TLV_DB_SCALE(db_scale_ac97_gain, -3450, 150, 0); 696static const DECLARE_TLV_DB_SCALE(db_scale_ac97_gain, -3450, 150, 0);
697 697
698/* 698#define WM_VOL_MAX 100
699 * Logarithmic volume values for WM8770 699#define WM_VOL_CNT 101 /* 0dB .. -100dB */
700 * Computed as 20 * Log10(255 / x)
701 */
702static const unsigned char wm_vol[256] = {
703 127, 48, 42, 39, 36, 34, 33, 31, 30, 29, 28, 27, 27, 26, 25, 25, 24, 24, 23,
704 23, 22, 22, 21, 21, 21, 20, 20, 20, 19, 19, 19, 18, 18, 18, 18, 17, 17, 17,
705 17, 16, 16, 16, 16, 15, 15, 15, 15, 15, 15, 14, 14, 14, 14, 14, 13, 13, 13,
706 13, 13, 13, 13, 12, 12, 12, 12, 12, 12, 12, 11, 11, 11, 11, 11, 11, 11, 11,
707 11, 10, 10, 10, 10, 10, 10, 10, 10, 10, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 8, 8,
708 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 6, 6, 6,
709 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
710 5, 5, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 3, 3, 3, 3, 3,
711 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
712 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
713 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
714 0, 0
715};
716
717#define WM_VOL_MAX (sizeof(wm_vol) - 1)
718#define WM_VOL_MUTE 0x8000 700#define WM_VOL_MUTE 0x8000
719 701
720static void wm_set_vol(struct snd_ice1712 *ice, unsigned int index, unsigned short vol, unsigned short master) 702static void wm_set_vol(struct snd_ice1712 *ice, unsigned int index, unsigned short vol, unsigned short master)
@@ -724,7 +706,8 @@ static void wm_set_vol(struct snd_ice1712 *ice, unsigned int index, unsigned sho
724 if ((master & WM_VOL_MUTE) || (vol & WM_VOL_MUTE)) 706 if ((master & WM_VOL_MUTE) || (vol & WM_VOL_MUTE))
725 nvol = 0; 707 nvol = 0;
726 else 708 else
727 nvol = 127 - wm_vol[(((vol & ~WM_VOL_MUTE) * (master & ~WM_VOL_MUTE)) / 127) & WM_VOL_MAX]; 709 nvol = ((vol % WM_VOL_CNT) * (master % WM_VOL_CNT)) /
710 WM_VOL_MAX;
728 711
729 wm_put(ice, index, nvol); 712 wm_put(ice, index, nvol);
730 wm_put_nocache(ice, index, 0x180 | nvol); 713 wm_put_nocache(ice, index, 0x180 | nvol);
@@ -820,7 +803,7 @@ static int wm_vol_info(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *
820 uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER; 803 uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER;
821 uinfo->count = voices; 804 uinfo->count = voices;
822 uinfo->value.integer.min = 0; /* mute (-101dB) */ 805 uinfo->value.integer.min = 0; /* mute (-101dB) */
823 uinfo->value.integer.max = 0x7F; /* 0dB */ 806 uinfo->value.integer.max = WM_VOL_MAX; /* 0dB */
824 return 0; 807 return 0;
825} 808}
826 809
@@ -850,7 +833,7 @@ static int wm_vol_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *
850 snd_ice1712_save_gpio_status(ice); 833 snd_ice1712_save_gpio_status(ice);
851 for (i = 0; i < voices; i++) { 834 for (i = 0; i < voices; i++) {
852 unsigned int vol = ucontrol->value.integer.value[i]; 835 unsigned int vol = ucontrol->value.integer.value[i];
853 if (vol > 0x7f) 836 if (vol > WM_VOL_MAX)
854 continue; 837 continue;
855 vol |= spec->vol[ofs+i]; 838 vol |= spec->vol[ofs+i];
856 if (vol != spec->vol[ofs+i]) { 839 if (vol != spec->vol[ofs+i]) {