summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYongqin Liu <yongqin.liu@linaro.org>2013-10-25 11:08:59 -0700
committerJohn Stultz <john.stultz@linaro.org>2013-10-25 11:22:30 -0700
commitef0cb36f1005fe795d0ae87d7563a0aea4a71cfc (patch)
tree4ce4efb10eae0aac51c2ead6fcc2edb1354d1857
parentb8e82081d7f37f0a0f27cb090dd35f2b9196f830 (diff)
HACK: input.h: fix EVDEV test failures
Since the value(0x91) of EVIOCREVOKE is the old value of EVIOCGSUSPENDBLOCK/EVIOCSSUSPENDBLOCK which are also defined in bionic, and it will cause errors on the userland if compiled with old version bionic. here make the EVIOCGSUSPENDBLOCK/EVIOCSSUSPENDBLOCK keep using the old 0x91 value, and set EVIOCREVOKE to the new 0x95 to make the new kernel with EVIOCREVOKE also work with old bionic version which still not have kernel header files updated. NOTE: This is a short term hack, since it breaks any EVIOCREVOKE users, but since EVIOCREVOKE was added in 3.12, there aren't likely to be many users yet. The long term solution is for Android userspace to migrate to EPOLLWAKEUP. Also, it may not be obvious from this commit, but the EVIOCGSUSPENDBLOCK/EVIOCSSUSPENDBLOCK ioctls were renumbered in the merge w/ 3.12 to avoid the collision with EVIOCREVOKE. However this caused problems in testing and resulted in the need for this patch. Change-Id: I18c944c8ae4744268c0576cd9fdbd45c0fafd1de Signed-off-by: Yongqin Liu <yongqin.liu@linaro.org> [jstultz: Commit message tweaks, minor merge adjustments, make it depend on CONFIG_ANDROID] Signed-off-by: John Stultz <john.stultz@linaro.og>
-rw-r--r--include/uapi/linux/input.h13
1 files changed, 10 insertions, 3 deletions
diff --git a/include/uapi/linux/input.h b/include/uapi/linux/input.h
index 2fc28b63f2f2..414353731296 100644
--- a/include/uapi/linux/input.h
+++ b/include/uapi/linux/input.h
@@ -152,10 +152,17 @@ struct input_keymap_entry {
#define EVIOCGEFFECTS _IOR('E', 0x84, int) /* Report number of effects playable at the same time */
#define EVIOCGRAB _IOW('E', 0x90, int) /* Grab/Release device */
-#define EVIOCREVOKE _IOW('E', 0x91, int) /* Revoke device access */
-#define EVIOCGSUSPENDBLOCK _IOR('E', 0x92, int) /* get suspend block enable */
-#define EVIOCSSUSPENDBLOCK _IOW('E', 0x92, int) /* set suspend block enable */
+#ifdef CONFIG_ANDROID
+# define EVIOCREVOKE _IOW('E', 0x95, int) /* Revoke device access (renumbered to avoid */
+ /* collision w/ Android's EVIOCSSUSPENDBLOCK */
+# define EVIOCGSUSPENDBLOCK _IOR('E', 0x91, int) /* get suspend block enable */
+# define EVIOCSSUSPENDBLOCK _IOW('E', 0x91, int) /* set suspend block enable */
+#else /* CONFIG_ANDROID */
+# define EVIOCREVOKE _IOW('E', 0x91, int) /* Revoke device access */
+# define EVIOCGSUSPENDBLOCK _IOR('E', 0x95, int) /* get suspend block enable */
+# define EVIOCSSUSPENDBLOCK _IOW('E', 0x95, int) /* set suspend block enable */
+#endif /* CONFIG_ANDROID */
#define EVIOCSCLOCKID _IOW('E', 0xa0, int) /* Set clockid to be used for timestamps */