1 /* SPDX-License-Identifier: GPL-2.0-only */
2 /*
3  * Samsung Exynos4 SoC series FIMC-IS slave interface driver
4  *
5  * FIMC-IS error code definition
6  *
7  * Copyright (C) 2011 - 2013 Samsung Electronics Co., Ltd.
8  *
9  * Authors: Younghwan Joo <yhwan.joo@samsung.com>
10  *          Sylwester Nawrocki <s.nawrocki@samsung.com>
11 */
12 
13 #ifndef FIMC_IS_ERR_H_
14 #define FIMC_IS_ERR_H_
15 
16 #define IS_ERROR_VER			011 /* IS ERROR VERSION 0.11 */
17 
18 enum {
19 	IS_ERROR_NONE,
20 
21 	/* General 1 ~ 99 */
22 	IS_ERROR_INVALID_COMMAND,
23 	IS_ERROR_REQUEST_FAIL,
24 	IS_ERROR_INVALID_SCENARIO,
25 	IS_ERROR_INVALID_SENSORID,
26 	IS_ERROR_INVALID_MODE_CHANGE,
27 	IS_ERROR_INVALID_MAGIC_NUMBER,
28 	IS_ERROR_INVALID_SETFILE_HDR,
29 	IS_ERROR_BUSY,
30 	IS_ERROR_SET_PARAMETER,
31 	IS_ERROR_INVALID_PATH,
32 	IS_ERROR_OPEN_SENSOR_FAIL,
33 	IS_ERROR_ENTRY_MSG_THREAD_DOWN,
34 	IS_ERROR_ISP_FRAME_END_NOT_DONE,
35 	IS_ERROR_DRC_FRAME_END_NOT_DONE,
36 	IS_ERROR_SCALERC_FRAME_END_NOT_DONE,
37 	IS_ERROR_ODC_FRAME_END_NOT_DONE,
38 	IS_ERROR_DIS_FRAME_END_NOT_DONE,
39 	IS_ERROR_TDNR_FRAME_END_NOT_DONE,
40 	IS_ERROR_SCALERP_FRAME_END_NOT_DONE,
41 	IS_ERROR_WAIT_STREAM_OFF_NOT_DONE,
42 	IS_ERROR_NO_MSG_IS_RECEIVED,
43 	IS_ERROR_SENSOR_MSG_FAIL,
44 	IS_ERROR_ISP_MSG_FAIL,
45 	IS_ERROR_DRC_MSG_FAIL,
46 	IS_ERROR_SCALERC_MSG_FAIL,
47 	IS_ERROR_ODC_MSG_FAIL,
48 	IS_ERROR_DIS_MSG_FAIL,
49 	IS_ERROR_TDNR_MSG_FAIL,
50 	IS_ERROR_SCALERP_MSG_FAIL,
51 	IS_ERROR_LHFD_MSG_FAIL,
52 	IS_ERROR_LHFD_INTERNAL_STOP,
53 
54 	/* Sensor 100 ~ 199 */
55 	IS_ERROR_SENSOR_PWRDN_FAIL	= 100,
56 	IS_ERROR_SENSOR_STREAM_ON_FAIL,
57 	IS_ERROR_SENSOR_STREAM_OFF_FAIL,
58 
59 	/* ISP 200 ~ 299 */
60 	IS_ERROR_ISP_PWRDN_FAIL		= 200,
61 	IS_ERROR_ISP_MULTIPLE_INPUT,
62 	IS_ERROR_ISP_ABSENT_INPUT,
63 	IS_ERROR_ISP_ABSENT_OUTPUT,
64 	IS_ERROR_ISP_NONADJACENT_OUTPUT,
65 	IS_ERROR_ISP_FORMAT_MISMATCH,
66 	IS_ERROR_ISP_WIDTH_MISMATCH,
67 	IS_ERROR_ISP_HEIGHT_MISMATCH,
68 	IS_ERROR_ISP_BITWIDTH_MISMATCH,
69 	IS_ERROR_ISP_FRAME_END_TIME_OUT,
70 
71 	/* DRC 300 ~ 399 */
72 	IS_ERROR_DRC_PWRDN_FAIL		= 300,
73 	IS_ERROR_DRC_MULTIPLE_INPUT,
74 	IS_ERROR_DRC_ABSENT_INPUT,
75 	IS_ERROR_DRC_NONADJACENT_INPUT,
76 	IS_ERROR_DRC_ABSENT_OUTPUT,
77 	IS_ERROR_DRC_NONADJACENT_OUTPUT,
78 	IS_ERROR_DRC_FORMAT_MISMATCH,
79 	IS_ERROR_DRC_WIDTH_MISMATCH,
80 	IS_ERROR_DRC_HEIGHT_MISMATCH,
81 	IS_ERROR_DRC_BITWIDTH_MISMATCH,
82 	IS_ERROR_DRC_FRAME_END_TIME_OUT,
83 
84 	/* SCALERC 400 ~ 499 */
85 	IS_ERROR_SCALERC_PWRDN_FAIL	= 400,
86 
87 	/* ODC 500 ~ 599 */
88 	IS_ERROR_ODC_PWRDN_FAIL		= 500,
89 
90 	/* DIS 600 ~ 699 */
91 	IS_ERROR_DIS_PWRDN_FAIL		= 600,
92 
93 	/* TDNR 700 ~ 799 */
94 	IS_ERROR_TDNR_PWRDN_FAIL	= 700,
95 
96 	/* SCALERC 800 ~ 899 */
97 	IS_ERROR_SCALERP_PWRDN_FAIL	= 800,
98 
99 	/* FD 900 ~ 999 */
100 	IS_ERROR_FD_PWRDN_FAIL		= 900,
101 	IS_ERROR_FD_MULTIPLE_INPUT,
102 	IS_ERROR_FD_ABSENT_INPUT,
103 	IS_ERROR_FD_NONADJACENT_INPUT,
104 	IS_ERROR_LHFD_FRAME_END_TIME_OUT,
105 
106 	IS_ERROR_UNKNOWN		= 1000,
107 };
108 
109 #define IS_ERROR_TIME_OUT_FLAG	0x80000000
110 
111 /* Set parameter error enum */
112 enum fimc_is_error {
113 	/* Common error (0~99) */
114 	ERROR_COMMON_NONE		= 0,
115 	ERROR_COMMON_CMD		= 1,	/* Invalid command */
116 	ERROR_COMMON_PARAMETER		= 2,	/* Invalid parameter */
117 	/* setfile is not loaded before adjusting */
118 	ERROR_COMMON_SETFILE_LOAD	= 3,
119 	/* setfile is not Adjusted before running. */
120 	ERROR_COMMON_SETFILE_ADJUST	= 4,
121 	/* Index of setfile is not valid (0~MAX_SETFILE_NUM-1) */
122 	ERROR_COMMON_SETFILE_INDEX	= 5,
123 	/* Input path can be changed in ready state(stop) */
124 	ERROR_COMMON_INPUT_PATH		= 6,
125 	/* IP can not start if input path is not set */
126 	ERROR_COMMON_INPUT_INIT		= 7,
127 	/* Output path can be changed in ready state (stop) */
128 	ERROR_COMMON_OUTPUT_PATH	= 8,
129 	/* IP can not start if output path is not set */
130 	ERROR_COMMON_OUTPUT_INIT	= 9,
131 
132 	ERROR_CONTROL_NONE		= ERROR_COMMON_NONE,
133 	ERROR_CONTROL_BYPASS		= 11,	/* Enable or Disable */
134 
135 	ERROR_OTF_INPUT_NONE		= ERROR_COMMON_NONE,
136 	ERROR_OTF_INPUT_CMD		= 21,
137 	/* invalid format  (DRC: YUV444, FD: YUV444, 422, 420) */
138 	ERROR_OTF_INPUT_FORMAT		= 22,
139 	/* invalid width (DRC: 128~8192, FD: 32~8190) */
140 	ERROR_OTF_INPUT_WIDTH		= 23,
141 	/* invalid height (DRC: 64~8192, FD: 16~8190) */
142 	ERROR_OTF_INPUT_HEIGHT		= 24,
143 	/* invalid bit-width (DRC: 8~12bits, FD: 8bit) */
144 	ERROR_OTF_INPUT_BIT_WIDTH	= 25,
145 	/* invalid FrameTime for ISP */
146 	ERROR_OTF_INPUT_USER_FRAMETIIME	= 26,
147 
148 	ERROR_DMA_INPUT_NONE		= ERROR_COMMON_NONE,
149 	/* invalid width (DRC: 128~8192, FD: 32~8190) */
150 	ERROR_DMA_INPUT_WIDTH		= 31,
151 	/* invalid height (DRC: 64~8192, FD: 16~8190) */
152 	ERROR_DMA_INPUT_HEIGHT		= 32,
153 	/* invalid format (DRC: YUV444 or YUV422, FD: YUV444, 422, 420) */
154 	ERROR_DMA_INPUT_FORMAT		= 33,
155 	/* invalid bit-width (DRC: 8~12bit, FD: 8bit) */
156 	ERROR_DMA_INPUT_BIT_WIDTH	= 34,
157 	/* invalid order(DRC: YYCbCrorYCbYCr, FD:NO,YYCbCr,YCbYCr,CbCr,CrCb) */
158 	ERROR_DMA_INPUT_ORDER		= 35,
159 	/* invalid palne (DRC: 3, FD: 1, 2, 3) */
160 	ERROR_DMA_INPUT_PLANE		= 36,
161 
162 	ERROR_OTF_OUTPUT_NONE		= ERROR_COMMON_NONE,
163 	/* invalid width (DRC: 128~8192) */
164 	ERROR_OTF_OUTPUT_WIDTH		= 41,
165 	/* invalid height (DRC: 64~8192) */
166 	ERROR_OTF_OUTPUT_HEIGHT		= 42,
167 	/* invalid format (DRC: YUV444) */
168 	ERROR_OTF_OUTPUT_FORMAT		= 43,
169 	/* invalid bit-width (DRC: 8~12bits) */
170 	ERROR_OTF_OUTPUT_BIT_WIDTH	= 44,
171 
172 	ERROR_DMA_OUTPUT_NONE		= ERROR_COMMON_NONE,
173 	ERROR_DMA_OUTPUT_WIDTH		= 51,	/* invalid width */
174 	ERROR_DMA_OUTPUT_HEIGHT		= 52,	/* invalid height */
175 	ERROR_DMA_OUTPUT_FORMAT		= 53,	/* invalid format */
176 	ERROR_DMA_OUTPUT_BIT_WIDTH	= 54,	/* invalid bit-width */
177 	ERROR_DMA_OUTPUT_PLANE		= 55,	/* invalid plane */
178 	ERROR_DMA_OUTPUT_ORDER		= 56,	/* invalid order */
179 
180 	ERROR_GLOBAL_SHOTMODE_NONE	= ERROR_COMMON_NONE,
181 
182 	/* SENSOR Error(100~199) */
183 	ERROR_SENSOR_NONE		= ERROR_COMMON_NONE,
184 	ERROR_SENSOR_I2C_FAIL		= 101,
185 	ERROR_SENSOR_INVALID_FRAMERATE,
186 	ERROR_SENSOR_INVALID_EXPOSURETIME,
187 	ERROR_SENSOR_INVALID_SIZE,
188 	ERROR_SENSOR_INVALID_SETTING,
189 	ERROR_SENSOR_ACTUATOR_INIT_FAIL,
190 	ERROR_SENSOR_INVALID_AF_POS,
191 	ERROR_SENSOR_UNSUPPORT_FUNC,
192 	ERROR_SENSOR_UNSUPPORT_PERI,
193 	ERROR_SENSOR_UNSUPPORT_AF,
194 
195 	/* ISP Error (200~299) */
196 	ERROR_ISP_AF_NONE		= ERROR_COMMON_NONE,
197 	ERROR_ISP_AF_BUSY		= 201,
198 	ERROR_ISP_AF_INVALID_COMMAND	= 202,
199 	ERROR_ISP_AF_INVALID_MODE	= 203,
200 	ERROR_ISP_FLASH_NONE		= ERROR_COMMON_NONE,
201 	ERROR_ISP_AWB_NONE		= ERROR_COMMON_NONE,
202 	ERROR_ISP_IMAGE_EFFECT_NONE	= ERROR_COMMON_NONE,
203 	ERROR_ISP_ISO_NONE		= ERROR_COMMON_NONE,
204 	ERROR_ISP_ADJUST_NONE		= ERROR_COMMON_NONE,
205 	ERROR_ISP_METERING_NONE		= ERROR_COMMON_NONE,
206 	ERROR_ISP_AFC_NONE		= ERROR_COMMON_NONE,
207 
208 	/* DRC Error (300~399) */
209 
210 	/* FD Error  (400~499) */
211 	ERROR_FD_NONE					= ERROR_COMMON_NONE,
212 	/* Invalid max number (1~16) */
213 	ERROR_FD_CONFIG_MAX_NUMBER_STATE		= 401,
214 	ERROR_FD_CONFIG_MAX_NUMBER_INVALID		= 402,
215 	ERROR_FD_CONFIG_YAW_ANGLE_STATE			= 403,
216 	ERROR_FD_CONFIG_YAW_ANGLE_INVALID		= 404,
217 	ERROR_FD_CONFIG_ROLL_ANGLE_STATE		= 405,
218 	ERROR_FD_CONFIG_ROLL_ANGLE_INVALID		= 406,
219 	ERROR_FD_CONFIG_SMILE_MODE_INVALID		= 407,
220 	ERROR_FD_CONFIG_BLINK_MODE_INVALID		= 408,
221 	ERROR_FD_CONFIG_EYES_DETECT_INVALID		= 409,
222 	ERROR_FD_CONFIG_MOUTH_DETECT_INVALID		= 410,
223 	ERROR_FD_CONFIG_ORIENTATION_STATE		= 411,
224 	ERROR_FD_CONFIG_ORIENTATION_INVALID		= 412,
225 	ERROR_FD_CONFIG_ORIENTATION_VALUE_INVALID	= 413,
226 	/* PARAM_FdResultStr can be only applied in ready-state or stream off */
227 	ERROR_FD_RESULT					= 414,
228 	/* PARAM_FdModeStr can be only applied in ready-state or stream off */
229 	ERROR_FD_MODE					= 415,
230 	/* Scaler Error  (500 ~ 599) */
231 	ERROR_SCALER_NO_NONE				= ERROR_COMMON_NONE,
232 	ERROR_SCALER_DMA_OUTSEL				= 501,
233 	ERROR_SCALER_H_RATIO				= 502,
234 	ERROR_SCALER_V_RATIO				= 503,
235 
236 	ERROR_SCALER_IMAGE_EFFECT			= 510,
237 
238 	ERROR_SCALER_ROTATE				= 520,
239 	ERROR_SCALER_FLIP				= 521,
240 };
241 
242 const char *fimc_is_strerr(unsigned int error);
243 const char *fimc_is_param_strerr(unsigned int error);
244 
245 #endif /* FIMC_IS_ERR_H_ */
246