diff options
author | Dmitry Torokhov <dtor_core@ameritech.net> | 2005-09-09 21:14:47 -0400 |
---|---|---|
committer | Dmitry Torokhov <dtor_core@ameritech.net> | 2005-09-09 21:14:47 -0400 |
commit | d344c5e0856ad03278d8700b503762dbc8b86e12 (patch) | |
tree | a6d893a643470a3c2580a58f3228a55fa1fd1d82 /include/linux/input.h | |
parent | 010988e888a0abbe7118635c1b33d049caae6b29 (diff) | |
parent | 87fc767b832ef5a681a0ff9d203c3289bc3be2bf (diff) |
Manual merge with Linus
Diffstat (limited to 'include/linux/input.h')
-rw-r--r-- | include/linux/input.h | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/include/linux/input.h b/include/linux/input.h index 227a497c0678..e8c296ff6257 100644 --- a/include/linux/input.h +++ b/include/linux/input.h | |||
@@ -66,6 +66,7 @@ struct input_absinfo { | |||
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 */ |
@@ -86,6 +87,7 @@ struct input_absinfo { | |||
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 |
@@ -559,6 +561,20 @@ struct input_absinfo { | |||
559 | #define ABS_MAX 0x3f | 561 | #define ABS_MAX 0x3f |
560 | 562 | ||
561 | /* | 563 | /* |
564 | * Switch events | ||
565 | */ | ||
566 | |||
567 | #define SW_0 0x00 | ||
568 | #define SW_1 0x01 | ||
569 | #define SW_2 0x02 | ||
570 | #define SW_3 0x03 | ||
571 | #define SW_4 0x04 | ||
572 | #define SW_5 0x05 | ||
573 | #define SW_6 0x06 | ||
574 | #define SW_7 0x07 | ||
575 | #define SW_MAX 0x0f | ||
576 | |||
577 | /* | ||
562 | * Misc events | 578 | * Misc events |
563 | */ | 579 | */ |
564 | 580 | ||
@@ -832,6 +848,7 @@ struct input_dev { | |||
832 | unsigned long ledbit[NBITS(LED_MAX)]; | 848 | unsigned long ledbit[NBITS(LED_MAX)]; |
833 | unsigned long sndbit[NBITS(SND_MAX)]; | 849 | unsigned long sndbit[NBITS(SND_MAX)]; |
834 | unsigned long ffbit[NBITS(FF_MAX)]; | 850 | unsigned long ffbit[NBITS(FF_MAX)]; |
851 | unsigned long swbit[NBITS(SW_MAX)]; | ||
835 | int ff_effects_max; | 852 | int ff_effects_max; |
836 | 853 | ||
837 | unsigned int keycodemax; | 854 | unsigned int keycodemax; |
@@ -852,6 +869,7 @@ struct input_dev { | |||
852 | unsigned long key[NBITS(KEY_MAX)]; | 869 | unsigned long key[NBITS(KEY_MAX)]; |
853 | unsigned long led[NBITS(LED_MAX)]; | 870 | unsigned long led[NBITS(LED_MAX)]; |
854 | unsigned long snd[NBITS(SND_MAX)]; | 871 | unsigned long snd[NBITS(SND_MAX)]; |
872 | unsigned long sw[NBITS(SW_MAX)]; | ||
855 | 873 | ||
856 | int absmax[ABS_MAX + 1]; | 874 | int absmax[ABS_MAX + 1]; |
857 | int absmin[ABS_MAX + 1]; | 875 | int absmin[ABS_MAX + 1]; |
@@ -894,6 +912,7 @@ struct input_dev { | |||
894 | #define INPUT_DEVICE_ID_MATCH_LEDBIT 0x200 | 912 | #define INPUT_DEVICE_ID_MATCH_LEDBIT 0x200 |
895 | #define INPUT_DEVICE_ID_MATCH_SNDBIT 0x400 | 913 | #define INPUT_DEVICE_ID_MATCH_SNDBIT 0x400 |
896 | #define INPUT_DEVICE_ID_MATCH_FFBIT 0x800 | 914 | #define INPUT_DEVICE_ID_MATCH_FFBIT 0x800 |
915 | #define INPUT_DEVICE_ID_MATCH_SWBIT 0x1000 | ||
897 | 916 | ||
898 | #define INPUT_DEVICE_ID_MATCH_DEVICE\ | 917 | #define INPUT_DEVICE_ID_MATCH_DEVICE\ |
899 | (INPUT_DEVICE_ID_MATCH_BUS | INPUT_DEVICE_ID_MATCH_VENDOR | INPUT_DEVICE_ID_MATCH_PRODUCT) | 918 | (INPUT_DEVICE_ID_MATCH_BUS | INPUT_DEVICE_ID_MATCH_VENDOR | INPUT_DEVICE_ID_MATCH_PRODUCT) |
@@ -914,6 +933,7 @@ struct input_device_id { | |||
914 | unsigned long ledbit[NBITS(LED_MAX)]; | 933 | unsigned long ledbit[NBITS(LED_MAX)]; |
915 | unsigned long sndbit[NBITS(SND_MAX)]; | 934 | unsigned long sndbit[NBITS(SND_MAX)]; |
916 | unsigned long ffbit[NBITS(FF_MAX)]; | 935 | unsigned long ffbit[NBITS(FF_MAX)]; |
936 | unsigned long swbit[NBITS(SW_MAX)]; | ||
917 | 937 | ||
918 | unsigned long driver_info; | 938 | unsigned long driver_info; |
919 | }; | 939 | }; |
@@ -1006,6 +1026,11 @@ static inline void input_report_ff_status(struct input_dev *dev, unsigned int co | |||
1006 | input_event(dev, EV_FF_STATUS, code, value); | 1026 | input_event(dev, EV_FF_STATUS, code, value); |
1007 | } | 1027 | } |
1008 | 1028 | ||
1029 | static inline void input_report_switch(struct input_dev *dev, unsigned int code, int value) | ||
1030 | { | ||
1031 | input_event(dev, EV_SW, code, !!value); | ||
1032 | } | ||
1033 | |||
1009 | static inline void input_regs(struct input_dev *dev, struct pt_regs *regs) | 1034 | static inline void input_regs(struct input_dev *dev, struct pt_regs *regs) |
1010 | { | 1035 | { |
1011 | dev->regs = regs; | 1036 | dev->regs = regs; |