input: keyreset: add support for reset after timeout
If a timeout is requested, a delayed work item will be
scheduled to restart the device. If the keys are released
before the timeout expires, the reset is aborted.
As expected, the reset_fn can be used to reset the device
after the timeout.
Bug: 7344361
Change-Id: I1d77cdb3dcc63f579b1250506f0a30de1e033d67
Signed-off-by: Dima Zavin <dima@android.com>
diff --git a/include/linux/keyreset.h b/include/linux/keyreset.h
index a2ac49e..22ebe11 100644
--- a/include/linux/keyreset.h
+++ b/include/linux/keyreset.h
@@ -21,6 +21,7 @@
struct keyreset_platform_data {
int (*reset_fn)(void);
+ int down_time_ms;
int *keys_up;
int keys_down[]; /* 0 terminated */
};