hid-gfrm: add autorepeat parameters
Use the following autorepeat parameters for GFTV remotes:
- REP_DELAY : 400 msec
- REP_PERIOD : 100 msec
- REP_MAX_COUNT: 30
This change evolved from Bruno 2.6.37 kernel commits:
commit 2b337770dbcbb717df76c34de8176896889a2ca9
Author: Sherry Moore <sherrym@google.com>
Date: Thu Jul 12 09:46:43 2012 -0700
Set REP_DELAY and REP_PERIOD for BCM BT HID.
commit 1176ecc8a8ebedbda4c8546a03dbf2bed918e574
Author: Petri Gynther <pgynther@google.com>
Date: Thu Apr 17 16:40:25 2014 -0700
Fix GFRM100 keypress auto-repeat delay and interval
commit e2a0d4d2b11c04c232ece9f9a5b82fc6b9d75b08
Author: Petri Gynther <pgynther@google.com>
Date: Thu Apr 17 17:18:27 2014 -0700
Limit GFRM100 keypress auto-repeat to REP_MAX_COUNT=300
Change-Id: I5a9cbc0249f4c6a7f734ee0a60a5720c7d5d6e5f
diff --git a/drivers/hid/hid-gfrm.c b/drivers/hid/hid-gfrm.c
index 622fa3b..7c1079b 100644
--- a/drivers/hid/hid-gfrm.c
+++ b/drivers/hid/hid-gfrm.c
@@ -10,6 +10,7 @@
*/
#include <linux/device.h>
#include <linux/hid.h>
+#include <linux/input.h>
#include <linux/module.h>
#include <linux/slab.h>
#include <linux/usb.h>
@@ -299,6 +300,17 @@
return (ret < 0) ? ret : -1;
}
+static void gfrm_input_configured(struct hid_device *hid, struct hid_input *hidinput)
+{
+ /*
+ * Enable software autorepeat with:
+ * - repeat delay: 400 msec
+ * - repeat period: 100 msec
+ * - repeat maximum count: 30
+ */
+ input_enable_softrepeat(hidinput->input, 400, 100, 30);
+}
+
static int gfrm_probe(struct hid_device *hdev, const struct hid_device_id *id)
{
int ret;
@@ -352,6 +364,7 @@
.input_mapping = gfrm_input_mapping,
.input_mapped = gfrm_input_mapped,
.raw_event = gfrm_raw_event,
+ .input_configured = gfrm_input_configured,
};
static int __init gfrm_init(void)