diff options
author | Dmitry Torokhov <dtor_core@ameritech.net> | 2006-04-29 01:13:21 -0400 |
---|---|---|
committer | Dmitry Torokhov <dtor_core@ameritech.net> | 2006-04-29 01:13:21 -0400 |
commit | 08791e5cf62b6952ca32106aebb79b6066005de4 (patch) | |
tree | 7cb1f7bfdb2b31bbc8d504be2245df8f21a28574 /drivers | |
parent | 89c9b4805a525bdd4c6e7529d06292f60ac837fc (diff) |
Input: ressurect EVIOCGREP and EVIOCSREP
While writing to an event device allows to set repeat rate for an
individual input device there is no way to retrieve current settings
so we need to ressurect EVIOCGREP. Also ressurect EVIOCSREP so we
have a symmetrical interface.
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/input/evdev.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/drivers/input/evdev.c b/drivers/input/evdev.c index a34e3d91d9ed..ba325f16d077 100644 --- a/drivers/input/evdev.c +++ b/drivers/input/evdev.c | |||
@@ -403,6 +403,27 @@ static long evdev_ioctl_handler(struct file *file, unsigned int cmd, | |||
403 | case EVIOCGID: | 403 | case EVIOCGID: |
404 | if (copy_to_user(p, &dev->id, sizeof(struct input_id))) | 404 | if (copy_to_user(p, &dev->id, sizeof(struct input_id))) |
405 | return -EFAULT; | 405 | return -EFAULT; |
406 | return 0; | ||
407 | |||
408 | case EVIOCGREP: | ||
409 | if (!test_bit(EV_REP, dev->evbit)) | ||
410 | return -ENOSYS; | ||
411 | if (put_user(dev->rep[REP_DELAY], ip)) | ||
412 | return -EFAULT; | ||
413 | if (put_user(dev->rep[REP_PERIOD], ip + 1)) | ||
414 | return -EFAULT; | ||
415 | return 0; | ||
416 | |||
417 | case EVIOCSREP: | ||
418 | if (!test_bit(EV_REP, dev->evbit)) | ||
419 | return -ENOSYS; | ||
420 | if (get_user(u, ip)) | ||
421 | return -EFAULT; | ||
422 | if (get_user(v, ip + 1)) | ||
423 | return -EFAULT; | ||
424 | |||
425 | input_event(dev, EV_REP, REP_DELAY, u); | ||
426 | input_event(dev, EV_REP, REP_PERIOD, v); | ||
406 | 427 | ||
407 | return 0; | 428 | return 0; |
408 | 429 | ||