summarylogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.SRCINFO21
-rw-r--r--.gitignore4
-rw-r--r--Makefile14
-rw-r--r--PKGBUILD44
-rw-r--r--bluetooth-remove-set-device-wakeup.patch30
5 files changed, 113 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 000000000000..0a038ff78606
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,21 @@
+pkgbase = macbook12-bluetooth-driver
+ pkgdesc = Driver for bluetooth on newer MacBook (Pro) models
+ pkgver = 5.4.15
+ pkgrel = 1
+ url = https://github.com/leifliddy/macbook12-bluetooth-driver
+ arch = i686
+ arch = x86_64
+ license = GPL2
+ noextract = linux-5.4.15.tar.xz
+ source = https://cdn.kernel.org/pub/linux/kernel/v5.x/linux-5.4.15.tar.xz
+ source = bluetooth-remove-set-device-wakeup.patch
+ source = Makefile
+ md5sums = 39893c474f29a1f57445b9e420cd202d
+ md5sums = ff7c2d3a0a168f84b4dce81aec69eefd
+ md5sums = a94e2ba612e42b2c5cbfaa8a502b2581
+ sha256sums = 6407222f850f685b346011bd696a3216d5df0f37e0184099100d2724396d94b1
+ sha256sums = cb99a8c710c5a374291394796e976214cfb44da6006f691b5a3b379512da1e96
+ sha256sums = b07b6fc4b3a6ad60dfd3cd29804f9aaf6922018804bbfb52c8f31bba888b2272
+
+pkgname = macbook12-bluetooth-driver
+
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 000000000000..19640cf45187
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,4 @@
+/pkg
+/src
+/linux-*.tar.xz
+/*.pkg.*
diff --git a/Makefile b/Makefile
new file mode 100644
index 000000000000..c5ea7b52a1b2
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,14 @@
+obj-m += hci_uart.o
+hci_uart-y := hci_ldisc.o
+hci_uart-m += hci_serdev.o
+hci_uart-m += hci_h4.o
+hci_uart-m += hci_bcsp.o
+hci_uart-m += hci_ll.o
+hci_uart-m += hci_ath.o
+hci_uart-m += hci_h5.o
+hci_uart-m += hci_intel.o
+hci_uart-m += hci_bcm.o
+hci_uart-m += hci_qca.o
+hci_uart-m += hci_ag6xx.o
+hci_uart-m += hci_mrvl.o
+hci_uart-objs := $(hci_uart-y)
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..cca080a96fc3
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,44 @@
+# Maintainer: Christoph Gysin <christoph.gysin@gmail.com>
+
+pkgname=macbook12-bluetooth-driver
+pkgver=5.4.15
+pkgrel=1
+pkgdesc="Driver for bluetooth on newer MacBook (Pro) models"
+arch=('i686' 'x86_64')
+url="https://github.com/leifliddy/macbook12-bluetooth-driver"
+license=('GPL2')
+source=("https://cdn.kernel.org/pub/linux/kernel/v${pkgver%%.*}.x/linux-$pkgver.tar.xz"
+ 'bluetooth-remove-set-device-wakeup.patch'
+ 'Makefile')
+noextract=("linux-$pkgver.tar.xz")
+md5sums=('39893c474f29a1f57445b9e420cd202d'
+ 'ff7c2d3a0a168f84b4dce81aec69eefd'
+ 'a94e2ba612e42b2c5cbfaa8a502b2581')
+sha256sums=('6407222f850f685b346011bd696a3216d5df0f37e0184099100d2724396d94b1'
+ 'cb99a8c710c5a374291394796e976214cfb44da6006f691b5a3b379512da1e96'
+ 'b07b6fc4b3a6ad60dfd3cd29804f9aaf6922018804bbfb52c8f31bba888b2272')
+
+pkgver() {
+ local kernel_version=$(uname -r)
+ echo ${kernel_version%%-*}
+}
+
+prepare() {
+ cd "$srcdir"
+ tar xf linux-$pkgver.tar.xz linux-$pkgver/drivers/bluetooth
+
+ cd linux-$pkgver
+ patch -Np1 -i ../bluetooth-remove-set-device-wakeup.patch
+
+ cp "$srcdir"/Makefile drivers/bluetooth/
+}
+
+build() {
+ make -C /lib/modules/$(uname -r)/build M="$srcdir"/linux-$pkgver/drivers/bluetooth modules
+}
+
+package() {
+ destdir="$pkgdir"/usr/lib/modules/$(uname -r)/updates
+ mkdir -p "$destdir"
+ cp "$srcdir"/linux-$pkgver/drivers/bluetooth/hci_uart.ko "$destdir"
+}
diff --git a/bluetooth-remove-set-device-wakeup.patch b/bluetooth-remove-set-device-wakeup.patch
new file mode 100644
index 000000000000..58dfd848afac
--- /dev/null
+++ b/bluetooth-remove-set-device-wakeup.patch
@@ -0,0 +1,30 @@
+commit 737a7a0ee53a6a9413b19a9d0079fc1d0dcf1caa
+Author: Christoph Gysin <christoph.gysin@gmail.com>
+Date: Mon Feb 12 10:50:34 2018 +0200
+
+ bluetooth: remove set_device_wakeup
+
+diff --git a/drivers/bluetooth/hci_bcm.c b/drivers/bluetooth/hci_bcm.c
+index 7646636f2d18..e245db70bb25 100644
+--- a/drivers/bluetooth/hci_bcm.c
++++ b/drivers/bluetooth/hci_bcm.c
+@@ -243,10 +243,6 @@ static int bcm_gpio_set_power(struct bcm_device *dev, bool powered)
+ if (err)
+ goto err_txco_clk_disable;
+
+- err = dev->set_device_wakeup(dev, powered);
+- if (err)
+- goto err_revert_shutdown;
+-
+ if (!powered && dev->res_enabled) {
+ clk_disable_unprepare(dev->txco_clk);
+ clk_disable_unprepare(dev->lpo_clk);
+@@ -266,8 +262,6 @@ static int bcm_gpio_set_power(struct bcm_device *dev, bool powered)
+
+ return 0;
+
+-err_revert_shutdown:
+- dev->set_shutdown(dev, !powered);
+ err_txco_clk_disable:
+ if (powered && !dev->res_enabled)
+ clk_disable_unprepare(dev->txco_clk);