[PATCH] addon-input: SW_LINEOUT_INSERT and SW_MICROPHONE_INSERT event reporting
Matthew Ranostay
mranostay at embeddedalley.com
Fri Oct 24 22:06:27 PDT 2008
Added support for SW_LINEOUT_INSERT and SW_MICROPHONE_INSERT with a type
"lineout_insert" and "microphone_insert" in button.type for addon-input.
Signed-off-by: Matthew Ranostay <mranostay at embeddedalley.com>
---
diff --git a/hald/linux/addons/addon-input.c b/hald/linux/addons/addon-input.c
index 5704f82..d9d0c27 100644
--- a/hald/linux/addons/addon-input.c
+++ b/hald/linux/addons/addon-input.c
@@ -248,6 +248,12 @@ event_io (GIOChannel *channel, GIOCondition condition,
gpointer data)
case SW_HEADPHONE_INSERT:
name = "headphone_insert";
break;
+ case SW_MICROPHONE_INSERT:
+ name = "microphone_insert";
+ break;
+ case SW_LINEOUT_INSERT:
+ name = "lineout_insert";
+ break;
#ifdef SW_RADIO
case SW_RADIO:
name = "radio";
diff --git a/hald/linux/device.c b/hald/linux/device.c
index 26f6c1b..77c67ea 100644
--- a/hald/linux/device.c
+++ b/hald/linux/device.c
@@ -249,6 +249,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");
+ } else if (test_bit (SW_MICROPHONE_INSERT, bitmask)) {
+ hal_device_property_set_string (d, "button.type", "microphone_insert");
+ } else if (test_bit (SW_LINEOUT_INSERT, bitmask)) {
+ hal_device_property_set_string (d, "button.type", "lineout_insert");
#ifdef SW_RADIO
} else if (test_bit (SW_RADIO, bitmask)) {
hal_device_property_set_string (d, "button.type", "radio");
diff --git a/hald/linux/probing/probe-input.c b/hald/linux/probing/probe-input.c
index 14b22b4..6e2ac81 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;
+ else if (strcmp (button_type, "microphone_insert") == 0)
+ sw = SW_MICROPHONE_INSERT;
+ else if (strcmp (button_type, "lineout_insert") == 0)
+ sw = SW_LINEOUT_INSERT;
#ifdef SW_RADIO
else if (strcmp (button_type, "radio") == 0)
sw = SW_RADIO;
More information about the hal
mailing list