summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Hughes <richard@hughsie.com>2006-08-31 20:43:54 +0100
committerRichard Hughes <richard@hughsie.com>2006-08-31 20:43:54 +0100
commit5ca71e535991a2fb0ee26c977ce5e502e32aaf33 (patch)
tree1788fc0e429bea022363e85d0b7b04c990d79db9
parent8f7c69240f0dd1fbfbcb813c7ba8cc9ba8558696 (diff)
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.
-rw-r--r--hald/linux/pmu.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/hald/linux/pmu.c b/hald/linux/pmu.c
index 3febe822..d2ce912d 100644
--- a/hald/linux/pmu.c
+++ b/hald/linux/pmu.c
@@ -218,10 +218,13 @@ laptop_panel_refresh (HalDevice *d, PMUDevHandler *handler)
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;
}