Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 11 Jan 2012 18:14:22 +0000 (UTC)
From:      Alexander Motin <mav@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
Subject:   svn commit: r229974 - stable/8/sys/dev/sound/pci/hda
Message-ID:  <201201111814.q0BIEMC6071068@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: mav
Date: Wed Jan 11 18:14:22 2012
New Revision: 229974
URL: http://svn.freebsd.org/changeset/base/229974

Log:
  MFC r228726, r228727:
  Cast some vendor-specific spell on VIA VT1708S codecs to:
   - make analog input loopback work;
   - get access to the mics boost controls.
  
  Sponsored by:   iXsystems, Inc.

Modified:
  stable/8/sys/dev/sound/pci/hda/hdac.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)

Modified: stable/8/sys/dev/sound/pci/hda/hdac.c
==============================================================================
--- stable/8/sys/dev/sound/pci/hda/hdac.c	Wed Jan 11 18:12:53 2012	(r229973)
+++ stable/8/sys/dev/sound/pci/hda/hdac.c	Wed Jan 11 18:14:22 2012	(r229974)
@@ -4921,6 +4921,30 @@ hdac_vendor_patch_parse(struct hdac_devi
 		if (w != NULL)
 			w->connsenable[0] = 0;
 		break;
+	case HDA_CODEC_VT1708S_0:
+	case HDA_CODEC_VT1708S_1:
+	case HDA_CODEC_VT1708S_2:
+	case HDA_CODEC_VT1708S_3:
+	case HDA_CODEC_VT1708S_4:
+	case HDA_CODEC_VT1708S_5:
+	case HDA_CODEC_VT1708S_6:
+	case HDA_CODEC_VT1708S_7:
+		/*
+		 * These codecs have hidden mic boost controls.
+		 */
+		w = hdac_widget_get(devinfo, 26);
+		if (w != NULL)
+			w->param.inamp_cap =
+			    (40 << HDA_PARAM_OUTPUT_AMP_CAP_STEPSIZE_SHIFT) |
+			    (3 << HDA_PARAM_OUTPUT_AMP_CAP_NUMSTEPS_SHIFT) |
+			    (0 << HDA_PARAM_OUTPUT_AMP_CAP_OFFSET_SHIFT);
+		w = hdac_widget_get(devinfo, 30);
+		if (w != NULL)
+			w->param.inamp_cap =
+			    (40 << HDA_PARAM_OUTPUT_AMP_CAP_STEPSIZE_SHIFT) |
+			    (3 << HDA_PARAM_OUTPUT_AMP_CAP_NUMSTEPS_SHIFT) |
+			    (0 << HDA_PARAM_OUTPUT_AMP_CAP_OFFSET_SHIFT);
+		break;
 	}
 }
 
@@ -6408,7 +6432,7 @@ hdac_audio_commit(struct hdac_devinfo *d
 	struct hdac_softc *sc = devinfo->codec->sc;
 	struct hdac_widget *w;
 	nid_t cad;
-	uint32_t gdata, gmask, gdir;
+	uint32_t id, gdata, gmask, gdir;
 	int commitgpio, numgpio;
 	int i;
 
@@ -6417,6 +6441,24 @@ hdac_audio_commit(struct hdac_devinfo *d
 	if (sc->pci_subvendor == APPLE_INTEL_MAC)
 		hdac_command(sc, HDA_CMD_12BIT(cad, devinfo->nid,
 		    0x7e7, 0), cad);
+	id = hdac_codec_id(devinfo->codec);
+	switch (id) {
+	case HDA_CODEC_VT1708S_0:
+	case HDA_CODEC_VT1708S_1:
+	case HDA_CODEC_VT1708S_2:
+	case HDA_CODEC_VT1708S_3:
+	case HDA_CODEC_VT1708S_4:
+	case HDA_CODEC_VT1708S_5:
+	case HDA_CODEC_VT1708S_6:
+	case HDA_CODEC_VT1708S_7:
+		/* Enable Mic Boost Volume controls. */
+		hdac_command(sc, HDA_CMD_12BIT(cad, devinfo->nid,
+		    0xf98, 0x01), cad);
+		/* Don't bypass mixer. */
+		hdac_command(sc, HDA_CMD_12BIT(cad, devinfo->nid,
+		    0xf88, 0xc0), cad);
+		break;
+	}
 
 	/* Commit controls. */
 	hdac_audio_ctl_commit(devinfo);
@@ -7718,10 +7760,6 @@ hdac_attach2(void *arg)
 			);
 			hdac_audio_parse(devinfo);
 			HDA_BOOTHVERBOSE(
-				device_printf(sc->dev, "Parsing Ctls...\n");
-			);
-		    	hdac_audio_ctl_parse(devinfo);
-			HDA_BOOTHVERBOSE(
 				device_printf(sc->dev, "Parsing vendor patch...\n");
 			);
 			hdac_vendor_patch_parse(devinfo);
@@ -7729,6 +7767,10 @@ hdac_attach2(void *arg)
 			devinfo->function.audio.quirks &= ~quirks_off;
 
 			HDA_BOOTHVERBOSE(
+				device_printf(sc->dev, "Parsing Ctls...\n");
+			);
+			hdac_audio_ctl_parse(devinfo);
+			HDA_BOOTHVERBOSE(
 				device_printf(sc->dev, "Disabling nonaudio...\n");
 			);
 			hdac_audio_disable_nonaudio(devinfo);



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