From patchwork Tue Aug 22 21:30:20 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: 9916203 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 C32FB60381 for ; Tue, 22 Aug 2017 21:30:31 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B5B9627F97 for ; Tue, 22 Aug 2017 21:30:31 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id AA8FB288FD; Tue, 22 Aug 2017 21:30:31 +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 6A32F27F97 for ; Tue, 22 Aug 2017 21:30:31 +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=ZQsjIymvQ8PDNL7l+Exr+KdF1J0JYyLmGFpRJvwLUts=; b=cEyOrRF3Mg4ofR nMrB/4+HF+MKticwxu2n4XLzIfnxLPxBJXSNWVDCWEUYLoeCFzIiUH2fuUDu6OGCG7E7tbdvhHexE JEddgmLDjAfQoEjGSR0tUsB/sz+DZ6y+6pE++7lm1Aa4inibc0FlOXOmM0o37Ov7cWx3W8FPwdUCj FeTW62eg9uRjZCkcSRizHsYSwG0dFX5sS1hdkFin6foLPZd+1UsWN04jcVgDwUN5SNmefZXUGr8kk p0wSlYNnPV5AVTwoENBli9RtXkWZULRZuFxQsbxlwPGjQwlEJ0hPnPWnf4ByuBD4Ttc9Is8myDlj9 VhUtIu/0GcoFW0UDx7fw==; 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 1dkGki-00025X-1F; Tue, 22 Aug 2017 21:30:24 +0000 Received: from alexa-out.qualcomm.com ([129.46.98.28] helo=alexa-out-lv-01.qualcomm.com) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1dkGke-0000qb-9B for ath10k@lists.infradead.org; Tue, 22 Aug 2017 21:30:21 +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=1503437420; x=1534973420; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version; bh=MglMnc+tn0oeQDc+aQr7l1OdVgH47CXoJkv2QDQMBX8=; b=hCRVot3i69tzH1vBn3fzXSfPsQ9MfrVRygmoDnCyBe21lTsai9lxyfbO +9WjWIR1xGvMw7TIl6IlsfxwzemMedmeIurzNPL6qOJLLVnvF8BENF9xk eQbc4d7htAUnxegx6WiCE9yVCIoii5IG+TRs2zKVnLeWBNK57BiQ6y2Y6 Y=; X-IronPort-AV: E=Sophos;i="5.41,414,1498546800"; d="scan'208";a="3688766" Received: from ironmsg08-lv.qualcomm.com ([10.47.202.152]) by alexa-out-lv-01.qualcomm.com with ESMTP; 22 Aug 2017 14:29:57 -0700 X-IronPort-AV: E=McAfee;i="5900,7806,8631"; a="7387042" X-MGA-submission: =?us-ascii?q?MDE1jMdAicICPgm4XeehUdfxMnfG8TvqBuIiR4?= =?us-ascii?q?6LvootRife1jSUho1IyR55Jq9Mu1ahD8y5hnplBoi7SECGO0lZ79at6/?= =?us-ascii?q?sQ7FTQrVE0cD8RlXULWDwHtRta2WrsvC6w42T8WSoxmMN5pikEbGbUYM?= =?us-ascii?q?iV?= Received: from nalasexr01g.na.qualcomm.com ([10.49.56.53]) by ironmsg08-lv.qualcomm.com with ESMTP/TLS/RC4-SHA; 22 Aug 2017 14:29:56 -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:29:56 -0700 From: To: , Subject: [PATCH v2 2/2] ath10k: Configure and enable the wakeup capability Date: Tue, 22 Aug 2017 14:30:20 -0700 Message-ID: <1503437420-5470-2-git-send-email-ryanhsu@qti.qualcomm.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1503437420-5470-1-git-send-email-ryanhsu@qti.qualcomm.com> References: <1503437420-5470-1-git-send-email-ryanhsu@qti.qualcomm.com> MIME-Version: 1.0 X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: NASANEXM01E.na.qualcomm.com (10.85.0.31) 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_143020_360487_4FD9BDB6 X-CRM114-Status: GOOD ( 10.64 ) 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. 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