hal: Branch 'master'

Richard Hughes hughsient at kemper.freedesktop.org
Thu Aug 31 12:44:25 PDT 2006


 hald/linux/pmu.c |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

New commits:
diff-tree 5ca71e535991a2fb0ee26c977ce5e502e32aaf33 (from 8f7c69240f0dd1fbfbcb813c7ba8cc9ba8558696)
Author: Richard Hughes <richard at hughsie.com>
Date:   Thu Aug 31 20:43:54 2006 +0100

    fix the maximum brightness level for pmu hardware
    
    In hald/linux/pmu.c (laptop_panel_refresh) we have:
    
    hal_device_property_set_int (d, "laptop_panel.num_levels", 14);
    
    on the (my?) incorrect assumption that we have 15 brightness states
    (1-15), where 0 is power off.
    
    We actually have 15 levels (0-14) (which is then shifted by
    hal-system-power-pmu.c to the correct (1-15) levels for the hardware.
    
    This was brought to my attention by
    http://bugzilla.gnome.org/show_bug.cgi?id=350507 which I can verify on
    my iBook.

diff --git a/hald/linux/pmu.c b/hald/linux/pmu.c
index 3febe82..d2ce912 100644
--- a/hald/linux/pmu.c
+++ b/hald/linux/pmu.c
@@ -218,10 +218,13 @@ laptop_panel_refresh (HalDevice *d, PMUD
 	hal_device_property_set_string (d, "laptop_panel.access_method", "pmu");
 	/*
 	 * We can set laptop_panel.num_levels as it will not change, 
-	 * all powerbooks have 15 steps for brightness, where state 0
+	 * all powerbooks have 16 steps for brightness, where state 0
 	 * is backlight disable.
+	 * In tools/hal-system-power-pmu.c we add 1 to the brightness
+	 * so we do not turn off the backlight, so we actually have 15
+	 * brightness steps inclusive (0-14).
 	 */
-	hal_device_property_set_int (d, "laptop_panel.num_levels", 14);
+	hal_device_property_set_int (d, "laptop_panel.num_levels", 15);
 	hal_device_add_capability (d, "laptop_panel");
 	return TRUE;
 }


More information about the hal-commit mailing list