Guys, i found two "elegant" solutions to enable wakeup at /sys/bus/usb/devices/*B-*P/power/wakeup file.
(This is only tested on Maverick)
This automaticly looks for the right port. No matter where you plug the receiver it will find it. For that you will need the Vendor- and Product Id for you receiver. You can get it with
Mine was:
Code:
Bus 004 Device 002: ID 0471:0815 Philips (or NXP) eHome Infrared Receiver
Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 003 Device 002: ID 046d:c517 Logitech, Inc. LX710 Cordless Desktop Laser
Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
So my Vendor id is 0471 and the Product id is 0815.
Now i found two solutions to get the things enabled at boottime. First one is more elegant. Credits to a guy at Fedora forums. We need to create an Udev rule and that is it:
Code:
sudo nano /etc/udev/rules.d/90-mcewakeup.rules
Put this there, of course changing the vendor and product ids.
Code:
# enable wake from S3 for MCE USB device 0471:0815
SUBSYSTEM=="usb", ATTRS{idVendor}=="0471", ATTRS{idProduct}=="0815" RUN+="/bin/sh -c 'echo enabled > /sys$env{DEVPATH}/../power/wakeup'"
After rebooting, this takes care of the /sys/... part. Of couerse you still need to take care of the /proc/acpi/wakeup part like always.
Solution2 is more basic:
If you have a script where you put these enabling lines. Just put there:
Code:
usbpath=$(grep 0815 /sys/bus/usb/devices/*/idProduct | cut -c-24)
echo enabled > $usbpath/power/wakeup
You have to change the product id for your device.
Has anyone got a solution how to find the USBx number which we need to enable for the device at /proc/acpi/wakeup ? In XBMC Live Luigi is using command lshal. But as we don't have HAL installed (at least on my minimal Maverick system) and i really don't want to install that (slows down boot) we have to find another solution. So any idea is welcome. By that time i enable all three ports i have on my machine like this:
Code:
status=`cat /proc/acpi/wakeup | grep "USB0" | awk {'print $3}'`
if [ "$status" = "*disabled" ]; then
echo USB0 > /proc/acpi/wakeup
fi
status=`cat /proc/acpi/wakeup | grep "USB1" | awk {'print $3}'`
if [ "$status" = "*disabled" ]; then
echo USB1 > /proc/acpi/wakeup
fi
status=`cat /proc/acpi/wakeup | grep "USB2" | awk {'print $3}'`
if [ "$status" = "*disabled" ]; then
echo USB2 > /proc/acpi/wakeup
fi
This could not work on your machine, or it could led the PC to wakeup for any mouse movements or just by itself so the best way would be to find a solution for picking out the right port at boot-time.