[prev in list] [next in list] [prev in thread] [next in thread] 

List:       openbsd-tech
Subject:    azalia: differentiate between line-in and line-out
From:       Jacob Meuser <jakemsr () sdf ! lonestar ! org>
Date:       2008-11-30 22:29:22
Message-ID: 20081130222922.GA25580 () SDF ! LONESTAR ! ORG
[Download RAW message or body]

this has long bugged me.  currently we call both line-in and line-out
just "line".  this make line-in, "line-in" and line-out "line".

I'm pretty sure the reason only "line" was used was to avoid name
truncation, but I don't think that is a problem anymore.  but I
can't know without some tests ...

-- 
jakemsr@sdf.lonestar.org
SDF Public Access UNIX System - http://sdf.lonestar.org

Index: azalia.c
===================================================================
RCS file: /cvs/src/sys/dev/pci/azalia.c,v
retrieving revision 1.79
diff -u -r1.79 azalia.c
--- azalia.c	30 Nov 2008 20:06:41 -0000	1.79
+++ azalia.c	30 Nov 2008 22:24:22 -0000
@@ -328,7 +328,7 @@
 static const char *pin_devices[16] = {
 	AudioNline, AudioNspeaker, AudioNheadphone, AudioNcd,
 	"SPDIF-out", "digital-out", "modem-line", "modem-handset",
-	AudioNline, AudioNaux, AudioNmicrophone, "telephony",
+	"line-in", AudioNaux, AudioNmicrophone, "telephony",
 	"SPDIF-in", "digital-in", "dev0e", "other"};
 static const char *wtypes[16] = {
 	"dac", "adc", "mix", "sel", "pin", "pow", "volume",
@@ -1722,24 +1722,13 @@
 		w = &codec->w[i];
 		if (w->type == COP_AWTYPE_PIN_COMPLEX) {
 			pins[w->d.pin.device]++;
-			if (w->d.pin.device == CORB_CD_LINEIN) {
-				pins[CORB_CD_LINEOUT]++;
-				if (pins[CORB_CD_LINEOUT] > 1)
-					snprintf(w->name, sizeof(w->name), "%s%d",
-					    pin_devices[CORB_CD_LINEOUT],
-					    pins[CORB_CD_LINEOUT]);
-				else
-					snprintf(w->name, sizeof(w->name), "%s",
-					    pin_devices[CORB_CD_LINEOUT]);
-			} else {
-				if (pins[w->d.pin.device] > 1)
-					snprintf(w->name, sizeof(w->name), "%s%d",
-					    pin_devices[w->d.pin.device],
-					    pins[w->d.pin.device]);
-				else
-					snprintf(w->name, sizeof(w->name), "%s",
-					    pin_devices[w->d.pin.device]);
-			}
+			if (pins[w->d.pin.device] > 1)
+				snprintf(w->name, sizeof(w->name), "%s%d",
+				    pin_devices[w->d.pin.device],
+				    pins[w->d.pin.device]);
+			else
+				snprintf(w->name, sizeof(w->name), "%s",
+				    pin_devices[w->d.pin.device]);
 		} else {
 			types[w->type]++;
 			if (types[w->type] > 1)

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic