summaryrefslogtreecommitdiff
path: root/libopie2/opiecore/linux_input.h
Side-by-side diff
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)