From patchwork Thu Mar 14 07:53:40 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jaroslav Kysela X-Patchwork-Id: 10852287 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 3AFE91575 for ; Thu, 14 Mar 2019 07:54:47 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2892529D2A for ; Thu, 14 Mar 2019 07:54:47 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1BF0529EC8; Thu, 14 Mar 2019 07:54:47 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 3BFC529D2A for ; Thu, 14 Mar 2019 07:54:46 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 5047D847; Thu, 14 Mar 2019 08:53:54 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 5047D847 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1552550084; bh=UAAlpYK9wi8+izUQW1l5hGTSG0UZxupbk5CsieWalb4=; h=From:To:Date:Cc:Subject:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From; b=IouV3H1JLyAhYfplrem+RFd29G+qaXhpBtIC+NIrN0gBuUviqKaWm6joVy8bW2akV ztscaclwB5/Goy6vy2DpWRVSVwWtHaPodZfycvL0o21+WD0Q+Foblkc1usgXs4r9S7 V+GQxdmN+VvUK7TVDiL2YAWg/P/4NQWaCRp33TDA= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id DEFE9F8963C; Thu, 14 Mar 2019 08:53:53 +0100 (CET) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa1.perex.cz (Postfix, from userid 50401) id 9DEC3F896CC; Thu, 14 Mar 2019 08:53:52 +0100 (CET) Received: from mail1.perex.cz (mail1.perex.cz [77.48.224.245]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 472CEF8963C for ; Thu, 14 Mar 2019 08:53:49 +0100 (CET) Received: from mail1.perex.cz (localhost [127.0.0.1]) by smtp1.perex.cz (Perex's E-mail Delivery System) with ESMTP id 7CAD1A0040; Thu, 14 Mar 2019 08:53:49 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp1.perex.cz 7CAD1A0040 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=perex.cz; s=default; t=1552550029; bh=8cQQO+RE01S829iD3ur6EhmtUU8IFvO4zFagJp7gNcw=; h=From:To:Cc:Subject:Date:From; b=YqsKQ1CDKDm9YTBbkHRBmd9+O44RiW4Mtq3CTR8JZtQU39ZPKw9CmhONSsw9Z4Y9q QS0lkHdHfKQsOLLnoqmjBXy00B3DoLDJxGcrZOTwCMgjkMk+pTFLNPQB7JHkLYYyMb T7c2UIXz5xr1dIEE/UOTK1YduKsuqtdhAy+ffjQ0= Received: from p50.perex-int.cz (unknown [192.168.100.94]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: perex) by mail1.perex.cz (Perex's E-mail Delivery System) with ESMTPSA; Thu, 14 Mar 2019 08:53:45 +0100 (CET) From: Jaroslav Kysela To: ALSA development Date: Thu, 14 Mar 2019 08:53:40 +0100 Message-Id: <20190314075340.26562-1-perex@perex.cz> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Cc: Takashi Iwai , Kailang Yang Subject: [alsa-devel] [PATCH] ALSA: hda/realtek: merge alc295_fixup_chromebook to alc_fixup_headset_jack X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" X-Virus-Scanned: ClamAV using ClamSMTP The ALC295_FIXUP_CHROME_BOOK fixup can be merged to alc_fixup_headset_jack unless some other model will reference ALC225_FIXUP_HEADSET_JACK in an incompatible way. Cc: Kailang Yang Signed-off-by: Jaroslav Kysela --- sound/pci/hda/patch_realtek.c | 39 ++++++++++------------------------- 1 file changed, 11 insertions(+), 28 deletions(-) diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c index a63670013943..41ac066c6ed7 100644 --- a/sound/pci/hda/patch_realtek.c +++ b/sound/pci/hda/patch_realtek.c @@ -5501,6 +5501,16 @@ static void alc_fixup_headset_jack(struct hda_codec *codec, alc_headset_btn_callback); snd_hda_jack_add_kctl(codec, 0x55, "Headset Jack", false, SND_JACK_HEADSET, alc_headset_btn_keymap); + switch (codec->core.vendor_id) { + case 0x10ec0295: + alc_update_coef_idx(codec, 0x4a, 0x8000, 1 << 15); /* Reset HP JD */ + alc_update_coef_idx(codec, 0x4a, 0x8000, 0 << 15); + break; + case 0x10ec0236: + alc_update_coef_idx(codec, 0x1b, 0x8000, 1 << 15); /* Reset HP JD */ + alc_update_coef_idx(codec, 0x1b, 0x8000, 0 << 15); + break; + } break; case HDA_FIXUP_ACT_INIT: switch (codec->core.vendor_id) { @@ -5521,26 +5531,6 @@ static void alc_fixup_headset_jack(struct hda_codec *codec, } } -static void alc295_fixup_chromebook(struct hda_codec *codec, - const struct hda_fixup *fix, int action) -{ - - switch (action) { - case HDA_FIXUP_ACT_PRE_PROBE: - switch (codec->core.vendor_id) { - case 0x10ec0295: - alc_update_coef_idx(codec, 0x4a, 0x8000, 1 << 15); /* Reset HP JD */ - alc_update_coef_idx(codec, 0x4a, 0x8000, 0 << 15); - break; - case 0x10ec0236: - alc_update_coef_idx(codec, 0x1b, 0x8000, 1 << 15); /* Reset HP JD */ - alc_update_coef_idx(codec, 0x1b, 0x8000, 0 << 15); - break; - } - break; - } -} - static void alc_fixup_disable_mic_vref(struct hda_codec *codec, const struct hda_fixup *fix, int action) { @@ -5694,7 +5684,6 @@ enum { ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE, ALC285_FIXUP_LENOVO_PC_BEEP_IN_NOISE, ALC255_FIXUP_ACER_HEADSET_MIC, - ALC295_FIXUP_CHROME_BOOK, }; static const struct hda_fixup alc269_fixups[] = { @@ -6671,12 +6660,6 @@ static const struct hda_fixup alc269_fixups[] = { .chained = true, .chain_id = ALC255_FIXUP_HEADSET_MODE_NO_HP_MIC }, - [ALC295_FIXUP_CHROME_BOOK] = { - .type = HDA_FIXUP_FUNC, - .v.func = alc295_fixup_chromebook, - .chained = true, - .chain_id = ALC225_FIXUP_HEADSET_JACK - }, }; static const struct snd_pci_quirk alc269_fixup_tbl[] = { @@ -7089,7 +7072,7 @@ static const struct hda_model_fixup alc269_fixup_models[] = { {.id = ALC255_FIXUP_DUMMY_LINEOUT_VERB, .name = "alc255-dummy-lineout"}, {.id = ALC255_FIXUP_DELL_HEADSET_MIC, .name = "alc255-dell-headset"}, {.id = ALC295_FIXUP_HP_X360, .name = "alc295-hp-x360"}, - {.id = ALC295_FIXUP_CHROME_BOOK, .name = "alc-sense-combo"}, + {.id = ALC225_FIXUP_HEADSET_JACK, .name = "alc-sense-combo"}, {} }; #define ALC225_STANDARD_PINS \