From owner-svn-src-all@freebsd.org Mon Jul 20 17:48:01 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 572939A6BB0; Mon, 20 Jul 2015 17:48:01 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4829E1ADE; Mon, 20 Jul 2015 17:48:01 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t6KHm1wo076894; Mon, 20 Jul 2015 17:48:01 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t6KHm1WU076893; Mon, 20 Jul 2015 17:48:01 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201507201748.t6KHm1WU076893@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Mon, 20 Jul 2015 17:48:01 +0000 (UTC) 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 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 Jul 2015 17:48:01 -0000 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); } } }