what triggers wakeup from suspend?

Chris Adams cmadams at hiwaay.net
Wed Aug 17 14:30:17 UTC 2011


Once upon a time, Andras Simon <szajmi at gmail.com> said:
> I have two types of netbooks (an Asus Eee 701, and an Acer Aspire
> One), both running F14. The Acer can be woken up by pressing any key
> on the keyboard; on the Eee, I have to push the Power button. Since
> that button seems to be dying, I'd like to be able to emulate the
> Acer's behavior. Is that doable? Or is this hardware-dependent?

It is system-dependent.  I haven't messed with it on portable computers
(which tend to have more system-specific config), but on desktops, there
is usually a BIOS screen for what type of events can wake the system
(PS/2 keyboard, USB device, LAN, alarm, etc.).

For a USB keyboard, I have to enable the USB device option in the BIOS,
and then I have to set Linux to leave the right USB controller enabled
when the system goes to sleep.  I have to figure out which USB
controller is needed and add a line to /etc/rc.d/rc.local to echo the
right one into /proc/acpi/wakeup (e.g. "echo USB3 > /proc/acpi/wakeup").

On a system that I for some reason kept plugging and unplugging the
keyboard (and ending up with it in different USB ports), I used the
following bit of shell code:

########################################################################
# Set USB keyboards to allow wakeup
for dev in $(grep -l '^01$' /sys/bus/usb/devices/*/bInterfaceProtocol); do
	dir=$(cd $(echo "$dev" | sed 's!/[^/]*$!!'); pwd -P)
	pci=$(echo $dir | cut -d/ -f5)
	for pdev in $(grep "disabled  *pci:$pci" /proc/acpi/wakeup | cut -d' ' -f1); do
		echo "$pdev" > /proc/acpi/wakeup
	done
done
########################################################################

-- 
Chris Adams <cmadams at hiwaay.net>
Systems and Network Administrator - HiWAAY Internet Services
I don't speak for anybody but myself - that's enough trouble.


More information about the users mailing list