Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp3990521iog; Tue, 28 Jun 2022 06:59:56 -0700 (PDT) X-Google-Smtp-Source: AGRyM1uOSoNnKyDUqk7vwi4+nGPcj+PZtGarB670FP6caTKiyLM160SGdo2KlicHLV5tCrd6x4E1 X-Received: by 2002:a63:6bc1:0:b0:40d:ffa7:9dc3 with SMTP id g184-20020a636bc1000000b0040dffa79dc3mr9341987pgc.111.1656424796089; Tue, 28 Jun 2022 06:59:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656424796; cv=none; d=google.com; s=arc-20160816; b=tR/TYxu6xvuIRdL4W8yKmi+SoUa2d1skzCvx5AhfeLMflpCQ0SmiuvFdzNohYFm6mP 8E8Dnr5PcHQ019DgdzZDovFka8kDrs/cE4jxol9oKXcQpeCGG/wEzR4/AKjZdiuEIq79 Uop+uIlt82UYB9/XJTcTH40umd6ovegmo1rOVAFmJLbUC7Gm+D04vZ7UeTJe454VXKlQ 9Pci0DOBiaClxIGUvlhT7YFQNqH79YvNbvefAxwY+oaaBFPoirQK69dWEBsrq9l/sFIj T22yUpre73+l15Qk5PL/+VFuSia5/E8o8/cG6DXN7eeDnNm9g3mlWxWthYkXoRWR/qva tX2A== 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:references:in-reply-to:message-id:date:subject:cc:to :from; bh=BlS9WWVnDEyvIcwLmlm3vvn5MCr/FbBMq1vDO6gpmGQ=; b=U32UZvbEWR7NUFyJpBSbA/6AKcACFNazBdNKKgL1RIo7M0HFePeH3WdIyz0InkCWLz 0OSjVFzPHpaHw+FmwRfbWZVKgTrBXFbOpoCXIyUifpyNQ8V+BOTyxnPBWHFOSlwNjF9I c9w6/FBnsD5cpyUJhcfYSWPgBm1JKRs4KHayE8tO24kPxT+Xvxi8oI7jXRbiWQzyZcN1 ViT77FhleUVq+AJZ/7YM66o3iwiq/WyfRjrkl2o0pxDxa8TcQgB6yanusgdbQRCFrooG UMbj+6WxWUM1A/xFhJ+usYsEd0smROxZs76jkE9/+AK/kn8H+w3vJblzzW8O0nI1q3iH oH4Q== 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 t2-20020a170902a5c200b0016786f2d1d8si16011949plq.475.2022.06.28.06.59.41; Tue, 28 Jun 2022 06:59:56 -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 S1346808AbiF1Non (ORCPT + 99 others); Tue, 28 Jun 2022 09:44:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48440 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346786AbiF1No1 (ORCPT ); Tue, 28 Jun 2022 09:44:27 -0400 Received: from smtpbgsg1.qq.com (smtpbgsg1.qq.com [54.254.200.92]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EFBA71D0E7 for ; Tue, 28 Jun 2022 06:44:25 -0700 (PDT) X-QQ-mid: bizesmtp64t1656423844t3a26bay Received: from localhost.localdomain ( [58.240.82.166]) by bizesmtp.qq.com (ESMTP) with id ; Tue, 28 Jun 2022 21:44:02 +0800 (CST) X-QQ-SSF: 01400000002000G0S000C00A0000000 X-QQ-FEAT: ZHWZeLXy+8dNqmTeNYcSBLpGb3yyRxv7f+CJdSU4W2HelncSAvCniH4VuIENT 1mE15xcwRwaP95h6+FBOLhgSrRZe72qxfFnuvssqqmST7yNU5vg2OLv3akpisxZXBKy2+IM 5Q/8rSd8MnzbZfmCOp1gqa9emAYaXk3NzdjcDaEIDrL3cn3VSVtcaUAEyB/PnEX0dLuBdPe w62rUBSxyST4G3PZRklK7Iz7vKloDE0Pv8NFYK44E5dAZeihAtumhu1lyups9C0jqLLAw2e SBcoPIohJVrBdCaeHXoysq4EN3jOyIt0w4lliWM+iSd7eCit/xRvnlVEUcAy1s8q8mfliP9 WWGxguO3QTsfkVekKl1wfPfdWnKnyao5OfS8OvXu2XqOWignTW2Hq3oOBaRgJEdCVDlCcZM X-QQ-GoodBg: 2 From: Meng Tang To: stable@vger.kernel.org, tony0620emma@gmail.com, kvalo@codeaurora.org, davem@davemloft.net, kuba@kernel.org Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Guo-Feng Fan , Ping-Ke Shih , Meng Tang Subject: [PATCH 5.10 v2 2/3] commit b789e3fe7047 ("rtw88: 8821c: support RFE type4 wifi NIC") Date: Tue, 28 Jun 2022 21:43:50 +0800 Message-Id: <20220628134351.4182-2-tangmeng@uniontech.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20220628134351.4182-1-tangmeng@uniontech.com> References: <20220628134351.4182-1-tangmeng@uniontech.com> 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=-0.6 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,RCVD_IN_VALIDITY_RPBL,SPF_HELO_PASS,SPF_PASS, 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 From: Guo-Feng Fan 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 4514c4e8ee58..9c8fbc96f536 100644 --- a/drivers/net/wireless/realtek/rtw88/rtw8821c.c +++ b/drivers/net/wireless/realtek/rtw88/rtw8821c.c @@ -300,7 +300,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); @@ -737,6 +738,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 && @@ -1457,6 +1467,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