Lines Matching refs:cmd

141 	struct cpia2_command cmd;  in cpia2_do_command()  local
144 cmd.command = command; in cpia2_do_command()
145 cmd.reg_count = 2; /* default */ in cpia2_do_command()
146 cmd.direction = direction; in cpia2_do_command()
153 cmd.req_mode = in cpia2_do_command()
155 cmd.start = CPIA2_SYSTEM_DEVICE_HI; in cpia2_do_command()
158 cmd.req_mode = in cpia2_do_command()
160 cmd.reg_count = 8; in cpia2_do_command()
161 cmd.start = CPIA2_SYSTEM_DESCRIP_VID_HI; in cpia2_do_command()
164 cmd.req_mode = CAMERAACCESS_TYPE_BLOCK | CAMERAACCESS_VC; in cpia2_do_command()
165 cmd.start = CPIA2_VC_ASIC_ID; in cpia2_do_command()
168 cmd.req_mode = CAMERAACCESS_TYPE_BLOCK | CAMERAACCESS_VP; in cpia2_do_command()
169 cmd.start = CPIA2_VP_SENSOR_FLAGS; in cpia2_do_command()
172 cmd.req_mode = CAMERAACCESS_TYPE_BLOCK | CAMERAACCESS_VP; in cpia2_do_command()
173 cmd.start = CPIA2_VP_DEVICEH; in cpia2_do_command()
176 cmd.buffer.block_data[0] = param; /* Then fall through */ in cpia2_do_command()
178 cmd.req_mode = CAMERAACCESS_TYPE_BLOCK | CAMERAACCESS_VP; in cpia2_do_command()
179 cmd.reg_count = 1; in cpia2_do_command()
181 cmd.start = CPIA2_VP4_EXPOSURE_TARGET; in cpia2_do_command()
183 cmd.start = CPIA2_VP5_EXPOSURE_TARGET; in cpia2_do_command()
186 cmd.buffer.block_data[0] = param; /* Then fall through */ in cpia2_do_command()
188 cmd.req_mode = CAMERAACCESS_TYPE_BLOCK | CAMERAACCESS_VP; in cpia2_do_command()
189 cmd.reg_count = 1; in cpia2_do_command()
190 cmd.start = CPIA2_VP_YRANGE; in cpia2_do_command()
193 cmd.buffer.block_data[0] = param; /* Then fall through */ in cpia2_do_command()
195 cmd.req_mode = CAMERAACCESS_TYPE_BLOCK | CAMERAACCESS_VP; in cpia2_do_command()
196 cmd.reg_count = 1; in cpia2_do_command()
198 cmd.start = CPIA2_VP_SATURATION; in cpia2_do_command()
200 cmd.start = CPIA2_VP5_MCUVSATURATION; in cpia2_do_command()
203 cmd.buffer.block_data[0] = param; /* Then fall through */ in cpia2_do_command()
205 cmd.req_mode = CAMERAACCESS_TYPE_BLOCK | CAMERAACCESS_VP; in cpia2_do_command()
206 cmd.reg_count = 1; in cpia2_do_command()
207 cmd.start = CPIA2_VP_GPIO_DATA; in cpia2_do_command()
210 cmd.buffer.block_data[0] = param; /* Then fall through */ in cpia2_do_command()
212 cmd.req_mode = CAMERAACCESS_TYPE_BLOCK | CAMERAACCESS_VP; in cpia2_do_command()
213 cmd.reg_count = 1; in cpia2_do_command()
214 cmd.start = CPIA2_VP_GPIO_DIRECTION; in cpia2_do_command()
217 cmd.buffer.block_data[0] = param; /* Then fall through */ in cpia2_do_command()
219 cmd.req_mode = CAMERAACCESS_TYPE_BLOCK | CAMERAACCESS_VC; in cpia2_do_command()
220 cmd.reg_count = 1; in cpia2_do_command()
221 cmd.start = CPIA2_VC_MP_DATA; in cpia2_do_command()
224 cmd.buffer.block_data[0] = param; /* Then fall through */ in cpia2_do_command()
226 cmd.req_mode = CAMERAACCESS_TYPE_BLOCK | CAMERAACCESS_VC; in cpia2_do_command()
227 cmd.reg_count = 1; in cpia2_do_command()
228 cmd.start = CPIA2_VC_MP_DIR; in cpia2_do_command()
231 cmd.req_mode = in cpia2_do_command()
233 cmd.start = CPIA2_SYSTEM_INT_PACKET_CTRL; in cpia2_do_command()
234 cmd.reg_count = 1; in cpia2_do_command()
235 cmd.buffer.block_data[0] = param; in cpia2_do_command()
238 cmd.buffer.block_data[0] = param; /* Then fall through */ in cpia2_do_command()
240 cmd.req_mode = CAMERAACCESS_TYPE_BLOCK | CAMERAACCESS_VP; in cpia2_do_command()
241 cmd.reg_count = 1; in cpia2_do_command()
242 cmd.start = CPIA2_VP_FLICKER_MODES; in cpia2_do_command()
245 cmd.req_mode = CAMERAACCESS_TYPE_RANDOM | CAMERAACCESS_VC; in cpia2_do_command()
246 cmd.reg_count = 2; in cpia2_do_command()
247 cmd.start = 0; in cpia2_do_command()
248 cmd.buffer.registers[0].index = CPIA2_VC_ST_CTRL; in cpia2_do_command()
249 cmd.buffer.registers[0].value = CPIA2_VC_ST_CTRL_SRC_VC | in cpia2_do_command()
251 cmd.buffer.registers[1].index = CPIA2_VC_ST_CTRL; in cpia2_do_command()
252 cmd.buffer.registers[1].value = CPIA2_VC_ST_CTRL_SRC_VC | in cpia2_do_command()
258 cmd.req_mode = in cpia2_do_command()
260 cmd.reg_count = 2; in cpia2_do_command()
261 cmd.buffer.registers[0].index = in cpia2_do_command()
263 cmd.buffer.registers[1].index = in cpia2_do_command()
265 cmd.buffer.registers[0].value = CPIA2_SYSTEM_CONTROL_CLEAR_ERR; in cpia2_do_command()
266 cmd.buffer.registers[1].value = in cpia2_do_command()
270 cmd.req_mode = in cpia2_do_command()
272 cmd.reg_count = 1; in cpia2_do_command()
273 cmd.start = CPIA2_SYSTEM_SYSTEM_CONTROL; in cpia2_do_command()
274 cmd.buffer.block_data[0] = 0; in cpia2_do_command()
277 cmd.req_mode = in cpia2_do_command()
279 cmd.reg_count = 1; in cpia2_do_command()
280 cmd.start = CPIA2_SYSTEM_SYSTEM_CONTROL; in cpia2_do_command()
281 cmd.buffer.block_data[0] = CPIA2_SYSTEM_CONTROL_CLEAR_ERR; in cpia2_do_command()
284 cmd.buffer.block_data[0] = param; in cpia2_do_command()
286 cmd.req_mode = CAMERAACCESS_TYPE_BLOCK | CAMERAACCESS_VP; in cpia2_do_command()
287 cmd.reg_count = 1; in cpia2_do_command()
289 cmd.start = CPIA2_VP4_USER_MODE; in cpia2_do_command()
291 cmd.start = CPIA2_VP5_USER_MODE; in cpia2_do_command()
294 cmd.req_mode = CAMERAACCESS_TYPE_BLOCK | CAMERAACCESS_VP; in cpia2_do_command()
295 cmd.reg_count = 1; in cpia2_do_command()
297 cmd.start = CPIA2_VP4_FRAMERATE_REQUEST; in cpia2_do_command()
299 cmd.start = CPIA2_VP5_FRAMERATE_REQUEST; in cpia2_do_command()
300 cmd.buffer.block_data[0] = param; in cpia2_do_command()
303 cmd.buffer.block_data[0] = param; /* Then fall through */ in cpia2_do_command()
305 cmd.req_mode = CAMERAACCESS_TYPE_BLOCK | CAMERAACCESS_VC; in cpia2_do_command()
306 cmd.reg_count = 1; in cpia2_do_command()
307 cmd.start = CPIA2_VC_WAKEUP; in cpia2_do_command()
310 cmd.buffer.block_data[0] = param; /* Then fall through */ in cpia2_do_command()
312 cmd.req_mode = CAMERAACCESS_TYPE_BLOCK | CAMERAACCESS_VC; in cpia2_do_command()
313 cmd.reg_count = 1; in cpia2_do_command()
314 cmd.start = CPIA2_VC_PW_CTRL; in cpia2_do_command()
317 cmd.req_mode = CAMERAACCESS_TYPE_BLOCK | CAMERAACCESS_VP; in cpia2_do_command()
318 cmd.reg_count = 1; in cpia2_do_command()
319 cmd.start = CPIA2_VP_SYSTEMSTATE; in cpia2_do_command()
322 cmd.buffer.block_data[0] = param; /* Then fall through */ in cpia2_do_command()
324 cmd.req_mode = in cpia2_do_command()
326 cmd.reg_count = 1; in cpia2_do_command()
327 cmd.start = CPIA2_SYSTEM_SYSTEM_CONTROL; in cpia2_do_command()
330 cmd.buffer.block_data[0] = param; /* Then fall through */ in cpia2_do_command()
332 cmd.req_mode = CAMERAACCESS_TYPE_BLOCK | CAMERAACCESS_VP; in cpia2_do_command()
333 cmd.reg_count = 1; in cpia2_do_command()
334 cmd.start = CPIA2_VP_SYSTEMCTRL; in cpia2_do_command()
337 cmd.buffer.block_data[0] = param; /* Then fall through */ in cpia2_do_command()
339 cmd.req_mode = CAMERAACCESS_TYPE_BLOCK | CAMERAACCESS_VP; in cpia2_do_command()
340 cmd.reg_count = 1; in cpia2_do_command()
341 cmd.start = CPIA2_VP_EXPOSURE_MODES; in cpia2_do_command()
344 cmd.buffer.block_data[0] = param; /* Then fall through */ in cpia2_do_command()
346 cmd.req_mode = CAMERAACCESS_TYPE_BLOCK | CAMERAACCESS_VP; in cpia2_do_command()
347 cmd.reg_count = 1; in cpia2_do_command()
348 cmd.start = CPIA2_VP_DEVICE_CONFIG; in cpia2_do_command()
351 cmd.buffer.block_data[0] = param; in cpia2_do_command()
352 cmd.req_mode = in cpia2_do_command()
354 cmd.reg_count = 1; in cpia2_do_command()
355 cmd.start = CPIA2_SYSTEM_VP_SERIAL_ADDR; in cpia2_do_command()
358 cmd.buffer.block_data[0] = param; in cpia2_do_command()
359 cmd.req_mode = CAMERAACCESS_TYPE_BLOCK | CAMERAACCESS_VP; in cpia2_do_command()
360 cmd.reg_count = 1; in cpia2_do_command()
361 cmd.start = CPIA2_SENSOR_CR1; in cpia2_do_command()
364 cmd.buffer.block_data[0] = param; /* Then fall through */ in cpia2_do_command()
366 cmd.req_mode = CAMERAACCESS_TYPE_BLOCK | CAMERAACCESS_VC; in cpia2_do_command()
367 cmd.reg_count = 1; in cpia2_do_command()
368 cmd.start = CPIA2_VC_VC_CTRL; in cpia2_do_command()
371 cmd.req_mode = CAMERAACCESS_TYPE_RANDOM | CAMERAACCESS_VC; in cpia2_do_command()
372 cmd.reg_count = 1; in cpia2_do_command()
373 cmd.buffer.registers[0].index = CPIA2_VC_VC_TARGET_KB; in cpia2_do_command()
374 cmd.buffer.registers[0].value = param; in cpia2_do_command()
377 cmd.req_mode = CAMERAACCESS_TYPE_RANDOM | CAMERAACCESS_VC; in cpia2_do_command()
378 cmd.reg_count = 4; in cpia2_do_command()
379 cmd.buffer.registers[0].index = CPIA2_VC_VC_JPEG_OPT; in cpia2_do_command()
380 cmd.buffer.registers[0].value = in cpia2_do_command()
382 cmd.buffer.registers[1].index = CPIA2_VC_VC_USER_SQUEEZE; in cpia2_do_command()
383 cmd.buffer.registers[1].value = 20; in cpia2_do_command()
384 cmd.buffer.registers[2].index = CPIA2_VC_VC_CREEP_PERIOD; in cpia2_do_command()
385 cmd.buffer.registers[2].value = 2; in cpia2_do_command()
386 cmd.buffer.registers[3].index = CPIA2_VC_VC_JPEG_OPT; in cpia2_do_command()
387 cmd.buffer.registers[3].value = CPIA2_VC_VC_JPEG_OPT_DEFAULT; in cpia2_do_command()
390 cmd.req_mode = CAMERAACCESS_TYPE_BLOCK | CAMERAACCESS_VP; in cpia2_do_command()
391 cmd.reg_count = 1; in cpia2_do_command()
392 cmd.start = CPIA2_VP_REHASH_VALUES; in cpia2_do_command()
393 cmd.buffer.block_data[0] = param; in cpia2_do_command()
398 cmd.buffer.block_data[0] = param; /* Then fall through */ in cpia2_do_command()
400 cmd.req_mode = CAMERAACCESS_TYPE_BLOCK | CAMERAACCESS_VP; in cpia2_do_command()
401 cmd.reg_count = 1; in cpia2_do_command()
403 cmd.start = CPIA2_VP4_USER_EFFECTS; in cpia2_do_command()
405 cmd.start = CPIA2_VP5_USER_EFFECTS; in cpia2_do_command()
412 retval = cpia2_send_command(cam, &cmd); in cpia2_do_command()
423 cmd.buffer.block_data[0]; in cpia2_do_command()
425 cmd.buffer.block_data[1]; in cpia2_do_command()
428 cam->params.pnp_id.vendor = (cmd.buffer.block_data[0] << 8) | in cpia2_do_command()
429 cmd.buffer.block_data[1]; in cpia2_do_command()
430 cam->params.pnp_id.product = (cmd.buffer.block_data[2] << 8) | in cpia2_do_command()
431 cmd.buffer.block_data[3]; in cpia2_do_command()
433 (cmd.buffer.block_data[4] << 8) | in cpia2_do_command()
434 cmd.buffer.block_data[5]; in cpia2_do_command()
445 cam->params.version.asic_id = cmd.buffer.block_data[0]; in cpia2_do_command()
446 cam->params.version.asic_rev = cmd.buffer.block_data[1]; in cpia2_do_command()
449 cam->params.version.sensor_flags = cmd.buffer.block_data[0]; in cpia2_do_command()
450 cam->params.version.sensor_rev = cmd.buffer.block_data[1]; in cpia2_do_command()
453 cam->params.version.vp_device_hi = cmd.buffer.block_data[0]; in cpia2_do_command()
454 cam->params.version.vp_device_lo = cmd.buffer.block_data[1]; in cpia2_do_command()
457 cam->params.color_params.brightness = cmd.buffer.block_data[0]; in cpia2_do_command()
460 cam->params.color_params.contrast = cmd.buffer.block_data[0]; in cpia2_do_command()
463 cam->params.color_params.saturation = cmd.buffer.block_data[0]; in cpia2_do_command()
466 cam->params.vp_params.gpio_data = cmd.buffer.block_data[0]; in cpia2_do_command()
469 cam->params.vp_params.gpio_direction = cmd.buffer.block_data[0]; in cpia2_do_command()
472 cam->params.vc_params.vc_mp_direction =cmd.buffer.block_data[0]; in cpia2_do_command()
475 cam->params.vc_params.vc_mp_data = cmd.buffer.block_data[0]; in cpia2_do_command()
479 cmd.buffer.block_data[0]; in cpia2_do_command()
482 cam->params.vc_params.wakeup = cmd.buffer.block_data[0]; in cpia2_do_command()
485 cam->params.vc_params.pw_control = cmd.buffer.block_data[0]; in cpia2_do_command()
488 cam->params.camera_state.system_ctrl = cmd.buffer.block_data[0]; in cpia2_do_command()
491 cam->params.vp_params.system_state = cmd.buffer.block_data[0]; in cpia2_do_command()
494 cam->params.vp_params.system_ctrl = cmd.buffer.block_data[0]; in cpia2_do_command()
497 cam->params.vp_params.exposure_modes = cmd.buffer.block_data[0]; in cpia2_do_command()
500 cam->params.vp_params.device_config = cmd.buffer.block_data[0]; in cpia2_do_command()
503 cam->params.vc_params.vc_control = cmd.buffer.block_data[0]; in cpia2_do_command()
506 cam->params.vp_params.video_mode = cmd.buffer.block_data[0]; in cpia2_do_command()
509 cam->params.vp_params.user_effects = cmd.buffer.block_data[0]; in cpia2_do_command()
523 #define DIR(cmd) ((cmd->direction == TRANSFER_WRITE) ? "Write" : "Read") argument
524 #define BINDEX(cmd) (cmd->req_mode & 0x03) argument
526 int cpia2_send_command(struct camera_data *cam, struct cpia2_command *cmd) in cpia2_send_command() argument
533 switch (cmd->req_mode & 0x0c) { in cpia2_send_command()
535 count = cmd->reg_count * sizeof(struct cpia2_register); in cpia2_send_command()
537 buffer = (u8 *) & cmd->buffer; in cpia2_send_command()
539 DBG("%s Random: Register block %s\n", DIR(cmd), in cpia2_send_command()
540 block_name[BINDEX(cmd)]); in cpia2_send_command()
543 count = cmd->reg_count; in cpia2_send_command()
544 start = cmd->start; in cpia2_send_command()
545 buffer = cmd->buffer.block_data; in cpia2_send_command()
547 DBG("%s Block: Register block %s\n", DIR(cmd), in cpia2_send_command()
548 block_name[BINDEX(cmd)]); in cpia2_send_command()
551 count = cmd->reg_count * sizeof(struct cpia2_reg_mask); in cpia2_send_command()
553 buffer = (u8 *) & cmd->buffer; in cpia2_send_command()
555 DBG("%s Mask: Register block %s\n", DIR(cmd), in cpia2_send_command()
556 block_name[BINDEX(cmd)]); in cpia2_send_command()
559 count = cmd->reg_count; in cpia2_send_command()
560 start = cmd->start; in cpia2_send_command()
561 buffer = cmd->buffer.block_data; in cpia2_send_command()
563 DBG("%s Repeat: Register block %s\n", DIR(cmd), in cpia2_send_command()
564 block_name[BINDEX(cmd)]); in cpia2_send_command()
573 cmd->req_mode, in cpia2_send_command()
574 start, count, cmd->direction); in cpia2_send_command()
578 for (i = 0; i < cmd->reg_count; i++) { in cpia2_send_command()
579 if((cmd->req_mode & 0x0c) == CAMERAACCESS_TYPE_BLOCK) in cpia2_send_command()
581 DIR(cmd), start + i, buffer[i]); in cpia2_send_command()
582 if((cmd->req_mode & 0x0c) == CAMERAACCESS_TYPE_RANDOM) in cpia2_send_command()
584 DIR(cmd), cmd->buffer.registers[i].index, in cpia2_send_command()
585 cmd->buffer.registers[i].value); in cpia2_send_command()
621 struct cpia2_command cmd; in cpia2_reset_camera() local
635 cmd.req_mode = CAMERAACCESS_TYPE_RANDOM | CAMERAACCESS_VC; in cpia2_reset_camera()
636 cmd.direction = TRANSFER_WRITE; in cpia2_reset_camera()
637 cmd.reg_count = 2; in cpia2_reset_camera()
638 cmd.buffer.registers[0].index = CPIA2_VC_ST_CTRL; in cpia2_reset_camera()
639 cmd.buffer.registers[0].value = CPIA2_VC_ST_CTRL_SRC_VC | in cpia2_reset_camera()
641 cmd.buffer.registers[1].index = CPIA2_VC_ST_CTRL; in cpia2_reset_camera()
642 cmd.buffer.registers[1].value = CPIA2_VC_ST_CTRL_SRC_VC | in cpia2_reset_camera()
646 cpia2_send_command(cam, &cmd); in cpia2_reset_camera()
652 cmd.req_mode = CAMERAACCESS_TYPE_RANDOM | CAMERAACCESS_SYSTEM; in cpia2_reset_camera()
653 cmd.buffer.registers[0].index = CPIA2_SYSTEM_INT_PACKET_CTRL; in cpia2_reset_camera()
654 cmd.buffer.registers[0].value = in cpia2_reset_camera()
656 cmd.reg_count = 1; in cpia2_reset_camera()
657 cpia2_send_command(cam, &cmd); in cpia2_reset_camera()
672 cmd.req_mode = CAMERAACCESS_TYPE_RANDOM | CAMERAACCESS_VP; in cpia2_reset_camera()
675 cmd.buffer.registers[0].index = CPIA2_VP5_MYBLACK_LEVEL; in cpia2_reset_camera()
676 cmd.buffer.registers[0].value = 0; /* reduce from the default in cpia2_reset_camera()
678 cmd.buffer.registers[1].index = CPIA2_VP5_MCYRANGE; in cpia2_reset_camera()
679 cmd.buffer.registers[1].value = 0x92; /* increase from 100% to in cpia2_reset_camera()
682 cmd.buffer.registers[2].index = CPIA2_VP5_MYCEILING; in cpia2_reset_camera()
683 cmd.buffer.registers[2].value = 0xFF; /* Increase from the in cpia2_reset_camera()
686 cmd.buffer.registers[3].index = CPIA2_VP5_MCUVSATURATION; in cpia2_reset_camera()
687 cmd.buffer.registers[3].value = 0xFF; /* Increase from the rec in cpia2_reset_camera()
690 cmd.buffer.registers[4].index = CPIA2_VP5_ANTIFLKRSETUP; in cpia2_reset_camera()
691 cmd.buffer.registers[4].value = 0x80; /* Inhibit the in cpia2_reset_camera()
695 cmd.buffer.registers[5].index = CPIA2_VP_RAM_ADDR_H; in cpia2_reset_camera()
696 cmd.buffer.registers[5].value = 0x01; in cpia2_reset_camera()
697 cmd.buffer.registers[6].index = CPIA2_VP_RAM_ADDR_L; in cpia2_reset_camera()
698 cmd.buffer.registers[6].value = 0xE3; in cpia2_reset_camera()
699 cmd.buffer.registers[7].index = CPIA2_VP_RAM_DATA; in cpia2_reset_camera()
700 cmd.buffer.registers[7].value = 0x02; in cpia2_reset_camera()
701 cmd.buffer.registers[8].index = CPIA2_VP_RAM_DATA; in cpia2_reset_camera()
702 cmd.buffer.registers[8].value = 0xFC; in cpia2_reset_camera()
704 cmd.direction = TRANSFER_WRITE; in cpia2_reset_camera()
705 cmd.reg_count = 9; in cpia2_reset_camera()
707 cpia2_send_command(cam, &cmd); in cpia2_reset_camera()
731 cmd.buffer.registers[0].value = tmp_reg & in cpia2_reset_camera()
735 cmd.buffer.registers[1].value = cam->params.vp_params.device_config | in cpia2_reset_camera()
737 cmd.buffer.registers[0].index = CPIA2_VP_SYSTEMCTRL; in cpia2_reset_camera()
738 cmd.buffer.registers[1].index = CPIA2_VP_DEVICE_CONFIG; in cpia2_reset_camera()
739 cmd.req_mode = CAMERAACCESS_TYPE_RANDOM | CAMERAACCESS_VP; in cpia2_reset_camera()
740 cmd.reg_count = 2; in cpia2_reset_camera()
741 cmd.direction = TRANSFER_WRITE; in cpia2_reset_camera()
742 cmd.start = 0; in cpia2_reset_camera()
743 cpia2_send_command(cam, &cmd); in cpia2_reset_camera()
777 cmd.buffer.registers[0].value = cam->params.vp_params.device_config & in cpia2_reset_camera()
781 cmd.buffer.registers[1].value = in cpia2_reset_camera()
784 cmd.buffer.registers[0].index = CPIA2_VP_DEVICE_CONFIG; in cpia2_reset_camera()
785 cmd.buffer.registers[1].index = CPIA2_VP_SYSTEMCTRL; in cpia2_reset_camera()
786 cmd.req_mode = CAMERAACCESS_TYPE_RANDOM | CAMERAACCESS_VP; in cpia2_reset_camera()
787 cmd.reg_count = 2; in cpia2_reset_camera()
788 cmd.direction = TRANSFER_WRITE; in cpia2_reset_camera()
790 cpia2_send_command(cam, &cmd); in cpia2_reset_camera()
891 struct cpia2_command *cmd, in cpia2_send_onebyte_command() argument
894 cmd->buffer.block_data[0] = datum; in cpia2_send_onebyte_command()
895 cmd->start = start; in cpia2_send_onebyte_command()
896 cmd->reg_count = 1; in cpia2_send_onebyte_command()
897 return cpia2_send_command(cam, cmd); in cpia2_send_onebyte_command()
905 struct cpia2_command cmd; in apply_vp_patch() local
914 cmd.req_mode = CAMERAACCESS_TYPE_REPEAT | CAMERAACCESS_VP; in apply_vp_patch()
915 cmd.direction = TRANSFER_WRITE; in apply_vp_patch()
918 cpia2_send_onebyte_command(cam, &cmd, 0x0A, fw->data[0]); /* hi */ in apply_vp_patch()
919 cpia2_send_onebyte_command(cam, &cmd, 0x0B, fw->data[1]); /* lo */ in apply_vp_patch()
923 cmd.start = 0x0C; /* Data */ in apply_vp_patch()
924 cmd.reg_count = min_t(int, 64, fw->size - i); in apply_vp_patch()
925 memcpy(cmd.buffer.block_data, &fw->data[i], cmd.reg_count); in apply_vp_patch()
926 cpia2_send_command(cam, &cmd); in apply_vp_patch()
930 cpia2_send_onebyte_command(cam, &cmd, 0x0A, fw->data[0]); /* hi */ in apply_vp_patch()
931 cpia2_send_onebyte_command(cam, &cmd, 0x0B, fw->data[1]); /* lo */ in apply_vp_patch()
934 cpia2_send_onebyte_command(cam, &cmd, 0x0D, 1); in apply_vp_patch()
1144 struct cpia2_command cmd; in config_sensor_410() local
1187 cmd.req_mode = CAMERAACCESS_TYPE_RANDOM | CAMERAACCESS_VC; in config_sensor_410()
1188 cmd.direction = TRANSFER_WRITE; in config_sensor_410()
1191 cmd.buffer.registers[i].index = CPIA2_VC_VC_FORMAT; in config_sensor_410()
1193 cmd.buffer.registers[i++].value = in config_sensor_410()
1197 cmd.buffer.registers[i++].value = in config_sensor_410()
1202 cmd.buffer.registers[i].index = CPIA2_VC_VC_CLOCKS; in config_sensor_410()
1205 cmd.buffer.registers[i++].value= in config_sensor_410()
1212 cmd.buffer.registers[i++].value= in config_sensor_410()
1218 cmd.buffer.registers[i++].value = in config_sensor_410()
1223 cmd.buffer.registers[i++].value = in config_sensor_410()
1229 DBG("VC_Clocks (0xc4) = 0x%0X\n", cmd.buffer.registers[i-1].value); in config_sensor_410()
1232 cmd.buffer.registers[i].index = CPIA2_VC_VC_IHSIZE_LO; in config_sensor_410()
1234 cmd.buffer.registers[i++].value = in config_sensor_410()
1237 cmd.buffer.registers[i++].value = in config_sensor_410()
1241 cmd.buffer.registers[i].index = CPIA2_VC_VC_XLIM_HI; in config_sensor_410()
1243 cmd.buffer.registers[i++].value = (u8) 0; in config_sensor_410()
1245 cmd.buffer.registers[i++].value = (u8) 1; in config_sensor_410()
1247 cmd.buffer.registers[i].index = CPIA2_VC_VC_XLIM_LO; in config_sensor_410()
1249 cmd.buffer.registers[i++].value = (u8) 208; in config_sensor_410()
1251 cmd.buffer.registers[i++].value = (u8) 160; in config_sensor_410()
1253 cmd.buffer.registers[i].index = CPIA2_VC_VC_YLIM_HI; in config_sensor_410()
1255 cmd.buffer.registers[i++].value = (u8) 0; in config_sensor_410()
1257 cmd.buffer.registers[i++].value = (u8) 1; in config_sensor_410()
1259 cmd.buffer.registers[i].index = CPIA2_VC_VC_YLIM_LO; in config_sensor_410()
1261 cmd.buffer.registers[i++].value = (u8) 160; in config_sensor_410()
1263 cmd.buffer.registers[i++].value = (u8) 64; in config_sensor_410()
1266 cmd.buffer.registers[i].index = CPIA2_VC_VC_OHSIZE; in config_sensor_410()
1267 cmd.buffer.registers[i++].value = cam->params.roi.width / 4; in config_sensor_410()
1269 cmd.buffer.registers[i].index = CPIA2_VC_VC_OVSIZE; in config_sensor_410()
1270 cmd.buffer.registers[i++].value = cam->params.roi.height / 4; in config_sensor_410()
1273 cmd.buffer.registers[i].index = CPIA2_VC_VC_HCROP; in config_sensor_410()
1275 cmd.buffer.registers[i++].value = in config_sensor_410()
1278 cmd.buffer.registers[i++].value = in config_sensor_410()
1281 cmd.buffer.registers[i].index = CPIA2_VC_VC_VCROP; in config_sensor_410()
1283 cmd.buffer.registers[i++].value = in config_sensor_410()
1286 cmd.buffer.registers[i++].value = in config_sensor_410()
1290 cmd.buffer.registers[i].index = CPIA2_VC_VC_HPHASE; in config_sensor_410()
1291 cmd.buffer.registers[i++].value = (u8) 0; in config_sensor_410()
1293 cmd.buffer.registers[i].index = CPIA2_VC_VC_VPHASE; in config_sensor_410()
1294 cmd.buffer.registers[i++].value = (u8) 0; in config_sensor_410()
1296 cmd.buffer.registers[i].index = CPIA2_VC_VC_HISPAN; in config_sensor_410()
1297 cmd.buffer.registers[i++].value = (u8) 31; in config_sensor_410()
1299 cmd.buffer.registers[i].index = CPIA2_VC_VC_VISPAN; in config_sensor_410()
1300 cmd.buffer.registers[i++].value = (u8) 31; in config_sensor_410()
1302 cmd.buffer.registers[i].index = CPIA2_VC_VC_HICROP; in config_sensor_410()
1303 cmd.buffer.registers[i++].value = (u8) 0; in config_sensor_410()
1305 cmd.buffer.registers[i].index = CPIA2_VC_VC_VICROP; in config_sensor_410()
1306 cmd.buffer.registers[i++].value = (u8) 0; in config_sensor_410()
1308 cmd.buffer.registers[i].index = CPIA2_VC_VC_HFRACT; in config_sensor_410()
1309 cmd.buffer.registers[i++].value = (u8) 0x81; /* = 8/1 = 8 (HIBYTE/LOBYTE) */ in config_sensor_410()
1311 cmd.buffer.registers[i].index = CPIA2_VC_VC_VFRACT; in config_sensor_410()
1312 cmd.buffer.registers[i++].value = (u8) 0x81; /* = 8/1 = 8 (HIBYTE/LOBYTE) */ in config_sensor_410()
1314 cmd.reg_count = i; in config_sensor_410()
1316 cpia2_send_command(cam, &cmd); in config_sensor_410()
1330 struct cpia2_command cmd; in config_sensor_500() local
1361 cmd.req_mode = CAMERAACCESS_TYPE_RANDOM | CAMERAACCESS_VC; in config_sensor_500()
1362 cmd.direction = TRANSFER_WRITE; in config_sensor_500()
1366 cmd.buffer.registers[i].index = CPIA2_VC_VC_FORMAT; in config_sensor_500()
1367 cmd.buffer.registers[i].value = (u8) CPIA2_VC_VC_FORMAT_UFIRST; in config_sensor_500()
1369 cmd.buffer.registers[i].value |= (u8) CPIA2_VC_VC_FORMAT_DECIMATING; in config_sensor_500()
1373 cmd.buffer.registers[i].index = CPIA2_VC_VC_CLOCKS; in config_sensor_500()
1376 cmd.buffer.registers[i].value = in config_sensor_500()
1379 cmd.buffer.registers[i].value = in config_sensor_500()
1384 cmd.buffer.registers[i].value = in config_sensor_500()
1387 cmd.buffer.registers[i].value = in config_sensor_500()
1393 DBG("VC_CLOCKS = 0x%X\n", cmd.buffer.registers[i-1].value); in config_sensor_500()
1396 cmd.buffer.registers[i].index = CPIA2_VC_VC_IHSIZE_LO; in config_sensor_500()
1398 cmd.buffer.registers[i].value = in config_sensor_500()
1401 cmd.buffer.registers[i].value = in config_sensor_500()
1404 DBG("Input width = %d\n", cmd.buffer.registers[i-1].value); in config_sensor_500()
1407 cmd.buffer.registers[i].index = CPIA2_VC_VC_XLIM_HI; in config_sensor_500()
1409 cmd.buffer.registers[i++].value = (u8) 2; in config_sensor_500()
1411 cmd.buffer.registers[i++].value = (u8) 1; in config_sensor_500()
1413 cmd.buffer.registers[i].index = CPIA2_VC_VC_XLIM_LO; in config_sensor_500()
1415 cmd.buffer.registers[i++].value = (u8) 250; in config_sensor_500()
1417 cmd.buffer.registers[i++].value = (u8) 125; in config_sensor_500()
1419 cmd.buffer.registers[i++].value = (u8) 160; in config_sensor_500()
1421 cmd.buffer.registers[i].index = CPIA2_VC_VC_YLIM_HI; in config_sensor_500()
1423 cmd.buffer.registers[i++].value = (u8) 2; in config_sensor_500()
1425 cmd.buffer.registers[i++].value = (u8) 1; in config_sensor_500()
1427 cmd.buffer.registers[i].index = CPIA2_VC_VC_YLIM_LO; in config_sensor_500()
1429 cmd.buffer.registers[i++].value = (u8) 12; in config_sensor_500()
1431 cmd.buffer.registers[i++].value = (u8) 64; in config_sensor_500()
1433 cmd.buffer.registers[i++].value = (u8) 6; in config_sensor_500()
1436 cmd.buffer.registers[i].index = CPIA2_VC_VC_OHSIZE; in config_sensor_500()
1438 cmd.buffer.registers[i++].value = STV_IMAGE_CIF_COLS / 4; in config_sensor_500()
1440 cmd.buffer.registers[i++].value = width / 4; in config_sensor_500()
1442 cmd.buffer.registers[i].index = CPIA2_VC_VC_OVSIZE; in config_sensor_500()
1444 cmd.buffer.registers[i++].value = STV_IMAGE_CIF_ROWS / 4; in config_sensor_500()
1446 cmd.buffer.registers[i++].value = height / 4; in config_sensor_500()
1449 cmd.buffer.registers[i].index = CPIA2_VC_VC_HCROP; in config_sensor_500()
1451 cmd.buffer.registers[i++].value = in config_sensor_500()
1454 cmd.buffer.registers[i++].value = in config_sensor_500()
1457 cmd.buffer.registers[i++].value = in config_sensor_500()
1460 cmd.buffer.registers[i++].value = in config_sensor_500()
1463 cmd.buffer.registers[i].index = CPIA2_VC_VC_VCROP; in config_sensor_500()
1465 cmd.buffer.registers[i++].value = in config_sensor_500()
1468 cmd.buffer.registers[i++].value = in config_sensor_500()
1471 cmd.buffer.registers[i++].value = in config_sensor_500()
1474 cmd.buffer.registers[i++].value = in config_sensor_500()
1478 cmd.buffer.registers[i].index = CPIA2_VC_VC_HPHASE; in config_sensor_500()
1480 cmd.buffer.registers[i++].value = (u8) 36; in config_sensor_500()
1482 cmd.buffer.registers[i++].value = (u8) 0; in config_sensor_500()
1484 cmd.buffer.registers[i].index = CPIA2_VC_VC_VPHASE; in config_sensor_500()
1486 cmd.buffer.registers[i++].value = (u8) 32; in config_sensor_500()
1488 cmd.buffer.registers[i++].value = (u8) 0; in config_sensor_500()
1490 cmd.buffer.registers[i].index = CPIA2_VC_VC_HISPAN; in config_sensor_500()
1492 cmd.buffer.registers[i++].value = (u8) 26; in config_sensor_500()
1494 cmd.buffer.registers[i++].value = (u8) 31; in config_sensor_500()
1496 cmd.buffer.registers[i].index = CPIA2_VC_VC_VISPAN; in config_sensor_500()
1498 cmd.buffer.registers[i++].value = (u8) 21; in config_sensor_500()
1500 cmd.buffer.registers[i++].value = (u8) 31; in config_sensor_500()
1502 cmd.buffer.registers[i].index = CPIA2_VC_VC_HICROP; in config_sensor_500()
1503 cmd.buffer.registers[i++].value = (u8) 0; in config_sensor_500()
1505 cmd.buffer.registers[i].index = CPIA2_VC_VC_VICROP; in config_sensor_500()
1506 cmd.buffer.registers[i++].value = (u8) 0; in config_sensor_500()
1508 cmd.buffer.registers[i].index = CPIA2_VC_VC_HFRACT; in config_sensor_500()
1510 cmd.buffer.registers[i++].value = (u8) 0x2B; /* 2/11 */ in config_sensor_500()
1512 cmd.buffer.registers[i++].value = (u8) 0x81; /* 8/1 */ in config_sensor_500()
1514 cmd.buffer.registers[i].index = CPIA2_VC_VC_VFRACT; in config_sensor_500()
1516 cmd.buffer.registers[i++].value = (u8) 0x13; /* 1/3 */ in config_sensor_500()
1518 cmd.buffer.registers[i++].value = (u8) 0x81; /* 8/1 */ in config_sensor_500()
1520 cmd.reg_count = i; in config_sensor_500()
1522 cpia2_send_command(cam, &cmd); in config_sensor_500()
1891 struct cpia2_command cmd; in set_lowlight_boost() local
1897 cmd.direction = TRANSFER_WRITE; in set_lowlight_boost()
1898 cmd.req_mode = CAMERAACCESS_TYPE_BLOCK | CAMERAACCESS_VP; in set_lowlight_boost()
1899 cmd.reg_count = 3; in set_lowlight_boost()
1900 cmd.start = CPIA2_VP_RAM_ADDR_H; in set_lowlight_boost()
1902 cmd.buffer.block_data[0] = 0; /* High byte of address to write to */ in set_lowlight_boost()
1903 cmd.buffer.block_data[1] = 0x59; /* Low byte of address to write to */ in set_lowlight_boost()
1904 cmd.buffer.block_data[2] = 0; /* High byte of data to write */ in set_lowlight_boost()
1906 cpia2_send_command(cam, &cmd); in set_lowlight_boost()
1909 cmd.buffer.block_data[0] = 0x02; /* Low byte data to write */ in set_lowlight_boost()
1911 cmd.buffer.block_data[0] = 0x06; in set_lowlight_boost()
1913 cmd.start = CPIA2_VP_RAM_DATA; in set_lowlight_boost()
1914 cmd.reg_count = 1; in set_lowlight_boost()
1915 cpia2_send_command(cam, &cmd); in set_lowlight_boost()
1951 struct cpia2_command cmd; in cpia2_dbg_dump_registers() local
1956 cmd.direction = TRANSFER_READ; in cpia2_dbg_dump_registers()
1959 cmd.req_mode = CAMERAACCESS_TYPE_BLOCK | CAMERAACCESS_SYSTEM; in cpia2_dbg_dump_registers()
1960 cmd.reg_count = 3; in cpia2_dbg_dump_registers()
1961 cmd.start = 0; in cpia2_dbg_dump_registers()
1962 cpia2_send_command(cam, &cmd); in cpia2_dbg_dump_registers()
1964 cmd.buffer.block_data[0]); in cpia2_dbg_dump_registers()
1966 cmd.buffer.block_data[1]); in cpia2_dbg_dump_registers()
1968 cmd.buffer.block_data[2]); in cpia2_dbg_dump_registers()
1971 cmd.req_mode = CAMERAACCESS_TYPE_BLOCK | CAMERAACCESS_VC; in cpia2_dbg_dump_registers()
1972 cmd.reg_count = 4; in cpia2_dbg_dump_registers()
1973 cmd.start = 0x80; in cpia2_dbg_dump_registers()
1974 cpia2_send_command(cam, &cmd); in cpia2_dbg_dump_registers()
1976 cmd.buffer.block_data[0]); in cpia2_dbg_dump_registers()
1978 cmd.buffer.block_data[1]); in cpia2_dbg_dump_registers()
1980 cmd.buffer.block_data[2]); in cpia2_dbg_dump_registers()
1982 cmd.buffer.block_data[3]); in cpia2_dbg_dump_registers()
1984 cmd.start = 0xA0; /* ST_CTRL */ in cpia2_dbg_dump_registers()
1985 cmd.reg_count = 1; in cpia2_dbg_dump_registers()
1986 cpia2_send_command(cam, &cmd); in cpia2_dbg_dump_registers()
1988 cmd.buffer.block_data[0]); in cpia2_dbg_dump_registers()
1990 cmd.start = 0xA4; /* Stream status */ in cpia2_dbg_dump_registers()
1991 cpia2_send_command(cam, &cmd); in cpia2_dbg_dump_registers()
1993 cmd.buffer.block_data[0]); in cpia2_dbg_dump_registers()
1995 cmd.start = 0xA8; /* USB status */ in cpia2_dbg_dump_registers()
1996 cmd.reg_count = 3; in cpia2_dbg_dump_registers()
1997 cpia2_send_command(cam, &cmd); in cpia2_dbg_dump_registers()
1999 cmd.buffer.block_data[0]); in cpia2_dbg_dump_registers()
2001 cmd.buffer.block_data[1]); in cpia2_dbg_dump_registers()
2003 cmd.buffer.block_data[2]); in cpia2_dbg_dump_registers()
2005 cmd.start = 0xAF; /* USB settings */ in cpia2_dbg_dump_registers()
2006 cmd.reg_count = 1; in cpia2_dbg_dump_registers()
2007 cpia2_send_command(cam, &cmd); in cpia2_dbg_dump_registers()
2009 cmd.buffer.block_data[0]); in cpia2_dbg_dump_registers()
2011 cmd.start = 0xC0; /* VC stuff */ in cpia2_dbg_dump_registers()
2012 cmd.reg_count = 26; in cpia2_dbg_dump_registers()
2013 cpia2_send_command(cam, &cmd); in cpia2_dbg_dump_registers()
2015 cmd.buffer.block_data[0]); in cpia2_dbg_dump_registers()
2017 cmd.buffer.block_data[3]); in cpia2_dbg_dump_registers()
2019 cmd.buffer.block_data[4]); in cpia2_dbg_dump_registers()
2021 cmd.buffer.block_data[5]); in cpia2_dbg_dump_registers()
2023 cmd.buffer.block_data[6]); in cpia2_dbg_dump_registers()
2025 cmd.buffer.block_data[7]); in cpia2_dbg_dump_registers()
2027 cmd.buffer.block_data[8]); in cpia2_dbg_dump_registers()
2029 cmd.buffer.block_data[9]); in cpia2_dbg_dump_registers()
2031 cmd.buffer.block_data[10]); in cpia2_dbg_dump_registers()
2033 cmd.buffer.block_data[11]); in cpia2_dbg_dump_registers()
2035 cmd.buffer.block_data[12]); in cpia2_dbg_dump_registers()
2037 cmd.buffer.block_data[13]); in cpia2_dbg_dump_registers()
2039 cmd.buffer.block_data[14]); in cpia2_dbg_dump_registers()
2041 cmd.buffer.block_data[15]); in cpia2_dbg_dump_registers()
2043 cmd.buffer.block_data[16]); in cpia2_dbg_dump_registers()
2045 cmd.buffer.block_data[17]); in cpia2_dbg_dump_registers()
2047 cmd.buffer.block_data[18]); in cpia2_dbg_dump_registers()
2049 cmd.buffer.block_data[19]); in cpia2_dbg_dump_registers()
2051 cmd.buffer.block_data[20]); in cpia2_dbg_dump_registers()
2053 cmd.buffer.block_data[21]); in cpia2_dbg_dump_registers()
2055 cmd.buffer.block_data[22]); in cpia2_dbg_dump_registers()
2057 cmd.buffer.block_data[23]); in cpia2_dbg_dump_registers()
2059 cmd.buffer.block_data[24]); in cpia2_dbg_dump_registers()
2061 cmd.buffer.block_data[25]); in cpia2_dbg_dump_registers()
2064 cmd.req_mode = CAMERAACCESS_TYPE_BLOCK | CAMERAACCESS_VP; in cpia2_dbg_dump_registers()
2065 cmd.reg_count = 14; in cpia2_dbg_dump_registers()
2066 cmd.start = 0; in cpia2_dbg_dump_registers()
2067 cpia2_send_command(cam, &cmd); in cpia2_dbg_dump_registers()
2070 cmd.buffer.block_data[0]); in cpia2_dbg_dump_registers()
2072 cmd.buffer.block_data[1]); in cpia2_dbg_dump_registers()
2074 cmd.buffer.block_data[2]); in cpia2_dbg_dump_registers()
2076 cmd.buffer.block_data[3]); in cpia2_dbg_dump_registers()
2078 cmd.buffer.block_data[5]); in cpia2_dbg_dump_registers()
2080 cmd.buffer.block_data[6]); in cpia2_dbg_dump_registers()
2082 cmd.buffer.block_data[7]); in cpia2_dbg_dump_registers()
2084 cmd.buffer.block_data[8]); in cpia2_dbg_dump_registers()
2086 cmd.buffer.block_data[9]); in cpia2_dbg_dump_registers()
2088 cmd.buffer.block_data[10]); in cpia2_dbg_dump_registers()
2090 cmd.buffer.block_data[11]); in cpia2_dbg_dump_registers()
2092 cmd.buffer.block_data[12]); in cpia2_dbg_dump_registers()
2094 cmd.buffer.block_data[13]); in cpia2_dbg_dump_registers()
2097 cmd.reg_count = 9; in cpia2_dbg_dump_registers()
2098 cmd.start = 0x0E; in cpia2_dbg_dump_registers()
2099 cpia2_send_command(cam, &cmd); in cpia2_dbg_dump_registers()
2101 cmd.buffer.block_data[0]); in cpia2_dbg_dump_registers()
2103 cmd.buffer.block_data[1]); in cpia2_dbg_dump_registers()
2105 cmd.buffer.block_data[2]); in cpia2_dbg_dump_registers()
2107 cmd.buffer.block_data[3]); in cpia2_dbg_dump_registers()
2109 cmd.buffer.block_data[4]); in cpia2_dbg_dump_registers()
2111 cmd.buffer.block_data[5]); in cpia2_dbg_dump_registers()
2113 cmd.buffer.block_data[6]); in cpia2_dbg_dump_registers()
2115 cmd.buffer.block_data[7]); in cpia2_dbg_dump_registers()
2117 cmd.buffer.block_data[8]); in cpia2_dbg_dump_registers()
2119 cmd.reg_count = 1; in cpia2_dbg_dump_registers()
2120 cmd.start = 0x1B; in cpia2_dbg_dump_registers()
2121 cpia2_send_command(cam, &cmd); in cpia2_dbg_dump_registers()
2123 cmd.buffer.block_data[0]); in cpia2_dbg_dump_registers()
2125 cmd.reg_count = 8 ; in cpia2_dbg_dump_registers()
2126 cmd.start = 0x0E; in cpia2_dbg_dump_registers()
2127 cpia2_send_command(cam, &cmd); in cpia2_dbg_dump_registers()
2129 cmd.buffer.block_data[0]); in cpia2_dbg_dump_registers()
2131 cmd.buffer.block_data[1]); in cpia2_dbg_dump_registers()
2133 cmd.buffer.block_data[5]); in cpia2_dbg_dump_registers()
2135 cmd.buffer.block_data[6]); in cpia2_dbg_dump_registers()
2137 cmd.buffer.block_data[7]); in cpia2_dbg_dump_registers()
2139 cmd.reg_count = 1; in cpia2_dbg_dump_registers()
2140 cmd.start = CPIA2_VP5_EXPOSURE_TARGET; in cpia2_dbg_dump_registers()
2141 cpia2_send_command(cam, &cmd); in cpia2_dbg_dump_registers()
2143 cmd.buffer.block_data[0]); in cpia2_dbg_dump_registers()
2145 cmd.reg_count = 4; in cpia2_dbg_dump_registers()
2146 cmd.start = 0x3A; in cpia2_dbg_dump_registers()
2147 cpia2_send_command(cam, &cmd); in cpia2_dbg_dump_registers()
2149 cmd.buffer.block_data[0]); in cpia2_dbg_dump_registers()
2151 cmd.buffer.block_data[1]); in cpia2_dbg_dump_registers()
2153 cmd.buffer.block_data[2]); in cpia2_dbg_dump_registers()
2155 cmd.buffer.block_data[3]); in cpia2_dbg_dump_registers()