Received: by 2002:a05:7412:37c9:b0:e2:908c:2ebd with SMTP id jz9csp1173426rdb; Wed, 20 Sep 2023 01:28:32 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGGdTBhLJeBXi05ZvBZrG25uCp7ymxzVRLmdSX+UIGwsa2/qHo1j5M2PvbXLcnd2BZ128O9 X-Received: by 2002:a17:90a:7c01:b0:274:b4ce:7049 with SMTP id v1-20020a17090a7c0100b00274b4ce7049mr1881530pjf.34.1695198512436; Wed, 20 Sep 2023 01:28:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695198512; cv=none; d=google.com; s=arc-20160816; b=O40gfzYGkhr+S7TdI/MFuv9O0ibeNQjyElIuBJXqZWbRwUrKVhY1uPyLQFzasu+dM8 PyhHAzf9d/FaH8X4GV1LkLwUGlZ9G+TeimKq1PO6n31vHyyCUVByeX4CzLxqArCgetR0 37jaVdw8ZlJgeicknXYbNypSiUWhA6CY1/CSKCj/xT7PugnJuT+HOgo1jsOBcv9vXMqF 3omZlpXKQytxWst0yzf2OJfGw0FLiIXdD+5FnVZHMlXFKA3fJGqN22655X7KT8X4V9N/ 1hKfiursKKbjyI6GGzmF8fQ7vTka0K5itcAEiVMD0I1dC7VtWQgQVYHBJy5l7kjofRoH DRhQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=ral/m/zgPpakvI8Y3nYgkZvvUdaYFJIcNuEo165hzts=; fh=TSuyMlfOTyCx0zt3ucDyTttlN37QPvmvgk5pf20rBgY=; b=l5rKkHuhVZlKydYc/D7pPNwnu1GNUuzoDek74UBRTfV9T7T/a/YqULgu+i8b3lq5L/ ASVVp92EA1kJS8j9rR0etb4GM99dLKf8x13icpzQVO+1jwtp2WfiOPhV+hyp7R2XchFe +sOnu7eEmBBn3Fhl6m3US3CFkXxpeudCg7urMRubWTPhp0Ah8nv2q0plIUy2eoJtUzal x1VotulAFO4RX3Rk0tgfRQwcOClrtLRyE6AHxBo6GfhkpGOGOqDuRFPSNaRjMbcOy1ug ZkL+78lRVPqPADePBsICr3Vyc/1/MCqicWFgj3jGTV19ONdzf80xf0xHgqo6cYV+deOE DOZA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Return-Path: Received: from howler.vger.email (howler.vger.email. [23.128.96.34]) by mx.google.com with ESMTPS id z2-20020a17090ab10200b00267ba1c43adsi1027036pjq.101.2023.09.20.01.28.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Sep 2023 01:28:32 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) client-ip=23.128.96.34; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id D46D882492AA; Wed, 20 Sep 2023 00:45:18 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234006AbjITHpJ (ORCPT + 56 others); Wed, 20 Sep 2023 03:45:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45520 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233894AbjITHoz (ORCPT ); Wed, 20 Sep 2023 03:44:55 -0400 Received: from rtits2.realtek.com.tw (rtits2.realtek.com [211.75.126.72]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2EA7DD9 for ; Wed, 20 Sep 2023 00:44:48 -0700 (PDT) X-SpamFilter-By: ArmorX SpamTrap 5.78 with qID 38K7ifvoF803277, This message is accepted by code: ctloc85258 Received: from mail.realtek.com (rtexh36505.realtek.com.tw[172.21.6.25]) by rtits2.realtek.com.tw (8.15.2/2.92/5.92) with ESMTPS id 38K7ifvoF803277 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 20 Sep 2023 15:44:41 +0800 Received: from RTEXMBS04.realtek.com.tw (172.21.6.97) by RTEXH36505.realtek.com.tw (172.21.6.25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.32; Wed, 20 Sep 2023 15:44:41 +0800 Received: from [127.0.1.1] (172.21.69.25) by RTEXMBS04.realtek.com.tw (172.21.6.97) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.7; Wed, 20 Sep 2023 15:44:39 +0800 From: Ping-Ke Shih To: CC: , Subject: [PATCH 5/7] wifi: rtw89: load TX power by rate when RFE parms setup Date: Wed, 20 Sep 2023 15:43:20 +0800 Message-ID: <20230920074322.42898-6-pkshih@realtek.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230920074322.42898-1-pkshih@realtek.com> References: <20230920074322.42898-1-pkshih@realtek.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [172.21.69.25] X-ClientProxiedBy: RTEXMBS02.realtek.com.tw (172.21.6.95) To RTEXMBS04.realtek.com.tw (172.21.6.97) X-KSE-ServerInfo: RTEXMBS04.realtek.com.tw, 9 X-KSE-AntiSpam-Interceptor-Info: fallback X-KSE-Antivirus-Interceptor-Info: fallback X-KSE-AntiSpam-Interceptor-Info: fallback X-KSE-ServerInfo: RTEXH36505.realtek.com.tw, 9 X-KSE-AntiSpam-Interceptor-Info: fallback X-KSE-Antivirus-Interceptor-Info: fallback X-KSE-AntiSpam-Interceptor-Info: fallback X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_PASS 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-wireless@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Wed, 20 Sep 2023 00:45:19 -0700 (PDT) From: Zong-Zhe Yang Table of TX power by rate only needs to be loaded once. But, we originally loaded it every time we start core. Now, we load it one time along as RFE (RF Front End) parameters are determined. Signed-off-by: Zong-Zhe Yang Signed-off-by: Ping-Ke Shih --- drivers/net/wireless/realtek/rtw89/core.c | 14 ++++++++++---- drivers/net/wireless/realtek/rtw89/phy.c | 3 --- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/drivers/net/wireless/realtek/rtw89/core.c b/drivers/net/wireless/realtek/rtw89/core.c index 362aa0922339..f9467adf0a14 100644 --- a/drivers/net/wireless/realtek/rtw89/core.c +++ b/drivers/net/wireless/realtek/rtw89/core.c @@ -4008,21 +4008,27 @@ static void rtw89_core_setup_rfe_parms(struct rtw89_dev *rtwdev) const struct rtw89_chip_info *chip = rtwdev->chip; const struct rtw89_rfe_parms_conf *conf = chip->rfe_parms_conf; struct rtw89_efuse *efuse = &rtwdev->efuse; + const struct rtw89_rfe_parms *sel; u8 rfe_type = efuse->rfe_type; - if (!conf) + if (!conf) { + sel = chip->dflt_parms; goto out; + } while (conf->rfe_parms) { if (rfe_type == conf->rfe_type) { - rtwdev->rfe_parms = conf->rfe_parms; - return; + sel = conf->rfe_parms; + goto out; } conf++; } + sel = chip->dflt_parms; + out: - rtwdev->rfe_parms = chip->dflt_parms; + rtwdev->rfe_parms = sel; + rtw89_load_txpwr_table(rtwdev, sel->byr_tbl); } static int rtw89_chip_efuse_info_setup(struct rtw89_dev *rtwdev) diff --git a/drivers/net/wireless/realtek/rtw89/phy.c b/drivers/net/wireless/realtek/rtw89/phy.c index f86de8c8ce18..f9f203295ee4 100644 --- a/drivers/net/wireless/realtek/rtw89/phy.c +++ b/drivers/net/wireless/realtek/rtw89/phy.c @@ -4481,8 +4481,6 @@ static void rtw89_phy_env_monitor_init(struct rtw89_dev *rtwdev) void rtw89_phy_dm_init(struct rtw89_dev *rtwdev) { - const struct rtw89_rfe_parms *rfe_parms = rtwdev->rfe_parms; - rtw89_phy_stat_init(rtwdev); rtw89_chip_bb_sethw(rtwdev); @@ -4498,7 +4496,6 @@ void rtw89_phy_dm_init(struct rtw89_dev *rtwdev) rtw89_phy_init_rf_nctl(rtwdev); rtw89_chip_rfk_init(rtwdev); - rtw89_load_txpwr_table(rtwdev, rfe_parms->byr_tbl); rtw89_chip_set_txpwr_ctrl(rtwdev); rtw89_chip_power_trim(rtwdev); rtw89_chip_cfg_txrx_path(rtwdev); -- 2.25.1