summaryrefslogtreecommitdiff
path: root/patches/collateral-evolutions/network/0062-acpi-gpio-remove/hci_bcm.patch
blob: 1d24e4787057637aec03425f8f1be49294d9411e (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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
--- a/drivers/bluetooth/hci_bcm.c
+++ b/drivers/bluetooth/hci_bcm.c
@@ -29,7 +29,9 @@
 #include <linux/acpi.h>
 #include <linux/platform_device.h>
 #include <linux/clk.h>
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,13,0)
 #include <linux/gpio/consumer.h>
+#endif
 #include <linux/tty.h>
 
 #include <net/bluetooth/bluetooth.h>
@@ -138,8 +140,10 @@ static int bcm_gpio_set_power(struct bcm
 	if (powered && !IS_ERR(dev->clk) && !dev->clk_enabled)
 		clk_enable(dev->clk);
 
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,13,0)
 	gpiod_set_value(dev->shutdown, powered);
 	gpiod_set_value(dev->device_wakeup, powered);
+#endif
 
 	if (!powered && !IS_ERR(dev->clk) && dev->clk_enabled)
 		clk_disable(dev->clk);
@@ -352,7 +356,9 @@ static int bcm_suspend(struct device *de
 
 	/* Suspend the device */
 	if (bdev->device_wakeup) {
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,13,0)
 		gpiod_set_value(bdev->device_wakeup, false);
+#endif
 		BT_DBG("suspend, delaying 15 ms");
 		mdelay(15);
 	}
@@ -376,7 +382,9 @@ static int bcm_resume(struct device *dev
 		goto unlock;
 
 	if (bdev->device_wakeup) {
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,13,0)
 		gpiod_set_value(bdev->device_wakeup, true);
+#endif
 		BT_DBG("resume, delaying 15 ms");
 		mdelay(15);
 	}
@@ -395,6 +403,7 @@ unlock:
 }
 #endif
 
+#if defined(CONFIG_ACPI) && LINUX_VERSION_CODE >= KERNEL_VERSION(3,19,0)
 static const struct acpi_gpio_params device_wakeup_gpios = { 0, 0, false };
 static const struct acpi_gpio_params shutdown_gpios = { 1, 0, false };
 
@@ -404,7 +413,6 @@ static const struct acpi_gpio_mapping ac
 	{ },
 };
 
-#ifdef CONFIG_ACPI
 static int bcm_resource(struct acpi_resource *ares, void *data)
 {
 	struct bcm_device *dev = data;
@@ -543,7 +551,7 @@ static const struct hci_uart_proto bcm_p
 	.dequeue	= bcm_dequeue,
 };
 
-#ifdef CONFIG_ACPI
+#if defined(CONFIG_ACPI) && LINUX_VERSION_CODE >= KERNEL_VERSION(3,19,0)
 static const struct acpi_device_id bcm_acpi_match[] = {
 	{ "BCM2E39", 0 },
 	{ "BCM2E67", 0 },
@@ -560,7 +568,9 @@ static struct platform_driver bcm_driver
 	.remove = bcm_remove,
 	.driver = {
 		.name = "hci_bcm",
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,19,0)
 		.acpi_match_table = ACPI_PTR(bcm_acpi_match),
+#endif
 		.pm = &bcm_pm_ops,
 	},
 };