Touchpad is disabled after sleep or shutdown

Hey all. Sorry if this isn’t the right category. Just some info about my system: I’m using KDE with wayland on an HP pavilion 15-ec107. However, I’ve been having an issue for the past month or so where my touchpad will be disabled after sleep. It also happens sometimes after a shutdown. What’s weird is that I will shut the lid on my laptop and it’ll go to sleep as expected, but when I open the lid the touchpad will work on the lock screen, but when I enter my password it stops working. I then have to open the touchpad settings through search and use tab and space to re-enable the touchpad. It’s kinda annoying to deal with so any help would be appreciated. I looked at other posts on here, and saw one that said it might be due to the fact that the user didn’t have swap. So I created a swap file and enabled it. Still didn’t work. All the other posts I couldn’t seem to follow, or weren’t related to my issue. Output from libinput:

Device:                  ELAN0718:00 04F3:30FD Touchpad
Kernel:                  /dev/input/event10
Id:                      i2c:04f3:30fd
Group:                   5
Seat:                    seat0, default
Size:                    114x58mm
Capabilities:            pointer gesture
Tap-to-click:            disabled
Tap-and-drag:            enabled
Tap button map:          left/right/middle
Tap drag lock:           disabled

This is very unlikely have any correlation with swap, so forget it. The one who suggested that might only have a lucky moment. The problem is usually due to asynchronous code, where touchpad (en|dis)ablement is having race condition with touchpad detection itself, and this is kernel (driver) level problem.

I found a potential solution:
https://www.reddit.com/r/Ubuntu/comments/sfpz9p/posible_fix_hp_pavilion_gaming_15ecxxxx_elantech/
It’s hackish, but should work.

Hey! Thanks for the response. I tried creating that script to reload the module. It did not work. I also tried creating the .conf file it did not work. I do not know if I need to enable this file in anyway, but I just created the file and then restarted. Let me know if I did anything wrong.

OK, since the thread above listed ecXXX, it might not be applicable to all models. So let’s first diagnose the logs.

Reproduce the problem, and after ensuring the touchpad doesn’t work, execute:

$ sudo dmesg | grep -i i2c > dmesg.txt

if the content is reasonably short, feel free to paste here. Otherwise, paste to something like pastebin then paste the link here.

We’re making sure the disablement is due to device not ready when the driver loads.

Thank you!. The ouput is:

[   10.170176] i2c_dev: i2c /dev entries driver
[   10.731979] i2c i2c-3: Successfully instantiated SPD at 0x50
[   10.733472] i2c i2c-3: Successfully instantiated SPD at 0x51
[   10.940210] input: ELAN0718:00 04F3:30FD Mouse as /devices/platform/AMDI0010:03/i2c-0/i2c-ELAN0718:00/0018:04F3:30FD.0001/input/input9
[   10.942912] input: ELAN0718:00 04F3:30FD Touchpad as /devices/platform/AMDI0010:03/i2c-0/i2c-ELAN0718:00/0018:04F3:30FD.0001/input/input11
[   10.951074] hid-generic 0018:04F3:30FD.0001: input,hidraw0: I2C HID v1.00 Mouse [ELAN0718:00 04F3:30FD] on i2c-ELAN0718:00
[   11.088560] input: ELAN0718:00 04F3:30FD Mouse as /devices/platform/AMDI0010:03/i2c-0/i2c-ELAN0718:00/0018:04F3:30FD.0001/input/input16
[   11.088727] input: ELAN0718:00 04F3:30FD Touchpad as /devices/platform/AMDI0010:03/i2c-0/i2c-ELAN0718:00/0018:04F3:30FD.0001/input/input18
[   11.088900] hid-multitouch 0018:04F3:30FD.0001: input,hidraw0: I2C HID v1.00 Mouse [ELAN0718:00 04F3:30FD] on i2c-ELAN0718:00

OK, this doesn’t seem to exhibit the same behavior, which is why the solution posted doesn’t work. The touchpad is correctly detected, but somehow disabled upon that. Therefore a possible solution is to forcefully enable it upon detection.

In Wayland, the config is stored at ~/.config/touchpadxlibinputrc. Find the [ELAN0718:00 04F3:30FD Touchpad] section and set enabled=true, adding the line if missing. Let’s try this first and see if it works.

Hey, sorry for the late response. I started a new job and moved into a new apartment so I hadn’t had time really outside of work. I did however, add that line since it was missing, rebooted the laptop, and then put it to sleep. The problem still occurs. Do you have anything else that might be worth a shot?