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
|
--- a/drivers/bluetooth/hci_intel.c
+++ b/drivers/bluetooth/hci_intel.c
@@ -29,7 +29,9 @@
#include <linux/wait.h>
#include <linux/tty.h>
#include <linux/platform_device.h>
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,13,0)
#include <linux/gpio/consumer.h>
+#endif
#include <linux/acpi.h>
#include <net/bluetooth/bluetooth.h>
@@ -166,7 +168,9 @@ static int intel_set_power(struct hci_ua
BT_INFO("hu %p, Switching compatible pm device (%s) to %u",
hu, dev_name(&idev->pdev->dev), powered);
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,13,0)
gpiod_set_value(idev->reset, powered);
+#endif
}
spin_unlock(&intel_device_list_lock);
@@ -895,12 +899,14 @@ static int intel_probe(struct platform_d
return -ENODEV;
}
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,17,0)
idev->reset = devm_gpiod_get_optional(&pdev->dev, "reset",
GPIOD_OUT_LOW);
if (IS_ERR(idev->reset)) {
dev_err(&pdev->dev, "Unable to retrieve gpio\n");
return PTR_ERR(idev->reset);
}
+#endif
platform_set_drvdata(pdev, idev);
|