summaryrefslogtreecommitdiffstats
path: root/drivers/media/platform/samsung/exynos4-is/fimc-is-errno.c
blob: 5d9f4c1cdc5ed4ded73d8214a83c4f520f4c4a50 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
// SPDX-License-Identifier: GPL-2.0-only
/*
 * Samsung Exynos4 SoC series FIMC-IS slave interface driver
 *
 * Error log interface functions
 *
 * Copyright (C) 2011 - 2013 Samsung Electronics Co., Ltd.
 *
 * Authors: Younghwan Joo <yhwan.joo@samsung.com>
 *          Sylwester Nawrocki <s.nawrocki@samsung.com>
 */

#include "fimc-is-errno.h"

const char *fimc_is_param_strerr(unsigned int error)
{
	switch (error) {
	case ERROR_COMMON_CMD:
		return "ERROR_COMMON_CMD: Invalid Command";
	case ERROR_COMMON_PARAMETER:
		return "ERROR_COMMON_PARAMETER: Invalid Parameter";
	case ERROR_COMMON_SETFILE_LOAD:
		return "ERROR_COMMON_SETFILE_LOAD: Illegal Setfile Loading";
	case ERROR_COMMON_SETFILE_ADJUST:
		return "ERROR_COMMON_SETFILE_ADJUST: Setfile isn't adjusted";
	case ERROR_COMMON_SETFILE_INDEX:
		return "ERROR_COMMON_SETFILE_INDEX: Invalid setfile index";
	case ERROR_COMMON_INPUT_PATH:
		return "ERROR_COMMON_INPUT_PATH: Input path can be changed in ready state";
	case ERROR_COMMON_INPUT_INIT:
		return "ERROR_COMMON_INPUT_INIT: IP can not start if input path is not set";
	case ERROR_COMMON_OUTPUT_PATH:
		return "ERROR_COMMON_OUTPUT_PATH: Output path can be changed in ready state (stop)";
	case ERROR_COMMON_OUTPUT_INIT:
		return "ERROR_COMMON_OUTPUT_INIT: IP can not start if output path is not set";
	case ERROR_CONTROL_BYPASS:
		return "ERROR_CONTROL_BYPASS";
	case ERROR_OTF_INPUT_FORMAT:
		return "ERROR_OTF_INPUT_FORMAT: Invalid format  (DRC: YUV444, FD: YUV444, 422, 420)";
	case ERROR_OTF_INPUT_WIDTH:
		return "ERROR_OTF_INPUT_WIDTH: Invalid width (DRC: 128~8192, FD: 32~8190)";
	case ERROR_OTF_INPUT_HEIGHT:
		return "ERROR_OTF_INPUT_HEIGHT: Invalid bit-width (DRC: 8~12bits, FD: 8bit)";
	case ERROR_OTF_INPUT_BIT_WIDTH:
		return "ERROR_OTF_INPUT_BIT_WIDTH: Invalid bit-width (DRC: 8~12bits, FD: 8bit)";
	case ERROR_DMA_INPUT_WIDTH:
		return "ERROR_DMA_INPUT_WIDTH: Invalid width (DRC: 128~8192, FD: 32~8190)";
	case ERROR_DMA_INPUT_HEIGHT:
		return "ERROR_DMA_INPUT_HEIGHT: Invalid height (DRC: 64~8192, FD: 16~8190)";
	case ERROR_DMA_INPUT_FORMAT:
		return "ERROR_DMA_INPUT_FORMAT: Invalid format (DRC: YUV444 or YUV422, FD: YUV444,422,420)";
	case ERROR_DMA_INPUT_BIT_WIDTH:
		return "ERROR_DMA_INPUT_BIT_WIDTH: Invalid bit-width (DRC: 8~12bits, FD: 8bit)";
	case ERROR_DMA_INPUT_ORDER:
		return "ERROR_DMA_INPUT_ORDER: Invalid order(DRC: YYCbCr,YCbYCr,FD:NO,YYCbCr,YCbYCr,CbCr,CrCb)";
	case ERROR_DMA_INPUT_PLANE:
		return "ERROR_DMA_INPUT_PLANE: Invalid palne (DRC: 3, FD: 1, 2, 3)";
	case ERROR_OTF_OUTPUT_WIDTH:
		return "ERROR_OTF_OUTPUT_WIDTH: Invalid width (DRC: 128~8192)";
	case ERROR_OTF_OUTPUT_HEIGHT:
		return "ERROR_OTF_OUTPUT_HEIGHT: Invalid height (DRC: 64~8192)";
	case ERROR_OTF_OUTPUT_FORMAT:
		return "ERROR_OTF_OUTPUT_FORMAT: Invalid format (DRC: YUV444)";
	case ERROR_OTF_OUTPUT_BIT_WIDTH:
		return "ERROR_OTF_OUTPUT_BIT_WIDTH: Invalid bit-width (DRC: 8~12bits, FD: 8bit)";
	case ERROR_DMA_OUTPUT_WIDTH:
		return "ERROR_DMA_OUTPUT_WIDTH";
	case ERROR_DMA_OUTPUT_HEIGHT:
		return "ERROR_DMA_OUTPUT_HEIGHT";
	case ERROR_DMA_OUTPUT_FORMAT:
		return "ERROR_DMA_OUTPUT_FORMAT";
	case ERROR_DMA_OUTPUT_BIT_WIDTH:
		return "ERROR_DMA_OUTPUT_BIT_WIDTH";
	case ERROR_DMA_OUTPUT_PLANE:
		return "ERROR_DMA_OUTPUT_PLANE";
	case ERROR_DMA_OUTPUT_ORDER:
		return "ERROR_DMA_OUTPUT_ORDER";

	/* Sensor Error(100~199) */
	case ERROR_SENSOR_I2C_FAIL:
		return "ERROR_SENSOR_I2C_FAIL";
	case ERROR_SENSOR_INVALID_FRAMERATE:
		return "ERROR_SENSOR_INVALID_FRAMERATE";
	case ERROR_SENSOR_INVALID_EXPOSURETIME:
		return "ERROR_SENSOR_INVALID_EXPOSURETIME";
	case ERROR_SENSOR_INVALID_SIZE:
		return "ERROR_SENSOR_INVALID_SIZE";
	case ERROR_SENSOR_INVALID_SETTING:
		return "ERROR_SENSOR_INVALID_SETTING";
	case ERROR_SENSOR_ACTUATOR_INIT_FAIL:
		return "ERROR_SENSOR_ACTUATOR_INIT_FAIL";
	case ERROR_SENSOR_INVALID_AF_POS:
		return "ERROR_SENSOR_INVALID_AF_POS";
	case ERROR_SENSOR_UNSUPPORT_FUNC:
		return "ERROR_SENSOR_UNSUPPORT_FUNC";
	case ERROR_SENSOR_UNSUPPORT_PERI:
		return "ERROR_SENSOR_UNSUPPORT_PERI";
	case ERROR_SENSOR_UNSUPPORT_AF:
		return "ERROR_SENSOR_UNSUPPORT_AF";

	/* ISP Error (200~299) */
	case ERROR_ISP_AF_BUSY:
		return "ERROR_ISP_AF_BUSY";
	case ERROR_ISP_AF_INVALID_COMMAND:
		return "ERROR_ISP_AF_INVALID_COMMAND";
	case ERROR_ISP_AF_INVALID_MODE:
		return "ERROR_ISP_AF_INVALID_MODE";

	/* DRC Error (300~399) */
	/* FD Error  (400~499) */
	case ERROR_FD_CONFIG_MAX_NUMBER_STATE:
		return "ERROR_FD_CONFIG_MAX_NUMBER_STATE";
	case ERROR_FD_CONFIG_MAX_NUMBER_INVALID:
		return "ERROR_FD_CONFIG_MAX_NUMBER_INVALID";
	case ERROR_FD_CONFIG_YAW_ANGLE_STATE:
		return "ERROR_FD_CONFIG_YAW_ANGLE_STATE";
	case ERROR_FD_CONFIG_YAW_ANGLE_INVALID:
		return "ERROR_FD_CONFIG_YAW_ANGLE_INVALID\n";
	case ERROR_FD_CONFIG_ROLL_ANGLE_STATE:
		return "ERROR_FD_CONFIG_ROLL_ANGLE_STATE";
	case ERROR_FD_CONFIG_ROLL_ANGLE_INVALID:
		return "ERROR_FD_CONFIG_ROLL_ANGLE_INVALID";
	case ERROR_FD_CONFIG_SMILE_MODE_INVALID:
		return "ERROR_FD_CONFIG_SMILE_MODE_INVALID";
	case ERROR_FD_CONFIG_BLINK_MODE_INVALID:
		return "ERROR_FD_CONFIG_BLINK_MODE_INVALID";
	case ERROR_FD_CONFIG_EYES_DETECT_INVALID:
		return "ERROR_FD_CONFIG_EYES_DETECT_INVALID";
	case ERROR_FD_CONFIG_MOUTH_DETECT_INVALID:
		return "ERROR_FD_CONFIG_MOUTH_DETECT_INVALID";
	case ERROR_FD_CONFIG_ORIENTATION_STATE:
		return "ERROR_FD_CONFIG_ORIENTATION_STATE";
	case ERROR_FD_CONFIG_ORIENTATION_INVALID:
		return "ERROR_FD_CONFIG_ORIENTATION_INVALID";
	case ERROR_FD_CONFIG_ORIENTATION_VALUE_INVALID:
		return "ERROR_FD_CONFIG_ORIENTATION_VALUE_INVALID";
	case ERROR_FD_RESULT:
		return "ERROR_FD_RESULT";
	case ERROR_FD_MODE:
		return "ERROR_FD_MODE";
	default:
		return "Unknown";
	}
}

