diff options
author | Richard Purdie <rpurdie@rpsys.net> | 2005-09-06 18:19:06 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2005-09-07 19:57:54 -0400 |
commit | 3158106685acac8f8d4e74a17b974f160fe77c0b (patch) | |
tree | 7712eb16eb543b5247f90b41647d08ff0a05e663 /include/linux/input.h | |
parent | 41b1bce80b43f7c6a6c64006b2abe3a8d52ab120 (diff) |
[PATCH] Input: Add a new switch event type
The corgi keyboard has need of a switch event type with slightly type to the
input system as recommended by the input maintainer.
Signed-off-by: Richard Purdie <rpurdie@rpsys.net>
Cc: Vojtech Pavlik <vojtech@suse.cz>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
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 bdc53c6cc962..4767e5429534 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 |
@@ -551,6 +553,20 @@ struct input_absinfo { | |||
551 | #define ABS_MAX 0x3f | 553 | #define ABS_MAX 0x3f |
552 | 554 | ||
553 | /* | 555 | /* |
556 | * Switch events | ||
557 | */ | ||
558 | |||
559 | #define SW_0 0x00 | ||
560 | #define SW_1 0x01 | ||
561 | #define SW_2 0x02 | ||
562 | #define SW_3 0x03 | ||
563 | #define SW_4 0x04 | ||
564 | #define SW_5 0x05 | ||
565 | #define SW_6 0x06 | ||
566 | #define SW_7 0x07 | ||
567 | #define SW_MAX 0x0f | ||
568 | |||
569 | /* | ||
554 | * Misc events | 570 | * Misc events |
555 | */ | 571 | */ |
556 | 572 | ||
@@ -824,6 +840,7 @@ struct input_dev { | |||
824 | unsigned long ledbit[NBITS(LED_MAX)]; | 840 | unsigned long ledbit[NBITS(LED_MAX)]; |
825 | unsigned long sndbit[NBITS(SND_MAX)]; | 841 | unsigned long sndbit[NBITS(SND_MAX)]; |
826 | unsigned long ffbit[NBITS(FF_MAX)]; | 842 | unsigned long ffbit[NBITS(FF_MAX)]; |
843 | unsigned long swbit[NBITS(SW_MAX)]; | ||
827 | int ff_effects_max; | 844 | int ff_effects_max; |
828 | 845 | ||
829 | unsigned int keycodemax; | 846 | unsigned int keycodemax; |
@@ -844,6 +861,7 @@ struct input_dev { | |||
844 | unsigned long key[NBITS(KEY_MAX)]; | 861 | unsigned long key[NBITS(KEY_MAX)]; |
845 | unsigned long led[NBITS(LED_MAX)]; | 862 | unsigned long led[NBITS(LED_MAX)]; |
846 | unsigned long snd[NBITS(SND_MAX)]; | 863 | unsigned long snd[NBITS(SND_MAX)]; |
864 | unsigned long sw[NBITS(SW_MAX)]; | ||
847 | 865 | ||
848 | int absmax[ABS_MAX + 1]; | 866 | int absmax[ABS_MAX + 1]; |
849 | int absmin[ABS_MAX + 1]; | 867 | int absmin[ABS_MAX + 1]; |
@@ -886,6 +904,7 @@ struct input_dev { | |||
886 | #define INPUT_DEVICE_ID_MATCH_LEDBIT 0x200 | 904 | #define INPUT_DEVICE_ID_MATCH_LEDBIT 0x200 |
887 | #define INPUT_DEVICE_ID_MATCH_SNDBIT 0x400 | 905 | #define INPUT_DEVICE_ID_MATCH_SNDBIT 0x400 |
888 | #define INPUT_DEVICE_ID_MATCH_FFBIT 0x800 | 906 | #define INPUT_DEVICE_ID_MATCH_FFBIT 0x800 |
907 | #define INPUT_DEVICE_ID_MATCH_SWBIT 0x1000 | ||
889 | 908 | ||
890 | #define INPUT_DEVICE_ID_MATCH_DEVICE\ | 909 | #define INPUT_DEVICE_ID_MATCH_DEVICE\ |
891 | (INPUT_DEVICE_ID_MATCH_BUS | INPUT_DEVICE_ID_MATCH_VENDOR | INPUT_DEVICE_ID_MATCH_PRODUCT) | 910 | (INPUT_DEVICE_ID_MATCH_BUS | INPUT_DEVICE_ID_MATCH_VENDOR | INPUT_DEVICE_ID_MATCH_PRODUCT) |
@@ -906,6 +925,7 @@ struct input_device_id { | |||
906 | unsigned long ledbit[NBITS(LED_MAX)]; | 925 | unsigned long ledbit[NBITS(LED_MAX)]; |
907 | unsigned long sndbit[NBITS(SND_MAX)]; | 926 | unsigned long sndbit[NBITS(SND_MAX)]; |
908 | unsigned long ffbit[NBITS(FF_MAX)]; | 927 | unsigned long ffbit[NBITS(FF_MAX)]; |
928 | unsigned long swbit[NBITS(SW_MAX)]; | ||
909 | 929 | ||
910 | unsigned long driver_info; | 930 | unsigned long driver_info; |
911 | }; | 931 | }; |
@@ -998,6 +1018,11 @@ static inline void input_report_ff_status(struct input_dev *dev, unsigned int co | |||
998 | input_event(dev, EV_FF_STATUS, code, value); | 1018 | input_event(dev, EV_FF_STATUS, code, value); |
999 | } | 1019 | } |
1000 | 1020 | ||
1021 | static inline void input_report_switch(struct input_dev *dev, unsigned int code, int value) | ||
1022 | { | ||
1023 | input_event(dev, EV_SW, code, !!value); | ||
1024 | } | ||
1025 | |||
1001 | static inline void input_regs(struct input_dev *dev, struct pt_regs *regs) | 1026 | static inline void input_regs(struct input_dev *dev, struct pt_regs *regs) |
1002 | { | 1027 | { |
1003 | dev->regs = regs; | 1028 | dev->regs = regs; |