Well, one could probably write a script to disable the keyboard and touchpad when going into suspend, leaving only the power button left to wake up, and then have a script on wakeup to enable the keyboard and touchpad.
For Linux, there is a feature called “unbind” and “bind” that can be used to obtain the above functionality.
E.g. the following stops the keyboard working for 5 seconds (tested on a FW16):
The following stops the mouse working for 5 seconds (tested on a FW16) echo AMDI0010:03 >/sys/bus/platform/drivers/i2c_designware/unbind; sleep 5; echo AMDI0010:03 >/sys/bus/platform/drivers/i2c_designware/bind
The following script disables the keyboard and trackpad during suspend on a FW16.
You can wake up the laptop by pressing the power key.
I tested by clicking on: “Power icon” → suspend.
Here is a script to do it:
Create the file: /usr/lib/systemd/system-sleep/keyboard-mouse-disable-sleep
Note: The script is not perfect. It leaves the lights on on the keyboard during suspend, so uses 5W during suspend instead of the normal 2W. I will add the turning the lights off, when I find out how.
I have done a script in a previous post above that I view as a workaround.
I.e. it disables the Keyboard and Trackpad during sleep, so that neither can wake from sleep.
For me, it is a good work around until the a firmware update can fix this.
This is a bit of overkill IMO; you should just be able to change the power/wakeup sysfs file for applicable USB and I2C devices, which can then be done with a udev rule instead of a script.
I don’t think it’s an overkill since if you can press a key or touchpad, you can press the power button. Disabling the keyboard and touchpad on suspend regardless of whether the lid is closed allows further power saving.
I guess the purpose of the BATTERY one is if one has suspended and sleeping and the battery gets too low to sustain it, it should really wake up and hibernate.
But if the hibernate is not working, it will just wake up and maybe get hot.
My preference that I would use is disable the Keyboard, Touchpad and LID open, leaving me to use the power button if I wish it to wake up.
At least this way, when I open the lid, and it is already awake, I know something must have gone wrong.
Wow what a saga with this one since October 2023. A lot of good investigative work! This seems like it might be ideally setup as a future design specification with criteria like when lid is closed the laptop cannot be woken up by onboard input devices. My FW13 AMD is very new to me so I hadn’t yet uncovered any of this behavior myself. It would be nice to see this fixed in the firmware.
Yes! We are in the process of releasing a bios update for AMD 13in Ryzen 7040 where this is going to be fixed! We found there was some BIOS code that was running on wake up causing this issue and it was finally root caused a few weeks ago, and we have a fix!
Has that BIOS been released, please? What is it (/ what will be) its version number? I fear that it has not yet been released. These things can take time but it would be good to hear about progress.
Will this also fix waking up from sleep when using the laptop closed connected to external monitor/keyboard/mouse? Currently having to open it open the lid and scoured the forums for a fix. Was pointed to this one from discord admin.