From patchwork Wed Sep 28 01:41:52 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rajat Jain X-Patchwork-Id: 9353045 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 DCB0160757 for ; Wed, 28 Sep 2016 01:42:49 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CB62929249 for ; Wed, 28 Sep 2016 01:42:49 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BDF632924B; Wed, 28 Sep 2016 01:42:49 +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=-7.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, RCVD_IN_DNSWL_HI 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 5510D29249 for ; Wed, 28 Sep 2016 01:42:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S935287AbcI1Bmh (ORCPT ); Tue, 27 Sep 2016 21:42:37 -0400 Received: from mail-pf0-f180.google.com ([209.85.192.180]:35245 "EHLO mail-pf0-f180.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S935141AbcI1Bmf (ORCPT ); Tue, 27 Sep 2016 21:42:35 -0400 Received: by mail-pf0-f180.google.com with SMTP id s13so11542855pfd.2 for ; Tue, 27 Sep 2016 18:42:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=uw5/Z71M05TLI8vn2Cx6w1bq3YNcZgRW2xn22S1cNGE=; b=SmQVm5v7pXmu+SBOBxXyh8Oqcozc+Ty/6LqojAzVQpr3O9G+qCDThCSTOlQEbLwmwb AGhTXTAIv62VpdD2npCV8rkQJb2gyZWWEU1sqLtG7kGM7M5ShpR08wiDJyrO/OECyujY 5Z8hP7U+r2IjqfnJOZHwlFqBF5tBOv+dcBOiwHYcRwmGM/snwZL4c/F6wOTYulPdjOj7 GFylbfSy96zPdgAWslIQIfMSUO1EBRO/x8WAj52+JRLH3xpJslFDCG1Q3zc0igqQXg5W FlnXXfomWosXLcLwN90jJe6bcYsoigX0ALXm8anm5dghiC+WR+ZitF7hwVaEq05q4kwQ wGXA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=uw5/Z71M05TLI8vn2Cx6w1bq3YNcZgRW2xn22S1cNGE=; b=LMRJ/MstCgQcw8dz9JX4AngfUNMEPDZRGZFuR0qriknh/HYeOk8c5FbLBYzdEJDHet VNe7cX7rlQvC3UwAvXjFBWr6/VNJNS6PKSPm1pj4dU/qinvmT6jGV0SHGTYCBdpOd5A3 kBrhlD/n3QvhUUCOMm9gfrSdtw+SckHr6bmZAQjPTXJVyjo/gfOMkXy/89iViX693bN8 Zp63RO9Cg+L0kUDD8kBFdsmJBkAyYDiyLxQQHaZCzTg22Jo/7JPrH3f7SVb7Kj28Akei H51Hx2Qef/ao0ZlIAWCOjwUU80+1hlYOoxcrG4am7y04ryChu2XKb4nRtQXUGXPq0Mi+ 957w== X-Gm-Message-State: AE9vXwMmMknIjgBUAEBh7C7ZZG3M8564rpb5zGfIU6F1K5EYRRBE8hXFxMx89/nVSOn9RT/C X-Received: by 10.98.2.215 with SMTP id 206mr53227097pfc.89.1475026954192; Tue, 27 Sep 2016 18:42:34 -0700 (PDT) Received: from rajat.mtv.corp.google.com ([172.22.64.13]) by smtp.gmail.com with ESMTPSA id ah5sm7623336pad.30.2016.09.27.18.42.33 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 27 Sep 2016 18:42:33 -0700 (PDT) From: Rajat Jain To: Amitkumar Karwar , Nishant Sarmukadam , Kalle Valo , linux-wireless@vger.kernel.org, netdev@vger.kernel.org Cc: Rajat Jain , Wei-Ning Huang , Brian Norris , Eric Caruso , rajatxjain@gmail.com Subject: [PATCH] mwifiex: report wakeup for wowlan Date: Tue, 27 Sep 2016 18:41:52 -0700 Message-Id: <1475026912-16265-1-git-send-email-rajatja@google.com> X-Mailer: git-send-email 2.8.0.rc3.226.g39d4020 In-Reply-To: <1474995364-123069-1-git-send-email-rajatja@google.com> References: <1474995364-123069-1-git-send-email-rajatja@google.com> 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 Enable notifying wakeup source to the PM core. This allow darkresume to correctly track wakeup source and mark mwifiex_plt as 'automatic' wakeup source. Signed-off-by: Wei-Ning Huang Signed-off-by: Rajat Jain Tested-by: Wei-Ning Huang Reviewed-by: Eric Caruso --- drivers/net/wireless/marvell/mwifiex/sdio.c | 8 ++++++++ drivers/net/wireless/marvell/mwifiex/sdio.h | 1 + 2 files changed, 9 insertions(+) diff --git a/drivers/net/wireless/marvell/mwifiex/sdio.c b/drivers/net/wireless/marvell/mwifiex/sdio.c index d3e1561..a5f63e4 100644 --- a/drivers/net/wireless/marvell/mwifiex/sdio.c +++ b/drivers/net/wireless/marvell/mwifiex/sdio.c @@ -89,6 +89,9 @@ static irqreturn_t mwifiex_wake_irq_wifi(int irq, void *priv) disable_irq_nosync(irq); } + /* Notify PM core we are wakeup source */ + pm_wakeup_event(cfg->dev, 0); + return IRQ_HANDLED; } @@ -112,6 +115,7 @@ static int mwifiex_sdio_probe_of(struct device *dev, struct sdio_mmc_card *card) GFP_KERNEL); cfg = card->plt_wake_cfg; if (cfg && card->plt_of_node) { + cfg->dev = dev; cfg->irq_wifi = irq_of_parse_and_map(card->plt_of_node, 0); if (!cfg->irq_wifi) { dev_dbg(dev, @@ -130,6 +134,10 @@ static int mwifiex_sdio_probe_of(struct device *dev, struct sdio_mmc_card *card) } } + ret = device_init_wakeup(dev, true); + if (ret) + dev_err(dev, "fail to init wakeup for mwifiex"); + return 0; } diff --git a/drivers/net/wireless/marvell/mwifiex/sdio.h b/drivers/net/wireless/marvell/mwifiex/sdio.h index db837f1..07cdd23 100644 --- a/drivers/net/wireless/marvell/mwifiex/sdio.h +++ b/drivers/net/wireless/marvell/mwifiex/sdio.h @@ -155,6 +155,7 @@ } while (0) struct mwifiex_plt_wake_cfg { + struct device *dev; int irq_wifi; bool wake_by_wifi; };