Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp490233iog; Thu, 30 Jun 2022 04:56:34 -0700 (PDT) X-Google-Smtp-Source: AGRyM1unnSLqLr8pYByhjaN2NDo/B0jB9A9li01+g2PytNAp92IL1MVGvpO2xkzDGPo0sqgtTN4W X-Received: by 2002:a63:125e:0:b0:411:a1bf:2e3b with SMTP id 30-20020a63125e000000b00411a1bf2e3bmr2602607pgs.388.1656590194361; Thu, 30 Jun 2022 04:56:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656590194; cv=none; d=google.com; s=arc-20160816; b=msrtRagjA9EpSXIfqd15ca5JxR9rTRzBtMZVLAKYCFrwmMoRqvznhDCSPR8JXTcs0J zBo76P2elqR2JruvgXQgh1L24auCUn2TY2hNY+MywOXVqDL/80wlbt9H2ZvrqjRzLO9j 9QHjpulcMX3ExZ3eXBQrbsIEfn5Y8ZNXeOHEbZA5NPvUIsuCK69h/GRpnhItm5XpUG2n F9gdN/y07DWQoriOZ7TkJCJRtFt0v/BoFxlS9Gy4zVRjdPGoisOU23AS2Kw34AiyDVkU fuPCCbg0lSVx2VLbSAnYX0hgNC2dVHW4ssbhjtN93BLDzOyzfcSrq3AqHNg3DvgwsK5M +CQw== 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=Ow1lr0DVkaACauGbL5/kWhrcipvWKI4qPe/oI+xiPqE=; b=pvxNmt5wFNlBdYx2/PMS8NPm/+vns+Ydt9nIzZFRBa6opfLiGtZXhzhv0cEGLakJVf 3nIGgJqlafrxxPYSncC+4AcooTlmz+poNBhrJLgfmuvwweaOe3Ojs7ZHjEGc/syj3hme oJmKm/CKQBuLVMAZotT/DoDvUN3qR5OOkG/PXLAjnexN7gs93PXLIIHX9T1Rwxkvjb8D FX7Hv6lmqSZsBwGk5UQmo8xO0Av0aKzIbXEwsH6a1/DCLefqxNY78uIJqfh4Oz2m5ibR 9kkKN83DvaK+WcrdWrLIuFsIS+JW5ZnFpqQfHZ1pGxcobzvboS6IZKiT7rB7tPAVDaaW Ev7A== 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 f15-20020a63100f000000b0040d1cff05e6si25436000pgl.687.2022.06.30.04.56.21; Thu, 30 Jun 2022 04:56:34 -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 S230171AbiF3Lqt (ORCPT + 99 others); Thu, 30 Jun 2022 07:46:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:32856 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235144AbiF3Lqq (ORCPT ); Thu, 30 Jun 2022 07:46:46 -0400 X-Greylist: delayed 166517 seconds by postgrey-1.37 at lindbergh.monkeyblade.net; Thu, 30 Jun 2022 04:46:44 PDT Received: from smtpbguseast2.qq.com (smtpbguseast2.qq.com [54.204.34.130]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EC3E55A465 for ; Thu, 30 Jun 2022 04:46:44 -0700 (PDT) X-QQ-mid: bizesmtp78t1656589589tuvgz5rg Received: from localhost.localdomain ( [58.240.82.166]) by bizesmtp.qq.com (ESMTP) with id ; Thu, 30 Jun 2022 19:46:23 +0800 (CST) X-QQ-SSF: 01400000002000G0S000B00A0000000 X-QQ-FEAT: KW3QVT31YreSECNQZBZXGPz7IqsT51g4EWvPhu8C7SBOUUi5kLMQ4+OIWZCfr /qfoTuJvmM8WfyAe2VaC8t9qNZMWCr0GlgFgPEjxPOYJXoW6053qLUGWzqmMFhPy96s01LD dosYsjA84JSimPvtVUIkgs6KigYUAkiHSon8bFTZ6Wa1exIzr7nMqy1K1GuTXTH9jbhMal5 o9PksIoBkfAgTJAHeYNpKsIBpdwdG3DS6f36ZsVs065b+kkS0KV2I0Jzb1CceAnBq3Jnqd6 Ji5BwNr9/YNeSuSxuLMHe/+8oLav8E6KphGiEGZ3qMbKBrD1GzBIob3WpFbw0QFcVPGZxM5 4ssi0wVUWCpnjILUujNkJk/cZniQW2h3P7iRR5L X-QQ-GoodBg: 2 From: Meng Tang To: stable@vger.kernel.org Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Guo-Feng Fan , Ping-Ke Shih , Kalle Valo , Meng Tang Subject: [PATCH 5.15 1/2] rtw88: 8821c: support RFE type4 wifi NIC Date: Thu, 30 Jun 2022 19:46:20 +0800 Message-Id: <20220630114621.19688-1-tangmeng@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:qybgforeign8 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_HELO_PASS,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable 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 From: Guo-Feng Fan commit b789e3fe7047296be0ccdbb7ceb0b58856053572 upstream. RFE type4 is a new NIC which has one RF antenna shares with BT. RFE type4 HW is the same as RFE type2 but attaching antenna to aux antenna connector. RFE type2 attach antenna to main antenna connector. Load the same parameter as RFE type2 when initializing NIC. Signed-off-by: Guo-Feng Fan Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20210922023637.9357-1-pkshih@realtek.com Signed-off-by: Meng Tang --- drivers/net/wireless/realtek/rtw88/rtw8821c.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/drivers/net/wireless/realtek/rtw88/rtw8821c.c b/drivers/net/wireless/realtek/rtw88/rtw8821c.c index f405f42d1c1b..746f6f8967d8 100644 --- a/drivers/net/wireless/realtek/rtw88/rtw8821c.c +++ b/drivers/net/wireless/realtek/rtw88/rtw8821c.c @@ -304,7 +304,8 @@ static void rtw8821c_set_channel_rf(struct rtw_dev *rtwdev, u8 channel, u8 bw) if (channel <= 14) { if (rtwdev->efuse.rfe_option == 0) rtw8821c_switch_rf_set(rtwdev, SWITCH_TO_WLG); - else if (rtwdev->efuse.rfe_option == 2) + else if (rtwdev->efuse.rfe_option == 2 || + rtwdev->efuse.rfe_option == 4) rtw8821c_switch_rf_set(rtwdev, SWITCH_TO_BTG); rtw_write_rf(rtwdev, RF_PATH_A, RF_LUTDBG, BIT(6), 0x1); rtw_write_rf(rtwdev, RF_PATH_A, 0x64, 0xf, 0xf); @@ -777,6 +778,15 @@ static void rtw8821c_coex_cfg_ant_switch(struct rtw_dev *rtwdev, u8 ctrl_type, if (switch_status == coex_dm->cur_switch_status) return; + if (coex_rfe->wlg_at_btg) { + ctrl_type = COEX_SWITCH_CTRL_BY_BBSW; + + if (coex_rfe->ant_switch_polarity) + pos_type = COEX_SWITCH_TO_WLA; + else + pos_type = COEX_SWITCH_TO_WLG_BT; + } + coex_dm->cur_switch_status = switch_status; if (coex_rfe->ant_switch_diversity && @@ -1502,6 +1512,7 @@ static const struct rtw_intf_phy_para_table phy_para_table_8821c = { static const struct rtw_rfe_def rtw8821c_rfe_defs[] = { [0] = RTW_DEF_RFE(8821c, 0, 0), [2] = RTW_DEF_RFE_EXT(8821c, 0, 0, 2), + [4] = RTW_DEF_RFE_EXT(8821c, 0, 0, 2), }; static struct rtw_hw_reg rtw8821c_dig[] = { -- 2.20.1