Skip to content

Commit

Permalink
azalia: add quirk for speaker routing on ThinkPad X1C7
Browse files Browse the repository at this point in the history
The X1C7 has 4 speakers and the speaker2 set needs to be routed to a
different DAC.

Also add the Intel 300 Series HDA to the list of devices on which to
enable snooping.
  • Loading branch information
jcs committed Aug 13, 2019
1 parent 06d5fe3 commit b4db693
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 4 deletions.
10 changes: 8 additions & 2 deletions sys/dev/pci/azalia.c
@@ -1,4 +1,4 @@
/* $OpenBSD: azalia.c,v 1.249 2019/05/09 14:50:46 bcook Exp $ */
/* $OpenBSD: azalia.c,v 1.250 2019/08/13 15:28:12 jcs Exp $ */
/* $NetBSD: azalia.c,v 1.20 2006/05/07 08:31:44 kent Exp $ */

/*-
Expand Down Expand Up @@ -453,6 +453,7 @@ azalia_configure_pci(azalia_t *az)
case PCI_PRODUCT_INTEL_100SERIES_LP_HDA:
case PCI_PRODUCT_INTEL_200SERIES_HDA:
case PCI_PRODUCT_INTEL_200SERIES_U_HDA:
case PCI_PRODUCT_INTEL_300SERIES_U_HDA:
case PCI_PRODUCT_INTEL_C600_HDA:
case PCI_PRODUCT_INTEL_C610_HDA:
case PCI_PRODUCT_INTEL_BSW_HDA:
Expand Down Expand Up @@ -2220,7 +2221,12 @@ azalia_codec_select_spkrdac(codec_t *this)
for (i = 0; i < w->nconnections; i++) {
conv = azalia_codec_find_defdac(this,
w->connections[i], 1);
if (conv == this->spkr_dac) {
if (this->qrks & AZ_QRK_WID_SPKR2_DAC) {
if (conv != this->spkr_dac) {
conn = i;
break;
}
} else if (conv == this->spkr_dac) {
conn = i;
break;
}
Expand Down
3 changes: 2 additions & 1 deletion sys/dev/pci/azalia.h
@@ -1,4 +1,4 @@
/* $OpenBSD: azalia.h,v 1.66 2019/03/24 14:37:44 jcs Exp $ */
/* $OpenBSD: azalia.h,v 1.67 2019/08/13 15:28:12 jcs Exp $ */
/* $NetBSD: azalia.h,v 1.6 2006/01/16 14:15:26 kent Exp $ */

/*-
Expand Down Expand Up @@ -514,6 +514,7 @@
#define AZ_QRK_WID_TPDOCK2 0x00020000
#define AZ_QRK_WID_TPDOCK3 0x00040000
#define AZ_QRK_WID_DOLBY_ATMOS 0x00100000
#define AZ_QRK_WID_SPKR2_DAC 0x00200000

/* memory-mapped types */
typedef struct {
Expand Down
4 changes: 3 additions & 1 deletion sys/dev/pci/azalia_codec.c
@@ -1,4 +1,4 @@
/* $OpenBSD: azalia_codec.c,v 1.175 2019/08/07 22:03:43 jcs Exp $ */
/* $OpenBSD: azalia_codec.c,v 1.176 2019/08/13 15:28:12 jcs Exp $ */
/* $NetBSD: azalia_codec.c,v 1.8 2006/05/10 11:17:27 kent Exp $ */

/*-
Expand Down Expand Up @@ -126,6 +126,8 @@ azalia_codec_init_vtbl(codec_t *this)
break;
case 0x10ec0285:
this->name = "Realtek ALC285";
if (this->subid == 0x229217aa) /* Thinkpad X1 Carbon 7 */
this->qrks |= AZ_QRK_WID_SPKR2_DAC;
break;
case 0x10ec0292:
this->name = "Realtek ALC292";
Expand Down

0 comments on commit b4db693

Please sign in to comment.