Skip to content

Instantly share code, notes, and snippets.

@rekby
Created December 3, 2018 07:57
Show Gist options
  • Star 10 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rekby/0f0859bca9c80d6b8fc52ec13b3b0772 to your computer and use it in GitHub Desktop.
Save rekby/0f0859bca9c80d6b8fc52ec13b3b0772 to your computer and use it in GitHub Desktop.
#!/bin/bash
# Workaround for https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1784152
# Copy the script to /lib/systemd/system-sleep/reload-dell-touchpad.sh
SUSPEND_MODULES="i2c_hid"
case $1 in
pre)
for mod in $SUSPEND_MODULES; do
rmmod $mod
done
;;
post)
for mod in $SUSPEND_MODULES; do
modprobe $mod
done
;;
reload)
for mod in $SUSPEND_MODULES; do
rmmod $mod
modprobe $mod
done
;;
esac
@jeffcogswell
Copy link

Thank you! This fixed it for me. I was also seeing journalctl eating up processor and it was causing my battery to drain quicker.

@IvanSafonov
Copy link

Thanks! It works for me too.

@fquinner
Copy link

fquinner commented Jan 2, 2019

Thanks!

Copy link

ghost commented Jan 25, 2019

Thanks a lot. This is probably applicable for non-Dell laptops too, at least those with so-called "precision touchpad".
On that note, rename your file to "reload-touchpad" 😆

@khaytsus
Copy link

Good deal, I've done something very similar, but was just reloading it on post, might be all the same but i like your approach better.

@jbroadus
Copy link

The ability to reprobe i2c-hid is broken in 4.20, but a fix was accepted into 5.1.

You can also apply this patch to fix issue all together if you're building your own kernel:
https://lore.kernel.org/lkml/20190211070040.4569-1-jbroadus@gmail.com/raw

@subdiff
Copy link

subdiff commented Mar 3, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment