ACPI
The ACPI support of the 2.6 kernel is very good. Use the asus_acpi kernel module to make ACPI work.
To make the AC-adapter status work you have to use this kernel patch or a fixed DSDT table.
If you use the newest bios version by Asus you don't have to use this patch anymore.
There are many fixed DSDT tables in the net. I use the patch variant and my AC status works too. For more Information see the ACPI4Linux pages.
To make the special buttons and LEDs work you have to install and configure the acpid program. Create and edit the following files: /etc/hotkeys.sh /etc/events/hotkey.
This is the content of the files:
,-------[/etc/acpi/events/hotkey]
event=hotkey ATKD .*
action=/etc/acpi/hotkey.sh %e
`-------
,------[/etc/acpi/hotkey.sh]
#!/bin/bash
case "$3" in
# Mute button
00000032) /usr/bin/amixer set Master toggle
;;
# Volume up button
00000030) /usr/bin/amixer set Master 1+
;;
# Volume down button
00000031) /usr/bin/amixer set Master 1-
;;
# Rewind button
00000040) su - nion -c "/usr/bin/xmms -r"
;;
# Stop button
00000043) su - nion -c "/usr/bin/xmms -s"
;;
# Play/pause button
00000045) su - nion -c "/usr/bin/xmms -t"
;;
# Forward button
00000041) su - nion -c "/usr/bin/xmms -f"
;;
# CD-player ON/OFF button (I use it to eject the cdrom)
0000004c) eject cdrom
;;
# Mail button
00000050) su - nion -c "export DISPLAY=:0.0;xterm -fg white -bg black -e mutt &"
;;
# Browser button
00000051) su - nion -c "export DISPLAY=:0.0;/usr/bin/mozilla-firefox &"
;;
# WiFi button
0000005d) wlanup start
;;
*) logger "ACPI hotkey $3 is not defined"
;;
esac
`------
The button 0000005d calls the wlanup script which i have written. It looks like this:
,------[/usr/bin/wlanup]
#!/bin/sh
ret=`lsmod | awk '{print $1}' | grep -c ipw2100`
if [ $ret = "1" ] ; then
then
/sbin/modprobe -r ipw2100
echo 0 > /proc/acpi/asus/wled
route del default gw 192.168.1.1 dev eth1
ifup eth0
rm -f /etc/resolv.conf
else
cp /root/resolv.conf /etc/
modprobe ipw2100
echo 1 > /proc/acpi/asus/wled
iwconfig eth1 power off
iwconfig eth1 mode Managed
iwconfig eth1 essid any
ifconfig eth1 192.168.1.2
route add default gw 192.168.1.1 dev eth1
ifdown eth0
fi
`------
This scripts start the wlan and turns on the led if you press the special
button and turns of the led and stops your wlan interface if you press the
button a second time.
If you need a program which shows acpi information like battery status in the text mode, try this acpi tool
Suspend to disk (S4) is working very well. If you want to use S4 under X make shure that you reload the fglrx driver before suspending because it causes error.
UPDATE: the new 8.19.10 fglrx driver supports suspend and it works well.
To configure your graphic card use the aticonfig and fireglcontrolpanel tools.
The softwaresuspend version 2 patches from http://softwaresuspend.sf.net don't work correctly too.
Another event is the lid event. It you close you laptop with a snap then the acpid will execute the specified script:
,--------[/etc/acpi/events/lm_lid]
event=button[ /]lid
action=/etc/acpi/lm_lid.sh %e
`------
The lm_lid.sh just executes 'echo "sleep" > /sys/power/state' which causes the notbook to go into suspend to ram if you close it with a snap.
Suspend
Software and suspend to RAM are working correclty now. The fglrx driver by ATI isn't a problem any longer.
For suspend to disk you have to enable it in the Kernel configuration.
I use the following scripts for suspending my system:
Suspend to disk:
,------[/etc/acpi/s4.sh]
#!/bin/bash
modprobe -r ipw2100
echo disk > /sys/power/state
`------
Suspend to RAM with ATI driver loaded (with 8.20.8 driver not needed anymore):
,------[/etc/acpi/s3.sh]
#!/bin/bash
down_wireless() {
/sbin/ifdown wlan0
pkill dhclient
/sbin/modprobe -r ipw2100
}
save_state() {
logger -t acpid "Saving state"
down_wireless
#/sbin/modprobe -r button
/bin/sync
vbetool vbestate save > /tmp/vbestate
chvt 1
}
suspend_to_ram() {
echo 3 > /proc/acpi/sleep
}
restore_state() {
logger -t acpid "Restoring state"
vbetool vbestate restore < /tmp/vbestate
/sbin/hdparm -S2 /dev/hda
/sbin/hwclock --hctosys
#/sbin/modprobe button
chvt 7
}
save_state
suspend_to_ram
restore_state
`------
Remember, this is not needed with 8.19.10 fglrx version.
You have to install the vbetool to make it work correctly.
Or see the acpi section for an example which works too but without ATI driver used.
Also there is I tell how to enable S3 by snapping down your notbook.