From patchwork Tue Sep 27 16:50: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: 9352351 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 95B786086A for ; Tue, 27 Sep 2016 16:51:52 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8769729282 for ; Tue, 27 Sep 2016 16:51:52 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7BD2A2929B; Tue, 27 Sep 2016 16:51:52 +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 F28B429284 for ; Tue, 27 Sep 2016 16:51:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S935250AbcI0Qvp (ORCPT ); Tue, 27 Sep 2016 12:51:45 -0400 Received: from mail-pf0-f181.google.com ([209.85.192.181]:33026 "EHLO mail-pf0-f181.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S935566AbcI0Qvm (ORCPT ); Tue, 27 Sep 2016 12:51:42 -0400 Received: by mail-pf0-f181.google.com with SMTP id 21so7637485pfy.0 for ; Tue, 27 Sep 2016 09:51:41 -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; bh=Z8dGQhJ4wS5f8ljftFvSUE6JiTwJzbzVYC0ZBW8l+40=; b=hNU0nKwyVn3gg1G4gX8tmXozd8SA4+djSck7dgRXhzHg8Hwh/SF+9NIqZP+yhqOx3i ZUQyJjlG9pmg3tFpgeZvqeBaVyr8miIyMjERhZgtK1ubooFDvKcNLC/5A8Sq6wqZvPiZ KK4rvnaeAk4TVPPBqvR88jLfW/Qcr8AJH1p+CSTNFGzeiRj/LN+bd6Gpaemy26SoR71n VvtP/+B+8339qRBEdzYLCIjiojRFv1C9Xej2iBSo7lauEfZBu/GfUurfHdQ3OvmqBCUD YkbDIZ6zwStC9uY05MU7g5TUhGOkrmh2/xrPnpHpG1UyQB/Nn6+Aa7XKiFW6tZ5b1Gq1 LYaA== 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; bh=Z8dGQhJ4wS5f8ljftFvSUE6JiTwJzbzVYC0ZBW8l+40=; b=dAT/xF2HUgg85uaOZ2NHEPk2ogrYFeXkIKy/yiMdDHxgQQalj6eNd+pBK7s6RZg3pd qbQGQPeVk7XDMIm8rfAJFW+Smk6v4sIw3EDl+Hb2sg/5lQJBvU0353fbCEUlvPAD7JLt iTWFUkFRlaPR7s6EwJliOcwso8eBtgsSVZW+9FsqFRWLlZsLfSm5MBTw8loKk/Jy180u D3KJvYD1juSpiZN6IZEoxJP1UeO5Pnvyq5j70ownJutA3bH3eWRTCVT7x7lq92+mYcMG w9Y3A9xcuazR8XFaF48hCyxJbHXty4R4G8/PmwcqZuNTSrDWXS6wdlMqShGjPuwe2ehr Aasw== X-Gm-Message-State: AE9vXwNB/JU6BzangX2xwse8PZzTvm/ZN92DDK+BkqFCInD5OsTRaOE9lSGUX+OOxoERzUPO X-Received: by 10.98.46.198 with SMTP id u189mr48913081pfu.116.1474995095508; Tue, 27 Sep 2016 09:51:35 -0700 (PDT) Received: from rajat.mtv.corp.google.com ([172.22.64.13]) by smtp.gmail.com with ESMTPSA id p189sm6232218pfb.5.2016.09.27.09.51.34 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 27 Sep 2016 09:51:35 -0700 (PDT) From: Rajat Jain To: Amitkumar Karwar , Nishant Sarmukadam , Kalle Valo , linux-wireless@vger.kernel.org, netdev@vger.kernel.org Cc: Wei-Ning Huang , Brian Norris , Eric Caruso , rajatxjain@gmail.com, Rajat Jain Subject: Date: Tue, 27 Sep 2016 09:50:52 -0700 Message-Id: <1474995052-122337-1-git-send-email-rajatja@google.com> X-Mailer: git-send-email 2.8.0.rc3.226.g39d4020 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: Wei-Ning Huang Date: Thu, 17 Mar 2016 11:43:16 +0800 Subject: [PATCH] mwifiex: report wakeup for wowlan 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; };