aboutsummaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorAlexander Motin <mav@FreeBSD.org>2015-07-20 17:48:00 +0000
committerAlexander Motin <mav@FreeBSD.org>2015-07-20 17:48:00 +0000
commitd575325b812602f7676bb8eabbac7fd38450b2bc (patch)
treefa299e3d4cee13d8318050e8ea4310363ac17602 /sys
parenta54bd5953b805b99146f5167a2294639667d860c (diff)
downloadsrc-d575325b812602f7676bb8eabbac7fd38450b2bc.tar.gz
src-d575325b812602f7676bb8eabbac7fd38450b2bc.zip
Increase output amp on ASUS UX31A by +5dB.
While there, implement couple helper functions.
Notes
Notes: svn path=/head/; revision=285723
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/sound/pci/hda/hdaa_patches.c26
1 files changed, 22 insertions, 4 deletions
diff --git a/sys/dev/sound/pci/hda/hdaa_patches.c b/sys/dev/sound/pci/hda/hdaa_patches.c
index 8852215faf14..548cb60d438a 100644
--- a/sys/dev/sound/pci/hda/hdaa_patches.c
+++ b/sys/dev/sound/pci/hda/hdaa_patches.c
@@ -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 *devinfo)
* 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);
}
}
}