Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp4010742iog; Tue, 28 Jun 2022 07:19:00 -0700 (PDT) X-Google-Smtp-Source: AGRyM1u3MlUo4O7v/eMa8L57SvMF0RZoWYcNPjXolP8oYUJ3p/QGwMsXousoHYhO/8DIVtx4L6Ds X-Received: by 2002:a17:90a:590e:b0:1ed:59f0:bc2f with SMTP id k14-20020a17090a590e00b001ed59f0bc2fmr15465723pji.120.1656425939856; Tue, 28 Jun 2022 07:18:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656425939; cv=none; d=google.com; s=arc-20160816; b=tkg3RTrCHjBPBwsNma0tXs3+tmayogfV1hj1p/USoxYPNcOLj9wdLv+/Gyz39+b9gK q52oLhCJ5caUXVDWm1E6G9tbaUg971XpYzIIFtIPRocDkhw5tVl7xSZTQfsruiCrJ01W c9736ZZhPzhrWLL4UQQXK/kWICafs7aeg2CUbqqhIb6qupe9mRgJtYD4TrC93oBVykHV tSqL21W3wxJbIvIWRagIaFhcNor2c5w8i3uyrxNgelde3/vHevNh3D14vPdrXaUS09os qMHBqXX2hKfDj9LyI6WxAfgRi+Sev0iEgMYq+fpdFEkg8h9ru4Gr81oCItjAzPj95yx0 haiQ== 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=UReNUPY03WHyu50s0ecLxYOuOvZPfWQer5mR8ZF7PmZ+wQ5R3k9YBsG/Mzua0CwXcW TKykeWdr3/jx4/BeBWHLHvK6uMLFIsrPCg817/wciEiVgFdBiw3egv/3zrs/LaNBFE/H CBfcAMPlTfVZI7W2FvQzSK1Ut7EeIMjwx6KFi7yEAiKCEvucQn1z2x0PP2nwEdFoKIjY ev4Y+I78ygdQu0gUOxx2bo10OM6ExwMuJCx53UnjgSeDIoiztiBsRzTq15/1GmNaB/CW Cbs1AGZy0vt8ooGNBKvDYo/N9oZIOz33nfG6FtL+BS+L/lezHjuIrmn/rE3xeuKbJljT f0xA== 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 12-20020a170902c20c00b0015d17ba5b87si17695725pll.20.2022.06.28.07.18.41; Tue, 28 Jun 2022 07:18:59 -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 S237544AbiF1Nco (ORCPT + 99 others); Tue, 28 Jun 2022 09:32:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34586 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345195AbiF1NcR (ORCPT ); Tue, 28 Jun 2022 09:32:17 -0400 Received: from smtpbgsg1.qq.com (smtpbgsg1.qq.com [54.254.200.92]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B42592CDD3 for ; Tue, 28 Jun 2022 06:31:27 -0700 (PDT) X-QQ-mid: bizesmtp78t1656423060trmfx83z Received: from localhost.localdomain ( [58.240.82.166]) by bizesmtp.qq.com (ESMTP) with id ; Tue, 28 Jun 2022 21:30:57 +0800 (CST) X-QQ-SSF: 01400000002000G0S000B00A0000000 X-QQ-FEAT: zCqO8hPdPe7z4KFAQ2d/MgTLxnUx5zs48XI+5lOMBR/3ecyAbEqg7rDeyhyQS 71wY5Ql/Ee4gWGv8+i42FfBLRjYaIa2Bmrp86AFCRcdQ4kOl3QwiiUZfObwBPr8yVwaDikj U6h+iw6Tt/nt+gxiQhRzjRQIvRlFTUyGYHM52g8VeZBBg1B5lR5Ts8YU9mGatG8q9NSyEH3 oE4X9G1ZYMYUPE/fq+YkxeuFJia9WAzJSr7Z1nawwYo1J4RFey+CPr03PlSrgvOytYh/D66 9f9Pf0ovgMFzg4BcTRO8E8om+nTfBzVhCuxA/UrzZqH6wZnwjEFWyHsTb6ALtG1zG2kqAkF Ji8NUAdHFvSNWF6Ehkm2icY1TD0SWn2MAVKgeFIQEyX6vk/QySv9Zp+Y9nn6A== 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 2/3] commit b789e3fe7047 ("rtw88: 8821c: support RFE type4 wifi NIC") Date: Tue, 28 Jun 2022 21:30:45 +0800 Message-Id: <20220628133046.2474-2-tangmeng@uniontech.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20220628133046.2474-1-tangmeng@uniontech.com> References: <20220628133046.2474-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