summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHauke Mehrtens <hauke@hauke-m.de>2015-09-21 00:06:17 +0200
committerHauke Mehrtens <hauke@hauke-m.de>2015-09-22 23:15:55 +0200
commit135c9409a7932c346354b865d41ff4e754373be6 (patch)
tree6806055feeece98b490ffb78029b3a60bb31aabb
parent5f17321d35e503616b31d74beb7f36eb9b62404d (diff)
patches: remove usage of gpio/consumer.h from hci_intel.c
hci_intel.c now also uses gpio/consumer.h which is only available in kernel >= 3.13. devm_gpiod_get_optional() with the current parameter list is only available in kernel 3.17. Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
-rw-r--r--patches/collateral-evolutions/network/0062-acpi-gpio-remove/hci_intel.patch67
1 files changed, 67 insertions, 0 deletions
diff --git a/patches/collateral-evolutions/network/0062-acpi-gpio-remove/hci_intel.patch b/patches/collateral-evolutions/network/0062-acpi-gpio-remove/hci_intel.patch
new file mode 100644
index 00000000..a6a7d0f4
--- /dev/null
+++ b/patches/collateral-evolutions/network/0062-acpi-gpio-remove/hci_intel.patch
@@ -0,0 +1,67 @@
+--- 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 <linux/interrupt.h>
+ #include <linux/pm_runtime.h>
+@@ -374,7 +376,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
+
+ /* Provide to idev a hu reference which is used to run LPM
+ * transactions (lpm suspend/resume) from PM callbacks.
+@@ -1322,14 +1326,17 @@ 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
+
+ idev->irq = platform_get_irq(pdev, 0);
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,17,0)
+ if (idev->irq < 0) {
+ struct gpio_desc *host_wake;
+
+@@ -1348,12 +1355,15 @@ static int intel_probe(struct platform_d
+ goto no_irq;
+ }
+ }
++#endif
+
+ /* Only enable wake-up/irq when controller is powered */
+ device_set_wakeup_capable(&pdev->dev, true);
+ device_wakeup_disable(&pdev->dev);
+
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,17,0)
+ no_irq:
++#endif
+ platform_set_drvdata(pdev, idev);
+
+ /* Place this instance on the device list */
+@@ -1361,8 +1371,10 @@ no_irq:
+ list_add_tail(&idev->list, &intel_device_list);
+ mutex_unlock(&intel_device_list_lock);
+
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,13,0)
+ dev_info(&pdev->dev, "registered, gpio(%d)/irq(%d).\n",
+ desc_to_gpio(idev->reset), idev->irq);
++#endif
+
+ return 0;
+ }