summaryrefslogtreecommitdiff
path: root/recipes-kernel/linux/linux-3.12.70/mtrv1/linux-3.12-wl12xx-set-power.patch
blob: fb8cf6e76f2170a85acfc1455b5eab0c92cb9f57 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
diff --git a/drivers/net/wireless/ti/wlcore/sdio.c b/drivers/net/wireless/ti/wlcore/sdio.c
index 29ef249..fba2e1b 100644
--- a/drivers/net/wireless/ti/wlcore/sdio.c
+++ b/drivers/net/wireless/ti/wlcore/sdio.c
@@ -52,6 +52,7 @@ static bool dump = false;
 struct wl12xx_sdio_glue {
 	struct device *dev;
 	struct platform_device *core;
+	void (*set_power)(bool enable);
 };
 
 static const struct sdio_device_id wl1271_devices[] = {
@@ -153,6 +154,9 @@ static int wl12xx_sdio_power_on(struct wl12xx_sdio_glue *glue)
 	struct sdio_func *func = dev_to_sdio_func(glue->dev);
 	struct mmc_card *card = func->card;
 
+	if (glue->set_power)
+		glue->set_power(1);
+
 	ret = pm_runtime_get_sync(&card->dev);
 	if (ret) {
 		/*
@@ -181,6 +185,9 @@ static int wl12xx_sdio_power_off(struct wl12xx_sdio_glue *glue)
 	struct sdio_func *func = dev_to_sdio_func(glue->dev);
 	struct mmc_card *card = func->card;
 
+	if (glue->set_power)
+		glue->set_power(0);
+
 	sdio_claim_host(func);
 	sdio_disable_func(func);
 	sdio_release_host(func);
@@ -311,6 +318,9 @@ static int wl1271_probe(struct sdio_func *func,
 		dev_err(glue->dev, "can't add platform device\n");
 		goto out_dev_put;
 	}
+
+	glue->set_power = pdev_data->pdata->set_power;
+
 	return 0;
 
 out_dev_put: