The Cookie Machine - Click here to drag window

DUMMY TEXT - Real text set in assets/js/theCookieMachine.js

If you can read me, I'm broken!

Views: 56,834β€…    Votes:  21β€…
Tags: touchpad   suspend   asus   synaptics  
Link: πŸ” See Original Answer on Ask Ubuntu ⧉ πŸ”—

URL: https://askubuntu.com/q/828920
Title: Touchpad not working after suspending laptop
ID: /2016/09/24/Touchpad-not-working-after-suspending-laptop
Created: September 24, 2016    Edited:  September 24, 2016
Upload: September 15, 2024    Layout:  post
TOC: false    Navigation:  false    Copy to clipboard:  false


This bug is reported in launchpad: Elantech touchpad stops working after suspend. After suspend the OP tries # modprobe -r psmouse and # modprobe psmouse and it doesn’t work. But what if psmouse was removed before suspend and inserted after suspend?

If this works manually then you can automate by creating a new file in the /lib/systemd/system-sleep/ directory containing:

#!/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 psmouse
    ;;
  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 psmouse
    ;;
esac

It is known after a suspend the psmouse module can’t be removed. We also know it can be removed and inserted before a suspend. So this technique removes it before suspend. After resume insert it and hopefully the kernel won’t reject it.

The sleep 2 command is from my own problems where systemd and kernel (via gnome or APM) were both sleeping and waking up. I needed to redirect pulseaudio sound back to the TV due to a bug introduced in Ubuntu 16.04/pulseaudio 8.0. The 2 second delay was necessary for kernel and systemd to finish waking up. Still haven’t figured out the dual suspend and dual resume yet….

⇧ Best directory to place my bash scripts? Module disabled after kernel upgrade  β‡©