#!/bin/sh

################
# Handbook ACPI
# sysctl hw.acpi

# Mouse workaround
# hint.psm.0.flags="0x3000" to /boot/loader.conf.

# Debugging resume issues
# This test emulates suspend/resume cycle of all device drivers without actually going into S3 state

# sysctl debug.bootverbose=1
# sysctl debug.acpi.suspend_bounce=1
# acpiconf -s 3

# https://wiki.freebsd.org/AsusEee#Suspend.2Fresume
# hw.acpi.reset_video=1
# hw.acpi.asus.lcd_brightness=8
# snd_hda(4) has no resume support. You have to kldunload it before suspend
# acpi_asus_load="YES"
# acpi_video_load="YES"

if fgrep acpi0: /var/run/dmesg.boot | fgrep IBM; then
    printf "Enable acpi_ibm? (y/n) "
    read resp
    if [ 0$resp = 0y ]; then
	auto-append-line 'acpi_ibm' 'acpi_ibm_load="YES"' /boot/loader.conf $0
	kldload acpi_ibm
    fi
fi

