Received: by 2002:a25:b794:0:0:0:0:0 with SMTP id n20csp5281563ybh; Wed, 7 Aug 2019 03:41:01 -0700 (PDT) X-Google-Smtp-Source: APXvYqxAclct7HDKbb3pXdZ4I6dlwcAUGU8w2Ew+E5K7QxMfAZhOdSBMiCogNt5sZBlO9wfBUzoh X-Received: by 2002:a17:902:424:: with SMTP id 33mr7535781ple.151.1565174461635; Wed, 07 Aug 2019 03:41:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565174461; cv=none; d=google.com; s=arc-20160816; b=PgN8iSshlLrluBko0C1kul0NSPY+v3fzS5o1ebcHl3//SkcMSt0uBzl/DE3KcDbaZT t9IaQektS86VF1LxtFfXe7JCjGgMBXD0LUbpNrNYet8y5nwmmDrDzxy4962MktIIGyv9 W8K5WmwiqY9fF2iNLwdWCAeS7I9mqxYD1wlLxs4catCn9OnlHIECJKx0q0l5OsHfXbk/ Vcgmmlf2IH5WGGDCYUXp/3DWW4psLuMh1GduA5dn/8XNDrmdJOHzZCu4eSSQvQs1L1Jk VY6R2azIHOleZauZw3D8Ip031MpQdPZbzoGYVRB4FClbNmn4uty6I/TMmdzLYTa/zTjf zI5A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:authenticated-by; bh=xBhpkgMBjIfY+sUX6EIg016ICOpq8BF0f0fVpHHZaFk=; b=ctqg1BvGB/7ueiYaOqOFaAdUgcgImML84HeFgkVcZAO2QZebXlg4d0lIh9WrrZd+jJ GVP+wGX3outkJkDfaPnlOwba+5AvF+5crZLZMXXWVcTfloKsw4KvvaBrjuRJRfZM35Uo uKKrd/thpvpg5vK7lEoVWg2H2MhHNFhq5EM239Xr3rTKtjU/dzKGsozYFZ1qhSL2e1kr p0fkk3PeUgBribqU7IHAkMNuZ/A8ULXDBIcZVGhCjp0bZMnFcXfUdcRyRFVg4HrDq9W4 oql1CFDnaQOUcjO6pj787GO3ZfXmTeRU+lZPiwMg5BCu/IsZiom/5q04o4HSn55yPwlA M7/g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-wireless-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i22si16785285pju.59.2019.08.07.03.40.39; Wed, 07 Aug 2019 03:41:01 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-wireless-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-wireless-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728793AbfHGKk1 (ORCPT + 99 others); Wed, 7 Aug 2019 06:40:27 -0400 Received: from rtits2.realtek.com ([211.75.126.72]:56218 "EHLO rtits2.realtek.com.tw" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727031AbfHGKk0 (ORCPT ); Wed, 7 Aug 2019 06:40:26 -0400 Authenticated-By: X-SpamFilter-By: BOX Solutions SpamTrap 5.62 with qID x77AeGfv010061, This message is accepted by code: ctloc85258 Received: from mail.realtek.com (RTITCASV01.realtek.com.tw[172.21.6.18]) by rtits2.realtek.com.tw (8.15.2/2.57/5.78) with ESMTPS id x77AeGfv010061 (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Wed, 7 Aug 2019 18:40:17 +0800 Received: from localhost.localdomain (172.21.68.126) by RTITCASV01.realtek.com.tw (172.21.6.18) with Microsoft SMTP Server id 14.3.439.0; Wed, 7 Aug 2019 18:40:16 +0800 From: To: CC: , , Subject: [PATCH 6/8] rtw88: move IQK/DPK into phy_calibration Date: Wed, 7 Aug 2019 18:40:03 +0800 Message-ID: <1565174405-2689-7-git-send-email-yhchuang@realtek.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1565174405-2689-1-git-send-email-yhchuang@realtek.com> References: <1565174405-2689-1-git-send-email-yhchuang@realtek.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [172.21.68.126] Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Yan-Hsuan Chuang Since 8822c requires to do not only IQK, but also DPK. Move these calibrations that need to be done once the channel is determined, into phy_calibration. And note that the order of the calibrations matters, 8822c should do IQK first, then DPK. Signed-off-by: Yan-Hsuan Chuang --- drivers/net/wireless/realtek/rtw88/mac80211.c | 2 +- drivers/net/wireless/realtek/rtw88/main.h | 3 +-- drivers/net/wireless/realtek/rtw88/rtw8822b.c | 6 +++--- drivers/net/wireless/realtek/rtw88/rtw8822c.c | 9 +++++++-- 4 files changed, 12 insertions(+), 8 deletions(-) diff --git a/drivers/net/wireless/realtek/rtw88/mac80211.c b/drivers/net/wireless/realtek/rtw88/mac80211.c index fedea28..e5e3605 100644 --- a/drivers/net/wireless/realtek/rtw88/mac80211.c +++ b/drivers/net/wireless/realtek/rtw88/mac80211.c @@ -256,7 +256,7 @@ static void rtw_ops_bss_info_changed(struct ieee80211_hw *hw, if (conf->assoc) { rtw_coex_connect_notify(rtwdev, COEX_ASSOCIATE_FINISH); net_type = RTW_NET_MGD_LINKED; - chip->ops->do_iqk(rtwdev); + chip->ops->phy_calibration(rtwdev); rtwvif->aid = conf->aid; rtw_add_rsvd_page(rtwdev, RSVD_PS_POLL, true); diff --git a/drivers/net/wireless/realtek/rtw88/main.h b/drivers/net/wireless/realtek/rtw88/main.h index 1ed7eb0..76d9253 100644 --- a/drivers/net/wireless/realtek/rtw88/main.h +++ b/drivers/net/wireless/realtek/rtw88/main.h @@ -640,9 +640,8 @@ struct rtw_chip_ops { u8 antenna_rx); void (*cfg_ldo25)(struct rtw_dev *rtwdev, bool enable); void (*false_alarm_statistics)(struct rtw_dev *rtwdev); - void (*do_iqk)(struct rtw_dev *rtwdev); + void (*phy_calibration)(struct rtw_dev *rtwdev); void (*dpk_track)(struct rtw_dev *rtwdev); - void (*do_dpk)(struct rtw_dev *rtwdev); /* for coex */ void (*coex_set_init)(struct rtw_dev *rtwdev); diff --git a/drivers/net/wireless/realtek/rtw88/rtw8822b.c b/drivers/net/wireless/realtek/rtw88/rtw8822b.c index 3679505..7056ea3 100644 --- a/drivers/net/wireless/realtek/rtw88/rtw8822b.c +++ b/drivers/net/wireless/realtek/rtw88/rtw8822b.c @@ -1001,8 +1001,9 @@ static void rtw8822b_do_iqk(struct rtw_dev *rtwdev) counter, reload, ++do_iqk_cnt, iqk_fail_mask); } -static void rtw8822b_do_dpk(struct rtw_dev *rtwdev) +static void rtw8822b_phy_calibration(struct rtw_dev *rtwdev) { + rtw8822b_do_iqk(rtwdev); } static void rtw8822b_coex_cfg_init(struct rtw_dev *rtwdev) @@ -1798,8 +1799,7 @@ static struct rtw_chip_ops rtw8822b_ops = { .set_antenna = rtw8822b_set_antenna, .cfg_ldo25 = rtw8822b_cfg_ldo25, .false_alarm_statistics = rtw8822b_false_alarm_statistics, - .do_iqk = rtw8822b_do_iqk, - .do_dpk = rtw8822b_do_dpk, + .phy_calibration = rtw8822b_phy_calibration, .coex_set_init = rtw8822b_coex_cfg_init, .coex_set_ant_switch = rtw8822b_coex_cfg_ant_switch, diff --git a/drivers/net/wireless/realtek/rtw88/rtw8822c.c b/drivers/net/wireless/realtek/rtw88/rtw8822c.c index cee12b1..5a428e0 100644 --- a/drivers/net/wireless/realtek/rtw88/rtw8822c.c +++ b/drivers/net/wireless/realtek/rtw88/rtw8822c.c @@ -3078,6 +3078,12 @@ static void rtw8822c_do_dpk(struct rtw_dev *rtwdev) rtw8822c_dpk_restore_registers(rtwdev, DPK_BB_REG_NUM, bckp); } +static void rtw8822c_phy_calibration(struct rtw_dev *rtwdev) +{ + rtw8822c_do_iqk(rtwdev); + rtw8822c_do_dpk(rtwdev); +} + void rtw8822c_dpk_track(struct rtw_dev *rtwdev) { struct rtw_dpk_info *dpk_info = &rtwdev->dm_info.dpk_info; @@ -3487,9 +3493,8 @@ static struct rtw_chip_ops rtw8822c_ops = { .set_tx_power_index = rtw8822c_set_tx_power_index, .cfg_ldo25 = rtw8822c_cfg_ldo25, .false_alarm_statistics = rtw8822c_false_alarm_statistics, - .do_iqk = rtw8822c_do_iqk, - .do_dpk = rtw8822c_do_dpk, .dpk_track = rtw8822c_dpk_track, + .phy_calibration = rtw8822c_phy_calibration, .coex_set_init = rtw8822c_coex_cfg_init, .coex_set_ant_switch = NULL, -- 2.7.4