Alsa-Devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/1] ThinkPad T410[s] docking station line-out
@ 2010-12-02 16:21 John Baboval
  0 siblings, 0 replies; only message in thread
From: John Baboval @ 2010-12-02 16:21 UTC (permalink / raw)
  To: alsa-devel

Signed-off-by: John Baboval <john.baboval at virtualcomputer.com>
---

diff -r e37815d2e813 sound/pci/hda/patch_conexant.c
--- a/sound/pci/hda/patch_conexant.c	Mon Nov 29 12:56:29 2010 -0500
+++ b/sound/pci/hda/patch_conexant.c	Mon Nov 29 17:35:36 2010 -0500
@@ -2060,20 +2060,29 @@
  	struct conexant_spec *spec = codec->spec;
  	unsigned int pinctl;

-	snd_printdd("CXT5066: update speaker, hp_present=%d\n",
-		spec->hp_present);
+	snd_printdd("CXT5066: update speaker, hp_present=%d, cur_eapd=%d\n",
+		    spec->hp_present, spec->cur_eapd);

  	/* Port A (HP) */
  	pinctl = ((spec->hp_present&  1)&&  spec->cur_eapd) ? PIN_HP : 0;
  	snd_hda_codec_write(codec, 0x19, 0, AC_VERB_SET_PIN_WIDGET_CONTROL,
  			pinctl);

-	/* Port D (HP/LO) */
-	pinctl = ((spec->hp_present&  2)&&  spec->cur_eapd)
-		? spec->port_d_mode : 0;
-	/* Mute if Port A is connected on Thinkpad */
-	if (spec->thinkpad&&  (spec->hp_present&  1))
-		pinctl = 0;
+	/* Port D (HP/LO */
+	if (spec->dell_automute) {
+                /* DELL AIO Port Rule: PortA>  PortD>  IntSpk */
+                pinctl = (!(spec->hp_present&  1)&&  spec->cur_eapd)
+                        ? PIN_OUT : 0;
+	} else if (spec->thinkpad) {
+		if (spec->cur_eapd)
+			pinctl = spec->port_d_mode;
+		/* Mute dock line-out if Port A (laptop HP) is present */
+		if (spec->hp_present&  1)
+			pinctl = 0;
+	} else {
+		pinctl = ((spec->hp_present&  2)&&  spec->cur_eapd)
+		        ? spec->port_d_mode : 0;
+	}
  	snd_hda_codec_write(codec, 0x1c, 0, AC_VERB_SET_PIN_WIDGET_CONTROL,
  			pinctl);

@@ -2081,14 +2090,6 @@
  	pinctl = (!spec->hp_present&&  spec->cur_eapd) ? PIN_OUT : 0;
  	snd_hda_codec_write(codec, 0x1f, 0, AC_VERB_SET_PIN_WIDGET_CONTROL,
  			pinctl);
-
-	if (spec->dell_automute) {
-		/* DELL AIO Port Rule: PortA>  PortD>  IntSpk */
-		pinctl = (!(spec->hp_present&  1)&&  spec->cur_eapd)
-			? PIN_OUT : 0;
-		snd_hda_codec_write(codec, 0x1c, 0,
-			AC_VERB_SET_PIN_WIDGET_CONTROL, pinctl);
-	}
  }

  /* turn on/off EAPD (+ mute HP) as a master switch */

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2010-12-02 16:21 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-12-02 16:21 [PATCH 1/1] ThinkPad T410[s] docking station line-out John Baboval

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox