aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci/hda/patch_analog.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/pci/hda/patch_analog.c')
-rw-r--r--sound/pci/hda/patch_analog.c17
1 files changed, 9 insertions, 8 deletions
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)