summaryrefslogtreecommitdiff
path: root/drivers/input/input.c
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2012-09-27 15:18:41 +0000
committerTom Rini <trini@ti.com>2012-10-15 11:54:04 -0700
commit1b1d3e6461e9195f825d6d8aa6a2a0e1e3188f62 (patch)
treea6120c3afff73816064a1e4fbeed227aaad84097 /drivers/input/input.c
parent00f1099e09d627632b60a3a29cb1bce2339510a7 (diff)
downloadu-boot-imx-1b1d3e6461e9195f825d6d8aa6a2a0e1e3188f62.zip
u-boot-imx-1b1d3e6461e9195f825d6d8aa6a2a0e1e3188f62.tar.gz
u-boot-imx-1b1d3e6461e9195f825d6d8aa6a2a0e1e3188f62.tar.bz2
input: Separate out keyboard repeat/delay from init
It is inconvenient to have to specify the keyboard repeat and delay at init time if it is not yet available, so move this into a separate function. Some drivers will want to do this when their keyboard init routine is actually called. Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'drivers/input/input.c')
-rw-r--r--drivers/input/input.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/drivers/input/input.c b/drivers/input/input.c
index 4eadd77..5b2b4b0 100644
--- a/drivers/input/input.c
+++ b/drivers/input/input.c
@@ -356,7 +356,8 @@ int input_send_keycodes(struct input_config *config,
* insert another character if we later realise that we
* have missed a repeat slot.
*/
- is_repeat = (int)get_timer(config->next_repeat_ms) >= 0;
+ is_repeat = config->repeat_rate_ms &&
+ (int)get_timer(config->next_repeat_ms) >= 0;
if (!is_repeat)
return 0;
}
@@ -392,13 +393,17 @@ int input_add_table(struct input_config *config, int left_keycode,
return 0;
}
-int input_init(struct input_config *config, int leds, int repeat_delay_ms,
+void input_set_delays(struct input_config *config, int repeat_delay_ms,
int repeat_rate_ms)
{
- memset(config, '\0', sizeof(*config));
- config->leds = leds;
config->repeat_delay_ms = repeat_delay_ms;
config->repeat_rate_ms = repeat_rate_ms;
+}
+
+int input_init(struct input_config *config, int leds)
+{
+ memset(config, '\0', sizeof(*config));
+ config->leds = leds;
if (input_add_table(config, -1, -1,
kbd_plain_xlate, ARRAY_SIZE(kbd_plain_xlate)) ||
input_add_table(config, KEY_LEFTSHIFT, KEY_RIGHTSHIFT,