Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 8 Jan 2009 19:43:47 +0000 (UTC)
From:      Alexander Motin <mav@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r186912 - head/sys/dev/sound/pci/hda
Message-ID:  <200901081943.n08JhlNG031900@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: mav
Date: Thu Jan  8 19:43:47 2009
New Revision: 186912
URL: http://svn.freebsd.org/changeset/base/186912

Log:
  Add external connector jack color into widget names.
  It should help users to identify them while reading verbose messages.

Modified:
  head/sys/dev/sound/pci/hda/hdac.c

Modified: head/sys/dev/sound/pci/hda/hdac.c
==============================================================================
--- head/sys/dev/sound/pci/hda/hdac.c	Thu Jan  8 19:13:34 2009	(r186911)
+++ head/sys/dev/sound/pci/hda/hdac.c	Thu Jan  8 19:43:47 2009	(r186912)
@@ -2443,9 +2443,10 @@ hdac_widget_pin_parse(struct hdac_widget
 {
 	struct hdac_softc *sc = w->devinfo->codec->sc;
 	uint32_t config, pincap;
-	const char *devstr, *connstr;
+	const char *devstr;
 	nid_t cad = w->devinfo->codec->cad;
 	nid_t nid = w->nid;
+	int conn, color;
 
 	config = hdac_widget_pin_getconfig(w);
 	w->wclass.pin.config = config;
@@ -2467,13 +2468,19 @@ hdac_widget_pin_parse(struct hdac_widget
 	devstr = HDA_DEVS[(config & HDA_CONFIG_DEFAULTCONF_DEVICE_MASK) >>
 	    HDA_CONFIG_DEFAULTCONF_DEVICE_SHIFT];
 
-	connstr = HDA_CONNS[(config & HDA_CONFIG_DEFAULTCONF_CONNECTIVITY_MASK) >>
-	    HDA_CONFIG_DEFAULTCONF_CONNECTIVITY_SHIFT];
+	conn = (config & HDA_CONFIG_DEFAULTCONF_CONNECTIVITY_MASK) >>
+	    HDA_CONFIG_DEFAULTCONF_CONNECTIVITY_SHIFT;
+	color = (config & HDA_CONFIG_DEFAULTCONF_COLOR_MASK) >>
+	    HDA_CONFIG_DEFAULTCONF_COLOR_SHIFT;
 
 	strlcat(w->name, ": ", sizeof(w->name));
 	strlcat(w->name, devstr, sizeof(w->name));
 	strlcat(w->name, " (", sizeof(w->name));
-	strlcat(w->name, connstr, sizeof(w->name));
+	if (conn == 0 && color != 0 && color != 15) {
+		strlcat(w->name, HDA_COLORS[color], sizeof(w->name));
+		strlcat(w->name, " ", sizeof(w->name));
+	}
+	strlcat(w->name, HDA_CONNS[conn], sizeof(w->name));
 	strlcat(w->name, ")", sizeof(w->name));
 }
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200901081943.n08JhlNG031900>