diff options
author | Colin Cross <ccross@android.com> | 2011-01-07 14:52:56 -0800 |
---|---|---|
committer | Colin Cross <ccross@android.com> | 2011-06-14 09:09:44 -0700 |
commit | 677ef29f71cba2017015c5a804e931314dc71df6 (patch) | |
tree | 4d08ae49d4fe6000b38f7350a551286e6ee81b09 /drivers/input | |
parent | 9b6f4a382dda68d41cbbd739095db3fd36f55f6b (diff) | |
download | kernel_samsung_tuna-677ef29f71cba2017015c5a804e931314dc71df6.zip kernel_samsung_tuna-677ef29f71cba2017015c5a804e931314dc71df6.tar.gz kernel_samsung_tuna-677ef29f71cba2017015c5a804e931314dc71df6.tar.bz2 |
input: keyreset: Allow reset function to be overriden
Change-Id: Ibb3dda05772b2e89d7b2646689944d309cb1f74e
Signed-off-by: Colin Cross <ccross@android.com>
Diffstat (limited to 'drivers/input')
-rw-r--r-- | drivers/input/keyreset.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/drivers/input/keyreset.c b/drivers/input/keyreset.c index b513506..a5091ac 100644 --- a/drivers/input/keyreset.c +++ b/drivers/input/keyreset.c @@ -33,6 +33,7 @@ struct keyreset_state { int key_down; int key_up; int restart_disabled; + int (*reset_fn)(void); }; int restart_requested; @@ -88,8 +89,12 @@ static void keyreset_event(struct input_handle *handle, unsigned int type, if (restart_requested) panic("keyboard reset failed, %d", restart_requested); pr_info("keyboard reset\n"); - schedule_work(&restart_work); - restart_requested = 1; + if (state->reset_fn) { + restart_requested = state->reset_fn(); + } else { + schedule_work(&restart_work); + restart_requested = 1; + } } done: spin_unlock_irqrestore(&state->lock, flags); @@ -187,6 +192,10 @@ static int keyreset_probe(struct platform_device *pdev) __set_bit(key, state->upbit); } } + + if (pdata->reset_fn) + state->reset_fn = pdata->reset_fn; + state->input_handler.event = keyreset_event; state->input_handler.connect = keyreset_connect; state->input_handler.disconnect = keyreset_disconnect; |