const char *fimc_is_strerr(unsigned int error)
{
	error &= ~IS_ERROR_TIME_OUT_FLAG;

	switch (error) {
	/* General */
	case IS_ERROR_INVALID_COMMAND:
		return "IS_ERROR_INVALID_COMMAND";
	case IS_ERROR_REQUEST_FAIL:
		return "IS_ERROR_REQUEST_FAIL";
	case IS_ERROR_INVALID_SCENARIO:
		return "IS_ERROR_INVALID_SCENARIO";
	case IS_ERROR_INVALID_SENSORID:
		return "IS_ERROR_INVALID_SENSORID";
	case IS_ERROR_INVALID_MODE_CHANGE:
		return "IS_ERROR_INVALID_MODE_CHANGE";
	case IS_ERROR_INVALID_MAGIC_NUMBER:
		return "IS_ERROR_INVALID_MAGIC_NUMBER";
	case IS_ERROR_INVALID_SETFILE_HDR:
		return "IS_ERROR_INVALID_SETFILE_HDR";
	case IS_ERROR_BUSY:
		return "IS_ERROR_BUSY";
	case IS_ERROR_SET_PARAMETER:
		return "IS_ERROR_SET_PARAMETER";
	case IS_ERROR_INVALID_PATH:
		return "IS_ERROR_INVALID_PATH";
	case IS_ERROR_OPEN_SENSOR_FAIL:
		return "IS_ERROR_OPEN_SENSOR_FAIL";
	case IS_ERROR_ENTRY_MSG_THREAD_DOWN:
		return "IS_ERROR_ENTRY_MSG_THREAD_DOWN";
	case IS_ERROR_ISP_FRAME_END_NOT_DONE:
		return "IS_ERROR_ISP_FRAME_END_NOT_DONE";
	case IS_ERROR_DRC_FRAME_END_NOT_DONE:
		return "IS_ERROR_DRC_FRAME_END_NOT_DONE";
	case IS_ERROR_SCALERC_FRAME_END_NOT_DONE:
		return "IS_ERROR_SCALERC_FRAME_END_NOT_DONE";
	case IS_ERROR_ODC_FRAME_END_NOT_DONE:
		return "IS_ERROR_ODC_FRAME_END_NOT_DONE";
	case IS_ERROR_DIS_FRAME_END_NOT_DONE:
		return "IS_ERROR_DIS_FRAME_END_NOT_DONE";
	case IS_ERROR_TDNR_FRAME_END_NOT_DONE:
		return "IS_ERROR_TDNR_FRAME_END_NOT_DONE";
	case IS_ERROR_SCALERP_FRAME_END_NOT_DONE:
		return "IS_ERROR_SCALERP_FRAME_END_NOT_DONE";
	case IS_ERROR_WAIT_STREAM_OFF_NOT_DONE:
		return "IS_ERROR_WAIT_STREAM_OFF_NOT_DONE";
	case IS_ERROR_NO_MSG_IS_RECEIVED:
		return "IS_ERROR_NO_MSG_IS_RECEIVED";
	case IS_ERROR_SENSOR_MSG_FAIL:
		return "IS_ERROR_SENSOR_MSG_FAIL";
	case IS_ERROR_ISP_MSG_FAIL:
		return "IS_ERROR_ISP_MSG_FAIL";
	case IS_ERROR_DRC_MSG_FAIL:
		return "IS_ERROR_DRC_MSG_FAIL";
	case IS_ERROR_LHFD_MSG_FAIL:
		return "IS_ERROR_LHFD_MSG_FAIL";
	case IS_ERROR_UNKNOWN:
		return "IS_ERROR_UNKNOWN";

	/* Sensor */
	case IS_ERROR_SENSOR_PWRDN_FAIL:
		return "IS_ERROR_SENSOR_PWRDN_FAIL";

	/* ISP */
	case IS_ERROR_ISP_PWRDN_FAIL:
		return "IS_ERROR_ISP_PWRDN_FAIL";
	case IS_ERROR_ISP_MULTIPLE_INPUT:
		return "IS_ERROR_ISP_MULTIPLE_INPUT";
	case IS_ERROR_ISP_ABSENT_INPUT:
		return "IS_ERROR_ISP_ABSENT_INPUT";
	case IS_ERROR_ISP_ABSENT_OUTPUT:
		return "IS_ERROR_ISP_ABSENT_OUTPUT";
	case IS_ERROR_ISP_NONADJACENT_OUTPUT:
		return "IS_ERROR_ISP_NONADJACENT_OUTPUT";
	case IS_ERROR_ISP_FORMAT_MISMATCH:
		return "IS_ERROR_ISP_FORMAT_MISMATCH";
	case IS_ERROR_ISP_WIDTH_MISMATCH:
		return "IS_ERROR_ISP_WIDTH_MISMATCH";
	case IS_ERROR_ISP_HEIGHT_MISMATCH:
		return "IS_ERROR_ISP_HEIGHT_MISMATCH";
	case IS_ERROR_ISP_BITWIDTH_MISMATCH:
		return "IS_ERROR_ISP_BITWIDTH_MISMATCH";
	case IS_ERROR_ISP_FRAME_END_TIME_OUT:
		return "IS_ERROR_ISP_FRAME_END_TIME_OUT";

	/* DRC */
	case IS_ERROR_DRC_PWRDN_FAIL:
		return "IS_ERROR_DRC_PWRDN_FAIL";
	case IS_ERROR_DRC_MULTIPLE_INPUT:
		return "IS_ERROR_DRC_MULTIPLE_INPUT";
	case IS_ERROR_DRC_ABSENT_INPUT:
		return "IS_ERROR_DRC_ABSENT_INPUT";
	case IS_ERROR_DRC_NONADJACENT_INPUT:
		return "IS_ERROR_DRC_NONADJACENT_INPUT";
	case IS_ERROR_DRC_ABSENT_OUTPUT:
		return "IS_ERROR_DRC_ABSENT_OUTPUT";
	case IS_ERROR_DRC_NONADJACENT_OUTPUT:
		return "IS_ERROR_DRC_NONADJACENT_OUTPUT";
	case IS_ERROR_DRC_FORMAT_MISMATCH:
		return "IS_ERROR_DRC_FORMAT_MISMATCH";
	case IS_ERROR_DRC_WIDTH_MISMATCH:
		return "IS_ERROR_DRC_WIDTH_MISMATCH";
	case IS_ERROR_DRC_HEIGHT_MISMATCH:
		return "IS_ERROR_DRC_HEIGHT_MISMATCH";
	case IS_ERROR_DRC_BITWIDTH_MISMATCH:
		return "IS_ERROR_DRC_BITWIDTH_MISMATCH";
	case IS_ERROR_DRC_FRAME_END_TIME_OUT:
		return "IS_ERROR_DRC_FRAME_END_TIME_OUT";

	/* FD */
	case IS_ERROR_FD_PWRDN_FAIL:
		return "IS_ERROR_FD_PWRDN_FAIL";
	case IS_ERROR_FD_MULTIPLE_INPUT:
		return "IS_ERROR_FD_MULTIPLE_INPUT";
	case IS_ERROR_FD_ABSENT_INPUT:
		return "IS_ERROR_FD_ABSENT_INPUT";
	case IS_ERROR_FD_NONADJACENT_INPUT:
		return "IS_ERROR_FD_NONADJACENT_INPUT";
	case IS_ERROR_LHFD_FRAME_END_TIME_OUT:
		return "IS_ERROR_LHFD_FRAME_END_TIME_OUT";
	default:
		return "Unknown";
	}
}