aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/input/evdev.c
diff options
context:
space:
mode:
authorRichard Purdie <rpurdie@rpsys.net>2005-09-06 18:19:06 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2005-09-07 19:57:54 -0400
commit3158106685acac8f8d4e74a17b974f160fe77c0b (patch)
tree7712eb16eb543b5247f90b41647d08ff0a05e663 /drivers/input/evdev.c
parent41b1bce80b43f7c6a6c64006b2abe3a8d52ab120 (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 'drivers/input/evdev.c')
-rw-r--r--drivers/input/evdev.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/input/evdev.c b/drivers/input/evdev.c
index f8b278d3559b..19c14c4beb44 100644
--- a/drivers/input/evdev.c
+++ b/drivers/input/evdev.c
@@ -393,6 +393,7 @@ static long evdev_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
393 case EV_LED: bits = dev->ledbit; len = LED_MAX; break; 393 case EV_LED: bits = dev->ledbit; len = LED_MAX; break;
394 case EV_SND: bits = dev->sndbit; len = SND_MAX; break; 394 case EV_SND: bits = dev->sndbit; len = SND_MAX; break;
395 case EV_FF: bits = dev->ffbit; len = FF_MAX; break; 395 case EV_FF: bits = dev->ffbit; len = FF_MAX; break;
396 case EV_SW: bits = dev->swbit; len = SW_MAX; break;
396 default: return -EINVAL; 397 default: return -EINVAL;
397 } 398 }
398 len = NBITS(len) * sizeof(long); 399 len = NBITS(len) * sizeof(long);
@@ -421,6 +422,13 @@ static long evdev_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
421 return copy_to_user(p, dev->snd, len) ? -EFAULT : len; 422 return copy_to_user(p, dev->snd, len) ? -EFAULT : len;
422 } 423 }
423 424
425 if (_IOC_NR(cmd) == _IOC_NR(EVIOCGSW(0))) {
426 int len;
427 len = NBITS(SW_MAX) * sizeof(long);
428 if (len > _IOC_SIZE(cmd)) len = _IOC_SIZE(cmd);
429 return copy_to_user(p, dev->sw, len) ? -EFAULT : len;
430 }
431
424 if (_IOC_NR(cmd) == _IOC_NR(EVIOCGNAME(0))) { 432 if (_IOC_NR(cmd) == _IOC_NR(EVIOCGNAME(0))) {
425 int len; 433 int len;
426 if (!dev->name) return -ENOENT; 434 if (!dev->name) return -ENOENT;