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 | |||
@@ -63,12 +63,13 @@ struct input_absinfo { | |||
63 | #define EVIOCGPHYS(len) _IOC(_IOC_READ, 'E', 0x07, len) /* get physical location */ | 63 | #define EVIOCGPHYS(len) _IOC(_IOC_READ, 'E', 0x07, len) /* get physical location */ |
64 | #define EVIOCGUNIQ(len) _IOC(_IOC_READ, 'E', 0x08, len) /* get unique identifier */ | 64 | #define EVIOCGUNIQ(len) _IOC(_IOC_READ, 'E', 0x08, len) /* get unique identifier */ |
65 | 65 | ||
66 | #define EVIOCGKEY(len) _IOC(_IOC_READ, 'E', 0x18, len) /* get global keystate */ | 66 | #define EVIOCGKEY(len) _IOC(_IOC_READ, 'E', 0x18, len) /* get global keystate */ |
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 */ |
71 | #define EVIOCGABS(abs) _IOR('E', 0x40 + abs, struct input_absinfo) /* get abs value/limits */ | 72 | #define EVIOCGABS(abs) _IOR('E', 0x40 + abs, struct input_absinfo) /* get abs value/limits */ |
72 | #define EVIOCSABS(abs) _IOW('E', 0xc0 + abs, struct input_absinfo) /* set abs value/limits */ | 73 | #define EVIOCSABS(abs) _IOW('E', 0xc0 + abs, struct input_absinfo) /* set abs value/limits */ |
73 | 74 | ||
74 | #define EVIOCSFF _IOC(_IOC_WRITE, 'E', 0x80, sizeof(struct ff_effect))/* send a force effect to a force feedback device */ | 75 | #define EVIOCSFF _IOC(_IOC_WRITE, 'E', 0x80, sizeof(struct ff_effect))/* send a force effect to a force feedback device */ |
@@ -83,12 +84,13 @@ struct input_absinfo { | |||
83 | 84 | ||
84 | #define EV_SYN 0x00 | 85 | #define EV_SYN 0x00 |
85 | #define EV_KEY 0x01 | 86 | #define EV_KEY 0x01 |
86 | #define EV_REL 0x02 | 87 | #define EV_REL 0x02 |
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 |
91 | #define EV_REP 0x14 | 93 | #define EV_REP 0x14 |
92 | #define EV_FF 0x15 | 94 | #define EV_FF 0x15 |
93 | #define EV_PWR 0x16 | 95 | #define EV_PWR 0x16 |
94 | #define EV_FF_STATUS 0x17 | 96 | #define EV_FF_STATUS 0x17 |
@@ -518,12 +520,26 @@ struct input_absinfo { | |||
518 | #define ABS_TOOL_WIDTH 0x1c | 520 | #define ABS_TOOL_WIDTH 0x1c |
519 | #define ABS_VOLUME 0x20 | 521 | #define ABS_VOLUME 0x20 |
520 | #define ABS_MISC 0x28 | 522 | #define ABS_MISC 0x28 |
521 | #define ABS_MAX 0x3f | 523 | #define ABS_MAX 0x3f |
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 | */ |
526 | 542 | ||
527 | #define MSC_SERIAL 0x00 | 543 | #define MSC_SERIAL 0x00 |
528 | #define MSC_PULSELED 0x01 | 544 | #define MSC_PULSELED 0x01 |
529 | #define MSC_GESTURE 0x02 | 545 | #define MSC_GESTURE 0x02 |
@@ -787,12 +803,13 @@ struct input_dev { | |||
787 | unsigned long relbit[NBITS(REL_MAX)]; | 803 | unsigned long relbit[NBITS(REL_MAX)]; |
788 | unsigned long absbit[NBITS(ABS_MAX)]; | 804 | unsigned long absbit[NBITS(ABS_MAX)]; |
789 | unsigned long mscbit[NBITS(MSC_MAX)]; | 805 | unsigned long mscbit[NBITS(MSC_MAX)]; |
790 | unsigned long ledbit[NBITS(LED_MAX)]; | 806 | unsigned long ledbit[NBITS(LED_MAX)]; |
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 | ||
795 | unsigned int keycodemax; | 812 | unsigned int keycodemax; |
796 | unsigned int keycodesize; | 813 | unsigned int keycodesize; |
797 | void *keycode; | 814 | void *keycode; |
798 | 815 | ||
@@ -808,12 +825,13 @@ struct input_dev { | |||
808 | int abs[ABS_MAX + 1]; | 825 | int abs[ABS_MAX + 1]; |
809 | int rep[REP_MAX + 1]; | 826 | int rep[REP_MAX + 1]; |
810 | 827 | ||
811 | unsigned long key[NBITS(KEY_MAX)]; | 828 | unsigned long key[NBITS(KEY_MAX)]; |
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]; |
816 | int absmin[ABS_MAX + 1]; | 834 | int absmin[ABS_MAX + 1]; |
817 | int absfuzz[ABS_MAX + 1]; | 835 | int absfuzz[ABS_MAX + 1]; |
818 | int absflat[ABS_MAX + 1]; | 836 | int absflat[ABS_MAX + 1]; |
819 | 837 | ||
@@ -846,12 +864,13 @@ struct input_dev { | |||
846 | #define INPUT_DEVICE_ID_MATCH_RELBIT0x040 | 864 | #define INPUT_DEVICE_ID_MATCH_RELBIT0x040 |
847 | #define INPUT_DEVICE_ID_MATCH_ABSBIT0x080 | 865 | #define INPUT_DEVICE_ID_MATCH_ABSBIT0x080 |
848 | #define INPUT_DEVICE_ID_MATCH_MSCIT0x100 | 866 | #define INPUT_DEVICE_ID_MATCH_MSCIT0x100 |
849 | #define INPUT_DEVICE_ID_MATCH_LEDBIT0x200 | 867 | #define INPUT_DEVICE_ID_MATCH_LEDBIT0x200 |
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\ |
854 | (INPUT_DEVICE_ID_MATCH_BUS | INPUT_DEVICE_ID_MATCH_VENDOR | INPUT_DEVICE_ID_MATCH_PRODUCT) | 873 | (INPUT_DEVICE_ID_MATCH_BUS | INPUT_DEVICE_ID_MATCH_VENDOR | INPUT_DEVICE_ID_MATCH_PRODUCT) |
855 | #define INPUT_DEVICE_ID_MATCH_DEVICE_AND_VERSION\ | 874 | #define INPUT_DEVICE_ID_MATCH_DEVICE_AND_VERSION\ |
856 | (INPUT_DEVICE_ID_MATCH_DEVICE | INPUT_DEVICE_ID_MATCH_VERSION) | 875 | (INPUT_DEVICE_ID_MATCH_DEVICE | INPUT_DEVICE_ID_MATCH_VERSION) |
857 | 876 | ||
@@ -866,12 +885,13 @@ struct input_device_id { | |||
866 | unsigned long relbit[NBITS(REL_MAX)]; | 885 | unsigned long relbit[NBITS(REL_MAX)]; |
867 | unsigned long absbit[NBITS(ABS_MAX)]; | 886 | unsigned long absbit[NBITS(ABS_MAX)]; |
868 | unsigned long mscbit[NBITS(MSC_MAX)]; | 887 | unsigned long mscbit[NBITS(MSC_MAX)]; |
869 | unsigned long ledbit[NBITS(LED_MAX)]; | 888 | unsigned long ledbit[NBITS(LED_MAX)]; |
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; |
874 | }; | 894 | }; |
875 | 895 | ||
876 | struct input_handle; | 896 | struct input_handle; |
877 | 897 | ||
@@ -958,12 +978,17 @@ static inline void input_report_ff(struct input_dev *dev, unsigned int code, int | |||
958 | 978 | ||
959 | static inline void input_report_ff_status(struct input_dev *dev, unsigned int code, int value) | 979 | static inline void input_report_ff_status(struct input_dev *dev, unsigned int code, int value) |
960 | { | 980 | { |
961 | input_event(dev, EV_FF_STATUS, code, value); | 981 | input_event(dev, EV_FF_STATUS, code, value); |
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 | { |
966 | dev->regs = regs; | 991 | dev->regs = regs; |
967 | } | 992 | } |
968 | 993 | ||
969 | static inline void input_sync(struct input_dev *dev) | 994 | static inline void input_sync(struct input_dev *dev) |