Received: by 2002:a5d:9c59:0:0:0:0:0 with SMTP id 25csp1439385iof; Tue, 7 Jun 2022 05:46:40 -0700 (PDT) X-Google-Smtp-Source: ABdhPJymiFNQzftqUjubNSrVNdt8BAgLwodks0miUIZhgyz/IvIP5iKS1+GHrJ7ZUNWk088TOEqv X-Received: by 2002:a05:6402:2687:b0:430:328f:e46b with SMTP id w7-20020a056402268700b00430328fe46bmr20789220edd.33.1654606000037; Tue, 07 Jun 2022 05:46:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654606000; cv=none; d=google.com; s=arc-20160816; b=frIK+10lqm0c7WtG27+XbvMjtklcxvAF/WW9bt/t6Lp/zUwemAGVto/Igx/kfvGPte FGR/xpsvpMzDl6yS8AJNsicGcv/OgUGkIVJls9OQ1AJuXE76rQ5q4tHeAsp1dS0BCqVA R/4bDgKRZlhb8ffBAkas1jmYv1v/REOEjOHcOfkGRxQiuFHrcnwuj3C3XLeNVmgEgC0H IQFeD0SwHpi2PcdwR59AxkxGiJ5+wvpCtlENMiBta7t3sBvNFyr+kdITTYOFP3L1grM0 nrDnHj6bnOHZs3ugOn3XasFLegvwvO5wnRU9cZFK3uSeAqSTF8Wc8ZBH/Ys67Nmn/cxQ W31A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:feedback-id:content-transfer-encoding :mime-version:message-id:date:subject:cc:to:from; bh=GoNb0t2KCdcqvoImjJLO9mDrrDeN9jDoefmFUBjjln8=; b=cGTwwbZG/uaCSfsMVO1lwldzoKXjjIIsrLzbrouu0btlQYC13hO//UcbMaKWbpjuD9 6CU+yvWrHvwNTgBtsw11J+e76X+Z1Zn1Hbsii79qBdLC43uJZEv8b2I3cUYfrYdm6r03 Ns9ihFto59iEutqGlA6usPr0lVV3+3baszxY3C2GzsFVPhb2b3/8JKwP4CbUtlFrzf7s TgDFa6h6AJ9t5foLsvSQwdMNVn6XnrSyprBsIn2/sBu5YTWXLGAu3Bl+KmGzcED1gmLC s79c9jJMvFSfPbdmJowcEhunaLhQPgvsU6a6i90hucOQWsNzrmG0e29L6uJV3ItNkLFm NOxg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id b9-20020a056402278900b00430f6f56a0dsi12094538ede.265.2022.06.07.05.46.14; Tue, 07 Jun 2022 05:46:40 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238310AbiFGIlb (ORCPT + 99 others); Tue, 7 Jun 2022 04:41:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44562 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237498AbiFGIl1 (ORCPT ); Tue, 7 Jun 2022 04:41:27 -0400 Received: from smtpbg516.qq.com (smtpbg516.qq.com [203.205.250.54]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 47F19D2476 for ; Tue, 7 Jun 2022 01:41:22 -0700 (PDT) X-QQ-mid: bizesmtp66t1654591274tjr4kd6n Received: from localhost.localdomain ( [113.57.152.160]) by bizesmtp.qq.com (ESMTP) with id ; Tue, 07 Jun 2022 16:41:12 +0800 (CST) X-QQ-SSF: 01400000002000B0I000B00A0000000 X-QQ-FEAT: ZHWZeLXy+8eqKx+JuPk8Ym3VtqxoQYUIFeKyur0hG1PG3CRVlrxVF2bp/pOTd SMgoJKIknFJwER5HZcDShBVDQbai7Rez98VXa7aPdOg3YMRL0XrmkrjoUFrZWz4C4wizFZU ke7ZWCGj322Gh+iFgHgwP1/PsctzPrUZrT/T+rMYuLNy34t2qCpzRcyekuO0YAq43N//Prr C7S1Z3o7UplMasp4pVFxEADtt26G/m/xKHnCOKdgXK9wWP/OwOYIWyxvWQpTYJmFZOaQWoB d8lq9hdg5F2fknLtbWdJSzotd8jEdoAzctxg7ltv/9Hw1r1p8VOYiHRNw4BqvsfV+MFaeE1 jbgYsXpvMcYWdHH+F+FuHyG0yU1jRncLbsu1oGv X-QQ-GoodBg: 2 From: huangwenhui To: perex@perex.cz, tiwai@suse.com Cc: jeremy.szu@canonical.com, hui.wang@canonical.com, wse@tuxedocomputers.com, cam@neo-zeon.de, kailang@realtek.com, tanureal@opensource.cirrus.com, sami@loone.fi, alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org, huangwenhui Subject: [PATCH] ALSA: hda/realtek - Add HW8326 support Date: Tue, 7 Jun 2022 16:41:09 +0800 Message-Id: <20220607084109.29120-1-huangwenhuia@uniontech.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-QQ-SENDSIZE: 520 Feedback-ID: bizesmtp:uniontech.com:qybgforeign:qybgforeign10 X-QQ-Bgrelay: 1 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_PASS,T_SCC_BODY_TEXT_LINE,T_SPF_HELO_TEMPERROR autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Added the support of new Huawei codec HW8326. Signed-off-by: huangwenhui --- sound/hda/hdac_device.c | 1 + sound/pci/hda/patch_realtek.c | 14 ++++++++++++++ 2 files changed, 15 insertions(+) diff --git a/sound/hda/hdac_device.c b/sound/hda/hdac_device.c index 3e9e9ac804f6..775474f00141 100644 --- a/sound/hda/hdac_device.c +++ b/sound/hda/hdac_device.c @@ -651,6 +651,7 @@ static const struct hda_vendor_id hda_vendor_ids[] = { { 0x1095, "Silicon Image" }, { 0x10de, "Nvidia" }, { 0x10ec, "Realtek" }, + { 0x19e5, "Huawei" }, { 0x1102, "Creative" }, { 0x1106, "VIA" }, { 0x111d, "IDT" }, diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c index f3ad454b3fbf..0f32c0d17a3f 100644 --- a/sound/pci/hda/patch_realtek.c +++ b/sound/pci/hda/patch_realtek.c @@ -443,6 +443,7 @@ static void alc_fill_eapd_coef(struct hda_codec *codec) case 0x10ec0245: case 0x10ec0255: case 0x10ec0256: + case 0x19e58326: case 0x10ec0257: case 0x10ec0282: case 0x10ec0283: @@ -580,6 +581,7 @@ static void alc_shutup_pins(struct hda_codec *codec) switch (codec->core.vendor_id) { case 0x10ec0236: case 0x10ec0256: + case 0x19e58326: case 0x10ec0283: case 0x10ec0286: case 0x10ec0288: @@ -3247,6 +3249,7 @@ static void alc_disable_headset_jack_key(struct hda_codec *codec) case 0x10ec0230: case 0x10ec0236: case 0x10ec0256: + case 0x19e58326: alc_write_coef_idx(codec, 0x48, 0x0); alc_update_coef_idx(codec, 0x49, 0x0045, 0x0); break; @@ -3275,6 +3278,7 @@ static void alc_enable_headset_jack_key(struct hda_codec *codec) case 0x10ec0230: case 0x10ec0236: case 0x10ec0256: + case 0x19e58326: alc_write_coef_idx(codec, 0x48, 0xd011); alc_update_coef_idx(codec, 0x49, 0x007f, 0x0045); break; @@ -4910,6 +4914,7 @@ static void alc_headset_mode_unplugged(struct hda_codec *codec) case 0x10ec0230: case 0x10ec0236: case 0x10ec0256: + case 0x19e58326: alc_process_coef_fw(codec, coef0256); break; case 0x10ec0234: @@ -5025,6 +5030,7 @@ static void alc_headset_mode_mic_in(struct hda_codec *codec, hda_nid_t hp_pin, case 0x10ec0230: case 0x10ec0236: case 0x10ec0256: + case 0x19e58326: alc_write_coef_idx(codec, 0x45, 0xc489); snd_hda_set_pin_ctl_cache(codec, hp_pin, 0); alc_process_coef_fw(codec, coef0256); @@ -5175,6 +5181,7 @@ static void alc_headset_mode_default(struct hda_codec *codec) case 0x10ec0230: case 0x10ec0236: case 0x10ec0256: + case 0x19e58326: alc_write_coef_idx(codec, 0x1b, 0x0e4b); alc_write_coef_idx(codec, 0x45, 0xc089); msleep(50); @@ -5274,6 +5281,7 @@ static void alc_headset_mode_ctia(struct hda_codec *codec) case 0x10ec0230: case 0x10ec0236: case 0x10ec0256: + case 0x19e58326: alc_process_coef_fw(codec, coef0256); break; case 0x10ec0234: @@ -5388,6 +5396,7 @@ static void alc_headset_mode_omtp(struct hda_codec *codec) case 0x10ec0230: case 0x10ec0236: case 0x10ec0256: + case 0x19e58326: alc_process_coef_fw(codec, coef0256); break; case 0x10ec0234: @@ -5489,6 +5498,7 @@ static void alc_determine_headset_type(struct hda_codec *codec) case 0x10ec0230: case 0x10ec0236: case 0x10ec0256: + case 0x19e58326: alc_write_coef_idx(codec, 0x1b, 0x0e4b); alc_write_coef_idx(codec, 0x06, 0x6104); alc_write_coefex_idx(codec, 0x57, 0x3, 0x09a3); @@ -5783,6 +5793,7 @@ static void alc255_set_default_jack_type(struct hda_codec *codec) case 0x10ec0230: case 0x10ec0236: case 0x10ec0256: + case 0x19e58326: alc_process_coef_fw(codec, alc256fw); break; } @@ -6385,6 +6396,7 @@ static void alc_combo_jack_hp_jd_restart(struct hda_codec *codec) case 0x10ec0236: case 0x10ec0255: case 0x10ec0256: + case 0x19e58326: alc_update_coef_idx(codec, 0x1b, 0x8000, 1 << 15); /* Reset HP JD */ alc_update_coef_idx(codec, 0x1b, 0x8000, 0 << 15); break; @@ -10095,6 +10107,7 @@ static int patch_alc269(struct hda_codec *codec) case 0x10ec0230: case 0x10ec0236: case 0x10ec0256: + case 0x19e58326: spec->codec_variant = ALC269_TYPE_ALC256; spec->shutup = alc256_shutup; spec->init_hook = alc256_init; @@ -11479,6 +11492,7 @@ static const struct hda_device_id snd_hda_id_realtek[] = { HDA_CODEC_ENTRY(0x10ec0236, "ALC236", patch_alc269), HDA_CODEC_ENTRY(0x10ec0245, "ALC245", patch_alc269), HDA_CODEC_ENTRY(0x10ec0255, "ALC255", patch_alc269), + HDA_CODEC_ENTRY(0x19e58326, "HW8326", patch_alc269), HDA_CODEC_ENTRY(0x10ec0256, "ALC256", patch_alc269), HDA_CODEC_ENTRY(0x10ec0257, "ALC257", patch_alc269), HDA_CODEC_ENTRY(0x10ec0260, "ALC260", patch_alc260), -- 2.20.1