fimc-is-errno.c 9.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272
  1. /*
  2. * Samsung Exynos4 SoC series FIMC-IS slave interface driver
  3. *
  4. * Error log interface functions
  5. *
  6. * Copyright (C) 2011 - 2013 Samsung Electronics Co., Ltd.
  7. *
  8. * Authors: Younghwan Joo <yhwan.joo@samsung.com>
  9. * Sylwester Nawrocki <s.nawrocki@samsung.com>
  10. *
  11. * This program is free software; you can redistribute it and/or modify
  12. * it under the terms of the GNU General Public License version 2 as
  13. * published by the Free Software Foundation.
  14. */
  15. #include "fimc-is-errno.h"
  16. const char *fimc_is_param_strerr(unsigned int error)
  17. {
  18. switch (error) {
  19. case ERROR_COMMON_CMD:
  20. return "ERROR_COMMON_CMD: Invalid Command";
  21. case ERROR_COMMON_PARAMETER:
  22. return "ERROR_COMMON_PARAMETER: Invalid Parameter";
  23. case ERROR_COMMON_SETFILE_LOAD:
  24. return "ERROR_COMMON_SETFILE_LOAD: Illegal Setfile Loading";
  25. case ERROR_COMMON_SETFILE_ADJUST:
  26. return "ERROR_COMMON_SETFILE_ADJUST: Setfile isn't adjusted";
  27. case ERROR_COMMON_SETFILE_INDEX:
  28. return "ERROR_COMMON_SETFILE_INDEX: Invalid setfile index";
  29. case ERROR_COMMON_INPUT_PATH:
  30. return "ERROR_COMMON_INPUT_PATH: Input path can be changed in ready state";
  31. case ERROR_COMMON_INPUT_INIT:
  32. return "ERROR_COMMON_INPUT_INIT: IP can not start if input path is not set";
  33. case ERROR_COMMON_OUTPUT_PATH:
  34. return "ERROR_COMMON_OUTPUT_PATH: Output path can be changed in ready state (stop)";
  35. case ERROR_COMMON_OUTPUT_INIT:
  36. return "ERROR_COMMON_OUTPUT_INIT: IP can not start if output path is not set";
  37. case ERROR_CONTROL_BYPASS:
  38. return "ERROR_CONTROL_BYPASS";
  39. case ERROR_OTF_INPUT_FORMAT:
  40. return "ERROR_OTF_INPUT_FORMAT: Invalid format (DRC: YUV444, FD: YUV444, 422, 420)";
  41. case ERROR_OTF_INPUT_WIDTH:
  42. return "ERROR_OTF_INPUT_WIDTH: Invalid width (DRC: 128~8192, FD: 32~8190)";
  43. case ERROR_OTF_INPUT_HEIGHT:
  44. return "ERROR_OTF_INPUT_HEIGHT: Invalid bit-width (DRC: 8~12bits, FD: 8bit)";
  45. case ERROR_OTF_INPUT_BIT_WIDTH:
  46. return "ERROR_OTF_INPUT_BIT_WIDTH: Invalid bit-width (DRC: 8~12bits, FD: 8bit)";
  47. case ERROR_DMA_INPUT_WIDTH:
  48. return "ERROR_DMA_INPUT_WIDTH: Invalid width (DRC: 128~8192, FD: 32~8190)";
  49. case ERROR_DMA_INPUT_HEIGHT:
  50. return "ERROR_DMA_INPUT_HEIGHT: Invalid height (DRC: 64~8192, FD: 16~8190)";
  51. case ERROR_DMA_INPUT_FORMAT:
  52. return "ERROR_DMA_INPUT_FORMAT: Invalid format (DRC: YUV444 or YUV422, FD: YUV444,422,420)";
  53. case ERROR_DMA_INPUT_BIT_WIDTH:
  54. return "ERROR_DMA_INPUT_BIT_WIDTH: Invalid bit-width (DRC: 8~12bits, FD: 8bit)";
  55. case ERROR_DMA_INPUT_ORDER:
  56. return "ERROR_DMA_INPUT_ORDER: Invalid order(DRC: YYCbCr,YCbYCr,FD:NO,YYCbCr,YCbYCr,CbCr,CrCb)";
  57. case ERROR_DMA_INPUT_PLANE:
  58. return "ERROR_DMA_INPUT_PLANE: Invalid palne (DRC: 3, FD: 1, 2, 3)";
  59. case ERROR_OTF_OUTPUT_WIDTH:
  60. return "ERROR_OTF_OUTPUT_WIDTH: Invalid width (DRC: 128~8192)";
  61. case ERROR_OTF_OUTPUT_HEIGHT:
  62. return "ERROR_OTF_OUTPUT_HEIGHT: Invalid height (DRC: 64~8192)";
  63. case ERROR_OTF_OUTPUT_FORMAT:
  64. return "ERROR_OTF_OUTPUT_FORMAT: Invalid format (DRC: YUV444)";
  65. case ERROR_OTF_OUTPUT_BIT_WIDTH:
  66. return "ERROR_OTF_OUTPUT_BIT_WIDTH: Invalid bit-width (DRC: 8~12bits, FD: 8bit)";
  67. case ERROR_DMA_OUTPUT_WIDTH:
  68. return "ERROR_DMA_OUTPUT_WIDTH";
  69. case ERROR_DMA_OUTPUT_HEIGHT:
  70. return "ERROR_DMA_OUTPUT_HEIGHT";
  71. case ERROR_DMA_OUTPUT_FORMAT:
  72. return "ERROR_DMA_OUTPUT_FORMAT";
  73. case ERROR_DMA_OUTPUT_BIT_WIDTH:
  74. return "ERROR_DMA_OUTPUT_BIT_WIDTH";
  75. case ERROR_DMA_OUTPUT_PLANE:
  76. return "ERROR_DMA_OUTPUT_PLANE";
  77. case ERROR_DMA_OUTPUT_ORDER:
  78. return "ERROR_DMA_OUTPUT_ORDER";
  79. /* Sensor Error(100~199) */
  80. case ERROR_SENSOR_I2C_FAIL:
  81. return "ERROR_SENSOR_I2C_FAIL";
  82. case ERROR_SENSOR_INVALID_FRAMERATE:
  83. return "ERROR_SENSOR_INVALID_FRAMERATE";
  84. case ERROR_SENSOR_INVALID_EXPOSURETIME:
  85. return "ERROR_SENSOR_INVALID_EXPOSURETIME";
  86. case ERROR_SENSOR_INVALID_SIZE:
  87. return "ERROR_SENSOR_INVALID_SIZE";
  88. case ERROR_SENSOR_INVALID_SETTING:
  89. return "ERROR_SENSOR_INVALID_SETTING";
  90. case ERROR_SENSOR_ACTURATOR_INIT_FAIL:
  91. return "ERROR_SENSOR_ACTURATOR_INIT_FAIL";
  92. case ERROR_SENSOR_INVALID_AF_POS:
  93. return "ERROR_SENSOR_INVALID_AF_POS";
  94. case ERROR_SENSOR_UNSUPPORT_FUNC:
  95. return "ERROR_SENSOR_UNSUPPORT_FUNC";
  96. case ERROR_SENSOR_UNSUPPORT_PERI:
  97. return "ERROR_SENSOR_UNSUPPORT_PERI";
  98. case ERROR_SENSOR_UNSUPPORT_AF:
  99. return "ERROR_SENSOR_UNSUPPORT_AF";
  100. /* ISP Error (200~299) */
  101. case ERROR_ISP_AF_BUSY:
  102. return "ERROR_ISP_AF_BUSY";
  103. case ERROR_ISP_AF_INVALID_COMMAND:
  104. return "ERROR_ISP_AF_INVALID_COMMAND";
  105. case ERROR_ISP_AF_INVALID_MODE:
  106. return "ERROR_ISP_AF_INVALID_MODE";
  107. /* DRC Error (300~399) */
  108. /* FD Error (400~499) */
  109. case ERROR_FD_CONFIG_MAX_NUMBER_STATE:
  110. return "ERROR_FD_CONFIG_MAX_NUMBER_STATE";
  111. case ERROR_FD_CONFIG_MAX_NUMBER_INVALID:
  112. return "ERROR_FD_CONFIG_MAX_NUMBER_INVALID";
  113. case ERROR_FD_CONFIG_YAW_ANGLE_STATE:
  114. return "ERROR_FD_CONFIG_YAW_ANGLE_STATE";
  115. case ERROR_FD_CONFIG_YAW_ANGLE_INVALID:
  116. return "ERROR_FD_CONFIG_YAW_ANGLE_INVALID\n";
  117. case ERROR_FD_CONFIG_ROLL_ANGLE_STATE:
  118. return "ERROR_FD_CONFIG_ROLL_ANGLE_STATE";
  119. case ERROR_FD_CONFIG_ROLL_ANGLE_INVALID:
  120. return "ERROR_FD_CONFIG_ROLL_ANGLE_INVALID";
  121. case ERROR_FD_CONFIG_SMILE_MODE_INVALID:
  122. return "ERROR_FD_CONFIG_SMILE_MODE_INVALID";
  123. case ERROR_FD_CONFIG_BLINK_MODE_INVALID:
  124. return "ERROR_FD_CONFIG_BLINK_MODE_INVALID";
  125. case ERROR_FD_CONFIG_EYES_DETECT_INVALID:
  126. return "ERROR_FD_CONFIG_EYES_DETECT_INVALID";
  127. case ERROR_FD_CONFIG_MOUTH_DETECT_INVALID:
  128. return "ERROR_FD_CONFIG_MOUTH_DETECT_INVALID";
  129. case ERROR_FD_CONFIG_ORIENTATION_STATE:
  130. return "ERROR_FD_CONFIG_ORIENTATION_STATE";
  131. case ERROR_FD_CONFIG_ORIENTATION_INVALID:
  132. return "ERROR_FD_CONFIG_ORIENTATION_INVALID";
  133. case ERROR_FD_CONFIG_ORIENTATION_VALUE_INVALID:
  134. return "ERROR_FD_CONFIG_ORIENTATION_VALUE_INVALID";
  135. case ERROR_FD_RESULT:
  136. return "ERROR_FD_RESULT";
  137. case ERROR_FD_MODE:
  138. return "ERROR_FD_MODE";
  139. default:
  140. return "Unknown";
  141. }
  142. }
  143. const char *fimc_is_strerr(unsigned int error)
  144. {
  145. error &= ~IS_ERROR_TIME_OUT_FLAG;
  146. switch (error) {
  147. /* General */
  148. case IS_ERROR_INVALID_COMMAND:
  149. return "IS_ERROR_INVALID_COMMAND";
  150. case IS_ERROR_REQUEST_FAIL:
  151. return "IS_ERROR_REQUEST_FAIL";
  152. case IS_ERROR_INVALID_SCENARIO:
  153. return "IS_ERROR_INVALID_SCENARIO";
  154. case IS_ERROR_INVALID_SENSORID:
  155. return "IS_ERROR_INVALID_SENSORID";
  156. case IS_ERROR_INVALID_MODE_CHANGE:
  157. return "IS_ERROR_INVALID_MODE_CHANGE";
  158. case IS_ERROR_INVALID_MAGIC_NUMBER:
  159. return "IS_ERROR_INVALID_MAGIC_NUMBER";
  160. case IS_ERROR_INVALID_SETFILE_HDR:
  161. return "IS_ERROR_INVALID_SETFILE_HDR";
  162. case IS_ERROR_BUSY:
  163. return "IS_ERROR_BUSY";
  164. case IS_ERROR_SET_PARAMETER:
  165. return "IS_ERROR_SET_PARAMETER";
  166. case IS_ERROR_INVALID_PATH:
  167. return "IS_ERROR_INVALID_PATH";
  168. case IS_ERROR_OPEN_SENSOR_FAIL:
  169. return "IS_ERROR_OPEN_SENSOR_FAIL";
  170. case IS_ERROR_ENTRY_MSG_THREAD_DOWN:
  171. return "IS_ERROR_ENTRY_MSG_THREAD_DOWN";
  172. case IS_ERROR_ISP_FRAME_END_NOT_DONE:
  173. return "IS_ERROR_ISP_FRAME_END_NOT_DONE";
  174. case IS_ERROR_DRC_FRAME_END_NOT_DONE:
  175. return "IS_ERROR_DRC_FRAME_END_NOT_DONE";
  176. case IS_ERROR_SCALERC_FRAME_END_NOT_DONE:
  177. return "IS_ERROR_SCALERC_FRAME_END_NOT_DONE";
  178. case IS_ERROR_ODC_FRAME_END_NOT_DONE:
  179. return "IS_ERROR_ODC_FRAME_END_NOT_DONE";
  180. case IS_ERROR_DIS_FRAME_END_NOT_DONE:
  181. return "IS_ERROR_DIS_FRAME_END_NOT_DONE";
  182. case IS_ERROR_TDNR_FRAME_END_NOT_DONE:
  183. return "IS_ERROR_TDNR_FRAME_END_NOT_DONE";
  184. case IS_ERROR_SCALERP_FRAME_END_NOT_DONE:
  185. return "IS_ERROR_SCALERP_FRAME_END_NOT_DONE";
  186. case IS_ERROR_WAIT_STREAM_OFF_NOT_DONE:
  187. return "IS_ERROR_WAIT_STREAM_OFF_NOT_DONE";
  188. case IS_ERROR_NO_MSG_IS_RECEIVED:
  189. return "IS_ERROR_NO_MSG_IS_RECEIVED";
  190. case IS_ERROR_SENSOR_MSG_FAIL:
  191. return "IS_ERROR_SENSOR_MSG_FAIL";
  192. case IS_ERROR_ISP_MSG_FAIL:
  193. return "IS_ERROR_ISP_MSG_FAIL";
  194. case IS_ERROR_DRC_MSG_FAIL:
  195. return "IS_ERROR_DRC_MSG_FAIL";
  196. case IS_ERROR_LHFD_MSG_FAIL:
  197. return "IS_ERROR_LHFD_MSG_FAIL";
  198. case IS_ERROR_UNKNOWN:
  199. return "IS_ERROR_UNKNOWN";
  200. /* Sensor */
  201. case IS_ERROR_SENSOR_PWRDN_FAIL:
  202. return "IS_ERROR_SENSOR_PWRDN_FAIL";
  203. /* ISP */
  204. case IS_ERROR_ISP_PWRDN_FAIL:
  205. return "IS_ERROR_ISP_PWRDN_FAIL";
  206. case IS_ERROR_ISP_MULTIPLE_INPUT:
  207. return "IS_ERROR_ISP_MULTIPLE_INPUT";
  208. case IS_ERROR_ISP_ABSENT_INPUT:
  209. return "IS_ERROR_ISP_ABSENT_INPUT";
  210. case IS_ERROR_ISP_ABSENT_OUTPUT:
  211. return "IS_ERROR_ISP_ABSENT_OUTPUT";
  212. case IS_ERROR_ISP_NONADJACENT_OUTPUT:
  213. return "IS_ERROR_ISP_NONADJACENT_OUTPUT";
  214. case IS_ERROR_ISP_FORMAT_MISMATCH:
  215. return "IS_ERROR_ISP_FORMAT_MISMATCH";
  216. case IS_ERROR_ISP_WIDTH_MISMATCH:
  217. return "IS_ERROR_ISP_WIDTH_MISMATCH";
  218. case IS_ERROR_ISP_HEIGHT_MISMATCH:
  219. return "IS_ERROR_ISP_HEIGHT_MISMATCH";
  220. case IS_ERROR_ISP_BITWIDTH_MISMATCH:
  221. return "IS_ERROR_ISP_BITWIDTH_MISMATCH";
  222. case IS_ERROR_ISP_FRAME_END_TIME_OUT:
  223. return "IS_ERROR_ISP_FRAME_END_TIME_OUT";
  224. /* DRC */
  225. case IS_ERROR_DRC_PWRDN_FAIL:
  226. return "IS_ERROR_DRC_PWRDN_FAIL";
  227. case IS_ERROR_DRC_MULTIPLE_INPUT:
  228. return "IS_ERROR_DRC_MULTIPLE_INPUT";
  229. case IS_ERROR_DRC_ABSENT_INPUT:
  230. return "IS_ERROR_DRC_ABSENT_INPUT";
  231. case IS_ERROR_DRC_NONADJACENT_INPUT:
  232. return "IS_ERROR_DRC_NONADJACENT_INPUT";
  233. case IS_ERROR_DRC_ABSENT_OUTPUT:
  234. return "IS_ERROR_DRC_ABSENT_OUTPUT";
  235. case IS_ERROR_DRC_NONADJACENT_OUTPUT:
  236. return "IS_ERROR_DRC_NONADJACENT_OUTPUT";
  237. case IS_ERROR_DRC_FORMAT_MISMATCH:
  238. return "IS_ERROR_DRC_FORMAT_MISMATCH";
  239. case IS_ERROR_DRC_WIDTH_MISMATCH:
  240. return "IS_ERROR_DRC_WIDTH_MISMATCH";
  241. case IS_ERROR_DRC_HEIGHT_MISMATCH:
  242. return "IS_ERROR_DRC_HEIGHT_MISMATCH";
  243. case IS_ERROR_DRC_BITWIDTH_MISMATCH:
  244. return "IS_ERROR_DRC_BITWIDTH_MISMATCH";
  245. case IS_ERROR_DRC_FRAME_END_TIME_OUT:
  246. return "IS_ERROR_DRC_FRAME_END_TIME_OUT";
  247. /* FD */
  248. case IS_ERROR_FD_PWRDN_FAIL:
  249. return "IS_ERROR_FD_PWRDN_FAIL";
  250. case IS_ERROR_FD_MULTIPLE_INPUT:
  251. return "IS_ERROR_FD_MULTIPLE_INPUT";
  252. case IS_ERROR_FD_ABSENT_INPUT:
  253. return "IS_ERROR_FD_ABSENT_INPUT";
  254. case IS_ERROR_FD_NONADJACENT_INPUT:
  255. return "IS_ERROR_FD_NONADJACENT_INPUT";
  256. case IS_ERROR_LHFD_FRAME_END_TIME_OUT:
  257. return "IS_ERROR_LHFD_FRAME_END_TIME_OUT";
  258. default:
  259. return "Unknown";
  260. }
  261. }