diff options
author | Richard Purdie <rpurdie@rpsys.net> | 2005-09-06 15:19:06 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2005-09-07 16:57:54 -0700 |
commit | 3158106685acac8f8d4e74a17b974f160fe77c0b (patch) | |
tree | 7712eb16eb543b5247f90b41647d08ff0a05e663 /drivers/input/input.c | |
parent | 41b1bce80b43f7c6a6c64006b2abe3a8d52ab120 (diff) | |
download | linux-3158106685acac8f8d4e74a17b974f160fe77c0b.tar.gz linux-3158106685acac8f8d4e74a17b974f160fe77c0b.tar.bz2 linux-3158106685acac8f8d4e74a17b974f160fe77c0b.zip |
[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 'drivers/input/input.c')
-rw-r--r-- | drivers/input/input.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/drivers/input/input.c b/drivers/input/input.c index a275211c8e1e..88636a204525 100644 --- a/drivers/input/input.c +++ b/drivers/input/input.c @@ -89,6 +89,15 @@ void input_event(struct input_dev *dev, unsigned int type, unsigned int code, in break; + case EV_SW: + + if (code > SW_MAX || !test_bit(code, dev->swbit) || !!test_bit(code, dev->sw) == value) + return; + + change_bit(code, dev->sw); + + break; + case EV_ABS: if (code > ABS_MAX || !test_bit(code, dev->absbit)) @@ -402,6 +411,7 @@ static void input_call_hotplug(char *verb, struct input_dev *dev) SPRINTF_BIT_A2(ledbit, "LED=", LED_MAX, EV_LED); SPRINTF_BIT_A2(sndbit, "SND=", SND_MAX, EV_SND); SPRINTF_BIT_A2(ffbit, "FF=", FF_MAX, EV_FF); + SPRINTF_BIT_A2(swbit, "SW=", SW_MAX, EV_SW); envp[i++] = NULL; @@ -490,6 +500,7 @@ static int input_devices_read(char *buf, char **start, off_t pos, int count, int SPRINTF_BIT_B2(ledbit, "LED=", LED_MAX, EV_LED); SPRINTF_BIT_B2(sndbit, "SND=", SND_MAX, EV_SND); SPRINTF_BIT_B2(ffbit, "FF=", FF_MAX, EV_FF); + SPRINTF_BIT_B2(swbit, "SW=", SW_MAX, EV_SW); len += sprintf(buf + len, "\n"); |