summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonathan Gray <jsg@cvs.openbsd.org>2015-08-24 04:50:41 +0000
committerJonathan Gray <jsg@cvs.openbsd.org>2015-08-24 04:50:41 +0000
commitab630e6bce5f1466444bcacfa967d62cd120f9bb (patch)
tree4eaf9beb61b028a75e51eaff958070eb20c7442e
parentd6b07a45a8ee30fd0d073120825abceb5c7724c9 (diff)
Audio on the T400/T410/T510/T420/T520/X220/X220t docks needs a quirk
for the pin configuration as well. From Dmitry Alenichev. ok mlarkin@
-rw-r--r--sys/dev/pci/azalia.h3
-rw-r--r--sys/dev/pci/azalia_codec.c37
2 files changed, 38 insertions, 2 deletions
diff --git a/sys/dev/pci/azalia.h b/sys/dev/pci/azalia.h
index 4f9468226a2..74c00a0f2c7 100644
--- a/sys/dev/pci/azalia.h
+++ b/sys/dev/pci/azalia.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: azalia.h,v 1.63 2015/08/20 06:44:06 mlarkin Exp $ */
+/* $OpenBSD: azalia.h,v 1.64 2015/08/24 04:50:40 jsg Exp $ */
/* $NetBSD: azalia.h,v 1.6 2006/01/16 14:15:26 kent Exp $ */
/*-
@@ -512,6 +512,7 @@
#define AZ_QRK_WID_AD1981_OAMP 0x00008000
#define AZ_QRK_WID_TPDOCK1 0x00010000
#define AZ_QRK_WID_TPDOCK2 0x00020000
+#define AZ_QRK_WID_TPDOCK3 0x00040000
/* memory-mapped types */
typedef struct {
diff --git a/sys/dev/pci/azalia_codec.c b/sys/dev/pci/azalia_codec.c
index 66ec94c178f..b1b007e4dd6 100644
--- a/sys/dev/pci/azalia_codec.c
+++ b/sys/dev/pci/azalia_codec.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: azalia_codec.c,v 1.169 2015/08/21 06:11:04 jsg Exp $ */
+/* $OpenBSD: azalia_codec.c,v 1.170 2015/08/24 04:50:40 jsg Exp $ */
/* $NetBSD: azalia_codec.c,v 1.8 2006/05/10 11:17:27 kent Exp $ */
/*-
@@ -321,6 +321,27 @@ azalia_codec_init_vtbl(codec_t *this)
case 0x14f15051:
this->name = "Conexant CX20561"; /* Hermosa */
break;
+ case 0x14f1506e:
+ this->name = "Conexant CX20590";
+ /*
+ * Enable dock audio on Thinkpad docks
+ * 0x17aa : 0x20f2 = Thinkpad T400
+ * 0x17aa : 0x215e = Thinkpad T410
+ * 0x17aa : 0x215f = Thinkpad T510
+ * 0x17aa : 0x21ce = Thinkpad T420
+ * 0x17aa : 0x21cf = Thinkpad T520
+ * 0x17aa : 0x21da = Thinkpad X220
+ * 0x17aa : 0x21db = Thinkpad X220t
+ */
+ if (this->subid == 0x20f217aa ||
+ this->subid == 0x215e17aa ||
+ this->subid == 0x215f17aa ||
+ this->subid == 0x21ce17aa ||
+ this->subid == 0x21cf17aa ||
+ this->subid == 0x21da17aa ||
+ this->subid == 0x21db17aa)
+ this->qrks |= AZ_QRK_WID_TPDOCK3;
+ break;
case 0x434d4980:
this->name = "CMedia CMI9880";
break;
@@ -2540,6 +2561,20 @@ azalia_codec_widget_quirks(codec_t *this, nid_t nid)
w->enable = 1;
}
+ if (this->qrks & AZ_QRK_WID_TPDOCK3 &&
+ nid == 0x1a) {
+ /* Thinkpad x220/t420 style dock microphone */
+ w->d.pin.config = 0x21a190f0;
+ w->enable = 1;
+ }
+
+ if (this->qrks & AZ_QRK_WID_TPDOCK3 &&
+ nid == 0x1c) {
+ /* Thinkpad x220/t420 style dock headphone */
+ w->d.pin.config = 0x212140ff;
+ w->enable = 1;
+ }
+
if (this->qrks & AZ_QRK_WID_CDIN_1C &&
nid == 0x1c && w->enable == 0 && w->d.pin.device == CORB_CD_CD) {
azalia_pin_config_ov(w, CORB_CD_PORT_MASK, CORB_CD_FIXED);