diff options
author | Petri Gynther <pgynther@google.com> | 2015-10-14 09:13:55 +0300 |
---|---|---|
committer | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2015-10-14 09:30:31 +0300 |
commit | 027c71bbae3a6eeff00c11d1b708593a5c790314 (patch) | |
tree | a676e49c72bf16bab255a4c9beeafb48784b8513 /include/linux/input.h | |
parent | aba54876bb38dde81abead1ed1936eb04fa30ca9 (diff) | |
download | linux-027c71bbae3a6eeff00c11d1b708593a5c790314.tar.xz |
Input: improve autorepeat initialization
Add new function input_enable_softrepeat() that allows drivers to
initialize their own values for input_dev->rep[REP_DELAY] and
input_dev->rep[REP_PERIOD], but also use the software autorepeat
functionality from input.c.
For example, a HID driver could do:
static void xyz_input_configured(struct hid_device *hid,
struct hid_input *hidinput)
{
input_enable_softrepeat(hidinput->input, 400, 100);
}
static struct hid_driver xyz_driver = {
.input_configured = xyz_input_configured,
}
Signed-off-by: Petri Gynther <pgynther@google.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Diffstat (limited to 'include/linux/input.h')
-rw-r--r-- | include/linux/input.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/include/linux/input.h b/include/linux/input.h index 82ce323b9986..1e967694e9a5 100644 --- a/include/linux/input.h +++ b/include/linux/input.h @@ -469,6 +469,8 @@ int input_get_keycode(struct input_dev *dev, struct input_keymap_entry *ke); int input_set_keycode(struct input_dev *dev, const struct input_keymap_entry *ke); +void input_enable_softrepeat(struct input_dev *dev, int delay, int period); + extern struct class input_class; /** |