Diffstat (limited to 'libopie2/opiecore/linux_input.h') (more/less context) (show whitespace changes)
-rw-r--r-- | libopie2/opiecore/linux_input.h | 25 |
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 | |||
@@ -67,4 +67,5 @@ struct input_absinfo { | |||
67 | #define EVIOCGLED(len) _IOC(_IOC_READ, 'E', 0x19, len) /* get all LEDs */ | 67 | #define EVIOCGLED(len) _IOC(_IOC_READ, 'E', 0x19, len) /* get all LEDs */ |
68 | #define EVIOCGSND(len) _IOC(_IOC_READ, 'E', 0x1a, len) /* get all sounds status */ | 68 | #define EVIOCGSND(len) _IOC(_IOC_READ, 'E', 0x1a, len) /* get all sounds status */ |
69 | #define EVIOCGSW(len) _IOC(_IOC_READ, 'E', 0x1b, len) /* get all switch states */ | ||
69 | 70 | ||
70 | #define EVIOCGBIT(ev,len) _IOC(_IOC_READ, 'E', 0x20 + ev, len)/* get event bits */ | 71 | #define EVIOCGBIT(ev,len) _IOC(_IOC_READ, 'E', 0x20 + ev, len)/* get event bits */ |
@@ -87,4 +88,5 @@ struct input_absinfo { | |||
87 | #define EV_ABS 0x03 | 88 | #define EV_ABS 0x03 |
88 | #define EV_MSC 0x04 | 89 | #define EV_MSC 0x04 |
90 | #define EV_SW 0x05 | ||
89 | #define EV_LED 0x11 | 91 | #define EV_LED 0x11 |
90 | #define EV_SND 0x12 | 92 | #define EV_SND 0x12 |
@@ -522,4 +524,18 @@ struct input_absinfo { | |||
522 | 524 | ||
523 | /* | 525 | /* |
526 | * Switch events | ||
527 | */ | ||
528 | |||
529 | #define SW_0 0x00 | ||
530 | #define SW_1 0x01 | ||
531 | #define SW_2 0x02 | ||
532 | #define SW_3 0x03 | ||
533 | #define SW_4 0x04 | ||
534 | #define SW_5 0x05 | ||
535 | #define SW_6 0x06 | ||
536 | #define SW_7 0x07 | ||
537 | #define SW_MAX 0x0f | ||
538 | |||
539 | /* | ||
524 | * Misc events | 540 | * Misc events |
525 | */ | 541 | */ |
@@ -791,4 +807,5 @@ struct input_dev { | |||
791 | unsigned long sndbit[NBITS(SND_MAX)]; | 807 | unsigned long sndbit[NBITS(SND_MAX)]; |
792 | unsigned long ffbit[NBITS(FF_MAX)]; | 808 | unsigned long ffbit[NBITS(FF_MAX)]; |
809 | unsigned long swbit[NBITS(SW_MAX)]; | ||
793 | int ff_effects_max; | 810 | int ff_effects_max; |
794 | 811 | ||
@@ -812,4 +829,5 @@ struct input_dev { | |||
812 | unsigned long led[NBITS(LED_MAX)]; | 829 | unsigned long led[NBITS(LED_MAX)]; |
813 | unsigned long snd[NBITS(SND_MAX)]; | 830 | unsigned long snd[NBITS(SND_MAX)]; |
831 | unsigned long sw[NBITS(SW_MAX)]; | ||
814 | 832 | ||
815 | int absmax[ABS_MAX + 1]; | 833 | int absmax[ABS_MAX + 1]; |
@@ -850,4 +868,5 @@ struct input_dev { | |||
850 | #define INPUT_DEVICE_ID_MATCH_SNDBIT0x400 | 868 | #define INPUT_DEVICE_ID_MATCH_SNDBIT0x400 |
851 | #define INPUT_DEVICE_ID_MATCH_FFBIT0x800 | 869 | #define INPUT_DEVICE_ID_MATCH_FFBIT0x800 |
870 | #define INPUT_DEVICE_ID_MATCH_SWBIT0x1000 | ||
852 | 871 | ||
853 | #define INPUT_DEVICE_ID_MATCH_DEVICE\ | 872 | #define INPUT_DEVICE_ID_MATCH_DEVICE\ |
@@ -870,4 +889,5 @@ struct input_device_id { | |||
870 | unsigned long sndbit[NBITS(SND_MAX)]; | 889 | unsigned long sndbit[NBITS(SND_MAX)]; |
871 | unsigned long ffbit[NBITS(FF_MAX)]; | 890 | unsigned long ffbit[NBITS(FF_MAX)]; |
891 | unsigned long swbit[NBITS(SW_MAX)]; | ||
872 | 892 | ||
873 | unsigned long driver_info; | 893 | unsigned long driver_info; |
@@ -962,4 +982,9 @@ static inline void input_report_ff_status(struct input_dev *dev, unsigned int co | |||
962 | } | 982 | } |
963 | 983 | ||
984 | static inline void input_report_switch(struct input_dev *dev, unsigned int code, int value) | ||
985 | { | ||
986 | input_event(dev, EV_SW, code, !!value); | ||
987 | } | ||
988 | |||
964 | static inline void input_regs(struct input_dev *dev, struct pt_regs *regs) | 989 | static inline void input_regs(struct input_dev *dev, struct pt_regs *regs) |
965 | { | 990 | { |