Commit | Line | Data |
---|---|---|
6fa3eb70 S |
1 | #include <linux/videodev2.h> |
2 | #include <linux/i2c.h> | |
3 | #include <linux/platform_device.h> | |
4 | #include <linux/delay.h> | |
5 | #include <linux/cdev.h> | |
6 | #include <linux/uaccess.h> | |
7 | #include <linux/fs.h> | |
8 | #include <asm/atomic.h> | |
9 | #include <linux/xlog.h> | |
10 | #include <mach/upmu_common.h> | |
11 | ||
12 | #include "kd_camera_hw.h" | |
13 | ||
14 | #include "kd_imgsensor.h" | |
15 | #include "kd_imgsensor_define.h" | |
16 | #include "kd_camera_feature.h" | |
17 | ||
18 | /****************************************************************************** | |
19 | * Debug configuration | |
20 | ******************************************************************************/ | |
21 | #define PFX "[kd_camera_hw]" | |
22 | #define PK_DBG_NONE(fmt, arg...) do {} while (0) | |
23 | #define PK_DBG_FUNC(fmt, arg...) xlog_printk(ANDROID_LOG_INFO, PFX , fmt, ##arg) | |
24 | ||
25 | #define DEBUG_CAMERA_HW_K | |
26 | #ifdef DEBUG_CAMERA_HW_K | |
27 | #define PK_DBG PK_DBG_FUNC | |
28 | #define PK_ERR(fmt, arg...) xlog_printk(ANDROID_LOG_ERR, PFX , fmt, ##arg) | |
29 | #define PK_XLOG_INFO(fmt, args...) \ | |
30 | do { \ | |
31 | xlog_printk(ANDROID_LOG_INFO, PFX , fmt, ##arg); \ | |
32 | } while(0) | |
33 | #else | |
34 | #define PK_DBG(a,...) | |
35 | #define PK_ERR(a,...) | |
36 | #define PK_XLOG_INFO(fmt, args...) | |
37 | #endif | |
38 | ||
39 | ||
40 | ||
41 | int kdCISModulePowerOn(CAMERA_DUAL_CAMERA_SENSOR_ENUM SensorIdx, char *currSensorName, BOOL On, char* mode_name) | |
42 | { | |
43 | #if !defined (MTK_ALPS_BOX_SUPPORT) | |
44 | ||
45 | u32 pinSetIdx = 0;//default main sensor | |
46 | ||
47 | #define IDX_PS_CMRST 0 | |
48 | #define IDX_PS_CMPDN 4 | |
49 | ||
50 | #define IDX_PS_MODE 1 | |
51 | #define IDX_PS_ON 2 | |
52 | #define IDX_PS_OFF 3 | |
53 | ||
54 | ||
55 | u32 pinSet[2][8] = { | |
56 | //for main sensor | |
57 | {GPIO_CAMERA_CMRST_PIN, | |
58 | GPIO_CAMERA_CMRST_PIN_M_GPIO, /* mode */ | |
59 | GPIO_OUT_ONE, /* ON state */ | |
60 | GPIO_OUT_ZERO, /* OFF state */ | |
61 | GPIO_CAMERA_CMPDN_PIN, | |
62 | GPIO_CAMERA_CMPDN_PIN_M_GPIO, | |
63 | GPIO_OUT_ONE, | |
64 | GPIO_OUT_ZERO, | |
65 | }, | |
66 | //for sub sensor | |
67 | {GPIO_CAMERA_CMRST1_PIN, | |
68 | GPIO_CAMERA_CMRST1_PIN_M_GPIO, | |
69 | GPIO_OUT_ONE, | |
70 | GPIO_OUT_ZERO, | |
71 | GPIO_CAMERA_CMPDN1_PIN, | |
72 | GPIO_CAMERA_CMPDN1_PIN_M_GPIO, | |
73 | GPIO_OUT_ONE, | |
74 | GPIO_OUT_ZERO, | |
75 | }, | |
76 | }; | |
77 | ||
78 | ||
79 | ||
80 | ||
81 | ||
82 | ||
83 | ||
84 | if (DUAL_CAMERA_MAIN_SENSOR == SensorIdx){ | |
85 | pinSetIdx = 0; | |
86 | } | |
87 | else if (DUAL_CAMERA_SUB_SENSOR == SensorIdx) { | |
88 | pinSetIdx = 1; | |
89 | } | |
90 | ||
91 | ||
92 | //power ON | |
93 | if (On) { | |
94 | ||
95 | PK_DBG("kdCISModulePowerOn -on:currSensorName=%s;\n",currSensorName); | |
96 | PK_DBG("kdCISModulePowerOn -on:pinSetIdx=%d\n",pinSetIdx); | |
97 | ||
98 | if ((pinSetIdx==0) && currSensorName && (0 == strcmp(SENSOR_DRVNAME_OV5647_RAW, currSensorName))) | |
99 | { | |
100 | //enable active sensor | |
101 | if (GPIO_CAMERA_INVALID != pinSet[pinSetIdx][IDX_PS_CMRST]) { | |
102 | //RST pin,active low | |
103 | if(mt_set_gpio_mode(pinSet[pinSetIdx][IDX_PS_CMRST],pinSet[pinSetIdx][IDX_PS_CMRST+IDX_PS_MODE])){PK_DBG("[CAMERA SENSOR] set gpio mode failed!! \n");} | |
104 | if(mt_set_gpio_dir(pinSet[pinSetIdx][IDX_PS_CMRST],GPIO_DIR_OUT)){PK_DBG("[CAMERA SENSOR] set gpio dir failed!! \n");} | |
105 | if(mt_set_gpio_out(pinSet[pinSetIdx][IDX_PS_CMRST],pinSet[pinSetIdx][IDX_PS_CMRST+IDX_PS_OFF])){PK_DBG("[CAMERA SENSOR] set gpio failed!! \n");} | |
106 | mdelay(5); | |
107 | ||
108 | //PDN pin,high | |
109 | if(mt_set_gpio_mode(pinSet[pinSetIdx][IDX_PS_CMPDN],pinSet[pinSetIdx][IDX_PS_CMPDN+IDX_PS_MODE])){PK_DBG("[CAMERA LENS] set gpio mode failed!! \n");} | |
110 | if(mt_set_gpio_dir(pinSet[pinSetIdx][IDX_PS_CMPDN],GPIO_DIR_OUT)){PK_DBG("[CAMERA LENS] set gpio dir failed!! \n");} | |
111 | if(mt_set_gpio_out(pinSet[pinSetIdx][IDX_PS_CMPDN],pinSet[pinSetIdx][IDX_PS_CMPDN+IDX_PS_ON])){PK_DBG("[CAMERA LENS] set gpio failed!! \n");} | |
112 | mdelay(5); | |
113 | } | |
114 | ||
115 | //DOVDD | |
116 | PK_DBG("[ON_general 1.8V]sensorIdx:%d \n",SensorIdx); | |
117 | if(TRUE != hwPowerOn(CAMERA_POWER_VCAM_D2, VOL_1800,mode_name)) | |
118 | { | |
119 | PK_DBG("[CAMERA SENSOR] Fail to enable D2 power\n"); | |
120 | //return -EIO; | |
121 | //goto _kdCISModulePowerOn_exit_; | |
122 | } | |
123 | mdelay(5); | |
124 | ||
125 | //AVDD | |
126 | if(TRUE != hwPowerOn(CAMERA_POWER_VCAM_A, VOL_2800,mode_name)) | |
127 | { | |
128 | PK_DBG("[CAMERA SENSOR] Fail to enable A power\n"); | |
129 | //return -EIO; | |
130 | //goto _kdCISModulePowerOn_exit_; | |
131 | } | |
132 | mdelay(5); | |
133 | ||
134 | //DVDD | |
135 | if(TRUE != hwPowerOn(CAMERA_POWER_VCAM_D, VOL_1500,mode_name)) | |
136 | { | |
137 | PK_DBG("[CAMERA SENSOR] Fail to enable D power\n"); | |
138 | //return -EIO; | |
139 | //goto _kdCISModulePowerOn_exit_; | |
140 | } | |
141 | mdelay(5); | |
142 | ||
143 | //AF_VCC | |
144 | if(TRUE != hwPowerOn(CAMERA_POWER_VCAM_A2, VOL_2800,mode_name)) | |
145 | { | |
146 | PK_DBG("[CAMERA SENSOR] Fail to enable A2 power\n"); | |
147 | //return -EIO; | |
148 | goto _kdCISModulePowerOn_exit_; | |
149 | } | |
150 | mdelay(5); | |
151 | ||
152 | //enable active sensor | |
153 | if (GPIO_CAMERA_INVALID != pinSet[pinSetIdx][IDX_PS_CMRST]) { | |
154 | //RST pin | |
155 | if(mt_set_gpio_mode(pinSet[pinSetIdx][IDX_PS_CMRST],pinSet[pinSetIdx][IDX_PS_CMRST+IDX_PS_MODE])){PK_DBG("[CAMERA SENSOR] set gpio mode failed!! \n");} | |
156 | if(mt_set_gpio_dir(pinSet[pinSetIdx][IDX_PS_CMRST],GPIO_DIR_OUT)){PK_DBG("[CAMERA SENSOR] set gpio dir failed!! \n");} | |
157 | if(mt_set_gpio_out(pinSet[pinSetIdx][IDX_PS_CMRST],pinSet[pinSetIdx][IDX_PS_CMRST+IDX_PS_ON])){PK_DBG("[CAMERA SENSOR] set gpio failed!! \n");} | |
158 | mdelay(5); | |
159 | ||
160 | //PDN pin | |
161 | if(mt_set_gpio_mode(pinSet[pinSetIdx][IDX_PS_CMPDN],pinSet[pinSetIdx][IDX_PS_CMPDN+IDX_PS_MODE])){PK_DBG("[CAMERA LENS] set gpio mode failed!! \n");} | |
162 | if(mt_set_gpio_dir(pinSet[pinSetIdx][IDX_PS_CMPDN],GPIO_DIR_OUT)){PK_DBG("[CAMERA LENS] set gpio dir failed!! \n");} | |
163 | if(mt_set_gpio_out(pinSet[pinSetIdx][IDX_PS_CMPDN],pinSet[pinSetIdx][IDX_PS_CMPDN+IDX_PS_OFF])){PK_DBG("[CAMERA LENS] set gpio failed!! \n");} | |
164 | mdelay(5); | |
165 | } | |
166 | #if 0 | |
167 | while(1){ | |
168 | ||
169 | mdelay(2000); | |
170 | PK_DBG("im sleep ...\n"); | |
171 | } | |
172 | #endif | |
173 | #if 1 | |
174 | //disable inactive sensor | |
175 | if(pinSetIdx == 0 || pinSetIdx == 2) {//disable sub | |
176 | if (GPIO_CAMERA_INVALID != pinSet[1][IDX_PS_CMRST]) { | |
177 | if(mt_set_gpio_mode(pinSet[1][IDX_PS_CMRST],pinSet[1][IDX_PS_CMRST+IDX_PS_MODE])){PK_DBG("[CAMERA SENSOR] set gpio mode failed!! \n");} | |
178 | if(mt_set_gpio_mode(pinSet[1][IDX_PS_CMPDN],pinSet[1][IDX_PS_CMPDN+IDX_PS_MODE])){PK_DBG("[CAMERA LENS] set gpio mode failed!! \n");} | |
179 | if(mt_set_gpio_dir(pinSet[1][IDX_PS_CMRST],GPIO_DIR_OUT)){PK_DBG("[CAMERA SENSOR] set gpio dir failed!! \n");} | |
180 | if(mt_set_gpio_dir(pinSet[1][IDX_PS_CMPDN],GPIO_DIR_OUT)){PK_DBG("[CAMERA LENS] set gpio dir failed!! \n");} | |
181 | if(mt_set_gpio_out(pinSet[1][IDX_PS_CMRST],pinSet[1][IDX_PS_CMRST+IDX_PS_OFF])){PK_DBG("[CAMERA SENSOR] set gpio failed!! \n");} //low == reset sensor | |
182 | if(mt_set_gpio_out(pinSet[1][IDX_PS_CMPDN],pinSet[1][IDX_PS_CMPDN+IDX_PS_OFF])){PK_DBG("[CAMERA LENS] set gpio failed!! \n");} //high == power down lens module | |
183 | } | |
184 | } | |
185 | else { | |
186 | if (GPIO_CAMERA_INVALID != pinSet[0][IDX_PS_CMRST]) { | |
187 | if(mt_set_gpio_mode(pinSet[0][IDX_PS_CMRST],pinSet[0][IDX_PS_CMRST+IDX_PS_MODE])){PK_DBG("[CAMERA SENSOR] set gpio mode failed!! \n");} | |
188 | if(mt_set_gpio_mode(pinSet[0][IDX_PS_CMPDN],pinSet[0][IDX_PS_CMPDN+IDX_PS_MODE])){PK_DBG("[CAMERA LENS] set gpio mode failed!! \n");} | |
189 | if(mt_set_gpio_dir(pinSet[0][IDX_PS_CMRST],GPIO_DIR_OUT)){PK_DBG("[CAMERA SENSOR] set gpio dir failed!! \n");} | |
190 | if(mt_set_gpio_dir(pinSet[0][IDX_PS_CMPDN],GPIO_DIR_OUT)){PK_DBG("[CAMERA LENS] set gpio dir failed!! \n");} | |
191 | if(mt_set_gpio_out(pinSet[0][IDX_PS_CMRST],pinSet[0][IDX_PS_CMRST+IDX_PS_OFF])){PK_DBG("[CAMERA SENSOR] set gpio failed!! \n");} //low == reset sensor | |
192 | if(mt_set_gpio_out(pinSet[0][IDX_PS_CMPDN],pinSet[0][IDX_PS_CMPDN+IDX_PS_OFF])){PK_DBG("[CAMERA LENS] set gpio failed!! \n");} //high == power down lens module | |
193 | } | |
194 | } | |
195 | #endif | |
196 | } | |
197 | else if (currSensorName && (0 == strcmp(SENSOR_DRVNAME_OV2659_YUV, currSensorName))) | |
198 | { | |
199 | //enable active sensor | |
200 | if (GPIO_CAMERA_INVALID != pinSet[pinSetIdx][IDX_PS_CMRST]) { | |
201 | //RST pin,active low | |
202 | if(mt_set_gpio_mode(pinSet[pinSetIdx][IDX_PS_CMRST],pinSet[pinSetIdx][IDX_PS_CMRST+IDX_PS_MODE])){PK_DBG("[CAMERA SENSOR] set gpio mode failed!! \n");} | |
203 | if(mt_set_gpio_dir(pinSet[pinSetIdx][IDX_PS_CMRST],GPIO_DIR_OUT)){PK_DBG("[CAMERA SENSOR] set gpio dir failed!! \n");} | |
204 | if(mt_set_gpio_out(pinSet[pinSetIdx][IDX_PS_CMRST],pinSet[pinSetIdx][IDX_PS_CMRST+IDX_PS_OFF])){PK_DBG("[CAMERA SENSOR] set gpio failed!! \n");} | |
205 | mdelay(5); | |
206 | ||
207 | //PDN pin,high | |
208 | if(mt_set_gpio_mode(pinSet[pinSetIdx][IDX_PS_CMPDN],pinSet[pinSetIdx][IDX_PS_CMPDN+IDX_PS_MODE])){PK_DBG("[CAMERA LENS] set gpio mode failed!! \n");} | |
209 | if(mt_set_gpio_dir(pinSet[pinSetIdx][IDX_PS_CMPDN],GPIO_DIR_OUT)){PK_DBG("[CAMERA LENS] set gpio dir failed!! \n");} | |
210 | if(mt_set_gpio_out(pinSet[pinSetIdx][IDX_PS_CMPDN],pinSet[pinSetIdx][IDX_PS_CMPDN+IDX_PS_ON])){PK_DBG("[CAMERA LENS] set gpio failed!! \n");} | |
211 | mdelay(5); | |
212 | } | |
213 | /* Enlarge the VCAMIO voltage to increase driving capability to avoid unexpected lines shown | |
214 | VCAMIO 1.8V + 0.02V ~ 0.16V | |
215 | 4'b1000: 160 mV | |
216 | 4'b1001: 140 mV | |
217 | 4'b1010: 120 mV | |
218 | 4'b1011: 100 mV | |
219 | 4'b1100: 80 mV | |
220 | 4'b1101: 60 mV | |
221 | 4'b1110: 40 mV | |
222 | 4'b1111: 20 mV | |
223 | */ | |
224 | upmu_set_rg_vcam_io_cal(0x08); // 1.96V | |
225 | ||
226 | //DOVDD | |
227 | PK_DBG("[ON_general 1.8V]sensorIdx:%d \n",SensorIdx); | |
228 | if(TRUE != hwPowerOn(CAMERA_POWER_VCAM_D2, VOL_1800,mode_name)) | |
229 | { | |
230 | PK_DBG("[CAMERA SENSOR] Fail to enable digital power\n"); | |
231 | //return -EIO; | |
232 | //goto _kdCISModulePowerOn_exit_; | |
233 | } | |
234 | mdelay(5); | |
235 | ||
236 | //AVDD | |
237 | if(TRUE != hwPowerOn(CAMERA_POWER_VCAM_A, VOL_2800,mode_name)) | |
238 | { | |
239 | PK_DBG("[CAMERA SENSOR] Fail to enable analog power\n"); | |
240 | //return -EIO; | |
241 | //goto _kdCISModulePowerOn_exit_; | |
242 | } | |
243 | mdelay(5); | |
244 | ||
245 | //DVDD | |
246 | if(TRUE != hwPowerOn(CAMERA_POWER_VCAM_D, VOL_1500,mode_name)) | |
247 | { | |
248 | PK_DBG("[CAMERA SENSOR] Fail to enable digital power\n"); | |
249 | //return -EIO; | |
250 | //goto _kdCISModulePowerOn_exit_; | |
251 | } | |
252 | mdelay(5); | |
253 | ||
254 | #if 0 | |
255 | // AF_VCC | |
256 | if(TRUE != hwPowerOn(CAMERA_POWER_VCAM_A2, VOL_2800,mode_name)) | |
257 | { | |
258 | PK_DBG("[CAMERA SENSOR] Fail to enable analog power\n"); | |
259 | //return -EIO; | |
260 | goto _kdCISModulePowerOn_exit_; | |
261 | } | |
262 | #endif | |
263 | ||
264 | //enable active sensor | |
265 | if (GPIO_CAMERA_INVALID != pinSet[pinSetIdx][IDX_PS_CMRST]) { | |
266 | //RST pin | |
267 | if(mt_set_gpio_mode(pinSet[pinSetIdx][IDX_PS_CMRST],pinSet[pinSetIdx][IDX_PS_CMRST+IDX_PS_MODE])){PK_DBG("[CAMERA SENSOR] set gpio mode failed!! \n");} | |
268 | if(mt_set_gpio_dir(pinSet[pinSetIdx][IDX_PS_CMRST],GPIO_DIR_OUT)){PK_DBG("[CAMERA SENSOR] set gpio dir failed!! \n");} | |
269 | if(mt_set_gpio_out(pinSet[pinSetIdx][IDX_PS_CMRST],pinSet[pinSetIdx][IDX_PS_CMRST+IDX_PS_ON])){PK_DBG("[CAMERA SENSOR] set gpio failed!! \n");} | |
270 | mdelay(5); | |
271 | ||
272 | //PDN pin | |
273 | if(mt_set_gpio_mode(pinSet[pinSetIdx][IDX_PS_CMPDN],pinSet[pinSetIdx][IDX_PS_CMPDN+IDX_PS_MODE])){PK_DBG("[CAMERA LENS] set gpio mode failed!! \n");} | |
274 | if(mt_set_gpio_dir(pinSet[pinSetIdx][IDX_PS_CMPDN],GPIO_DIR_OUT)){PK_DBG("[CAMERA LENS] set gpio dir failed!! \n");} | |
275 | if(mt_set_gpio_out(pinSet[pinSetIdx][IDX_PS_CMPDN],pinSet[pinSetIdx][IDX_PS_CMPDN+IDX_PS_OFF])){PK_DBG("[CAMERA LENS] set gpio failed!! \n");} | |
276 | mdelay(5); | |
277 | } | |
278 | ||
279 | ||
280 | //disable inactive sensor | |
281 | if(pinSetIdx == 0 || pinSetIdx == 2) {//disable sub | |
282 | if (GPIO_CAMERA_INVALID != pinSet[1][IDX_PS_CMRST]) { | |
283 | if(mt_set_gpio_mode(pinSet[1][IDX_PS_CMRST],pinSet[1][IDX_PS_CMRST+IDX_PS_MODE])){PK_DBG("[CAMERA SENSOR] set gpio mode failed!! \n");} | |
284 | if(mt_set_gpio_mode(pinSet[1][IDX_PS_CMPDN],pinSet[1][IDX_PS_CMPDN+IDX_PS_MODE])){PK_DBG("[CAMERA LENS] set gpio mode failed!! \n");} | |
285 | if(mt_set_gpio_dir(pinSet[1][IDX_PS_CMRST],GPIO_DIR_OUT)){PK_DBG("[CAMERA SENSOR] set gpio dir failed!! \n");} | |
286 | if(mt_set_gpio_dir(pinSet[1][IDX_PS_CMPDN],GPIO_DIR_OUT)){PK_DBG("[CAMERA LENS] set gpio dir failed!! \n");} | |
287 | if(mt_set_gpio_out(pinSet[1][IDX_PS_CMRST],pinSet[1][IDX_PS_CMRST+IDX_PS_OFF])){PK_DBG("[CAMERA SENSOR] set gpio failed!! \n");} //low == reset sensor | |
288 | if(mt_set_gpio_out(pinSet[1][IDX_PS_CMPDN],pinSet[1][IDX_PS_CMPDN+IDX_PS_OFF])){PK_DBG("[CAMERA LENS] set gpio failed!! \n");} //high == power down lens module | |
289 | } | |
290 | } | |
291 | else { | |
292 | if (GPIO_CAMERA_INVALID != pinSet[0][IDX_PS_CMRST]) { | |
293 | if(mt_set_gpio_mode(pinSet[0][IDX_PS_CMRST],pinSet[0][IDX_PS_CMRST+IDX_PS_MODE])){PK_DBG("[CAMERA SENSOR] set gpio mode failed!! \n");} | |
294 | if(mt_set_gpio_mode(pinSet[0][IDX_PS_CMPDN],pinSet[0][IDX_PS_CMPDN+IDX_PS_MODE])){PK_DBG("[CAMERA LENS] set gpio mode failed!! \n");} | |
295 | if(mt_set_gpio_dir(pinSet[0][IDX_PS_CMRST],GPIO_DIR_OUT)){PK_DBG("[CAMERA SENSOR] set gpio dir failed!! \n");} | |
296 | if(mt_set_gpio_dir(pinSet[0][IDX_PS_CMPDN],GPIO_DIR_OUT)){PK_DBG("[CAMERA LENS] set gpio dir failed!! \n");} | |
297 | if(mt_set_gpio_out(pinSet[0][IDX_PS_CMRST],pinSet[0][IDX_PS_CMRST+IDX_PS_OFF])){PK_DBG("[CAMERA SENSOR] set gpio failed!! \n");} //low == reset sensor | |
298 | if(mt_set_gpio_out(pinSet[0][IDX_PS_CMPDN],pinSet[0][IDX_PS_CMPDN+IDX_PS_OFF])){PK_DBG("[CAMERA LENS] set gpio failed!! \n");} //high == power down lens module | |
299 | } | |
300 | } | |
301 | ||
302 | ||
303 | } | |
304 | } | |
305 | else {//power OFF | |
306 | ||
307 | //PK_DBG("[OFF]sensorIdx:%d \n",SensorIdx); | |
308 | if (GPIO_CAMERA_INVALID != pinSet[pinSetIdx][IDX_PS_CMRST]) { | |
309 | if(mt_set_gpio_mode(pinSet[pinSetIdx][IDX_PS_CMRST],pinSet[pinSetIdx][IDX_PS_CMRST+IDX_PS_MODE])){PK_DBG("[CAMERA SENSOR] set gpio mode failed!! \n");} | |
310 | if(mt_set_gpio_mode(pinSet[pinSetIdx][IDX_PS_CMPDN],pinSet[pinSetIdx][IDX_PS_CMPDN+IDX_PS_MODE])){PK_DBG("[CAMERA LENS] set gpio mode failed!! \n");} | |
311 | if(mt_set_gpio_dir(pinSet[pinSetIdx][IDX_PS_CMRST],GPIO_DIR_OUT)){PK_DBG("[CAMERA SENSOR] set gpio dir failed!! \n");} | |
312 | if(mt_set_gpio_dir(pinSet[pinSetIdx][IDX_PS_CMPDN],GPIO_DIR_OUT)){PK_DBG("[CAMERA LENS] set gpio dir failed!! \n");} | |
313 | if(mt_set_gpio_out(pinSet[pinSetIdx][IDX_PS_CMRST],pinSet[pinSetIdx][IDX_PS_CMRST+IDX_PS_OFF])){PK_DBG("[CAMERA SENSOR] set gpio failed!! \n");} //low == reset sensor | |
314 | if(mt_set_gpio_out(pinSet[pinSetIdx][IDX_PS_CMPDN],pinSet[pinSetIdx][IDX_PS_CMPDN+IDX_PS_OFF])){PK_DBG("[CAMERA LENS] set gpio failed!! \n");} //high == power down lens module | |
315 | } | |
316 | ||
317 | if(TRUE != hwPowerDown(CAMERA_POWER_VCAM_A,mode_name)) { | |
318 | PK_DBG("[CAMERA SENSOR] Fail to OFF a power\n"); | |
319 | } | |
320 | if(TRUE != hwPowerDown(CAMERA_POWER_VCAM_A2,mode_name)){ | |
321 | PK_DBG("[CAMERA SENSOR] Fail to OFF a2 power\n"); | |
322 | } | |
323 | if(TRUE != hwPowerDown(CAMERA_POWER_VCAM_D, mode_name)) { | |
324 | PK_DBG("[CAMERA SENSOR] Fail to OFF d digital power\n"); | |
325 | } | |
326 | if(TRUE != hwPowerDown(CAMERA_POWER_VCAM_D2,mode_name)) | |
327 | { | |
328 | PK_DBG("[CAMERA SENSOR] Fail to OFF d2 digital power\n"); | |
329 | } | |
330 | }// | |
331 | ||
332 | #endif /* end of defined MTK_ALPS_BOX_SUPPORT */ | |
333 | ||
334 | return 0; | |
335 | ||
336 | _kdCISModulePowerOn_exit_: | |
337 | return -EIO; | |
338 | } | |
339 | ||
340 | EXPORT_SYMBOL(kdCISModulePowerOn); | |
341 | ||
342 | ||
343 | //!-- | |
344 | // | |
345 | ||
346 | ||
347 | ||
348 |