[PATCH][INPUT] Added support for SW_MICROPHONE_INSERT switch event

Ulrich Dangel uli at spamt.net
Fri Jan 2 07:53:06 PST 2009


This Patch adds support for the SW_MICROPHONE_INSERT switch introduced in 2.6.27

Signed-off-by: Ulrich Dangel <uli at spamt.net>
---
 hald/linux/addons/addon-input.c  |    5 +++++
 hald/linux/device.c              |    4 ++++
 hald/linux/probing/probe-input.c |    4 ++++
 3 files changed, 13 insertions(+), 0 deletions(-)

diff --git a/hald/linux/addons/addon-input.c b/hald/linux/addons/addon-input.c
index 5704f82..3bed906 100644
--- a/hald/linux/addons/addon-input.c
+++ b/hald/linux/addons/addon-input.c
@@ -253,6 +253,11 @@ event_io (GIOChannel *channel, GIOCondition condition, gpointer data)
 				name = "radio";
 				break;
 #endif
+#ifdef SW_MICROPHONE_INSERT
+			case SW_MICROPHONE_INSERT:
+				name = "microphone_insert";
+				break;
+#endif
 			}
 			if (name != NULL) {
 				long bitmask[NBITS(SW_MAX)];
diff --git a/hald/linux/device.c b/hald/linux/device.c
index d16ac3a..0fd5ea0 100644
--- a/hald/linux/device.c
+++ b/hald/linux/device.c
@@ -1054,6 +1054,10 @@ input_test_switch (HalDevice *d, const char *sysfs_path)
 		} else if (test_bit (SW_RADIO, bitmask)) {
 			hal_device_property_set_string (d, "button.type", "radio");
 #endif
+#ifdef SW_MICROPHONE_INSERT
+		} else if (test_bit (SW_MICROPHONE_INSERT, bitmask)) {
+			hal_device_property_set_string (d, "button.type", "microphone_insert");
+#endif
 		}
 	}
 
diff --git a/hald/linux/probing/probe-input.c b/hald/linux/probing/probe-input.c
index 14b22b4..25b476e 100644
--- a/hald/linux/probing/probe-input.c
+++ b/hald/linux/probing/probe-input.c
@@ -85,6 +85,10 @@ main (int argc, char *argv[])
 	else if (strcmp (button_type, "radio") == 0)
 		sw = SW_RADIO;
 #endif
+#ifdef SW_MICROPHONE_INSERT
+	else if (strcmp (button_type, "microphone_insert") == 0)
+		sw = SW_MICROPHONE_INSERT;
+#endif
 	else
 		goto out;
 
-- 
1.6.0.6



More information about the hal mailing list