problems with HAL and input devices

Bill Nottingham notting at redhat.com
Mon Jul 23 09:19:39 PDT 2007


I'm attempting to get my keyboard to work as specified at:

 http://people.freedesktop.org/~hughsient/quirk/

In querying HAL, the "Thinkpad Extra Buttons" never appears to show up
as a property of the device in lshal. Looking at the code, it was looking
in the wrong place for properties.

So, I cooked up the attached patch. However, with this change... hal now
denies that the proper input device exists - it opens it, reads the properties,
etc... but it never shows up in lshal.

Bill
-------------- next part --------------
diff -ru hal-0.5.10/hald/linux/device.c hal-0.5.10-fixed/hald/linux/device.c
--- hal-0.5.10/hald/linux/device.c	2007-07-21 18:07:14.000000000 -0400
+++ hal-0.5.10-fixed/hald/linux/device.c	2007-07-23 12:02:27.000000000 -0400
@@ -107,7 +107,7 @@
 	long bitmask[NBITS(REL_MAX)];
 	int num_bits;
 
-	s = hal_util_get_string_from_file (sysfs_path, "../capabilities/rel");
+	s = hal_util_get_string_from_file (sysfs_path, "device/capabilities/rel");
 	if (s == NULL)
 		goto out;
 
@@ -168,7 +168,7 @@
 	long bitmask[NBITS(KEY_MAX)];
 	int num_bits;
 
-	s = hal_util_get_string_from_file (sysfs_path, "../capabilities/key");
+	s = hal_util_get_string_from_file (sysfs_path, "device/capabilities/key");
 	if (s == NULL)
 		goto out;
 
@@ -213,7 +213,7 @@
 	long bitmask[NBITS(SW_MAX)];
 	int num_bits;
 
-	s = hal_util_get_string_from_file (sysfs_path, "../capabilities/sw");
+	s = hal_util_get_string_from_file (sysfs_path, "device/capabilities/sw");
 	if (s == NULL)
 		goto out;
 
@@ -248,7 +248,7 @@
 	long bitmask[NBITS(ABS_MAX)];
 	int num_bits;
 
-	s = hal_util_get_string_from_file (sysfs_path, "../capabilities/abs");
+	s = hal_util_get_string_from_file (sysfs_path, "device/capabilities/abs");
 	if (s == NULL)
 		goto out;
 	num_bits = input_str_to_bitmask (s, bitmask, sizeof (bitmask));
@@ -264,7 +264,7 @@
 
 		hal_device_add_capability (d, "input.joystick");
 
-		s = hal_util_get_string_from_file (sysfs_path, "../capabilities/key");
+		s = hal_util_get_string_from_file (sysfs_path, "device/capabilities/key");
 		if (s == NULL)
 			goto out;
 		input_str_to_bitmask (s, bitmask_touch, sizeof (bitmask_touch));
@@ -304,8 +304,8 @@
 
 	hal_device_property_set_string (d, "input.device", device_file);
 
-	hal_util_set_string_from_file (d, "info.product", sysfs_path, "../name");
-	hal_util_set_string_from_file (d, "input.product", sysfs_path, "../name");
+	hal_util_set_string_from_file (d, "info.product", sysfs_path, "device/name");
+	hal_util_set_string_from_file (d, "input.product", sysfs_path, "device/name");
 
 	/* check for keys */
 	input_test_key (d, sysfs_path);


More information about the hal mailing list