ftsSoftware.h 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191
  1. /* SPDX-License-Identifier: GPL-2.0-only */
  2. /*
  3. * FTS Capacitive touch screen controller (FingerTipS)
  4. *
  5. * Copyright (C) 2016-2019, STMicroelectronics Limited.
  6. * Authors: AMG(Analog Mems Group) <[email protected]>
  7. *
  8. *
  9. * This program is free software; you can redistribute it and/or modify it
  10. * under the terms of the GNU General Public License version 2 as published by
  11. * the Free Software Foundation.
  12. *
  13. * This program is distributed in the hope that it will be useful, but WITHOUT
  14. * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  15. * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
  16. * more details.
  17. *
  18. * You should have received a copy of the GNU General Public License along with
  19. * this program. If not, see <http://www.gnu.org/licenses/>.
  20. */
  21. /**
  22. *
  23. *************************************************************************
  24. ** STMicroelectronics **
  25. **************************************************************************
  26. ** [email protected] **
  27. **************************************************************************
  28. * *
  29. * FW related data *
  30. * *
  31. **************************************************************************
  32. **************************************************************************
  33. *
  34. */
  35. #ifndef __FTS_SOFTWARE_H
  36. #define __FTS_SOFTWARE_H
  37. #include <linux/types.h>
  38. #include "ftsHardware.h"
  39. #define ECHO_ENABLED 0x00000001
  40. //FTS FW COMMAND
  41. #define FTS_CMD_MS_MT_SENSE_OFF 0x92
  42. #define FTS_CMD_MS_MT_SENSE_ON 0x93
  43. #define FTS_CMD_SS_HOVER_OFF 0x94
  44. #define FTS_CMD_SS_HOVER_ON 0x95
  45. #define FTS_CMD_LP_TIMER_CALIB 0x97
  46. #define FTS_CMD_MS_KEY_OFF 0x9A
  47. #define FTS_CMD_MS_KEY_ON 0x9B
  48. #define FTS_CMD_MS_COMP_TUNING 0xA3
  49. #define FTS_CMD_SS_COMP_TUNING 0xA4
  50. #define FTS_CMD_FULL_INITIALIZATION 0xA5
  51. #define FTS_CMD_ITO_CHECK 0xA7
  52. #define FTS_CMD_RELEASE_INFO 0xAA
  53. #define FTS_CMD_GESTURE_MODE 0xAD
  54. #define FTS_CMD_REQU_FW_CONF 0xB2
  55. #define FTS_CMD_REQU_FRAME_DATA 0xB7
  56. #define FTS_CMD_REQU_COMP_DATA 0xB8
  57. #define FTS_CMD_WRITE_MP_FLAG 0xC0
  58. #define FTS_CMD_FEATURE_ENABLE 0xC1
  59. #define FTS_CMD_FEATURE_DISABLE 0xC2
  60. #define FTS_CMD_GESTURE_CMD 0xC3
  61. #define FTS_CMD_LOCKDOWN_CMD 0xC4
  62. #define FTS_CMD_NOISE_WRITE 0xC7
  63. #define FTS_CMD_NOISE_READ 0xC8
  64. #define FTS_CMD_LOCKDOWN_FILL 0xCA
  65. #define FTS_CMD_LOCKDOWN_WRITE 0xCB
  66. #define FTS_CMD_LOCKDOWN_READ 0xCC
  67. #define FTS_CMD_SAVE_CX_TUNING 0xFC
  68. //Event ID
  69. #define EVENTID_NO_EVENT 0x00
  70. #define EVENTID_ERROR_EVENT 0x0F
  71. #define EVENTID_CONTROL_READY 0x10
  72. #define EVENTID_FW_CONFIGURATION 0x12
  73. #define EVENTID_COMP_DATA_READ 0x13
  74. #define EVENTID_STATUS_UPDATE 0x16
  75. #define EVENTID_RELEASE_INFO 0x1C
  76. #define EVENTID_LOCKDOWN_INFO 0x1E
  77. #define EVENTID_ENTER_POINTER 0x03
  78. #define EVENTID_LEAVE_POINTER 0x04
  79. #define EVENTID_MOTION_POINTER 0x05
  80. #define EVENTID_HOVER_ENTER_POINTER 0x07
  81. #define EVENTID_HOVER_LEAVE_POINTER 0x08
  82. #define EVENTID_HOVER_MOTION_POINTER 0x09
  83. #define EVENTID_PROXIMITY_ENTER 0x0B
  84. #define EVENTID_PROXIMITY_LEAVE 0x0C
  85. #define EVENTID_KEY_STATUS 0x0E
  86. #define EVENTID_LOCKDOWN_INFO_READ 0x1E
  87. #define EVENTID_NOISE_READ 0x17
  88. #define EVENTID_NOISE_WRITE 0x18
  89. #define EVENTID_GESTURE 0x22
  90. #define EVENTID_FRAME_DATA_READ 0x25
  91. #define EVENTID_ECHO 0xEC
  92. #define EVENTID_LAST (EVENTID_FRAME_DATA_READ+1)
  93. //EVENT TYPE
  94. #define EVENT_TYPE_MS_TUNING_CMPL 0x01
  95. #define EVENT_TYPE_SS_TUNING_CMPL 0x02
  96. #define EVENT_TYPE_COMP_DATA_SAVED 0x04
  97. #define EVENT_TYPE_ITO 0x05
  98. #define EVENT_TYPE_FULL_INITIALIZATION 0x07
  99. #define EVENT_TYPE_LPTIMER_TUNING_CMPL 0x20
  100. #define EVENT_TYPE_ESD_ERROR 0x0A
  101. #define EVENT_TYPE_WATCHDOG_ERROR 0x01
  102. #define EVENT_TYPE_CHECKSUM_ERROR 0x03
  103. #define EVENT_TYPE_LOCKDOWN 0x0A
  104. #define EVENT_TYPE_LOCKDOWN_WRITE 0x08
  105. #define EVENT_TYPE_LOCKDOWN_ERROR 0x0B
  106. //CRC type
  107. #define CRC_CONFIG_SIGNATURE 0x01
  108. #define CRC_CONFIG 0x02
  109. #define CRC_CX_MEMORY 0x03
  110. // CONFIG ID INFO
  111. #define CONFIG_ID_ADDR 0x0001
  112. #define CONFIG_ID_BYTE 2
  113. //ADDRESS OFFSET IN SYSINFO
  114. #define ADDR_RAW_TOUCH 0x0000
  115. #define ADDR_FILTER_TOUCH 0x0002
  116. #define ADDR_NORM_TOUCH 0x0004
  117. #define ADDR_CALIB_TOUCH 0x0006
  118. #define ADDR_RAW_HOVER_FORCE 0x000A
  119. #define ADDR_RAW_HOVER_SENSE 0x000C
  120. #define ADDR_FILTER_HOVER_FORCE 0x000E
  121. #define ADDR_FILTER_HOVER_SENSE 0x0010
  122. #define ADDR_NORM_HOVER_FORCE 0x0012
  123. #define ADDR_NORM_HOVER_SENSE 0x0014
  124. #define ADDR_CALIB_HOVER_FORCE 0x0016
  125. #define ADDR_CALIB_HOVER_SENSE 0x0018
  126. #define ADDR_RAW_PRX_FORCE 0x001A
  127. #define ADDR_RAW_PRX_SENSE 0x001C
  128. #define ADDR_FILTER_PRX_FORCE 0x001E
  129. #define ADDR_FILTER_PRX_SENSE 0x0020
  130. #define ADDR_NORM_PRX_FORCE 0x0022
  131. #define ADDR_NORM_PRX_SENSE 0x0024
  132. #define ADDR_CALIB_PRX_FORCE 0x0026
  133. #define ADDR_CALIB_PRX_SENSE 0x0028
  134. #define ADDR_RAW_MS_KEY 0x0032
  135. #define ADDR_NORM_MS_KEY 0x0036
  136. #define ADDR_COMP_DATA 0x0050
  137. #define ADDR_FRAMEBUFFER_DATA 0x8000
  138. //ADDRESS FW REGISTER
  139. #define ADDR_SENSE_LEN 0x0014
  140. #define ADDR_FORCE_LEN 0x0015
  141. #define ADDR_MS_TUNING_VER 0x0729
  142. #define ADDR_SS_TUNING_VER 0x074E
  143. //B2 INFO
  144. #define B2_DATA_BYTES 4
  145. //number of bytes
  146. #define B2_CHUNK ((FIFO_DEPTH/2)*B2_DATA_BYTES)
  147. //FEATURES
  148. #define FEAT_GLOVE 0x00000001
  149. #define FEAT_STYLUS 0x00000002
  150. #define FEAT_COVER 0x00000004
  151. #define FEAT_CHARGER 0x00000008
  152. #define FEAT_VR 0x00000010
  153. #define FEAT_EDGE_REJECTION 0x00000020
  154. #define FEAT_CORNER_REJECTION 0x00000040
  155. #define FEAT_EDGE_PALM_REJECTION 0x00000100
  156. //TOUCH SIZE
  157. #define STYLUS_SIZE 0x01
  158. #define FINGER_SIZE 0x02
  159. #define LARGE_SIZE 0x03
  160. //C7/C8 parameters
  161. #define NOISE_PARAMETERS 0x01
  162. //MP_FLAG_VALUE
  163. #define INIT_MP 0xA5A5A501
  164. #define INIT_FIELD 0xA5A5A502
  165. //NOISE PARAMS
  166. #define NOISE_PARAMETERS_SIZE 4 //bytes
  167. //ERROR INFO
  168. #define ERROR_INFO_SIZE (20*4) // bytes
  169. #define ERROR_SIGNATURE 0xFA5005AF
  170. #define ERROR_SIGN_HEAD 0xA5
  171. #endif