Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Add another quirk for the ALC285 on the X1C7 to avoid a clicking
noise on the headphone output

From Linux
  • Loading branch information
jcs committed Oct 14, 2019
1 parent 054809f commit 6eae905
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
5 changes: 3 additions & 2 deletions sys/dev/pci/azalia.h
@@ -1,4 +1,4 @@
/* $OpenBSD: azalia.h,v 1.68 2019/10/14 01:59:14 jcs Exp $ */
/* $OpenBSD: azalia.h,v 1.69 2019/10/14 02:04:35 jcs Exp $ */
/* $NetBSD: azalia.h,v 1.6 2006/01/16 14:15:26 kent Exp $ */

/*-
Expand Down Expand Up @@ -505,14 +505,15 @@
#define AZ_QRK_GPIO_UNMUTE_6 0x00000040
#define AZ_QRK_GPIO_UNMUTE_7 0x00000080
#define AZ_QRK_GPIO_POL_0 0x00000100
#define AZ_QRK_WID_MASK 0x000ff000
#define AZ_QRK_WID_MASK 0x00fff000
#define AZ_QRK_WID_CDIN_1C 0x00001000
#define AZ_QRK_WID_BEEP_1D 0x00002000
#define AZ_QRK_WID_OVREF50 0x00004000
#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
#define AZ_QRK_WID_CLOSE_PCBEEP 0x00080000
#define AZ_QRK_ROUTE_SPKR2_DAC 0x01000000
#define AZ_QRK_DOLBY_ATMOS 0x02000000

Expand Down
13 changes: 11 additions & 2 deletions sys/dev/pci/azalia_codec.c
@@ -1,4 +1,4 @@
/* $OpenBSD: azalia_codec.c,v 1.177 2019/10/14 01:59:14 jcs Exp $ */
/* $OpenBSD: azalia_codec.c,v 1.178 2019/10/14 02:04:35 jcs Exp $ */
/* $NetBSD: azalia_codec.c,v 1.8 2006/05/10 11:17:27 kent Exp $ */

/*-
Expand Down Expand Up @@ -127,7 +127,8 @@ azalia_codec_init_vtbl(codec_t *this)
case 0x10ec0285:
this->name = "Realtek ALC285";
if (this->subid == 0x229217aa) /* Thinkpad X1 Carbon 7 */
this->qrks |= AZ_QRK_ROUTE_SPKR2_DAC;
this->qrks |= AZ_QRK_ROUTE_SPKR2_DAC |
AZ_QRK_WID_CLOSE_PCBEEP;
break;
case 0x10ec0292:
this->name = "Realtek ALC292";
Expand Down Expand Up @@ -2603,6 +2604,14 @@ azalia_codec_widget_quirks(codec_t *this, nid_t nid)
azalia_ampcap_ov(w, COP_OUTPUT_AMPCAP, 31, 33, 6, 30, 1);
}

if ((this->qrks & AZ_QRK_WID_CLOSE_PCBEEP) && (nid == 0x20)) {
/* Close PC beep passthrough to avoid headphone noise */
azalia_comresp(this, nid, CORB_SET_COEFFICIENT_INDEX, 0x36,
NULL);
azalia_comresp(this, nid, CORB_SET_PROCESSING_COEFFICIENT,
0x57d7, NULL);
}

return(0);
}

Expand Down

0 comments on commit 6eae905

Please sign in to comment.