From d792a792846f9632edfdea3651a74fcd24b2ead7 Mon Sep 17 00:00:00 2001
From: Johannes Hessellund <osos@openeyes.dk>
Date: Fri, 24 Jul 2009 09:25:02 +0000
Subject: read brightness from actual_brightness and not from brightness

The get_backlight function read from the wrong sysfs file.
The real backlight value is available from 'actual_brightness', whereas
'brightness' is used for changing/setting the backlight through software.
'brightness' always reads last value writen to it.
Backlight which is hardware controlled, as with many thinkpads (ex T42), does
not update 'brightness'. Thus hald is not returning the right value!

fd.o#21612
---
diff --git a/hald/linux/addons/addon-generic-backlight.c b/hald/linux/addons/addon-generic-backlight.c
index 952a369..fd2d8f5 100644
--- a/hald/linux/addons/addon-generic-backlight.c
+++ b/hald/linux/addons/addon-generic-backlight.c
@@ -64,7 +64,7 @@ get_backlight ()
 	f = NULL;
 	value = -1;
 
-	g_snprintf (sysfs_path, sizeof (sysfs_path), "%s/brightness", path);
+	g_snprintf (sysfs_path, sizeof (sysfs_path), "%s/actual_brightness", path);
 
 	f = fopen (sysfs_path, "rb");
         if (f == NULL) {
--
cgit v0.8.2
