From c6461349b52a54970af82d538dd5e3eaae3cc228 Mon Sep 17 00:00:00 2001 From: Andrew Ruthven Date: Mon, 18 Feb 2019 11:18:13 +0000 Subject: [PATCH] Patch to unload hid-topseed driver after we move bound devices --- debian/patches/remove_rmmod | 28 ++++++++++++++++++++++++++++ debian/patches/series | 1 + 2 files changed, 29 insertions(+) create mode 100644 debian/patches/remove_rmmod diff --git a/debian/patches/remove_rmmod b/debian/patches/remove_rmmod new file mode 100644 index 0000000..ea57f75 --- /dev/null +++ b/debian/patches/remove_rmmod @@ -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. diff --git a/debian/patches/series b/debian/patches/series index 5f14c60..1963f0a 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -1 +1,2 @@ paths.diff +remove_rmmod -- 2.30.2