From patchwork Sun Apr 16 19:04:27 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Larry Finger X-Patchwork-Id: 9683093 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id B441160138 for ; Sun, 16 Apr 2017 19:04:58 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A6B822793A for ; Sun, 16 Apr 2017 19:04:58 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9A8B227DA4; Sun, 16 Apr 2017 19:04:58 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.6 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM, T_DKIM_INVALID, URIBL_BLACK autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 30AC72793A for ; Sun, 16 Apr 2017 19:04:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756614AbdDPTE4 (ORCPT ); Sun, 16 Apr 2017 15:04:56 -0400 Received: from mail-oi0-f67.google.com ([209.85.218.67]:35014 "EHLO mail-oi0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756631AbdDPTEm (ORCPT ); Sun, 16 Apr 2017 15:04:42 -0400 Received: by mail-oi0-f67.google.com with SMTP id a21so8126882oic.2 for ; Sun, 16 Apr 2017 12:04:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=vTPzEx6lak/QJxk+RFkMGwTJi6fi3FT6pL214+m1oUc=; b=nxD9/XS3gfpmFB+yLNXV8nCfd2nt17ii5HrN+q7WJepJBGDPsTfoCMFr8RjaRnNeLJ JZi/6NfCtf3j8QqvtRVm3wTyU4Vm/3NbBLQoPXnctNPaO+QFP6QWYYcGnNijWxhKaRE6 ETQV58oElA21gtqJj5CKisSWumMMakjLYih3O8TAtH+1KagTbgkzLoYRoh22RpOENxek m4o+zskjT7sjh0o31FOHRqwkjjtMQGkiXI8IjvEngWCWNdvsEQO+khcGxPhyNwZrs1nd H7VyFPNV3MyFWKq/Fsd/jz5QXHCZPZbqFzG4JZAEt74fL552JhepjnAuMuHY0nnA2NJY jCNw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=vTPzEx6lak/QJxk+RFkMGwTJi6fi3FT6pL214+m1oUc=; b=X51WwONi0uGKvSyi0X64IXT8xUqyUgB7zUN8d+jr+8jLyjVjD8R/0b/tV90zdL7K2o n000T7DtOIl+rnYjCgfHXJG77l1GUhW7H5cOGuH5oUw1ks0LrqoeWcAQ0WW4cCPmD7yO tsSnfIKyiupjG3V6jjEu4hrNFFB2Hxr8pxXmSYDjOwt/PLY+8DxW3W48D18SGh9/egPF aLeQMWDJpmQJgdqugcIfrnM4ozCYymTshxpjA4Y2ACy3am43/e4sptTti3a81zCtXVEy oTB8QlsKG9vgTXYeTxS72cmxgFW5XTcms7VuSlSAVnJXd7V0cDZylewg4n8F4hZwz8lD bzxQ== X-Gm-Message-State: AN3rC/7xW9U4ubqIv7BVYW5kNqyZoXGX23RCpFNFSBuQWczj6oBp8YUv tBN1B4k4bMOSrYkv X-Received: by 10.157.24.43 with SMTP id b40mr3872985ote.246.1492369482148; Sun, 16 Apr 2017 12:04:42 -0700 (PDT) Received: from linux-4v1g.suse (cpe-24-31-249-175.kc.res.rr.com. [24.31.249.175]) by smtp.gmail.com with ESMTPSA id y185sm3709022oig.1.2017.04.16.12.04.41 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 16 Apr 2017 12:04:41 -0700 (PDT) From: Larry Finger To: kvalo@codeaurora.org Cc: linux-wireless@vger.kernel.org, Yan-Hsuan Chuang , Larry Finger , Pkshih , Birming Chiu , Shaofu , Steven Ting Subject: [PATCH 09/10] rtlwifi: btcoex: 21a 2ant: fix PTA unstable problem when hw init Date: Sun, 16 Apr 2017 14:04:27 -0500 Message-Id: <20170416190428.23857-10-Larry.Finger@lwfinger.net> X-Mailer: git-send-email 2.12.0 In-Reply-To: <20170416190428.23857-1-Larry.Finger@lwfinger.net> References: <20170416190428.23857-1-Larry.Finger@lwfinger.net> Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Yan-Hsuan Chuang In the hardware initialisation stage, the PTA circuits may be unstable, so we reset it after 6 secs to fix the problem. dis_ver_info_cnt is used to indicate the time after init, and we can set PTA according to it. Signed-off-by: Yan-Hsuan Chuang Signed-off-by: Larry Finger Cc: Pkshih Cc: Birming Chiu Cc: Shaofu Cc: Steven Ting --- .../realtek/rtlwifi/btcoexist/halbtc8821a2ant.c | 38 +++++++--------------- .../realtek/rtlwifi/btcoexist/halbtc8821a2ant.h | 2 ++ 2 files changed, 14 insertions(+), 26 deletions(-) diff --git a/drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtc8821a2ant.c b/drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtc8821a2ant.c index 1307099a02f3..e61016f660a8 100644 --- a/drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtc8821a2ant.c +++ b/drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtc8821a2ant.c @@ -3598,6 +3598,7 @@ void ex_btc8821a2ant_init_hwconfig(struct btc_coexist *btcoexist) /* Antenna config */ btc8821a2ant_set_ant_path(btcoexist, BTC_ANT_WIFI_AT_MAIN, true, false); + coex_sta->dis_ver_info_cnt = 0; /* PTA parameter */ btc8821a2ant_coex_table_with_type(btcoexist, FORCE_EXEC, 0); @@ -4245,36 +4246,21 @@ void ex_btc8821a2ant_pnp_notify(struct btc_coexist *btcoexist, u8 pnp_state) void ex_btc8821a2ant_periodical(struct btc_coexist *btcoexist) { struct rtl_priv *rtlpriv = btcoexist->adapter; - static u8 dis_ver_info_cnt; - struct btc_board_info *board_info = &btcoexist->board_info; - struct btc_stack_info *stack_info = &btcoexist->stack_info; - u32 fw_ver = 0, bt_patch_ver = 0; RT_TRACE(rtlpriv, COMP_BT_COEXIST, DBG_LOUD, "[BTCoex], ==========================Periodical===========================\n"); - if (dis_ver_info_cnt <= 5) { - dis_ver_info_cnt += 1; - RT_TRACE(rtlpriv, COMP_BT_COEXIST, DBG_LOUD, - "[BTCoex], ****************************************************************\n"); - RT_TRACE(rtlpriv, COMP_BT_COEXIST, DBG_LOUD, - "[BTCoex], Ant PG Num/ Ant Mech/ Ant Pos = %d/ %d/ %d\n", - board_info->pg_ant_num, - board_info->btdm_ant_num, - board_info->btdm_ant_pos); - RT_TRACE(rtlpriv, COMP_BT_COEXIST, DBG_LOUD, - "[BTCoex], BT stack/ hci ext ver = %s / %d\n", - stack_info->profile_notified ? "Yes" : "No", - stack_info->hci_version); - btcoexist->btc_get(btcoexist, BTC_GET_U4_BT_PATCH_VER, - &bt_patch_ver); - btcoexist->btc_get(btcoexist, BTC_GET_U4_WIFI_FW_VER, &fw_ver); - RT_TRACE(rtlpriv, COMP_BT_COEXIST, DBG_LOUD, - "[BTCoex], CoexVer/ FwVer/ PatchVer = %d_%x/ 0x%x/ 0x%x(%d)\n", - glcoex_ver_date_8821a_2ant, glcoex_ver_8821a_2ant, - fw_ver, bt_patch_ver, bt_patch_ver); - RT_TRACE(rtlpriv, COMP_BT_COEXIST, DBG_LOUD, - "[BTCoex], ****************************************************************\n"); + if (coex_sta->dis_ver_info_cnt <= 5) { + coex_sta->dis_ver_info_cnt += 1; + if (coex_sta->dis_ver_info_cnt == 3) { + /* Antenna config to set 0x765 = 0x0 (GNT_BT control by + * PTA) after initial + */ + RT_TRACE(rtlpriv, COMP_BT_COEXIST, DBG_LOUD, + "[BTCoex], Set GNT_BT control by PTA\n"); + btc8821a2ant_set_ant_path(btcoexist, + BTC_ANT_WIFI_AT_MAIN, false, false); + } } #ifdef BT_AUTO_REPORT_ONLY_8821A_2ANT diff --git a/drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtc8821a2ant.h b/drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtc8821a2ant.h index d268f424249f..74edfd75875a 100644 --- a/drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtc8821a2ant.h +++ b/drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtc8821a2ant.h @@ -168,6 +168,8 @@ struct coex_sta_8821a_2ant { u8 coex_table_type; bool force_lps_on; + + u8 dis_ver_info_cnt; }; /*===========================================