qbt_handler.h 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158
  1. /* SPDX-License-Identifier: GPL-2.0-only */
  2. /*
  3. * Copyright (c) 2016-2021, The Linux Foundation. All rights reserved.
  4. * Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved.
  5. */
  6. #include <linux/types.h>
  7. #ifndef _QBT_HANDLER_H_
  8. #define _QBT_HANDLER_H_
  9. #define MAX_NAME_SIZE 32
  10. #define QBT_IS_WUHB_CONNECTED 100
  11. #define QBT_SEND_KEY_EVENT 101
  12. #define QBT_ENABLE_IPC 102
  13. #define QBT_DISABLE_IPC 103
  14. #define QBT_ENABLE_FD 104
  15. #define QBT_DISABLE_FD 105
  16. #define QBT_CONFIGURE_TOUCH_FD 106
  17. #define QBT_ACQUIRE_WAKELOCK 107
  18. #define QBT_RELEASE_WAKELOCK 108
  19. #define QBT_GET_TOUCH_FD_VERSION 109
  20. #define QBT_CONFIGURE_TOUCH_FD_V2 110
  21. #define QBT_INTR2_TEST 111
  22. #define QBT_CONFIGURE_TOUCH_FD_V3 112
  23. /*
  24. * enum qbt_finger_events -
  25. * enumeration of qbt finger events
  26. * @QBT_EVENT_FINGER_UP - finger up detected
  27. * @QBT_EVENT_FINGER_DOWN - finger down detected
  28. * @QBT_EVENT_FINGER_MOVE - finger move detected
  29. */
  30. enum qbt_finger_events {
  31. QBT_EVENT_FINGER_UP,
  32. QBT_EVENT_FINGER_DOWN,
  33. QBT_EVENT_FINGER_MOVE
  34. };
  35. /*
  36. * enum qbt_fw_event -
  37. * enumeration of firmware events
  38. * @FW_EVENT_FINGER_DOWN - finger down detected
  39. * @FW_EVENT_FINGER_UP - finger up detected
  40. * @FW_EVENT_IPC - an IPC from the firmware is pending
  41. */
  42. enum qbt_fw_event {
  43. FW_EVENT_FINGER_DOWN = 1,
  44. FW_EVENT_FINGER_UP = 2,
  45. FW_EVENT_IPC = 3,
  46. };
  47. /*
  48. * struct qbt_wuhb_connected_status -
  49. * used to query whether WUHB INT line is connected
  50. * @is_wuhb_connected - if non-zero, WUHB INT line is connected
  51. */
  52. struct qbt_wuhb_connected_status {
  53. _Bool is_wuhb_connected;
  54. };
  55. /*
  56. * struct qbt_key_event -
  57. * used to send key event
  58. * @key - the key event to send
  59. * @value - value of the key event
  60. */
  61. struct qbt_key_event {
  62. int key;
  63. int value;
  64. };
  65. /*
  66. * struct qbt_touch_config -
  67. * used to configure touch finger detect
  68. * @rad_filter_enable - flag to enable/disable radius based filtering
  69. * @rad_x: movement radius in x direction
  70. * @rad_y: movement radius in y direction
  71. */
  72. struct qbt_touch_config {
  73. _Bool rad_filter_enable;
  74. int rad_x;
  75. int rad_y;
  76. };
  77. /*
  78. * struct qbt_touch_fd_version -
  79. * used to get touch finger detect version
  80. * @version: version number
  81. */
  82. struct qbt_touch_fd_version {
  83. int version;
  84. };
  85. /*
  86. * struct qbt_touch_config_v2 -
  87. * used to configure touch finger detect
  88. * @version - touch FD version
  89. * @touch_fd_enable - flag to enable/disable touch finger detect
  90. * @rad_filter_enable - flag to enable/disable radius based filtering
  91. * @left - x-coordinate of top left corner of AOI
  92. * @top - y-coordinate of top left corner of AOI
  93. * @right - x-coordinate of bottom right corner of AOI
  94. * @bottom - y--coordinate of bottom right corner of AOI
  95. * @rad_x: movement radius in x direction
  96. * @rad_y: movement radius in y direction
  97. */
  98. struct qbt_touch_config_v2 {
  99. struct qbt_touch_fd_version version;
  100. _Bool touch_fd_enable;
  101. _Bool rad_filter_enable;
  102. int left;
  103. int top;
  104. int right;
  105. int bottom;
  106. int rad_x;
  107. int rad_y;
  108. };
  109. /*
  110. * struct qbt_touch_config_v3 -
  111. * used to configure touch finger detect
  112. * @version - touch FD version
  113. * @touch_fd_enable - flag to enable/disable touch finger detect
  114. * @rad_filter_enable - flag to enable/disable radius based filtering
  115. * @left - x-coordinate of top left corner of AOI
  116. * @top - y-coordinate of top left corner of AOI
  117. * @right - x-coordinate of bottom right corner of AOI
  118. * @bottom - y--coordinate of bottom right corner of AOI
  119. * @rad_x: movement radius in x direction
  120. * @rad_y: movement radius in y direction
  121. * @intr2_enable - flag to enable/disable intr2
  122. */
  123. struct qbt_touch_config_v3 {
  124. struct qbt_touch_fd_version version;
  125. _Bool touch_fd_enable;
  126. _Bool rad_filter_enable;
  127. int left;
  128. int top;
  129. int right;
  130. int bottom;
  131. int rad_x;
  132. int rad_y;
  133. _Bool intr2_enable;
  134. };
  135. /*
  136. * struct qbt_intr2_test -
  137. * used for INTR2 factory test
  138. * @state: state to toggle INTR2 pin
  139. */
  140. struct qbt_intr2_test {
  141. __s32 state;
  142. };
  143. #endif /* _QBT_HANDLER_H_ */