From patchwork Tue Sep 27 16:56: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: 9352361 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 0B24E600CB for ; Tue, 27 Sep 2016 16:56:57 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id F12262898B for ; Tue, 27 Sep 2016 16:56:56 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E592728F2B; Tue, 27 Sep 2016 16:56:56 +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=-6.5 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM 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 281C329284 for ; Tue, 27 Sep 2016 16:56:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S936391AbcI0Q4i (ORCPT ); Tue, 27 Sep 2016 12:56:38 -0400 Received: from mail-pf0-f178.google.com ([209.85.192.178]:35455 "EHLO mail-pf0-f178.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S936357AbcI0Q4f (ORCPT ); Tue, 27 Sep 2016 12:56:35 -0400 Received: by mail-pf0-f178.google.com with SMTP id s13so7649046pfd.2 for ; Tue, 27 Sep 2016 09:56:35 -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=uw5/Z71M05TLI8vn2Cx6w1bq3YNcZgRW2xn22S1cNGE=; b=j34zVTp4s9qYVYBmJc+AL9jtcg4zp3/M1q/g6w5WTF9famdOm2SBjShr1Hvr3eHI8z 3uf76KZTJWdUdX6UR5JRObIaorqhjv/GRicXDC9PL06y1kd0u3B754WlPp8Iq3Ueg2LB VHgl3XigUvJU+J8U75Ix89CM9DKcM5KQJ4ZcK2qfHa/mvULbwH4N6jY/+5M6C0pl6qPR vKOiT69HdMrwCJ7r1K/IsSCJdOrInp6QPf7EeUrw/SluRDZ6R43C9GRCFrLA/TxxYNfa keI4ctatjFAvpboMaSMgVdkd4IswWIWs2fmq5VzUoyq9uexXg79bk5BNiJ0OBrqKUlIx RcAg== 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=uw5/Z71M05TLI8vn2Cx6w1bq3YNcZgRW2xn22S1cNGE=; b=kXxYdpBmAHAtKbKPG96VYChUYmOd/pKHyYPvHDs6mJzPMzzXpbCdhmEzalq7S2EhU+ /91ltMeGUJE+bAAWAOK0n0F/k0s4BMDhbWC6PI4ffC6J12UBPKMhyRnuWhZGrYhhOSml 35RdmD4Pbi5eV/hfm+zgWxYBNWDpAjVE0x0HQ6T2q3j5uRuxxrH3CODjgGh+i5F8RQrF ZRlXhnfsJSbw9X0r1pRRHPXrnWEtTmVWThnyFtQHLPipqeYEyc71+BIlndvCwuEbMwnw 1C6yOTQu72vzpS7DcdZj2OT494SI8kVls1DVbS61K5v91nFdi6gn7SBIDhXaCZ0n+9Sc 8Lrw== X-Gm-Message-State: AE9vXwOknndDw6jpbtqbxacVeYRiL+t4NS7S+NJLlg6rqLocWWmv8qK6v7+SzRB3H0zBBg25 X-Received: by 10.98.49.198 with SMTP id x189mr50116876pfx.135.1474995394485; Tue, 27 Sep 2016 09:56:34 -0700 (PDT) Received: from rajat.mtv.corp.google.com ([172.22.64.13]) by smtp.gmail.com with ESMTPSA id r7sm6226610pfk.49.2016.09.27.09.56.33 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 27 Sep 2016 09:56:34 -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 09:56:04 -0700 Message-Id: <1474995364-123069-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 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; };