diff --git a/drivers/net/wireless/marvell/mwifiex/sdio.c b/drivers/net/wireless/marvell/mwifiex/sdio.c index 8718950004f3..807af13f9b41 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, @@ -132,6 +136,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 db837f12c547..07cdd2371eb5 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; };