From patchwork Mon Apr 10 16:23:02 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Larry Finger X-Patchwork-Id: 9673229 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 B2C176020C for ; Mon, 10 Apr 2017 16:23:23 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B557027CAF for ; Mon, 10 Apr 2017 16:23:23 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id AA41E27FA8; Mon, 10 Apr 2017 16:23:23 +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 58DCC27CAF for ; Mon, 10 Apr 2017 16:23:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753136AbdDJQXW (ORCPT ); Mon, 10 Apr 2017 12:23:22 -0400 Received: from mail-oi0-f66.google.com ([209.85.218.66]:35262 "EHLO mail-oi0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753101AbdDJQXV (ORCPT ); Mon, 10 Apr 2017 12:23:21 -0400 Received: by mail-oi0-f66.google.com with SMTP id g204so13131562oib.2 for ; Mon, 10 Apr 2017 09:23:20 -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=C3tMSJglu9sSyNZIWopVBBuDgRQw4sdPvUJAc9CFsvQ=; b=YzZFynbsAnyAGhAUlnyCMOEteK6I7ZtCZnAAb8p95Km1PmN0yox5MSP4GRYOTLw+U1 TYKckn5jeUqNyIpJzXX6u7IbimkmQ0oQns9D2KqiPD/5V0A1YB09stkBe2AB3EwOqnoI pcNRUcXEBLKycCLYT+aiv54OX21QU97k8sA3Czm1ws5wW+OadjdsE1/Ibx2sYkhigt0Q 2hMKSda3Y++TLkp1LjVNAg+h27hX9EGYeNeSAl3+2ZBoLZeMw/2JrdMrnJ1uwOFS4dKD yc3x0kcxMEBuddUMNRE5mu5OyW3JU15X5uDZ0C5Kq2XoRCDA3RxnsqwrKZd3TZeFgLP3 FMZw== 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=C3tMSJglu9sSyNZIWopVBBuDgRQw4sdPvUJAc9CFsvQ=; b=NyqEpcir5J0dOM55IHTmN0eAqhniyBuPgY0kHJukMJazlciQ/LmdQGuVNlhybquc8n WozjtUi85eDHqetEEw/3eR9X/u4C5YP+aM555AWuN5RdW91whVuAeJoHDelFCGp0fJhv C8WtUyt1VsaJR9dT5mM9Vp3gakGkm5+7VOgGcdYxt5QYH07T0gVcNCBDdWo1GGLCgtWJ QMQUz9NBkSAKKg3GEtTrLqI3eYh6BoAjBcnx4KmZSkJCF0gX1Ztl9N746hdK4zd8QTeG /78lmgnWTjqdjrwxLelLCAsy+3LzFVbeAC3mYh8t8bS4ayYTfXb3PnD8zGLxfDzGwUzc 1UEg== X-Gm-Message-State: AFeK/H2P95SFIg0Lsw4Bdw42Nlwtcjes3b26d+ewBrwAduuba2/ZpiZPowvVG2fRFCvAGQ== X-Received: by 10.202.219.10 with SMTP id s10mr23097236oig.110.1491841400298; Mon, 10 Apr 2017 09:23:20 -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 64sm6396752otc.35.2017.04.10.09.23.19 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 10 Apr 2017 09:23:19 -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 06/14] rtlwifi: btcoex: 21a 1ant: set antenna control path for PTA Date: Mon, 10 Apr 2017 11:23:02 -0500 Message-Id: <20170410162310.7515-7-Larry.Finger@lwfinger.net> X-Mailer: git-send-email 2.12.0 In-Reply-To: <20170410162310.7515-1-Larry.Finger@lwfinger.net> References: <20170410162310.7515-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 Set antenna control path if PTA is in control of the packet path of wifi and bt. If wifi is turned off, tell the PTA about it. Signed-off-by: Yan-Hsuan Chuang Signed-off-by: Larry Finger Cc: Pkshih Cc: Birming Chiu Cc: Shaofu Cc: Steven Ting --- drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtc8821a1ant.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtc8821a1ant.c b/drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtc8821a1ant.c index b84c1a5be40a..5b374c7728ba 100644 --- a/drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtc8821a1ant.c +++ b/drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtc8821a1ant.c @@ -1011,11 +1011,18 @@ static void btc8821a1ant_set_ant_path(struct btc_coexist *btcoexist, u4_tmp &= ~BIT23; u4_tmp &= ~BIT24; btcoexist->btc_write_4byte(btcoexist, 0x4c, u4_tmp); + + /* 0x765 = 0x18 */ + btcoexist->btc_write_1byte_bitmask(btcoexist, 0x765, 0x18, 0x3); + } else { + /* 0x765 = 0x0 */ + btcoexist->btc_write_1byte_bitmask(btcoexist, 0x765, 0x18, 0x0); } /* ext switch setting */ switch (ant_pos_type) { case BTC_ANT_PATH_WIFI: + btcoexist->btc_write_1byte(btcoexist, 0xcb4, 0x77); if (board_info->btdm_ant_pos == BTC_ANTENNA_AT_MAIN_PORT) btcoexist->btc_write_1byte_bitmask(btcoexist, 0xcb7, 0x30, 0x1); @@ -1024,6 +1031,7 @@ static void btc8821a1ant_set_ant_path(struct btc_coexist *btcoexist, 0x30, 0x2); break; case BTC_ANT_PATH_BT: + btcoexist->btc_write_1byte(btcoexist, 0xcb4, 0x77); if (board_info->btdm_ant_pos == BTC_ANTENNA_AT_MAIN_PORT) btcoexist->btc_write_1byte_bitmask(btcoexist, 0xcb7, 0x30, 0x2); @@ -1033,6 +1041,7 @@ static void btc8821a1ant_set_ant_path(struct btc_coexist *btcoexist, break; default: case BTC_ANT_PATH_PTA: + btcoexist->btc_write_1byte(btcoexist, 0xcb4, 0x66); if (board_info->btdm_ant_pos == BTC_ANTENNA_AT_MAIN_PORT) btcoexist->btc_write_1byte_bitmask(btcoexist, 0xcb7, 0x30, 0x1);