Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 20 Jul 2015 17:48:01 +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: r285723 - head/sys/dev/sound/pci/hda
Message-ID:  <201507201748.t6KHm1WU076893@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: mav
Date: Mon Jul 20 17:48:00 2015
New Revision: 285723
URL: https://svnweb.freebsd.org/changeset/base/285723

Log:
  Increase output amp on ASUS UX31A by +5dB.
  
  While there, implement couple helper functions.

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

Modified: head/sys/dev/sound/pci/hda/hdaa_patches.c
==============================================================================
--- head/sys/dev/sound/pci/hda/hdaa_patches.c	Mon Jul 20 16:27:44 2015	(r285722)
+++ head/sys/dev/sound/pci/hda/hdaa_patches.c	Mon Jul 20 17:48:00 2015	(r285723)
@@ -696,6 +696,22 @@ hdaa_patch(struct hdaa_devinfo *devinfo)
 	}
 }
 
+static uint32_t
+hdaa_read_coef(device_t dev, nid_t nid, uint16_t idx)
+{
+
+	hda_command(dev, HDA_CMD_SET_COEFF_INDEX(0, nid, idx));
+	return (hda_command(dev, HDA_CMD_GET_PROCESSING_COEFF(0, nid)));
+}
+
+static uint32_t
+hdaa_write_coef(device_t dev, nid_t nid, uint16_t idx, uint16_t val)
+{
+
+	hda_command(dev, HDA_CMD_SET_COEFF_INDEX(0, nid, idx));
+	return (hda_command(dev, HDA_CMD_SET_PROCESSING_COEFF(0, nid, val)));
+}
+
 void
 hdaa_patch_direct(struct hdaa_devinfo *devinfo)
 {
@@ -737,10 +753,12 @@ hdaa_patch_direct(struct hdaa_devinfo *d
 			 * That results in silence if downmix it to mono.
 			 * To workaround, make codec to handle signal as mono.
 			 */
-			hda_command(dev, HDA_CMD_SET_COEFF_INDEX(0, 0x20, 0x07));
-			val = hda_command(dev, HDA_CMD_GET_PROCESSING_COEFF(0, 0x20));
-			hda_command(dev, HDA_CMD_SET_COEFF_INDEX(0, 0x20, 0x07));
-			hda_command(dev, HDA_CMD_SET_PROCESSING_COEFF(0, 0x20, val|0x80));
+			val = hdaa_read_coef(dev, 0x20, 0x07);
+			hdaa_write_coef(dev, 0x20, 0x07, val|0x80);
+		}
+		if (subid == 0x15171043) {
+			/* Increase output amp on ASUS UX31A by +5dB. */
+			hdaa_write_coef(dev, 0x20, 0x12, 0x2800);
 		}
 	}
 }



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