[PATCH] [UBUNTU:sound/pci/hda/] Fix mic input for STAC92xx HDA codecs

crimsun at fungus.sh.nu crimsun at fungus.sh.nu
Sun Oct 8 01:59:19 UTC 2006


From a3af3852f0bde94630b87d68dafe83735c0d65d5 Mon Sep 17 00:00:00 2001
From: Daniel T. Chen <crimsun at garnish.localdomain>
Date: Sat, 7 Oct 2006 21:12:48 -0400
Subject: [PATCH] [UBUNTU:sound/pci/hda/] Fix mic input for STAC92xx HDA codecs

UpstreamStatus: Added in upstream alsa-kernel hg changeset:
		485d967b52ab [http://hg-mirror.alsa-project.org/alsa-kernel?cmd=changeset;node=485d967b52ab12cbde1d4c9d2faed8c49cfa06a1;style=raw]

This patch from Takashi Iwai completes the backporting of current
Sigmatel HDA fixes by fixing the mic pin setting, which could be
set to OUTPUT by auto-detection. This commit also attempts to
assign a secondary mic as front-mic (or vice versa).

This commit is applicable to both Dapper and Edgy linux-source
provided the previous set of Sigmatel fixes are first applied.

Signed-off-by: Daniel T Chen <crimsun at ubuntu.com>
---
 sound/pci/hda/hda_codec.c |   19 ++++++++++++++-----
 1 files changed, 14 insertions(+), 5 deletions(-)

diff --git a/sound/pci/hda/hda_codec.c b/sound/pci/hda/hda_codec.c
index 2e7344b..c5ab756 100644
--- a/sound/pci/hda/hda_codec.c
+++ b/sound/pci/hda/hda_codec.c
@@ -2031,12 +2031,21 @@ int snd_hda_parse_pin_def_config(struct 
 		case AC_JACK_HP_OUT:
 			cfg->hp_pin = nid;
 			break;
-		case AC_JACK_MIC_IN:
-			if (loc == AC_JACK_LOC_FRONT)
-				cfg->input_pins[AUTO_PIN_FRONT_MIC] = nid;
-			else
-				cfg->input_pins[AUTO_PIN_MIC] = nid;
+		case AC_JACK_MIC_IN: {
+			int preferred, alt;
+			if (loc == AC_JACK_LOC_FRONT) {
+				preferred = AUTO_PIN_FRONT_MIC;
+				alt = AUTO_PIN_MIC;
+			} else {
+				preferred = AUTO_PIN_MIC;
+				alt = AUTO_PIN_FRONT_MIC;
+			}
+			if (!cfg->input_pins[preferred])
+				cfg->input_pins[preferred] = nid;
+			else if (!cfg->input_pins[alt])
+				cfg->input_pins[alt] = nid;
 			break;
+		}
 		case AC_JACK_LINE_IN:
 			if (loc == AC_JACK_LOC_FRONT)
 				cfg->input_pins[AUTO_PIN_FRONT_LINE] = nid;
-- 
1.4.1


-- 
Daniel T. Chen            crimsun at ubuntu.com
GPG key:  0xC88ABDA3
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <https://lists.ubuntu.com/archives/kernel-team/attachments/20061007/7801910c/attachment.sig>


More information about the kernel-team mailing list