Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 12 Dec 2012 11:44:21 +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: r244145 - head/sys/dev/sound/pci/hda
Message-ID:  <201212121144.qBCBiLt3036512@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: mav
Date: Wed Dec 12 11:44:20 2012
New Revision: 244145
URL: http://svnweb.freebsd.org/changeset/base/244145

Log:
  Add quirks for AD1984A codec and Lenovo X300 laptop.
  
  PR:		kern/148741
  MFC after:	2 weeks

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

Modified: head/sys/dev/sound/pci/hda/hdaa_patches.c
==============================================================================
--- head/sys/dev/sound/pci/hda/hdaa_patches.c	Wed Dec 12 08:35:32 2012	(r244144)
+++ head/sys/dev/sound/pci/hda/hdaa_patches.c	Wed Dec 12 11:44:20 2012	(r244145)
@@ -271,7 +271,17 @@ hdac_pin_patch(struct hdaa_widget *w)
 	}
 
 	/* New patches */
-	if (id == HDA_CODEC_AD1986A &&
+	if (id == HDA_CODEC_AD1984A &&
+	    subid == LENOVO_X300_SUBVENDOR) {
+		switch (nid) {
+		case 17: /* Headphones with redirection */
+			patch = "as=1 seq=15";
+			break;
+		case 20: /* Two mics together */
+			patch = "as=2 seq=15";
+			break;
+		}
+	} else if (id == HDA_CODEC_AD1986A &&
 	    (subid == ASUS_M2NPVMX_SUBVENDOR ||
 	    subid == ASUS_A8NVMCSM_SUBVENDOR ||
 	    subid == ASUS_P5PL2_SUBVENDOR)) {
@@ -372,6 +382,13 @@ hdaa_widget_patch(struct hdaa_widget *w)
 		    HDA_PARAM_AUDIO_WIDGET_CAP_TYPE_SHIFT;
 		w->waspin = 1;
 	}
+	/*
+	 * Clear "digital" flag from digital mic input, as its signal then goes
+	 * to "analog" mixer and this separation just limits functionaity.
+	 */
+	if (hdaa_codec_id(devinfo) == HDA_CODEC_AD1984A &&
+	    w->nid == 23)
+		w->param.widget_cap &= ~HDA_PARAM_AUDIO_WIDGET_CAP_DIGITAL_MASK;
 	HDA_BOOTVERBOSE(
 		if (w->param.widget_cap != orig) {
 			device_printf(w->devinfo->dev,

Modified: head/sys/dev/sound/pci/hda/hdac.h
==============================================================================
--- head/sys/dev/sound/pci/hda/hdac.h	Wed Dec 12 08:35:32 2012	(r244144)
+++ head/sys/dev/sound/pci/hda/hdac.h	Wed Dec 12 11:44:20 2012	(r244145)
@@ -218,6 +218,7 @@
 #define LENOVO_3KN200_SUBVENDOR	HDA_MODEL_CONSTRUCT(LENOVO, 0x384e)
 #define LENOVO_B450_SUBVENDOR HDA_MODEL_CONSTRUCT(LENOVO, 0x3a0d)
 #define LENOVO_TCA55_SUBVENDOR	HDA_MODEL_CONSTRUCT(LENOVO, 0x1015)
+#define LENOVO_X300_SUBVENDOR	HDA_MODEL_CONSTRUCT(LENOVO, 0x20ac)
 #define LENOVO_ALL_SUBVENDOR	HDA_MODEL_CONSTRUCT(LENOVO, 0xffff)
 
 /* Samsung */



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