restarting mysterious touchpad driver in 19.10
Solution 1:
When using the built-in mouse driver that comes with ubuntu, I found the best way to do this was to restart the i2c_hid
module, this is what i2c_designware
uses as the i2c manager. Which is why you can't find it in the lib_modules
command.
I as able to figure this out using the lsmod
command to list the modules in the kernel, and then looked for the keyword i2c
. After that it was kind of a lucky guess to find the correct one.
As @ZanyZachary1 suggested, after finding the module to restart, it's as simple as setting up a bash script to run whenever the laptop is resumed or put to sleep.
#!/bin/sh
case $1/$2 in
pre/*)
echo "Going to $2..."
# Place your pre suspend commands here, or `exit 0` if no pre suspend action required
modprobe -r i2c_hid
;;
post/*)
echo "Waking up from $2..."
# Place your post suspend (resume) commands here, or `exit 0` if no post suspend action required
sleep 2
modprobe i2c_hid
;;
esac
Then place this in /usr/lib/systemd/system-sleep/
You can find more information on this at: https://www.addictivetips.com/ubuntu-linux-tips/run-scripts-and-commands-on-suspend-and-resume-on-linux/