提交 df566a48 编写于 作者: R Rajat Jain 提交者: Kalle Valo

mwifiex: report wakeup for wowlan

Register the WLAN device as a wakeup source since it can
wake the system via wake-on-wireless-lan. In an actual wowlan
event, notify the PM core that we are the current wakeup source.
This allows the PM core to update the wakeup attributes in /sys.

This was causing wakeup issues on chromeos as the system was
apparently confused about the wakeup source.
Signed-off-by: NWei-Ning Huang <wnhuang@google.com>
Signed-off-by: NRajat Jain <rajatja@google.com>
Tested-by: NWei-Ning Huang <wnhuang@chromium.org>
Reviewed-by: NEric Caruso <ejcaruso@chromium.org>
Acked-by: NAmitkumar Karwar <akarwar@marvell.com>
Signed-off-by: NKalle Valo <kvalo@codeaurora.org>
上级 e7ee74b5
...@@ -89,6 +89,9 @@ static irqreturn_t mwifiex_wake_irq_wifi(int irq, void *priv) ...@@ -89,6 +89,9 @@ static irqreturn_t mwifiex_wake_irq_wifi(int irq, void *priv)
disable_irq_nosync(irq); disable_irq_nosync(irq);
} }
/* Notify PM core we are wakeup source */
pm_wakeup_event(cfg->dev, 0);
return IRQ_HANDLED; return IRQ_HANDLED;
} }
...@@ -112,6 +115,7 @@ static int mwifiex_sdio_probe_of(struct device *dev, struct sdio_mmc_card *card) ...@@ -112,6 +115,7 @@ static int mwifiex_sdio_probe_of(struct device *dev, struct sdio_mmc_card *card)
GFP_KERNEL); GFP_KERNEL);
cfg = card->plt_wake_cfg; cfg = card->plt_wake_cfg;
if (cfg && card->plt_of_node) { if (cfg && card->plt_of_node) {
cfg->dev = dev;
cfg->irq_wifi = irq_of_parse_and_map(card->plt_of_node, 0); cfg->irq_wifi = irq_of_parse_and_map(card->plt_of_node, 0);
if (!cfg->irq_wifi) { if (!cfg->irq_wifi) {
dev_dbg(dev, dev_dbg(dev,
...@@ -132,6 +136,10 @@ static int mwifiex_sdio_probe_of(struct device *dev, struct sdio_mmc_card *card) ...@@ -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; return 0;
} }
......
...@@ -155,6 +155,7 @@ ...@@ -155,6 +155,7 @@
} while (0) } while (0)
struct mwifiex_plt_wake_cfg { struct mwifiex_plt_wake_cfg {
struct device *dev;
int irq_wifi; int irq_wifi;
bool wake_by_wifi; bool wake_by_wifi;
}; };
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册