From patchwork Tue Aug 22 21:47:35 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: ryanhsu@qti.qualcomm.com X-Patchwork-Id: 9916217 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 C8870600C5 for ; Tue, 22 Aug 2017 21:47:35 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BA1EF288AA for ; Tue, 22 Aug 2017 21:47:35 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id AF2FF288FA; Tue, 22 Aug 2017 21:47:35 +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=-2.6 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_LOW autolearn=unavailable version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 42A10288AA for ; Tue, 22 Aug 2017 21:47:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=zga9SIUH/XKRfbvM3wjv2u05iOM4DkskM6QN23hwhOM=; b=f94EJ4rHcsynH4 W6DF2ilvznk8jGAPnL9O41Bpwhm4ckrhk74LeHSvF4PSzWzzG7Jet2yoMviZUGqTp7IUYRLhafy22 cEnx20MUGTPLEdKm0zOTW1fofkV3mGl+C0vhfgzzjq47RbkV1iW5vdLjj0mJ66x1QMwdFJrrUYIT/ snZOA54TGodWg8sUZEM5PSU1HLJrrH4ZZg6UB9CUBKCWD3Lj1Og2Nc8e3a4+oqEYVewuvB6aifMnR BQRmVjakEGeXMwv7SyQ/E3Pa5squp3b+Ouypo+pzAJcY1VqEq6LpBe5gTTPKyjgh/TpB+fBRWLD75 mBUa3fIqJNy9BijzvH9g==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1dkH1G-0001qh-RS; Tue, 22 Aug 2017 21:47:30 +0000 Received: from sabertooth02.qualcomm.com ([65.197.215.38]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1dkH1D-0001p6-O5 for ath10k@lists.infradead.org; Tue, 22 Aug 2017 21:47:29 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=qti.qualcomm.com; i=@qti.qualcomm.com; q=dns/txt; s=qcdkim; t=1503438447; x=1534974447; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version; bh=pRYCe7deyFwlKFEBxMUf0Mc8uk5PGl0U7yT3UZaSCVk=; b=PuPGGDEYT6kvl3u6S+3gew3Rwka0am2F0txlCV4PV+d69BHb9ipw6je2 LR6T4lhIOZ/vdlQf333TAiyMu34b7O0gXEHYMNlN1bqOIHFpUDgh4iqxa 0vZs/xhlruwiSSYlahlRZHGzrF47sx0MYwe1Zh4yqTItI251Teu8k/ehj c=; X-IronPort-AV: E=Sophos;i="5.41,414,1498546800"; d="scan'208";a="114151324" Received: from unknown (HELO ironmsg01-lv.qualcomm.com) ([10.47.202.180]) by sabertooth02.qualcomm.com with ESMTP; 22 Aug 2017 14:47:07 -0700 X-IronPort-AV: E=McAfee;i="5900,7806,8631"; a="37368647" X-MGA-submission: =?us-ascii?q?MDEqIlW9QOotYSO8Ywg97HykWRBfX2IRHeF3/I?= =?us-ascii?q?s4ZE7haaIeOwghtHtMnLvSHhCt98nKMN9aP/gZtHxxrwsAbb7Mh5dSId?= =?us-ascii?q?ZNuB/ZVSfDpDyXMCdoKL2+80iMppewc4iUvcmtzZMIqa3Plys+9kvmqH?= =?us-ascii?q?6w?= Received: from nalasexr01g.na.qualcomm.com ([10.49.56.53]) by ironmsg01-lv.qualcomm.com with ESMTP/TLS/RC4-SHA; 22 Aug 2017 14:47:07 -0700 Received: from ryanhsu-linux2.qualcomm.com (10.80.80.8) by NALASEXR01G.na.qualcomm.com (10.49.56.53) with Microsoft SMTP Server (TLS) id 15.0.1178.4; Tue, 22 Aug 2017 14:47:06 -0700 From: To: , Subject: [PATCH v3 2/2] ath10k: Configure and enable the wakeup capability Date: Tue, 22 Aug 2017 14:47:35 -0700 Message-ID: <1503438455-6133-2-git-send-email-ryanhsu@qti.qualcomm.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1503438455-6133-1-git-send-email-ryanhsu@qti.qualcomm.com> References: <1503438455-6133-1-git-send-email-ryanhsu@qti.qualcomm.com> MIME-Version: 1.0 X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: NASANEXM01B.na.qualcomm.com (10.85.0.82) To NALASEXR01G.na.qualcomm.com (10.49.56.53) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170822_144727_833288_761FBA18 X-CRM114-Status: GOOD ( 10.50 ) X-BeenThere: ath10k@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: ryanhsu@qti.qualcomm.com Sender: "ath10k" Errors-To: ath10k-bounces+patchwork-ath10k=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP From: Ryan Hsu ACPI will rely on device driver to tell it if the device could support wakeup function when system in D3 state. This has caused some platform can't support remote wakeup correctly, because the ACPI wakeup GPE is not enabled, hence registers the .set_wakeup callback to handle it if device supports wakeup. Tested with QCA6174 hw3.0, firmware ('WLAN.RM.4.4.1-00008-QCARMSWP-1') Signed-off-by: Ryan Hsu --- drivers/net/wireless/ath/ath10k/mac.c | 1 + drivers/net/wireless/ath/ath10k/wow.c | 14 ++++++++++++++ drivers/net/wireless/ath/ath10k/wow.h | 1 + 3 files changed, 16 insertions(+) diff --git a/drivers/net/wireless/ath/ath10k/mac.c b/drivers/net/wireless/ath/ath10k/mac.c index 2e5d2ca..bbf7da1 100644 --- a/drivers/net/wireless/ath/ath10k/mac.c +++ b/drivers/net/wireless/ath/ath10k/mac.c @@ -7488,6 +7488,7 @@ static const struct ieee80211_ops ath10k_ops = { #ifdef CONFIG_PM .suspend = ath10k_wow_op_suspend, .resume = ath10k_wow_op_resume, + .set_wakeup = ath10k_wow_op_set_wakeup, #endif #ifdef CONFIG_MAC80211_DEBUGFS .sta_add_debugfs = ath10k_sta_add_debugfs, diff --git a/drivers/net/wireless/ath/ath10k/wow.c b/drivers/net/wireless/ath/ath10k/wow.c index 77100d4..0d46d6d 100644 --- a/drivers/net/wireless/ath/ath10k/wow.c +++ b/drivers/net/wireless/ath/ath10k/wow.c @@ -277,6 +277,18 @@ exit: return ret ? 1 : 0; } +void ath10k_wow_op_set_wakeup(struct ieee80211_hw *hw, bool enabled) +{ + struct ath10k *ar = hw->priv; + + mutex_lock(&ar->conf_mutex); + if (test_bit(ATH10K_FW_FEATURE_WOWLAN_SUPPORT, + ar->running_fw->fw_file.fw_features)) { + device_set_wakeup_enable(ar->dev, enabled); + } + mutex_unlock(&ar->conf_mutex); +} + int ath10k_wow_op_resume(struct ieee80211_hw *hw) { struct ath10k *ar = hw->priv; @@ -336,5 +348,7 @@ int ath10k_wow_init(struct ath10k *ar) ar->wow.wowlan_support.n_patterns = ar->wow.max_num_patterns; ar->hw->wiphy->wowlan = &ar->wow.wowlan_support; + device_set_wakeup_capable(ar->dev, true); + return 0; } diff --git a/drivers/net/wireless/ath/ath10k/wow.h b/drivers/net/wireless/ath/ath10k/wow.h index abbb04b..9745b9d 100644 --- a/drivers/net/wireless/ath/ath10k/wow.h +++ b/drivers/net/wireless/ath/ath10k/wow.h @@ -28,6 +28,7 @@ int ath10k_wow_init(struct ath10k *ar); int ath10k_wow_op_suspend(struct ieee80211_hw *hw, struct cfg80211_wowlan *wowlan); int ath10k_wow_op_resume(struct ieee80211_hw *hw); +void ath10k_wow_op_set_wakeup(struct ieee80211_hw *hw, bool enabled); #else