ftsError.h 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181
  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. * FTS error/info kernel log reporting *
  30. * *
  31. **************************************************************************
  32. **************************************************************************
  33. */
  34. #ifndef __FTS_ERROR_H
  35. #define __FTS_ERROR_H
  36. //FIRST LEVEL ERROR CODE
  37. #define OK (int)(0x00000000)/* No ERROR*/
  38. /*allocation of memory failed*/
  39. #define ERROR_ALLOC (int)(0x80000001)
  40. #define ERROR_I2C_R (int)(0x80000002)//i2c read failed
  41. #define ERROR_I2C_W (int)(0x80000003)//i2c write failed
  42. #define ERROR_I2C_WR (int)(0x80000004)//i2c write/read failed
  43. //error during opening i2c device
  44. #define ERROR_I2C_O (int)(0x80000005)
  45. #define ERROR_OP_NOT_ALLOW (int)(0x80000006)//operation not allowed
  46. //timeout expired! exceed the max number of
  47. //retries or the max waiting time
  48. #define ERROR_TIMEOUT (int)(0x80000007)
  49. //the file that i want to open is not found
  50. #define ERROR_FILE_NOT_FOUND (int)(0x80000008)
  51. //error during parsing the file
  52. #define ERROR_FILE_PARSE (int)(0x80000009)
  53. //error during reading the file
  54. #define ERROR_FILE_READ (int)(0x8000000A)
  55. #define ERROR_LABEL_NOT_FOUND (int)(0x8000000B)//label not found
  56. //fw in the chip newer than the one in the memmh
  57. #define ERROR_FW_NO_UPDATE (int)(0x8000000C)
  58. //flash status busy or unknown
  59. #define ERROR_FLASH_UNKNOWN (int)(0x8000000D)
  60. //SECOND LEVEL ERROR CODE
  61. //unable to disable the interrupt
  62. #define ERROR_DISABLE_INTER (int)(0x80000200)
  63. //unable to activate the interrupt
  64. #define ERROR_ENABLE_INTER (int)(0x80000300)
  65. #define ERROR_READ_B2 (int)(0x80000400)//B2 command failed
  66. //unable to read an offset from memory
  67. #define ERROR_GET_OFFSET (int)(0x80000500)
  68. //unable to retrieve the data of a required frame
  69. #define ERROR_GET_FRAME_DATA (int)(0x80000600)
  70. //FW answers with an event that has a
  71. //different address respect the request done
  72. #define ERROR_DIFF_COMP_TYPE (int)(0x80000700)
  73. //the signature of the compensation data is not A5
  74. #define ERROR_WRONG_COMP_SIGN (int)(0x80000800)
  75. //the command Sense On failed
  76. #define ERROR_SENSE_ON_FAIL (int)(0x80000900)
  77. //the command Sense Off failed
  78. #define ERROR_SENSE_OFF_FAIL (int)(0x80000A00)
  79. //the command SYSTEM RESET failed
  80. #define ERROR_SYSTEM_RESET_FAIL (int)(0x80000B00)
  81. //flash status not ready within a timeout
  82. #define ERROR_FLASH_NOT_READY (int)(0x80000C00)
  83. //unable to retrieve fw_vers or the config_id
  84. #define ERROR_FW_VER_READ (int)(0x80000D00)
  85. //unable to enable/disable the gesture
  86. #define ERROR_GESTURE_ENABLE_FAIL (int)(0x80000E00)
  87. //unable to start to add custom gesture
  88. #define ERROR_GESTURE_START_ADD (int)(0x80000F00)
  89. //unable to finish to add custom gesture
  90. #define ERROR_GESTURE_FINISH_ADD (int)(0x80001000)
  91. //unable to add custom gesture data
  92. #define ERROR_GESTURE_DATA_ADD (int)(0x80001100)
  93. //unable to remove custom gesture data
  94. #define ERROR_GESTURE_REMOVE (int)(0x80001200)
  95. //unable to enable/disable a feature mode in the IC
  96. #define ERROR_FEATURE_ENABLE_DISABLE (int)(0x80001300)
  97. //unable to set/read noise parameter in the IC
  98. #define ERROR_NOISE_PARAMETERS (int)(0x80001400)
  99. //unable to write/rewrite/read lockdown code in the IC
  100. #define ERROR_LOCKDOWN_CODE (int)(0x80001500)
  101. //THIRD LEVEL ERROR CODE
  102. //unable to retrieve the force and/or sense length
  103. #define ERROR_CH_LEN (int)(0x80010000)
  104. //compensation data request failed
  105. #define ERROR_REQU_COMP_DATA (int)(0x80020000)
  106. //unable to retrieve the compensation data header
  107. #define ERROR_COMP_DATA_HEADER (int)(0x80030000)
  108. //unable to retrieve the global compensation data
  109. #define ERROR_COMP_DATA_GLOBAL (int)(0x80040000)
  110. //unable to retrieve the compensation data for each node
  111. #define ERROR_COMP_DATA_NODE (int)(0x80050000)
  112. //check of production limits or of fw answers failed
  113. #define ERROR_TEST_CHECK_FAIL (int)(0x80060000)
  114. #define ERROR_MEMH_READ (int)(0x80070000)//memh reading failed
  115. #define ERROR_FLASH_BURN_FAILED (int)(0x80080000)//flash burn failed
  116. #define ERROR_MS_TUNING (int)(0x80090000)//ms tuning failed
  117. #define ERROR_SS_TUNING (int)(0x800A0000)//ss tuning failed
  118. //lp timer calibration failed
  119. #define ERROR_LP_TIMER_TUNING (int)(0x800B0000)
  120. //save cx data to flash failed
  121. #define ERROR_SAVE_CX_TUNING (int)(0x800C0000)
  122. //stop the poll of the FIFO if particular errors are found
  123. #define ERROR_HANDLER_STOP_PROC (int)(0x800D0000)
  124. //unable to retrieve echo event
  125. #define ERROR_CHECK_ECHO_FAIL (int)(0x800E0000)
  126. //FOURTH LEVEL ERROR CODE
  127. //production data test failed
  128. #define ERROR_PROD_TEST_DATA (int)(0x81000000)
  129. //complete flash procedure failed
  130. #define ERROR_FLASH_PROCEDURE (int)(0x82000000)
  131. //production ito test failed
  132. #define ERROR_PROD_TEST_ITO (int)(0x83000000)
  133. //production initialization test failed
  134. #define ERROR_PROD_TEST_INITIALIZATION (int)(0x84000000)
  135. //mismatch of the MS or SS tuning_version
  136. #define ERROR_GET_INIT_STATUS (int)(0x85000000)
  137. void logError(int force, const char *msg, ...);
  138. int isI2cError(int error);
  139. int dumpErrorInfo(void);
  140. int errorHandler(u8 *event, int size);
  141. #endif