From patchwork Mon Jun 5 15:29:55 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Larry Finger X-Patchwork-Id: 9766371 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 9192D60364 for ; Mon, 5 Jun 2017 15:30:18 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8359026E16 for ; Mon, 5 Jun 2017 15:30:18 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7839427F8F; Mon, 5 Jun 2017 15:30:18 +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=-6.3 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM, T_DKIM_INVALID 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 1BC6826E16 for ; Mon, 5 Jun 2017 15:30:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751316AbdFEPaR (ORCPT ); Mon, 5 Jun 2017 11:30:17 -0400 Received: from mail-oi0-f67.google.com ([209.85.218.67]:32994 "EHLO mail-oi0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751200AbdFEPaQ (ORCPT ); Mon, 5 Jun 2017 11:30:16 -0400 Received: by mail-oi0-f67.google.com with SMTP id h4so22371045oib.0 for ; Mon, 05 Jun 2017 08:30:15 -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=Ow1nYzwDKD6xCO6FuosWc6dfChst3WYhyEAyXvtIW2I=; b=PoVU3hPa47iCMDYjOZ8mUdefcz2EMZdZYRQS+T2gmjcERWRtCg7T/PtUjFGstvE0oZ TQJIlGX9bp01fY+dKsvNC4GXdz4KUg/LZBkx47aO4a05Q4wPHGz79wLD9aNMH6K9Lb0w LAAl0X9q1aH3FUQEorcXl+1Z27o2orzbeMpDJr472qgP/BpTdLsjk5w6foHQMg6lU0Zf d6AHBJ/kdWBtUhPEIYNLFSllvRvB+ehEjbfue80lipipRLmDe1bnQQTSKFMaxpWVfsIm 29YQRJpAma0V/qahFahiDUa4g7HP/LDvLGNUK1WZnzTgH7ufdxZfdBOdpqZswtLztY7u FQOg== 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=Ow1nYzwDKD6xCO6FuosWc6dfChst3WYhyEAyXvtIW2I=; b=ask6lFQGtTXCOX8XZ8+KSSp0tWWP3oCDZ8SkYYTsU55GEkOziLZcTUeIt3WtGekaOE zJHEk/iMiF0CiqEivQ8PT7Of2MmPS+4il75fLiihLsJe0Pa2SqcXyx4gPyUrEMADyIbW W43In+C0S3M6sq8k9oj6VLgDzfidYvgz/DA5os5zE95GIGbJy3eRJzcYOEA5zeOh1J9y pvAXbxpHqyvVUECqQ24FYqYQwKItSecxmcmWUtwwAIgdh1vMMeHy8R1GkE4iYFtTLS9v WGexQPQNtuQimftrkCUecz8Zoq1t6lZ925kuJHZz2acdZCbRW62v0L0MclpA/RLnt457 VFrA== X-Gm-Message-State: AKS2vOxtQdah9n5Vv8MlnB1XhN+T33+w2R5hixMySyLmhTL00LTHj/5I pAnQLHEmNhC/3w== X-Received: by 10.157.9.73 with SMTP id 67mr10643212otp.79.1496676608240; Mon, 05 Jun 2017 08:30:08 -0700 (PDT) Received: from localhost.localdomain (cpe-24-31-249-175.kc.res.rr.com. [24.31.249.175]) by smtp.gmail.com with ESMTPSA id z23sm5554723otz.11.2017.06.05.08.30.07 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 05 Jun 2017 08:30:07 -0700 (PDT) From: Larry Finger To: kvalo@codeaurora.org Cc: linux-wireless@vger.kernel.org, Yan-Hsuan Chuang , Larry Finger , Ping-Ke Shih , Birming Chiu , Shaofu , Steven Ting Subject: [PATCH v2 5/9] rtlwifi: btcoex: add settings before the hardware is ready Date: Mon, 5 Jun 2017 10:29:55 -0500 Message-Id: <20170605152959.27439-6-Larry.Finger@lwfinger.net> X-Mailer: git-send-email 2.13.0 In-Reply-To: <20170605152959.27439-1-Larry.Finger@lwfinger.net> References: <20170605152959.27439-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 When the hardware is turned on and in the initialization stage, the PTA circuit is unstable. Hence we need to force some hardware settings to make sure the PTA circuit work correctly, otherwise it may affect the user's experience. Signed-off-by: Yan-Hsuan Chuang Signed-off-by: Larry Finger Cc: Ping-Ke Shih Cc: Birming Chiu Cc: Shaofu Cc: Steven Ting --- .../wireless/realtek/rtlwifi/btcoexist/halbtc8723b2ant.h | 1 + .../net/wireless/realtek/rtlwifi/btcoexist/halbtcoutsrc.c | 15 +++++++++++++++ .../net/wireless/realtek/rtlwifi/btcoexist/halbtcoutsrc.h | 1 + 3 files changed, 17 insertions(+) diff --git a/drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtc8723b2ant.h b/drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtc8723b2ant.h index ae3e450c5966..bc1e3042e271 100644 --- a/drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtc8723b2ant.h +++ b/drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtc8723b2ant.h @@ -198,5 +198,6 @@ void ex_btc8723b2ant_periodical(struct btc_coexist *btcoexist); void ex_btc8723b2ant_display_coex_info(struct btc_coexist *btcoexist); void ex_btc8723b2ant_pnp_notify(struct btc_coexist *btcoexist, u8 pnp_state); void ex_btc8723b2ant_pre_load_firmware(struct btc_coexist *btcoexist); +void ex_btc8723b2ant_power_on_setting(struct btc_coexist *btcoexist); #endif diff --git a/drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtcoutsrc.c b/drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtcoutsrc.c index 5e6e14fd8c85..8b015e64af49 100644 --- a/drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtcoutsrc.c +++ b/drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtcoutsrc.c @@ -690,6 +690,21 @@ bool exhalbtc_initlize_variables(struct rtl_priv *adapter) return true; } +void exhalbtc_power_on_setting(struct btc_coexist *btcoexist) +{ + if (!halbtc_is_bt_coexist_available(btcoexist)) + return; + + btcoexist->statistics.cnt_power_on++; + + if (IS_HARDWARE_TYPE_8723B(btcoexist->adapter)) { + if (btcoexist->board_info.btdm_ant_num == 2) + ex_btc8723b2ant_power_on_setting(btcoexist); + else if (btcoexist->board_info.btdm_ant_num == 1) + ex_btc8723b1ant_power_on_setting(btcoexist); + } +} + void exhalbtc_pre_load_firmware(struct btc_coexist *btcoexist) { if (!halbtc_is_bt_coexist_available(btcoexist)) diff --git a/drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtcoutsrc.h b/drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtcoutsrc.h index eca0e5a78ada..9b0a6e9c5b20 100644 --- a/drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtcoutsrc.h +++ b/drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtcoutsrc.h @@ -487,6 +487,7 @@ struct btc_statistics { u32 cnt_stack_operation_notify; u32 cnt_dbg_ctrl; u32 cnt_pre_load_firmware; + u32 cnt_power_on; }; struct btc_bt_link_info {