d46b300daaec3c3d5aae5aa0142c66fea91a013a
[15.05/openwrt.git] / package / kernel / mac80211 / patches / 366-brcmfmac-prohibit-ACPI-power-management-for-brcmfmac.patch
1 From: "Fu, Zhonghui" <zhonghui.fu@linux.intel.com>
2 Date: Mon, 11 May 2015 10:41:32 +0800
3 Subject: [PATCH] brcmfmac: prohibit ACPI power management for brcmfmac driver
4
5 ACPI will manage WiFi chip's power state during suspend/resume
6 process on some tablet platforms(such as ASUS T100TA). This is
7 not supported by brcmfmac driver now, and the context of WiFi
8 chip will be damaged after resume. This patch informs ACPI not
9 to manage WiFi chip's power state.
10
11 Signed-off-by: Zhonghui Fu <zhonghui.fu@linux.intel.com>
12 Acked-by: Arend van Spriel <arend@broadcom.com>
13 Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
14 ---
15
16 --- a/drivers/net/wireless/brcm80211/brcmfmac/bcmsdh.c
17 +++ b/drivers/net/wireless/brcm80211/brcmfmac/bcmsdh.c
18 @@ -33,6 +33,7 @@
19  #include <linux/suspend.h>
20  #include <linux/errno.h>
21  #include <linux/module.h>
22 +#include <linux/acpi.h>
23  #include <net/cfg80211.h>
24  
25  #include <defs.h>
26 @@ -1122,6 +1123,8 @@ static int brcmf_ops_sdio_probe(struct s
27         int err;
28         struct brcmf_sdio_dev *sdiodev;
29         struct brcmf_bus *bus_if;
30 +       struct device *dev;
31 +       struct acpi_device *adev;
32  
33         brcmf_dbg(SDIO, "Enter\n");
34         brcmf_dbg(SDIO, "Class=%x\n", func->class);
35 @@ -1129,6 +1132,12 @@ static int brcmf_ops_sdio_probe(struct s
36         brcmf_dbg(SDIO, "sdio device ID: 0x%04x\n", func->device);
37         brcmf_dbg(SDIO, "Function#: %d\n", func->num);
38  
39 +       /* prohibit ACPI power management for this device */
40 +       dev = &func->dev;
41 +       adev = ACPI_COMPANION(dev);
42 +       if (adev)
43 +               adev->flags.power_manageable = 0;
44 +
45         /* Consume func num 1 but dont do anything with it. */
46         if (func->num == 1)
47                 return 0;