Input: improve autorepeat initialization
authorPetri Gynther <pgynther@google.com>
Wed, 14 Oct 2015 06:13:55 +0000 (23:13 -0700)
committerDmitry Torokhov <dmitry.torokhov@gmail.com>
Wed, 14 Oct 2015 06:30:31 +0000 (23:30 -0700)
commit027c71bbae3a6eeff00c11d1b708593a5c790314
treea676e49c72bf16bab255a4c9beeafb48784b8513
parentaba54876bb38dde81abead1ed1936eb04fa30ca9
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>
drivers/input/input.c
include/linux/input.h