From patchwork Wed Sep 28 01:45:04 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rajat Jain X-Patchwork-Id: 9353051 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 2DB9360757 for ; Wed, 28 Sep 2016 01:45:26 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1A90128E35 for ; Wed, 28 Sep 2016 01:45:26 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0DC2128E58; Wed, 28 Sep 2016 01:45:26 +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 8C7ED28E35 for ; Wed, 28 Sep 2016 01:45:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S935747AbcI1BpR (ORCPT ); Tue, 27 Sep 2016 21:45:17 -0400 Received: from mail-pf0-f174.google.com ([209.85.192.174]:34038 "EHLO mail-pf0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934855AbcI1BpP (ORCPT ); Tue, 27 Sep 2016 21:45:15 -0400 Received: by mail-pf0-f174.google.com with SMTP id l25so11566591pfb.1 for ; Tue, 27 Sep 2016 18:45:15 -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=D94OuM01rZCpMq+gkAIMTzQ4rGeSRKJMZRosBAy6DFM=; b=iS1gZdiTn6NNUi1abLGbMxVbRiD0o5xHkROGq2AcYYQnWGYHUZDlezc6aYYmQvP77e Sy0xzCf1EFYV5GbrJisuzP93W13DJtD3Oiavrkv2dagU6Yu5Wa/d8iNjO491RB+1MedG sWbfI4bfFM/tqhAXdr8xnijn7fTcDmEMrVRoBVoWJjsiRLDw1yqNa1mUhLMy9EKzY4Jn g9E1xuyhKdCuIupLPaVOZ8+6arP5JBtjgElQV1YJJjm7UYw7kNG62qQAlncD/QAze9Sj Yvc/zLMv+05aMtJiIlHHag6cD/wJzwaiQOzMxoVV5ux2mve0fuPJtwcwrT6qpuFO+9m6 Zj0g== 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=D94OuM01rZCpMq+gkAIMTzQ4rGeSRKJMZRosBAy6DFM=; b=SBryknKnOX85J845H9aamyRYFyM3BtjOTXc1ed2pjo1YkdQamDoc5BlaR/6Kfj7L/F cCsQTgYKE3G2CM7LFBFDzGla4v2aPMBZmk2Kr/g+llR+QUx7Ls23Zo9eCprk40n94Xx3 /36mJBJrR3Imlap5dWEkdIc1KYIiY+KEqA27RuwEb1zSVKoUPeBjJnaH407e0HP6iTTL JaHWELLC3A9RAJAbQh1tkVEUsZjVsHRRal5iuaXx+D7OKrOxynEY/Cayww5Vc2S45uVL QPBCju/iO3DyqZR3j0pidvWnVZXL0WhgWEO3RdIGQJhG/M0y4V+V+WgRlrBoj9xaEYMc UPiQ== X-Gm-Message-State: AE9vXwMnMCyQ0L9UgtsZnNlnDVz6R1qVDh2FsOvrRRMHjgTIpBFaAWoNkJbdhFKBZgp4bC0K X-Received: by 10.98.192.130 with SMTP id g2mr53402261pfk.54.1475027114975; Tue, 27 Sep 2016 18:45:14 -0700 (PDT) Received: from rajat.mtv.corp.google.com ([172.22.64.13]) by smtp.gmail.com with ESMTPSA id b188sm7607188pfa.82.2016.09.27.18.45.14 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 27 Sep 2016 18:45:14 -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 v2] mwifiex: report wakeup for wowlan Date: Tue, 27 Sep 2016 18:45:04 -0700 Message-Id: <1475027104-17423-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 in case of a wake on wireless LAN event. Signed-off-by: Wei-Ning Huang Signed-off-by: Rajat Jain Tested-by: Wei-Ning Huang Reviewed-by: Eric Caruso Acked-by: Amitkumar Karwar --- v2: Fix the commit log 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; };