From 0ef5d865801658087932bb33cbc203ac45df1632 Mon Sep 17 00:00:00 2001 From: Dmitry Torokhov Date: Sat, 29 Apr 2006 01:13:21 -0400 Subject: [PATCH] --- yaml --- r: 26361 b: refs/heads/master c: 08791e5cf62b6952ca32106aebb79b6066005de4 h: refs/heads/master i: 26359: a604d9be89ba0d47775e04cce0af3f25ae3f6524 v: v3 --- [refs] | 2 +- trunk/drivers/input/evdev.c | 21 +++++++++++++++++++++ trunk/include/linux/input.h | 2 ++ 3 files changed, 24 insertions(+), 1 deletion(-) diff --git a/[refs] b/[refs] index 83a478dc5411..afcd2c45abd1 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 89c9b4805a525bdd4c6e7529d06292f60ac837fc +refs/heads/master: 08791e5cf62b6952ca32106aebb79b6066005de4 diff --git a/trunk/drivers/input/evdev.c b/trunk/drivers/input/evdev.c index a34e3d91d9ed..ba325f16d077 100644 --- a/trunk/drivers/input/evdev.c +++ b/trunk/drivers/input/evdev.c @@ -403,6 +403,27 @@ static long evdev_ioctl_handler(struct file *file, unsigned int cmd, case EVIOCGID: if (copy_to_user(p, &dev->id, sizeof(struct input_id))) return -EFAULT; + return 0; + + case EVIOCGREP: + if (!test_bit(EV_REP, dev->evbit)) + return -ENOSYS; + if (put_user(dev->rep[REP_DELAY], ip)) + return -EFAULT; + if (put_user(dev->rep[REP_PERIOD], ip + 1)) + return -EFAULT; + return 0; + + case EVIOCSREP: + if (!test_bit(EV_REP, dev->evbit)) + return -ENOSYS; + if (get_user(u, ip)) + return -EFAULT; + if (get_user(v, ip + 1)) + return -EFAULT; + + input_event(dev, EV_REP, REP_DELAY, u); + input_event(dev, EV_REP, REP_PERIOD, v); return 0; diff --git a/trunk/include/linux/input.h b/trunk/include/linux/input.h index 8298b4bf5a07..50e338d2ffda 100644 --- a/trunk/include/linux/input.h +++ b/trunk/include/linux/input.h @@ -56,6 +56,8 @@ struct input_absinfo { #define EVIOCGVERSION _IOR('E', 0x01, int) /* get driver version */ #define EVIOCGID _IOR('E', 0x02, struct input_id) /* get device ID */ +#define EVIOCGREP _IOR('E', 0x03, int[2]) /* get repeat settings */ +#define EVIOCSREP _IOW('E', 0x03, int[2]) /* set repeat settings */ #define EVIOCGKEYCODE _IOR('E', 0x04, int[2]) /* get keycode */ #define EVIOCSKEYCODE _IOW('E', 0x04, int[2]) /* set keycode */