From patchwork Tue Dec 12 07:25:58 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: You-Sheng Yang X-Patchwork-Id: 1874906 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.ubuntu.com (client-ip=185.125.189.65; helo=lists.ubuntu.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=patchwork.ozlabs.org) Received: from lists.ubuntu.com (lists.ubuntu.com [185.125.189.65]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4Sq9DM650sz20Gd for ; Tue, 12 Dec 2023 18:27:15 +1100 (AEDT) Received: from localhost ([127.0.0.1] helo=lists.ubuntu.com) by lists.ubuntu.com with esmtp (Exim 4.86_2) (envelope-from ) id 1rCxAZ-00079m-9F; Tue, 12 Dec 2023 07:27:07 +0000 Received: from mail-pf1-f171.google.com ([209.85.210.171]) by lists.ubuntu.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1rCxAJ-0006xl-8c for kernel-team@lists.ubuntu.com; Tue, 12 Dec 2023 07:26:51 +0000 Received: by mail-pf1-f171.google.com with SMTP id d2e1a72fcca58-6ce6d926f76so3703908b3a.1 for ; Mon, 11 Dec 2023 23:26:51 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702366009; x=1702970809; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=cdAvpxATS3ahbg4HjQGqKuwIbbLFa2UmNuGLeOtL+cI=; b=pV1jOLxvjtjjN6LzTC9KngRIc6Uqr+MKkaoEqoiM5+CukmM2q132zOExSjO1UfQOEs cYbRWvgOgXMqQ0rwxL3l3I2cHCNbzj7Qw4+SGpcTgZBoZFWrivduVjzBlbDX3m4I2ysR 1ryBo3OacWYcL1kTnoal9xg52usQXVNh8cLsBSN//TW5W5LkaFs1hxzRY7tYHYKuHhc9 1Me+R4kYS52jd04C8nbH2RKSn1TSPJBbeOndgPVlRYUPF1H8PEZkmshugIyI2Cc77nnf IQ8k67tv85gPntCD11QB9VTdcg+5pSyBDtLXyggMdxasWvEJcI+ksNEBjvDXvHsBu9Bp JYLQ== X-Gm-Message-State: AOJu0YxPxNEYndydvBmtKjwS4BydNk24MTVQrFcBfez8W7qHTkH/45Xe kwPYGPrWA+zeWGcXVUUXYSXsJM60Moo= X-Google-Smtp-Source: AGHT+IG8UBpLPW+qu43XawFdeOf3YVtay7OTa0XXdBGERpDQ/Rw6ZZYqEC77fAP0g7MUgf2bCtTzOA== X-Received: by 2002:a05:6a21:9985:b0:191:520b:6d92 with SMTP id ve5-20020a056a21998500b00191520b6d92mr1762881pzb.63.1702366008778; Mon, 11 Dec 2023 23:26:48 -0800 (PST) Received: from localhost.localdomain (125-229-129-140.hinet-ip.hinet.net. [125.229.129.140]) by smtp.gmail.com with ESMTPSA id n19-20020aa78a53000000b006ce61c9495bsm7745223pfa.10.2023.12.11.23.26.47 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 Dec 2023 23:26:48 -0800 (PST) From: You-Sheng Yang To: kernel-team@lists.ubuntu.com Subject: [PATCH 04/10][Noble] wifi: rtw89: load TX power by rate when RFE parms setup Date: Tue, 12 Dec 2023 15:25:58 +0800 Message-Id: <20231212072604.2198209-5-vicamo.yang@canonical.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20231212072604.2198209-1-vicamo.yang@canonical.com> References: <20231212072604.2198209-1-vicamo.yang@canonical.com> MIME-Version: 1.0 Received-SPF: pass client-ip=209.85.210.171; envelope-from=vicamo@gmail.com; helo=mail-pf1-f171.google.com X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" From: Zong-Zhe Yang BugLink: https://bugs.launchpad.net/bugs/2043964 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 Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230920074322.42898-6-pkshih@realtek.com (cherry picked from commit 9707ea6d68226507f2ce46f7d2098b20595beffb) Signed-off-by: You-Sheng Yang --- 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 133bf289bacb..9da4799bf44a 100644 --- a/drivers/net/wireless/realtek/rtw89/core.c +++ b/drivers/net/wireless/realtek/rtw89/core.c @@ -3767,21 +3767,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 d9f56c510eed..62814dc60631 100644 --- a/drivers/net/wireless/realtek/rtw89/phy.c +++ b/drivers/net/wireless/realtek/rtw89/phy.c @@ -4474,8 +4474,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); @@ -4491,7 +4489,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);