1 #ifndef __RK_CAMERA_SENSOR_INFO_H_
2 #define __RK_CAMERA_SENSOR_INFO_H_
5 /*---------------- Camera Sensor Must Define Macro Begin ------------------------*/
6 #define RK29_CAM_SENSOR_OV7675 ov7675
7 #define RK29_CAM_SENSOR_OV9650 ov9650
8 #define RK29_CAM_SENSOR_OV2640 ov2640
9 #define RK29_CAM_SENSOR_OV2655 ov2655
10 #define RK29_CAM_SENSOR_OV2659 ov2659
11 #define RK29_CAM_SENSOR_OV7690 ov7690
12 #define RK29_CAM_SENSOR_OV3640 ov3640
13 #define RK29_CAM_SENSOR_OV3660 ov3660
14 #define RK29_CAM_SENSOR_OV5640 ov5640
15 #define RK29_CAM_SENSOR_OV5642 ov5642
16 #define RK29_CAM_SENSOR_S5K6AA s5k6aa
17 #define RK29_CAM_SENSOR_MT9D112 mt9d112
18 #define RK29_CAM_SENSOR_MT9D113 mt9d113
19 #define RK29_CAM_SENSOR_MT9P111 mt9p111
20 #define RK29_CAM_SENSOR_MT9T111 mt9t111
21 #define RK29_CAM_SENSOR_GT2005 gt2005
22 #define RK29_CAM_SENSOR_GC0307 gc0307
23 #define RK29_CAM_SENSOR_GC0308 gc0308
24 #define RK29_CAM_SENSOR_GC0309 gc0309
25 #define RK29_CAM_SENSOR_GC2015 gc2015
26 #define RK29_CAM_SENSOR_GC0328 gc0328
27 #define RK29_CAM_SENSOR_GC0329 gc0329
28 #define RK29_CAM_SENSOR_GC2035 gc2035
29 #define RK29_CAM_SENSOR_SIV120B siv120b
30 #define RK29_CAM_SENSOR_SIV121D siv121d
31 #define RK29_CAM_SENSOR_SID130B sid130B
32 #define RK29_CAM_SENSOR_HI253 hi253
33 #define RK29_CAM_SENSOR_HI704 hi704
34 #define RK29_CAM_SENSOR_NT99250 nt99250
35 #define RK29_CAM_SENSOR_SP0718 sp0718
36 #define RK29_CAM_SENSOR_SP0838 sp0838
37 #define RK29_CAM_SENSOR_SP2518 sp2518
38 #define RK29_CAM_SENSOR_S5K5CA s5k5ca
39 #define RK29_CAM_ISP_MTK9335 mtk9335isp
40 #define RK29_CAM_SENSOR_HM2057 hm2057
41 #define RK29_CAM_SENSOR_HM5065 hm5065
42 #define RK29_CAM_SENSOR_NT99160 nt99160 //oyyf@rock-chips.com
43 #define RK29_CAM_SENSOR_NT99240 nt99240 //oyyf@rock-chips.com
44 #define RK29_CAM_SENSOR_NT99252 nt99252 //oyyf@rock-chips.com
45 #define RK29_CAM_SENSOR_NT99340 nt99340 //oyyf@rock-chips.com
46 #define RK29_CAM_ISP_ICATCH7002_MI1040 icatchmi1040
47 #define RK29_CAM_ISP_ICATCH7002_OV5693 icatchov5693
48 #define RK29_CAM_ISP_ICATCH7002_OV8825 icatchov8825 //zyt
49 #define RK29_CAM_ISP_ICATCH7002_OV2720 icatchov2720 //zyt
51 #define RK29_CAM_SENSOR_NAME_OV7675 "ov7675"
52 #define RK29_CAM_SENSOR_NAME_OV9650 "ov9650"
53 #define RK29_CAM_SENSOR_NAME_OV2640 "ov2640"
54 #define RK29_CAM_SENSOR_NAME_OV2655 "ov2655"
55 #define RK29_CAM_SENSOR_NAME_OV2659 "ov2659"
56 #define RK29_CAM_SENSOR_NAME_OV7690 "ov7690"
57 #define RK29_CAM_SENSOR_NAME_OV3640 "ov3640"
58 #define RK29_CAM_SENSOR_NAME_OV3660 "ov3660"
59 #define RK29_CAM_SENSOR_NAME_OV5640 "ov5640"
60 #define RK29_CAM_SENSOR_NAME_OV5642 "ov5642"
61 #define RK29_CAM_SENSOR_NAME_S5K6AA "s5k6aa"
62 #define RK29_CAM_SENSOR_NAME_MT9D112 "mt9d112"
63 #define RK29_CAM_SENSOR_NAME_MT9D113 "mt9d113"
64 #define RK29_CAM_SENSOR_NAME_MT9P111 "mt9p111"
65 #define RK29_CAM_SENSOR_NAME_MT9T111 "mt9t111"
66 #define RK29_CAM_SENSOR_NAME_GT2005 "gt2005"
67 #define RK29_CAM_SENSOR_NAME_GC0307 "gc0307"
68 #define RK29_CAM_SENSOR_NAME_GC0308 "gc0308"
69 #define RK29_CAM_SENSOR_NAME_GC0309 "gc0309"
70 #define RK29_CAM_SENSOR_NAME_GC2015 "gc2015"
71 #define RK29_CAM_SENSOR_NAME_GC0328 "gc0328"
72 #define RK29_CAM_SENSOR_NAME_GC2035 "gc2035"
73 #define RK29_CAM_SENSOR_NAME_GC0329 "gc0329"
74 #define RK29_CAM_SENSOR_NAME_SIV120B "siv120b"
75 #define RK29_CAM_SENSOR_NAME_SIV121D "siv121d"
76 #define RK29_CAM_SENSOR_NAME_SID130B "sid130B"
77 #define RK29_CAM_SENSOR_NAME_HI253 "hi253"
78 #define RK29_CAM_SENSOR_NAME_HI704 "hi704"
79 #define RK29_CAM_SENSOR_NAME_NT99250 "nt99250"
80 #define RK29_CAM_SENSOR_NAME_SP0718 "sp0718"
81 #define RK29_CAM_SENSOR_NAME_SP0838 "sp0838"
82 #define RK29_CAM_SENSOR_NAME_SP2518 "sp2518"
83 #define RK29_CAM_SENSOR_NAME_S5K5CA "s5k5ca"
84 #define RK29_CAM_ISP_NAME_MTK9335ISP "mtk9335isp"
85 #define RK29_CAM_SENSOR_NAME_HM2057 "hm2057"
86 #define RK29_CAM_SENSOR_NAME_HM5065 "hm5065"
87 #define RK29_CAM_ISP_NAME_ICATCH7002_MI1040 "icatchmi1040"
88 #define RK29_CAM_ISP_NAME_ICATCH7002_OV5693 "icatchov5693"
89 #define RK29_CAM_ISP_NAME_ICATCH7002_OV8825 "icatchov8825" //zyt
90 #define RK29_CAM_ISP_NAME_ICATCH7002_OV2720 "icatchov2720" //zyt
92 //Sensor full resolution define
93 #define ov7675_FULL_RESOLUTION 0x30000 // 0.3 megapixel
94 #define ov9650_FULL_RESOLUTION 0x130000 // 1.3 megapixel
95 #define ov2640_FULL_RESOLUTION 0x200000 // 2 megapixel
96 #define ov2655_FULL_RESOLUTION 0x200000 // 2 megapixel
97 #define ov2659_FULL_RESOLUTION 0x200000 // 2 megapixel
99 #define ov2660_FULL_RESOLUTION 0x200000 // 2 megapixel
101 #define ov7690_FULL_RESOLUTION 0x300000 // 2 megapixel
102 #define ov3640_FULL_RESOLUTION 0x300000 // 3 megapixel
103 #define ov3660_FULL_RESOLUTION 0x300000 // 3 megapixel
104 #define ov5640_FULL_RESOLUTION 0x500000 // 5 megapixel
105 #if defined(CONFIG_SOC_CAMERA_OV5642_INTERPOLATION_8M)
106 #define ov5642_FULL_RESOLUTION 0x800000 // 8 megapixel
108 #define ov5642_FULL_RESOLUTION 0x500000 // 5 megapixel
110 #define s5k6aa_FULL_RESOLUTION 0x130000 // 1.3 megapixel
111 #define mt9d112_FULL_RESOLUTION 0x200000 // 2 megapixel
112 #define mt9d113_FULL_RESOLUTION 0x200000 // 2 megapixel
113 #define mt9t111_FULL_RESOLUTION 0x300000 // 3 megapixel
114 #define mt9p111_FULL_RESOLUTION 0x500000 // 5 megapixel
115 #define gt2005_FULL_RESOLUTION 0x200000 // 2 megapixel
116 #if defined(CONFIG_SOC_CAMERA_GC0308_INTERPOLATION_5M)
117 #define gc0308_FULL_RESOLUTION 0x500000 // 5 megapixel
118 #elif defined(CONFIG_SOC_CAMERA_GC0308_INTERPOLATION_3M)
119 #define gc0308_FULL_RESOLUTION 0x300000 // 3 megapixel
120 #elif defined(CONFIG_SOC_CAMERA_GC0308_INTERPOLATION_2M)
121 #define gc0308_FULL_RESOLUTION 0x200000 // 2 megapixel
123 #define gc0308_FULL_RESOLUTION 0x30000 // 0.3 megapixel#endif
125 #define gc0328_FULL_RESOLUTION 0x30000 // 0.3 megapixel
126 #define gc0307_FULL_RESOLUTION 0x30000 // 0.3 megapixel
127 #define gc0309_FULL_RESOLUTION 0x30000 // 0.3 megapixel
128 #define gc2015_FULL_RESOLUTION 0x200000 // 2 megapixel
129 #define siv120b_FULL_RESOLUTION 0x30000 // 0.3 megapixel
130 #define siv121d_FULL_RESOLUTION 0x30000 // 0.3 megapixel
131 #define sid130B_FULL_RESOLUTION 0x200000 // 2 megapixel
133 #if defined(CONFIG_SOC_CAMERA_HI253_INTERPOLATION_5M)
134 #define hi253_FULL_RESOLUTION 0x500000 // 5 megapixel
135 #elif defined(CONFIG_SOC_CAMERA_HI253_INTERPOLATION_3M)
136 #define hi253_FULL_RESOLUTION 0x300000 // 3 megapixel
138 #define hi253_FULL_RESOLUTION 0x200000 // 2 megapixel
141 #define hi704_FULL_RESOLUTION 0x30000 // 0.3 megapixel
142 #define nt99250_FULL_RESOLUTION 0x200000 // 2 megapixel
143 #define sp0718_FULL_RESOLUTION 0x30000 // 0.3 megapixel
144 #define sp0838_FULL_RESOLUTION 0x30000 // 0.3 megapixel
145 #define sp2518_FULL_RESOLUTION 0x200000 // 2 megapixel
146 #define gc0329_FULL_RESOLUTION 0x30000 // 0.3 megapixel
147 #define s5k5ca_FULL_RESOLUTION 0x300000 // 3 megapixel
148 #define mtk9335isp_FULL_RESOLUTION 0x500000 //5 megapixel
149 #define gc2035_FULL_RESOLUTION 0x200000 // 2 megapixel
150 #define hm2057_FULL_RESOLUTION 0x200000 // 2 megapixel
151 #define hm5065_FULL_RESOLUTION 0x500000 // 5 megapixel
152 #define nt99160_FULL_RESOLUTION 0x100000 // oyyf@rock-chips.com: 1 megapixel 1280*720
153 #define nt99240_FULL_RESOLUTION 0x200000 // oyyf@rock-chips.com: 2 megapixel 1600*1200
154 #define nt99252_FULL_RESOLUTION 0x200000 // oyyf@rock-chips.com: 2 megapixel 1600*1200
155 #define nt99340_FULL_RESOLUTION 0x300000 // oyyf@rock-chips.com: 3 megapixel 2048*1536
156 #define icatchmi1040_FULL_RESOLUTION 0x200000
157 #define icatchov5693_FULL_RESOLUTION 0x500000
158 #define icatchov8825_FULL_RESOLUTION 0x800000 //zyt
159 #define icatchov2720_FULL_RESOLUTION 0x210000 //zyt
160 #define end_FULL_RESOLUTION 0x00
162 //Sensor i2c addr define
163 #define ov7675_I2C_ADDR 0x78
164 #define ov9650_I2C_ADDR 0x60
165 #define ov2640_I2C_ADDR 0x60
166 #define ov2655_I2C_ADDR 0x60
167 #define ov2659_I2C_ADDR 0x60
168 #define ov7690_I2C_ADDR 0x42
169 #define ov3640_I2C_ADDR 0x78
170 #define ov3660_I2C_ADDR 0x78
171 #define ov5640_I2C_ADDR 0x78
172 #define ov5642_I2C_ADDR 0x78
174 #define s5k6aa_I2C_ADDR 0x78 //0x5a
175 #define s5k5ca_I2C_ADDR 0x78 //0x5a
177 #define mt9d112_I2C_ADDR 0x78
178 #define mt9d113_I2C_ADDR 0x78
179 #define mt9t111_I2C_ADDR 0x78 // 0x7a
181 #define mt9p111_I2C_ADDR 0x78 //0x7a
182 #define gt2005_I2C_ADDR 0x78
183 #define gc0307_I2C_ADDR 0x42
184 #define gc0328_I2C_ADDR 0x42
185 #define gc0308_I2C_ADDR 0x42
186 #define gc0309_I2C_ADDR 0x42
187 #define gc0329_I2C_ADDR 0x62
188 #define gc2015_I2C_ADDR 0x60
189 #define gc2035_I2C_ADDR 0x78
191 #define siv120b_I2C_ADDR INVALID_VALUE
192 #define siv121d_I2C_ADDR INVALID_VALUE
193 #define sid130B_I2C_ADDR 0x37
195 #define hi253_I2C_ADDR 0x40
196 #define hi704_I2C_ADDR 0x60
198 #define nt99160_I2C_ADDR 0x54
199 #define nt99240_I2C_ADDR 0x6c
200 #define nt99250_I2C_ADDR 0x6c
201 #define nt99252_I2C_ADDR 0x6c
202 #define nt99340_I2C_ADDR 0x76
204 #define sp0718_I2C_ADDR 0x42
205 #define sp0838_I2C_ADDR 0x30
206 #define sp0a19_I2C_ADDR 0x7a
207 #define sp1628_I2C_ADDR 0x78
208 #define sp2518_I2C_ADDR 0x60
209 #define mtk9335isp_I2C_ADDR 0x50
210 #define hm2057_I2C_ADDR 0x48
211 #define hm5065_I2C_ADDR 0x3e
212 #define icatchmi1040_I2C_ADDR 0x78
213 #define icatchov5693_I2C_ADDR 0x78
214 #define icatchov8825_I2C_ADDR 0x78 //zyt
215 #define icatchov2720_I2C_ADDR 0x78 //zyt
216 #define end_I2C_ADDR INVALID_VALUE
218 //Sensor power active level define
219 #define PWR_ACTIVE_HIGH 0x01
220 #define PWR_ACTIVE_LOW 0x0
222 //Sensor power down active level define
223 #define ov7675_PWRDN_ACTIVE 0x01
224 #define ov9650_PWRDN_ACTIVE 0x01
225 #define ov2640_PWRDN_ACTIVE 0x01
226 #define ov2655_PWRDN_ACTIVE 0x01
227 #define ov2659_PWRDN_ACTIVE 0x01
228 #define ov7690_PWRDN_ACTIVE 0x01
229 #define ov3640_PWRDN_ACTIVE 0x01
230 #define ov3660_PWRDN_ACTIVE 0x01
231 #define ov5640_PWRDN_ACTIVE 0x01
232 #define ov5642_PWRDN_ACTIVE 0x01
234 #define s5k6aa_PWRDN_ACTIVE 0x00
235 #define s5k5ca_PWRDN_ACTIVE 0x00
237 #define mt9d112_PWRDN_ACTIVE 0x01
238 #define mt9d113_PWRDN_ACTIVE 0x01
239 #define mt9t111_PWRDN_ACTIVE 0x01
240 #define mt9p111_PWRDN_ACTIVE 0x01
242 #define gt2005_PWRDN_ACTIVE 0x00
243 #define gc0307_PWRDN_ACTIVE 0x01
244 #define gc0308_PWRDN_ACTIVE 0x01
245 #define gc0328_PWRDN_ACTIVE 0x01
246 #define gc0309_PWRDN_ACTIVE 0x01
247 #define gc0329_PWRDN_ACTIVE 0x01
248 #define gc2015_PWRDN_ACTIVE 0x01
249 #define gc2035_PWRDN_ACTIVE 0x01
251 #define siv120b_PWRDN_ACTIVE INVALID_VALUE
252 #define siv121d_PWRDN_ACTIVE INVALID_VALUE
253 #define sid130B_PWRDN_ACTIVE 0x37
255 #define hi253_PWRDN_ACTIVE 0x01
256 #define hi704_PWRDN_ACTIVE 0x01
258 #define nt99160_PWRDN_ACTIVE 0x01
259 #define nt99240_PWRDN_ACTIVE 0x01
260 #define nt99250_PWRDN_ACTIVE 0x01
261 #define nt99252_PWRDN_ACTIVE 0x01
262 #define nt99340_PWRDN_ACTIVE 0x01
264 #define sp0718_PWRDN_ACTIVE 0x01
265 #define sp0838_PWRDN_ACTIVE 0x01
266 #define sp0a19_PWRDN_ACTIVE 0x01
267 #define sp1628_PWRDN_ACTIVE 0x01
268 #define sp2518_PWRDN_ACTIVE 0x01
269 #define hm2057_PWRDN_ACTIVE 0x01
270 #define hm5065_PWRDN_ACTIVE 0x00
271 #define mtk9335isp_PWRDN_ACTIVE 0x01
272 #define end_PWRDN_ACTIVE INVALID_VALUE
275 //Sensor power up sequence define
277 #define SENSOR_PWRSEQ_BEGIN 0x00
278 #define SENSOR_PWRSEQ_AVDD 0x01
279 #define SENSOR_PWRSEQ_DOVDD 0x02
280 #define SENSOR_PWRSEQ_DVDD 0x03
281 #define SENSOR_PWRSEQ_PWR 0x04
282 #define SENSOR_PWRSEQ_HWRST 0x05
283 #define SENSOR_PWRSEQ_PWRDN 0x06
284 #define SENSOR_PWRSEQ_CLKIN 0x07
285 #define SENSOR_PWRSEQ_END 0x0F
287 #define SENSOR_PWRSEQ_SET(type,idx) (type<<(idx*4))
288 #define SENSOR_PWRSEQ_GET(seq,idx) ((seq>>(idx*4))&0x0f)
290 #define sensor_PWRSEQ_DEFAULT (SENSOR_PWRSEQ_SET(SENSOR_PWRSEQ_PWR,0)|\
291 SENSOR_PWRSEQ_SET(SENSOR_PWRSEQ_HWRST,1)|\
292 SENSOR_PWRSEQ_SET(SENSOR_PWRSEQ_PWRDN,2)|\
293 SENSOR_PWRSEQ_SET(SENSOR_PWRSEQ_CLKIN,3))
295 #define ov7675_PWRSEQ sensor_PWRSEQ_DEFAULT
296 #define ov9650_PWRSEQ sensor_PWRSEQ_DEFAULT
297 #define ov2640_PWRSEQ sensor_PWRSEQ_DEFAULT
298 #define ov2655_PWRSEQ sensor_PWRSEQ_DEFAULT
299 #define ov2659_PWRSEQ sensor_PWRSEQ_DEFAULT
300 #define ov7690_PWRSEQ sensor_PWRSEQ_DEFAULT
301 #define ov3640_PWRSEQ sensor_PWRSEQ_DEFAULT
302 #define ov3660_PWRSEQ sensor_PWRSEQ_DEFAULT
303 #define ov5640_PWRSEQ sensor_PWRSEQ_DEFAULT
304 #define ov5642_PWRSEQ sensor_PWRSEQ_DEFAULT
306 #define s5k6aa_PWRSEQ sensor_PWRSEQ_DEFAULT
307 #define s5k5ca_PWRSEQ sensor_PWRSEQ_DEFAULT
309 #define mt9d112_PWRSEQ sensor_PWRSEQ_DEFAULT
310 #define mt9d113_PWRSEQ sensor_PWRSEQ_DEFAULT
311 #define mt9t111_PWRSEQ sensor_PWRSEQ_DEFAULT
312 #define mt9p111_PWRSEQ sensor_PWRSEQ_DEFAULT
314 #define gt2005_PWRSEQ sensor_PWRSEQ_DEFAULT
315 #define gc0307_PWRSEQ sensor_PWRSEQ_DEFAULT
316 #define gc0308_PWRSEQ sensor_PWRSEQ_DEFAULT
317 #define gc0328_PWRSEQ sensor_PWRSEQ_DEFAULT
318 #define gc0309_PWRSEQ sensor_PWRSEQ_DEFAULT
319 #define gc0329_PWRSEQ sensor_PWRSEQ_DEFAULT
320 #define gc2015_PWRSEQ sensor_PWRSEQ_DEFAULT
321 #define gc2035_PWRSEQ sensor_PWRSEQ_DEFAULT
323 #define siv120b_PWRSEQ sensor_PWRSEQ_DEFAULT
324 #define siv121d_PWRSEQ sensor_PWRSEQ_DEFAULT
325 #define sid130B_PWRSEQ sensor_PWRSEQ_DEFAULT
327 #define hi253_PWRSEQ sensor_PWRSEQ_DEFAULT
328 #define hi704_PWRSEQ sensor_PWRSEQ_DEFAULT
330 #define nt99160_PWRSEQ sensor_PWRSEQ_DEFAULT
331 #define nt99240_PWRSEQ sensor_PWRSEQ_DEFAULT
332 #define nt99250_PWRSEQ sensor_PWRSEQ_DEFAULT
333 #define nt99252_PWRSEQ sensor_PWRSEQ_DEFAULT
334 #define nt99340_PWRSEQ sensor_PWRSEQ_DEFAULT
336 #define sp0718_PWRSEQ sensor_PWRSEQ_DEFAULT
337 #define sp0838_PWRSEQ sensor_PWRSEQ_DEFAULT
338 #define sp0a19_PWRSEQ sensor_PWRSEQ_DEFAULT
339 #define sp1628_PWRSEQ sensor_PWRSEQ_DEFAULT
340 #define sp2518_PWRSEQ sensor_PWRSEQ_DEFAULT
341 #define hm2057_PWRSEQ sensor_PWRSEQ_DEFAULT
342 #define hm5065_PWRSEQ (SENSOR_PWRSEQ_SET(SENSOR_PWRSEQ_PWR,1)|\
343 SENSOR_PWRSEQ_SET(SENSOR_PWRSEQ_HWRST,2)|\
344 SENSOR_PWRSEQ_SET(SENSOR_PWRSEQ_PWRDN,0)|\
345 SENSOR_PWRSEQ_SET(SENSOR_PWRSEQ_CLKIN,3))
346 #define mtk9335isp_PWRSEQ sensor_PWRSEQ_DEFAULT
347 #define icatchov5693_PWRSEQ (SENSOR_PWRSEQ_SET(SENSOR_PWRSEQ_PWR,0)|\
348 SENSOR_PWRSEQ_SET(SENSOR_PWRSEQ_HWRST,2)|\
349 SENSOR_PWRSEQ_SET(SENSOR_PWRSEQ_CLKIN,1))
351 #define icatchov8825_PWRSEQ (SENSOR_PWRSEQ_SET(SENSOR_PWRSEQ_PWR,0)|\
352 SENSOR_PWRSEQ_SET(SENSOR_PWRSEQ_HWRST,2)|\
353 SENSOR_PWRSEQ_SET(SENSOR_PWRSEQ_CLKIN,1)) //zyt
355 #define icatchov2720_PWRSEQ (SENSOR_PWRSEQ_SET(SENSOR_PWRSEQ_PWR,0)|\
356 SENSOR_PWRSEQ_SET(SENSOR_PWRSEQ_HWRST,2)|\
357 SENSOR_PWRSEQ_SET(SENSOR_PWRSEQ_CLKIN,1)) //zyt
359 #define icatchmi1040_PWRSEQ (SENSOR_PWRSEQ_SET(SENSOR_PWRSEQ_PWR,0)|\
360 SENSOR_PWRSEQ_SET(SENSOR_PWRSEQ_HWRST,2)|\
361 SENSOR_PWRSEQ_SET(SENSOR_PWRSEQ_CLKIN,1))
363 #define end_PWRSEQ 0xffffffff
367 /*---------------- Camera Sensor Must Define Macro End ------------------------*/