hal: Branch 'master'

Richard Hughes hughsient at kemper.freedesktop.org
Mon Feb 5 16:54:04 PST 2007


 hald/linux/device.c |    6 +++---
 hald/linux/pmu.c    |    4 ++++
 2 files changed, 7 insertions(+), 3 deletions(-)

New commits:
diff-tree 2884ab63651de6f769570be835332db9a2b98bd3 (from bae149a89341750ad52a07dd27a337a1b7659ae7)
Author: Richard Hughes <richard at hughsie.com>
Date:   Tue Feb 6 00:53:53 2007 +0000

    fix pmu laptop screen on new kernels
    
    New kernels export the PMU backlight as a kernel backlight class, and
    GET_BACKLIGHT and SET_BACKLIGHT ioctls fail. This means that HAL fails
    to set the brightness on PPC hardware.
    
    We should check for the existence of the backlight device (like in
    acpi.c) before we add the PMU backlight to avoid having two backlight
    devices, one of which that does not work.
    
    The patch also gives the generic backlight class a name, so it does not
    show up as unknown device.

diff --git a/hald/linux/device.c b/hald/linux/device.c
index d5cea0b..f6fe900 100644
--- a/hald/linux/device.c
+++ b/hald/linux/device.c
@@ -2305,14 +2305,14 @@ backlight_add (const gchar *sysfs_path, 
 	HalDevice *d;
 	int max_brightness;
 
-	d = NULL;
 	d = hal_device_new ();
 	hal_device_add_capability (d, "laptop_panel");
 	hal_device_property_set_string (d, "linux.sysfs_path", sysfs_path);
 	hal_device_property_set_string (d, "info.parent", "/org/freedesktop/Hal/devices/computer");
-	
 	hal_device_property_set_string (d, "info.category", "laptop_panel");
-	
+	hal_device_property_set_string (d, "info.product", "Generic Backlight Device");
+	hal_device_property_set_string (d, "laptop_panel.access_method", "general");
+
 	hal_util_get_int_from_file (sysfs_path, "max_brightness", &max_brightness, 10);
 	hal_device_property_set_int (d, "laptop_panel.num_levels", max_brightness + 1);
 	return d;
diff --git a/hald/linux/pmu.c b/hald/linux/pmu.c
index 734a1ca..8d1a1e6 100644
--- a/hald/linux/pmu.c
+++ b/hald/linux/pmu.c
@@ -212,6 +212,10 @@ lid_button_refresh (HalDevice *d, PMUDev
 static gboolean
 laptop_panel_refresh (HalDevice *d, PMUDevHandler *handler)
 {
+	if ((hal_device_store_find (hald_get_gdl (),
+				    "/org/freedesktop/Hal/devices/computer_backlight")) != NULL)
+		return FALSE;
+
 	hal_device_property_set_string (d, "info.category", "laptop_panel");
 	hal_device_property_set_string (d, "info.product", "Apple Laptop Panel");
 


More information about the hal-commit mailing list