hal: Branch 'master'
Danny Kukawka
dkukawka at kemper.freedesktop.org
Tue Feb 5 13:43:02 PST 2008
hald/linux/addons/addon-input.c | 5 +++++
hald/linux/device.c | 4 ++++
hald/linux/probing/probe-input.c | 4 ++++
3 files changed, 13 insertions(+)
New commits:
commit 2bc6448592c22d547be4207e48e98e8335d787d9
Author: Ben Liblit <liblit at cs.wisc.edu>
Date: Tue Feb 5 22:42:56 2008 +0100
add support for SW_RADIO switches
Further research and experimentation shows that the SW_RADIO aspect of this
device does correspond to the hardware RF kill switch. So the right thing to
do is to teach input_test_switch() and other related code how to cope with
SW_RADIO and button.type "radio". The attached patch does exactly that. It's
been tested with Linux kernel version 2.6.23.9-85.fc8 and thinkpad_acpi module
version 0.18-20071203.
SW_RADIO was added to the Linux kernel "input.h" header in version 2.6.22, but
presumable we want HAL to build against earlier kernel versions too. The patch
uses ifdefs to check that SW_RADIO exists and omits the new code if it does
not.
diff --git a/hald/linux/addons/addon-input.c b/hald/linux/addons/addon-input.c
index 0474802..48fd815 100644
--- a/hald/linux/addons/addon-input.c
+++ b/hald/linux/addons/addon-input.c
@@ -248,6 +248,11 @@ event_io (GIOChannel *channel, GIOCondition condition, gpointer data)
case SW_HEADPHONE_INSERT:
name = "headphone_insert";
break;
+#ifdef SW_RADIO
+ case SW_RADIO:
+ name = "radio";
+ break;
+#endif
}
if (name != NULL) {
long bitmask[NBITS(SW_MAX)];
diff --git a/hald/linux/device.c b/hald/linux/device.c
index d3dbc36..007b759 100644
--- a/hald/linux/device.c
+++ b/hald/linux/device.c
@@ -242,6 +242,10 @@ input_test_switch (HalDevice *d, const char *sysfs_path)
hal_device_property_set_string (d, "button.type", "tablet_mode");
} else if (test_bit (SW_HEADPHONE_INSERT, bitmask)) {
hal_device_property_set_string (d, "button.type", "headphone_insert");
+#ifdef SW_RADIO
+ } else if (test_bit (SW_RADIO, bitmask)) {
+ hal_device_property_set_string (d, "button.type", "radio");
+#endif
}
}
diff --git a/hald/linux/probing/probe-input.c b/hald/linux/probing/probe-input.c
index 6ace0fa..14b22b4 100644
--- a/hald/linux/probing/probe-input.c
+++ b/hald/linux/probing/probe-input.c
@@ -81,6 +81,10 @@ main (int argc, char *argv[])
sw = SW_TABLET_MODE;
else if (strcmp (button_type, "headphone_insert") == 0)
sw = SW_HEADPHONE_INSERT;
+#ifdef SW_RADIO
+ else if (strcmp (button_type, "radio") == 0)
+ sw = SW_RADIO;
+#endif
else
goto out;
More information about the hal-commit
mailing list