diff options
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 b51350602fc3..a5091ac19bbe 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; |