Received: by 2002:a05:6358:a55:b0:ec:fcf4:3ecf with SMTP id 21csp572328rwb; Fri, 13 Jan 2023 01:13:25 -0800 (PST) X-Google-Smtp-Source: AMrXdXs6qMIpTRv+Qg81zTs9vA5+2cMF9H+ayLNCcZIGjo+oICCJ6RDmTLekZkiLN3j37dSf7NSd X-Received: by 2002:a17:906:6d14:b0:7c1:765:9cfc with SMTP id m20-20020a1709066d1400b007c107659cfcmr2391827ejr.34.1673601205705; Fri, 13 Jan 2023 01:13:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673601205; cv=none; d=google.com; s=arc-20160816; b=xV30dICdZLHRjD991u7p47JWexmwQ53NztmDf9QjzlyofcZdDK+SYDk9lJx1ma68QP 2GKrmJmDfMct61hJkKse4XrmaR8hd82tbQmkLlWqbnUuM9E+wTNqMM3P5ByWE28QabUa Ez4KxWZt5jBmXQkJqfdawApGApZZFK7YvWAFwCZw+MeU/6yr0h/kE+qmy7ATSwM575+Z awczKub9fEU5JXodyCrewlqy1Tzwd0jQ/8BnRztTtA5WsXLeH4jUYipS3aGqdSLKEhS0 viLo4wmUQsyTxD12akKsIxWq2QpWk4R3U9oBPsDS2ocY7mf6yz5XcmnWzSowZjYQLmiQ SfuA== 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 :authenticated-by; bh=QcK2SACi+lJiiH2pGYKTmfgWypBijr9nhsoQ100Z/j8=; b=kFMx8mgU44CGTzrDMY/QNUHDIW/rCUw5Ik6Ue+LkQRZt1HapoLu3pxob5wlW+LeJ4L zinvs5NsiKmm37TEfEO0cFgDnIztIIj8RPcB7oOGyz/SxeYzooQqZ6vr5PkfyVG2+hZP NWRGd6p8S44AkQipLZirJOIrDrK3dOlh32HA7ZbSxhhY9aw99Q0AZTTq0W4/K7ximeXX Nd0YJgGWHTn8nhs5hInmhtj94SvfVPGZPeIbR9Vj84o6c/fGSxxnpIOCaJWYS+EwYYdV i9h3uMFgaI8G+133IhPbG1SaqscCFYcXP+tCIQXYODuZ2zfxZvjpN0TlEvQ1jMe0Spgl Szug== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-wireless-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 be13-20020a1709070a4d00b0084ca4bdbc7asi20446139ejc.780.2023.01.13.01.13.06; Fri, 13 Jan 2023 01:13:25 -0800 (PST) Received-SPF: pass (google.com: domain of linux-wireless-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-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241200AbjAMJKZ (ORCPT + 65 others); Fri, 13 Jan 2023 04:10:25 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44186 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240798AbjAMJJ7 (ORCPT ); Fri, 13 Jan 2023 04:09:59 -0500 Received: from rtits2.realtek.com.tw (rtits2.realtek.com [211.75.126.72]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 1BF3A43A39 for ; Fri, 13 Jan 2023 01:07:12 -0800 (PST) Authenticated-By: X-SpamFilter-By: ArmorX SpamTrap 5.77 with qID 30D95qLhA029922, This message is accepted by code: ctloc85258 Received: from mail.realtek.com (rtexh36506.realtek.com.tw[172.21.6.27]) by rtits2.realtek.com.tw (8.15.2/2.81/5.90) with ESMTPS id 30D95qLhA029922 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=FAIL); Fri, 13 Jan 2023 17:05:52 +0800 Received: from RTEXMBS04.realtek.com.tw (172.21.6.97) by RTEXH36506.realtek.com.tw (172.21.6.27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.9; Fri, 13 Jan 2023 17:06:50 +0800 Received: from localhost (172.21.69.188) 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; Fri, 13 Jan 2023 17:06:50 +0800 From: Ping-Ke Shih To: CC: , , , Subject: [PATCH 1/4] wifi: rtw89: correct register definitions of digital CFO and spur elimination Date: Fri, 13 Jan 2023 17:06:29 +0800 Message-ID: <20230113090632.60957-2-pkshih@realtek.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230113090632.60957-1-pkshih@realtek.com> References: <20230113090632.60957-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.188] 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: trusted connection X-KSE-Antiphishing-Info: Clean X-KSE-Antiphishing-ScanningType: Deterministic X-KSE-Antiphishing-Method: None X-KSE-Antiphishing-Bases: 01/13/2023 08:45:00 X-KSE-AttachmentFiltering-Interceptor-Info: no applicable attachment filtering rules found X-KSE-Antivirus-Interceptor-Info: scan successful X-KSE-Antivirus-Info: =?big5?B?Q2xlYW4sIGJhc2VzOiAyMDIzLzEvMTMgpFekyCAwNjowMDowMA==?= X-KSE-BulkMessagesFiltering-Scan-Result: protection disabled 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 From: Eric Huang This change fixes the precision of CFO and TX EVM, and it could imporve performance in some cases. Also, use the correctted definition for 8852A. Signed-off-by: Eric Huang Signed-off-by: Ping-Ke Shih --- drivers/net/wireless/realtek/rtw89/reg.h | 4 ++-- drivers/net/wireless/realtek/rtw89/rtw8852a.c | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/net/wireless/realtek/rtw89/reg.h b/drivers/net/wireless/realtek/rtw89/reg.h index 578a1969afd61..412a6918efd6c 100644 --- a/drivers/net/wireless/realtek/rtw89/reg.h +++ b/drivers/net/wireless/realtek/rtw89/reg.h @@ -4102,9 +4102,9 @@ #define R_MUIC 0x40F8 #define B_MUIC_EN BIT(0) #define R_DCFO 0x4264 -#define B_DCFO GENMASK(1, 0) +#define B_DCFO GENMASK(7, 0) #define R_SEG0CSI 0x42AC -#define B_SEG0CSI_IDX GENMASK(11, 0) +#define B_SEG0CSI_IDX GENMASK(10, 0) #define R_SEG0CSI_EN 0x42C4 #define B_SEG0CSI_EN BIT(23) #define R_BSS_CLR_MAP 0x43ac diff --git a/drivers/net/wireless/realtek/rtw89/rtw8852a.c b/drivers/net/wireless/realtek/rtw89/rtw8852a.c index 1875c2537ddbd..9f1b134ec8590 100644 --- a/drivers/net/wireless/realtek/rtw89/rtw8852a.c +++ b/drivers/net/wireless/realtek/rtw89/rtw8852a.c @@ -1035,7 +1035,7 @@ static void rtw8852a_spur_elimination(struct rtw89_dev *rtwdev, u8 central_ch) 0x210); rtw89_phy_write32_mask(rtwdev, R_P1_NBIIDX, B_P1_NBIIDX_VAL, 0x210); - rtw89_phy_write32_mask(rtwdev, R_SEG0CSI, 0xfff, 0x7c0); + rtw89_phy_write32_mask(rtwdev, R_SEG0CSI, B_SEG0CSI_IDX, 0x7c0); rtw89_phy_write32_mask(rtwdev, R_P0_NBIIDX, B_P0_NBIIDX_NOTCH_EN, 0x1); rtw89_phy_write32_mask(rtwdev, R_P1_NBIIDX, @@ -1047,7 +1047,7 @@ static void rtw8852a_spur_elimination(struct rtw89_dev *rtwdev, u8 central_ch) 0x210); rtw89_phy_write32_mask(rtwdev, R_P1_NBIIDX, B_P1_NBIIDX_VAL, 0x210); - rtw89_phy_write32_mask(rtwdev, R_SEG0CSI, 0xfff, 0x40); + rtw89_phy_write32_mask(rtwdev, R_SEG0CSI, B_SEG0CSI_IDX, 0x40); rtw89_phy_write32_mask(rtwdev, R_P0_NBIIDX, B_P0_NBIIDX_NOTCH_EN, 0x1); rtw89_phy_write32_mask(rtwdev, R_P1_NBIIDX, @@ -1059,7 +1059,7 @@ static void rtw8852a_spur_elimination(struct rtw89_dev *rtwdev, u8 central_ch) 0x2d0); rtw89_phy_write32_mask(rtwdev, R_P1_NBIIDX, B_P1_NBIIDX_VAL, 0x2d0); - rtw89_phy_write32_mask(rtwdev, R_SEG0CSI, 0xfff, 0x740); + rtw89_phy_write32_mask(rtwdev, R_SEG0CSI, B_SEG0CSI_IDX, 0x740); rtw89_phy_write32_mask(rtwdev, R_P0_NBIIDX, B_P0_NBIIDX_NOTCH_EN, 0x1); rtw89_phy_write32_mask(rtwdev, R_P1_NBIIDX, -- 2.25.1