From afadc0e4570ee55a698f97f832cb3df1c3441407 Mon Sep 17 00:00:00 2001 From: Grazvydas Ignotas Date: Tue, 15 May 2012 01:33:31 +0300 Subject: [PATCH] op_power: don't change brightness under new kernel on blank the kernel handles this now --- recipes/pandora-system/pandora-scripts/op_power.sh | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/recipes/pandora-system/pandora-scripts/op_power.sh b/recipes/pandora-system/pandora-scripts/op_power.sh index e5b5e61..8dc1c21 100644 --- a/recipes/pandora-system/pandora-scripts/op_power.sh +++ b/recipes/pandora-system/pandora-scripts/op_power.sh @@ -56,6 +56,13 @@ resume_net() { display_on() { echo 0 > /sys/class/graphics/fb0/blank + # only bother restoring brightness if it's 0 + # (old kernel or user messed it up somehow) + brightness=$(cat $SYSFS_BACKLIGHT_BRIGHTNESS) + if [ $brightness -gt 0 ]; then + return 0 + fi + maxbright=$(cat $SYSFS_BACKLIGHT/max_brightness) oldbright=0 if [ -f /tmp/oldbright ]; then @@ -76,7 +83,10 @@ display_off() { if [ $brightness -gt 0 ]; then echo $brightness > /tmp/oldbright fi - echo 0 > $SYSFS_BACKLIGHT_BRIGHTNESS + kernel_major=`uname -r | cut -c 1` + if [ "$kernel_major" = "2" ]; then + echo 0 > $SYSFS_BACKLIGHT_BRIGHTNESS + fi echo 1 > /sys/class/graphics/fb0/blank } -- 2.39.5