summaryrefslogtreecommitdiffstats
path: root/sys/dev/sound
diff options
context:
space:
mode:
authormav <mav@FreeBSD.org>2009-04-01 18:55:08 +0000
committermav <mav@FreeBSD.org>2009-04-01 18:55:08 +0000
commit8e113a97cc807e9d137ab502cb952c044aabab50 (patch)
tree875aa8569c7d0951c6a05cfa561066e0c5b77201 /sys/dev/sound
parent52733bdbbcf2f5552837de418327898b06016de9 (diff)
downloadFreeBSD-src-8e113a97cc807e9d137ab502cb952c044aabab50.zip
FreeBSD-src-8e113a97cc807e9d137ab502cb952c044aabab50.tar.gz
Add some more logic for AD1986A codec input tracing. Use mic preamplifier
only for mic-type inputs. This gives better chances to use it. Change default configuration for some AD1986A codec based ASUS boards, use it also for ASUS P5PL2 board. This makes front mic preamplifier working. Tested by: Vadim Frolov <frolov@frolov.ck.ua>
Diffstat (limited to 'sys/dev/sound')
-rw-r--r--sys/dev/sound/pci/hda/hdac.c47
1 files changed, 42 insertions, 5 deletions
diff --git a/sys/dev/sound/pci/hda/hdac.c b/sys/dev/sound/pci/hda/hdac.c
index c87360f..e580944 100644
--- a/sys/dev/sound/pci/hda/hdac.c
+++ b/sys/dev/sound/pci/hda/hdac.c
@@ -83,7 +83,7 @@
#include "mixer_if.h"
-#define HDA_DRV_TEST_REV "20090329_0131"
+#define HDA_DRV_TEST_REV "20090401_0132"
SND_DECLARE_FILE("$FreeBSD$");
@@ -261,6 +261,7 @@ SND_DECLARE_FILE("$FreeBSD$");
#define ASUS_A7T_SUBVENDOR HDA_MODEL_CONSTRUCT(ASUS, 0x13c2)
#define ASUS_W2J_SUBVENDOR HDA_MODEL_CONSTRUCT(ASUS, 0x1971)
#define ASUS_M5200_SUBVENDOR HDA_MODEL_CONSTRUCT(ASUS, 0x1993)
+#define ASUS_P5PL2_SUBVENDOR HDA_MODEL_CONSTRUCT(ASUS, 0x817f)
#define ASUS_P1AH2_SUBVENDOR HDA_MODEL_CONSTRUCT(ASUS, 0x81cb)
#define ASUS_M2NPVMX_SUBVENDOR HDA_MODEL_CONSTRUCT(ASUS, 0x81cb)
#define ASUS_M2V_SUBVENDOR HDA_MODEL_CONSTRUCT(ASUS, 0x81e7)
@@ -2425,13 +2426,20 @@ hdac_widget_pin_getconfig(struct hdac_widget *w)
/* New patches */
if (id == HDA_CODEC_AD1986A &&
(sc->pci_subvendor == ASUS_M2NPVMX_SUBVENDOR ||
- sc->pci_subvendor == ASUS_A8NVMCSM_SUBVENDOR)) {
+ sc->pci_subvendor == ASUS_A8NVMCSM_SUBVENDOR ||
+ sc->pci_subvendor == ASUS_P5PL2_SUBVENDOR)) {
switch (nid) {
- case 28: /* 5.1 out => 2.0 out + 2 inputs */
+ case 26: /* Headphones with redirection */
+ patch = "as=1 seq=15";
+ break;
+ case 28: /* 5.1 out => 2.0 out + 1 input */
patch = "device=Line-in as=8 seq=1";
break;
- case 29:
- patch = "device=Mic as=8 seq=2";
+ case 29: /* Can't use this as input, as the only available mic
+ * preamplifier is busy by front panel mic (nid 31).
+ * If you want to use this rear connector as mic input,
+ * you have to disable the front panel one. */
+ patch = "as=0";
break;
case 31: /* Lot of inputs configured with as=15 and unusable */
patch = "as=8 seq=3";
@@ -4731,6 +4739,35 @@ hdac_vendor_patch_parse(struct hdac_devinfo *devinfo)
w = hdac_widget_get(devinfo, 15);
if (w != NULL)
w->connsenable[3] = 0;
+ /* There is only one mic preamplifier, use it effectively. */
+ w = hdac_widget_get(devinfo, 31);
+ if (w != NULL) {
+ if ((w->wclass.pin.config &
+ HDA_CONFIG_DEFAULTCONF_DEVICE_MASK) ==
+ HDA_CONFIG_DEFAULTCONF_DEVICE_MIC_IN) {
+ w = hdac_widget_get(devinfo, 16);
+ if (w != NULL)
+ w->connsenable[2] = 0;
+ } else {
+ w = hdac_widget_get(devinfo, 15);
+ if (w != NULL)
+ w->connsenable[0] = 0;
+ }
+ }
+ w = hdac_widget_get(devinfo, 32);
+ if (w != NULL) {
+ if ((w->wclass.pin.config &
+ HDA_CONFIG_DEFAULTCONF_DEVICE_MASK) ==
+ HDA_CONFIG_DEFAULTCONF_DEVICE_MIC_IN) {
+ w = hdac_widget_get(devinfo, 16);
+ if (w != NULL)
+ w->connsenable[0] = 0;
+ } else {
+ w = hdac_widget_get(devinfo, 15);
+ if (w != NULL)
+ w->connsenable[1] = 0;
+ }
+ }
if (subvendor == ASUS_A8X_SUBVENDOR) {
/*
OpenPOWER on IntegriCloud