summaryrefslogtreecommitdiff
path: root/libopie2/opiecore/linux_input.h
authormickeyl <mickeyl>2005-08-31 10:21:12 (UTC)
committer mickeyl <mickeyl>2005-08-31 10:21:12 (UTC)
commitcde931654d1966be6989e6c8f3cfacb23e6822a2 (patch) (side-by-side diff)
tree9a8244f4da0180a685554ebca0d7b628630fb42e /libopie2/opiecore/linux_input.h
parent142e7e82efa6dd45884805c34fadec2160225e4b (diff)
downloadopie-cde931654d1966be6989e6c8f3cfacb23e6822a2.zip
opie-cde931654d1966be6989e6c8f3cfacb23e6822a2.tar.gz
opie-cde931654d1966be6989e6c8f3cfacb23e6822a2.tar.bz2
- add support for the new Switches type in the Linux Input System (coming with 2.6.14)
- use the new Switches support to rewrite the hinge sensor handling on Zaurus models w/ 2.6 - add Switches support to SysInfo, OInputSystem, oinputsystemdemo
Diffstat (limited to 'libopie2/opiecore/linux_input.h') (more/less context) (ignore whitespace changes)
-rw-r--r--libopie2/opiecore/linux_input.h25
1 files changed, 25 insertions, 0 deletions
diff --git a/libopie2/opiecore/linux_input.h b/libopie2/opiecore/linux_input.h
index b7a30bb..2df8a59 100644
--- a/libopie2/opiecore/linux_input.h
+++ b/libopie2/opiecore/linux_input.h
@@ -68,2 +68,3 @@ struct input_absinfo {
#define EVIOCGSND(len) _IOC(_IOC_READ, 'E', 0x1a, len) /* get all sounds status */
+#define EVIOCGSW(len) _IOC(_IOC_READ, 'E', 0x1b, len) /* get all switch states */
@@ -88,2 +89,3 @@ struct input_absinfo {
#define EV_MSC 0x04
+#define EV_SW 0x05
#define EV_LED 0x11
@@ -523,2 +525,16 @@ struct input_absinfo {
/*
+ * Switch events
+ */
+
+#define SW_0 0x00
+#define SW_1 0x01
+#define SW_2 0x02
+#define SW_3 0x03
+#define SW_4 0x04
+#define SW_5 0x05
+#define SW_6 0x06
+#define SW_7 0x07
+#define SW_MAX 0x0f
+
+/*
* Misc events
@@ -792,2 +808,3 @@ struct input_dev {
unsigned long ffbit[NBITS(FF_MAX)];
+ unsigned long swbit[NBITS(SW_MAX)];
int ff_effects_max;
@@ -813,2 +830,3 @@ struct input_dev {
unsigned long snd[NBITS(SND_MAX)];
+ unsigned long sw[NBITS(SW_MAX)];
@@ -851,2 +869,3 @@ struct input_dev {
#define INPUT_DEVICE_ID_MATCH_FFBIT 0x800
+#define INPUT_DEVICE_ID_MATCH_SWBIT 0x1000
@@ -871,2 +890,3 @@ struct input_device_id {
unsigned long ffbit[NBITS(FF_MAX)];
+ unsigned long swbit[NBITS(SW_MAX)];
@@ -963,2 +983,7 @@ static inline void input_report_ff_status(struct input_dev *dev, unsigned int co
+static inline void input_report_switch(struct input_dev *dev, unsigned int code, int value)
+{
+ input_event(dev, EV_SW, code, !!value);
+}
+
static inline void input_regs(struct input_dev *dev, struct pt_regs *regs)