Patch to unload hid-topseed driver after we move bound devices
authorAndrew Ruthven <andrew@etc.gen.nz>
Mon, 18 Feb 2019 11:18:13 +0000 (11:18 +0000)
committerAndrew Ruthven <andrew@etc.gen.nz>
Wed, 20 Feb 2019 00:45:28 +0000 (13:45 +1300)
debian/patches/remove_rmmod [new file with mode: 0644]
debian/patches/series

diff --git a/debian/patches/remove_rmmod b/debian/patches/remove_rmmod
new file mode 100644 (file)
index 0000000..ea57f75
--- /dev/null
@@ -0,0 +1,28 @@
+By leaving hid_topseed running, we can see what devices it had
+bound, then move them over to sapphire.
+
+I was running into a problem where after unloading hid_topseed,
+when I loaded sapphire the remote wasn't being registered
+with sapphire until I unplugged it and plugged it back it.
+--- a/sapphire-remote-7.1/sapphire_startup.sh
++++ b/sapphire-remote-7.1/sapphire_startup.sh
+@@ -8,8 +8,9 @@
+ #
+ TOPSEED=/sys/bus/hid/drivers/topseed
+ SAPPHIRE=/sys/bus/hid/drivers/sapphire
+-rmmod hid-topseed     &>/dev/null
+ modprobe sapphire     &>/dev/null
++
++# Move any devices bound to hid-topseed over to sapphire.
+ if [ -d $SAPPHIRE -a -e $TOPSEED/unbind ]; then
+       cd $TOPSEED
+       for dev in [0-9]*[-0-9A-F] ; do
+@@ -19,6 +20,8 @@
+               fi
+       done
+ fi
++
++rmmod hid-topseed      &>/dev/null
+ #
+ # Ubuntu/Mint kernels (and likely others too) don't like it
+ # when we unload and reload the sapphire driver.
index 5f14c60..1963f0a 100644 (file)
@@ -1 +1,2 @@
 paths.diff
+remove_rmmod