Received: by 2002:a5d:9c59:0:0:0:0:0 with SMTP id 25csp2328760iof; Wed, 8 Jun 2022 02:37:00 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxbCRfC6RQjrwF76RDr57q8IKGaoIk3FOcagR91h3FL/8JR/mt29QRBnJNqgPo4SOknMCwd X-Received: by 2002:a17:902:ebca:b0:15f:4cc5:f40f with SMTP id p10-20020a170902ebca00b0015f4cc5f40fmr33497525plg.96.1654681020343; Wed, 08 Jun 2022 02:37:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654681020; cv=none; d=google.com; s=arc-20160816; b=jxxkmByM86ZP5X2M3ovUvbkhWtVLXyMi+ioKZTuNl6txplw6j2bmbxCYBmb7N4XEFP 8GcsEXDbkTdZr5aFuH9K2aUa9d6XrrTXV6ly8+2oE9l/7DQhlA/X8lozZ4hSI2prZatJ ei7meJci0k/MkpOMYLNRWHjKOMyi5H1b8Eml1iYjS0CdVmQKMp5kDzISR/FQkrF6uO2J v7SSMs22zy89GZKaBE/DG81oghxdNzk86EU5lWJMHeRgkYJlIglkebMp/JWrSP36+9so R6FmnQFV9s7oOqSGwR/ImJDzPVDOEJUQxcaoYGViOvSExSbMDvJBGZZ4iexR4PdeNOG3 JXyQ== 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=nXD7b13QNe9eC7qzMHKzb426VtkYcLc3r/Z8WboOfug=; b=RSroJVKCM0wXjIGwSx2twE6XmDdNGAUeB0FVHUWOzchnyCHvJ67UgTXPyp5wX71kec 9kw8AIFf0u9c93cbAb9l/MZi5mp6S1J31HCx7lyp9oSiK/SJ6BW62u/Osz8BlETAGKPA tuy0NTQpFE9oXrPPlGErQfJ94acL5BG7fsTPqfv2nHF5HV0/CByk0N8mC7WyEudEh5M4 uw+MOIwXHiKJCjva8DJormlJckxZpuptg2KFfSEWg4D5dO672M0EMBWB64o41Fb0pi2j GBabnKxxZqDeBVVJn85+suWJUO0ze05GjfkWsx77MHL/7YLFwGhE2s5/JTJAOQF49mAY e8YA== 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:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id my13-20020a17090b4c8d00b001e29c6b2ff5si15087071pjb.151.2022.06.08.02.37.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 Jun 2022 02:37:00 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id F353E1A65C8; Wed, 8 Jun 2022 02:07:58 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233723AbiFHJHC (ORCPT + 99 others); Wed, 8 Jun 2022 05:07:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57372 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233923AbiFHJEY (ORCPT ); Wed, 8 Jun 2022 05:04:24 -0400 Received: from smtpbgsg1.qq.com (smtpbgsg1.qq.com [54.254.200.92]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CB314132A11 for ; Wed, 8 Jun 2022 01:24:17 -0700 (PDT) X-QQ-mid: bizesmtp73t1654676641t3bod84q Received: from localhost.localdomain ( [113.57.152.160]) by bizesmtp.qq.com (ESMTP) with id ; Wed, 08 Jun 2022 16:24:00 +0800 (CST) X-QQ-SSF: 01400000002000B0I000C00A0000000 X-QQ-FEAT: Y/4E1fKPEOqGCOO7piKJQT33A7sh+vWQ3vI5J9Qn111r+qqD3vEFZT0UNiPWV nqAuu191WENy8+Jl7i+NzgvPQkulhPVW6bk8GX4EU19NpDNHRza8CeZFLo6gkwuvoCPAJZa e8XR2E7kXRJFGvJEuHNSYkVSqeWMVz8OrZo4TGe9bzd74UTd39GSOV9nTRcmfvaIhsaUy6l kxaJWJdPZX+nU/Lha4kzmr5P8Qx+WlVok8G3isYmnCKFi7Mawbg/4AGSEhv1qQkV3XfGAFL DHxdg5WUplHGE6Qw9j/OXuqCOd6xxgRsitjzre3/M+DHFIILGYdSIwFOidKIXLrSkEMRaMy ufaA0LdMzw6/99xrfJpau5vpXYQnExFxH5UwNLOf7mmyFnRwQk= X-QQ-GoodBg: 2 From: huangwenhui To: tiwai@suse.com, perex@perex.cz 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 v4] ALSA: hda/realtek - Add HW8326 support Date: Wed, 8 Jun 2022 16:23:57 +0800 Message-Id: <20220608082357.26898-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:qybgforeign9 X-QQ-Bgrelay: 1 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RDNS_NONE, SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no 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. The HW8326 is developed by Huawei with Realtek's IP Core, and it's compatible with ALC256. 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..b7e5032b61c9 100644 --- a/sound/hda/hdac_device.c +++ b/sound/hda/hdac_device.c @@ -660,6 +660,7 @@ static const struct hda_vendor_id hda_vendor_ids[] = { { 0x14f1, "Conexant" }, { 0x17e8, "Chrontel" }, { 0x1854, "LG" }, + { 0x19e5, "Huawei" }, { 0x1aec, "Wolfson Microelectronics" }, { 0x1af4, "QEMU" }, { 0x434d, "C-Media" }, diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c index f3ad454b3fbf..cd1281691767 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; @@ -11545,6 +11558,7 @@ static const struct hda_device_id snd_hda_id_realtek[] = { HDA_CODEC_ENTRY(0x10ec0b00, "ALCS1200A", patch_alc882), HDA_CODEC_ENTRY(0x10ec1168, "ALC1220", patch_alc882), HDA_CODEC_ENTRY(0x10ec1220, "ALC1220", patch_alc882), + HDA_CODEC_ENTRY(0x19e58326, "HW8326", patch_alc269), {} /* terminator */ }; MODULE_DEVICE_TABLE(hdaudio, snd_hda_id_realtek); -- 2.20.1