summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'sys-kernel/linuxwacom-module/files/check_driver')
-rw-r--r--sys-kernel/linuxwacom-module/files/check_driver24
1 files changed, 24 insertions, 0 deletions
diff --git a/sys-kernel/linuxwacom-module/files/check_driver b/sys-kernel/linuxwacom-module/files/check_driver
new file mode 100644
index 0000000..6e49aa1
--- /dev/null
+++ b/sys-kernel/linuxwacom-module/files/check_driver
@@ -0,0 +1,24 @@
+#!/bin/sh
+#
+
+#logger check_driver called with: $1 - $2 - $3 -
+
+wanted=$1
+devpath=$2
+bustype=$3
+
+device=$(readlink /sys/$devpath/device)
+device=${device##*/}
+driver=$(readlink /sys/$devpath/device/driver)
+driver=${driver##*/}
+
+logger device $device is bound to the $driver driver
+
+if [ "$driver" != "$wanted" ]; then
+ logger must rebind
+ echo -n "$device" > /sys/$devpath/device/driver/unbind
+ echo -n "$device" > /sys/bus/$bustype/drivers/$wanted/bind
+else
+ logger no need to rebind
+fi
+