Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 19 Aug 2019 21:30:13 +0000 (UTC)
From:      Jung-uk Kim <jkim@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r351231 - head/sys/dev/sound/pci/hda
Message-ID:  <201908192130.x7JLUDKp035771@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: jkim
Date: Mon Aug 19 21:30:12 2019
New Revision: 351231
URL: https://svnweb.freebsd.org/changeset/base/351231

Log:
  Fix sound on headset jack for Lenovo Thinkpad X1 Carbon Gen 6 (model 20KH).
  
  Note this commit was inspired by r350433.
  
  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	Mon Aug 19 21:21:32 2019	(r351230)
+++ head/sys/dev/sound/pci/hda/hdaa_patches.c	Mon Aug 19 21:30:12 2019	(r351231)
@@ -389,6 +389,13 @@ hdac_pin_patch(struct hdaa_widget *w)
 			patch = "as=1 seq=15";
 			break;
 		}
+	} else if (id == HDA_CODEC_ALC285 &&
+	    subid == LENOVO_X120KH_SUBVENDOR) {
+		switch (nid) {
+		case 33:
+			patch = "as=1 seq=15";
+			break;
+		}
 	} else if (id == HDA_CODEC_ALC269 &&
 	    subid == ASUS_UX31A_SUBVENDOR) {
 		switch (nid) {
@@ -771,16 +778,18 @@ hdaa_patch_direct(struct hdaa_devinfo *devinfo)
 		hda_command(dev, HDA_CMD_12BIT(0, devinfo->nid,
 		    0xf88, 0xc0));
 		break;
+	case HDA_CODEC_ALC255:
+	case HDA_CODEC_ALC256:
+	case HDA_CODEC_ALC285:
+		val = hdaa_read_coef(dev, 0x20, 0x46);
+		hdaa_write_coef(dev, 0x20, 0x46, val | 0x3000);
+		break;
 	case HDA_CODEC_ALC1150:
 		if (subid == 0xd9781462) {
 			/* Too low volume on MSI H170 GAMING M3. */
 			hdaa_write_coef(dev, 0x20, 0x07, 0x7cb);
 		}
 		break;
-	}
-	if (id == HDA_CODEC_ALC255 || id == HDA_CODEC_ALC256) {
-		val = hdaa_read_coef(dev, 0x20, 0x46);
-		hdaa_write_coef(dev, 0x20, 0x46, val|0x3000);
 	}
 	if (subid == APPLE_INTEL_MAC)
 		hda_command(dev, HDA_CMD_12BIT(0, devinfo->nid,

Modified: head/sys/dev/sound/pci/hda/hdac.h
==============================================================================
--- head/sys/dev/sound/pci/hda/hdac.h	Mon Aug 19 21:21:32 2019	(r351230)
+++ head/sys/dev/sound/pci/hda/hdac.h	Mon Aug 19 21:30:12 2019	(r351231)
@@ -257,6 +257,7 @@
 #define	LENOVO_X1_SUBVENDOR	HDA_MODEL_CONSTRUCT(LENOVO, 0x21e8)
 #define	LENOVO_X1CRBN_SUBVENDOR	HDA_MODEL_CONSTRUCT(LENOVO, 0x21f9)
 #define	LENOVO_X120BS_SUBVENDOR	HDA_MODEL_CONSTRUCT(LENOVO, 0x2227)
+#define	LENOVO_X120KH_SUBVENDOR	HDA_MODEL_CONSTRUCT(LENOVO, 0x225c)
 #define LENOVO_X220_SUBVENDOR	HDA_MODEL_CONSTRUCT(LENOVO, 0x21da)
 #define LENOVO_X300_SUBVENDOR	HDA_MODEL_CONSTRUCT(LENOVO, 0x20ac)
 #define	LENOVO_T400_SUBVENDOR	HDA_MODEL_CONSTRUCT(LENOVO, 0x20f2)



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