Package: hibernate
Version: 1.93-1
Severity: normal

The fujitsu p7120 laptop has an issue when resuming from suspend to ram:
The LCD is left turned off. This can easily be fixed by using the
brightness control keys, which turn it back on, but that's a bit
annoying, and I have automated it, creating a scriptlet for hibernate
that saves and restores the brightness. 

I've attached the scriptlet for possible addition to the package. It's
licensed the same as the rest of hibernate.

This needs version 1.19 of the BIOS for this laptop to be able to
support ACPI brightness control. The "video" kernel module must be
loaded. I don't know if the /proc/acpi/video/GFX0/LCD/brightness file
will exist or work on other laptop models, or if this file should be
made configurable, but it works great for the p7120 and should be at
least close to working on other laptops that support ACPI brightness
control.

-- System Information:
Debian Release: testing/unstable
  APT prefers unstable
  APT policy: (500, 'unstable'), (1, 'experimental')
Architecture: i386 (i686)
Shell:  /bin/sh linked to /bin/bash
Kernel: Linux 2.6.17-2-686
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)

Versions of packages hibernate depends on:
ii  console-tools              1:0.2.3dbs-64 Linux console and font utilities

Versions of packages hibernate recommends:
ii  hdparm                        6.6-1      tune hard disk parameters for high
pn  vlock                         <none>     (no description available)

-- no debconf information

-- 
see shy jo
# -*- sh -*-
# vim:ft=sh:ts=8:sw=4:noet

AddConfigHandler BrightnessOptions
AddConfigHelp "RestoreBrightness <boolean>" "This will save and restore LCD 
brightness using ACPI."

# May need to be made configurable later.
acpifile=/proc/acpi/video/GFX0/LCD/brightness

SaveBrightness() {
    if [ ! -e "$acpifile" ]; then
        vecho 0 "$acpifile not present, will not save brightness level"
    fi
    LEVEL=$(grep current $acpifile | cut -d ' ' -f 2) || true
    if [ -z "$LEVEL" ]; then
        vecho 0 "could not determine current brightness level"
        LEVEL=4
    fi
echo $LEVEL

    return 0
}

RestoreBrightness() {
    if [ -n "$LEVEL" ] && [ -e "$acpifile" ]; then
        echo "$LEVEL" > "$acpifile"
    fi
    return 0
}

BrightnessOptions() {
    case $1 in
        restorebrightness)
            BoolIsOn "$1" "$2" || return 0
            if [ -z "$BRIGHTNESS_HOOKED" ] ; then
                AddSuspendHook 85 SaveBrightness
                AddResumeHook 85 RestoreBrightness
                BRIGHTNESS_HOOKED=1
            fi
            ;;
        *)
            return 1
    esac
    return 0
}

Attachment: signature.asc
Description: Digital signature

Reply via email to