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
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.
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>
16 --- a/drivers/net/wireless/brcm80211/brcmfmac/bcmsdh.c
17 +++ b/drivers/net/wireless/brcm80211/brcmfmac/bcmsdh.c
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>
26 @@ -1122,6 +1123,8 @@ static int brcmf_ops_sdio_probe(struct s
28 struct brcmf_sdio_dev *sdiodev;
29 struct brcmf_bus *bus_if;
31 + struct acpi_device *adev;
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);
39 + /* prohibit ACPI power management for this device */
41 + adev = ACPI_COMPANION(dev);
43 + adev->flags.power_manageable = 0;
45 /* Consume func num 1 but dont do anything with it. */