Created
September 18, 2016 19:32
-
-
Save defunctio/b544880c25036b33aa611edd53b42c53 to your computer and use it in GitHub Desktop.
Dell 5500 resume backlight fix in Ubuntu
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# From patchwork.freedesktop.org/.../ | |
# and en.community.dell.com/.../19985320 | |
# /lib/systemd/system-sleep/fixbacklight | |
# Suspend Resume fails to restore PWM_GRANUALITY | |
# Based on script by [email protected] | |
INTEL_REG=/usr/bin/intel_reg | |
ADDR="0x000c2000" | |
SAVE_FILE=/var/lib/systemd/save_intel_reg_pwm_granuality | |
[ -x "$INTEL_REG" ] || exit 0 | |
case "$1" in | |
pre) | |
echo "$0: Saving Intel Register PWM_GRANUALITY" | |
"$INTEL_REG" read "$ADDR" \ | |
| (read addr value && echo "$value") \ | |
>"$SAVE_FILE" | |
sync | |
;; | |
post) | |
value=`cat "$SAVE_FILE" 2>/dev/null` | |
if [ -n "$value" ] | |
then | |
echo "$0: Restoring Intel Register PWM_GRANUALITY $value" | |
"$INTEL_REG" write "$ADDR" "$value" | |
rm "$SAVE_FILE" | |
fi | |
;; | |
esac |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment