Lines Matching refs:pdev
168 usb_control_msg(pdev->udev, usb_sndctrlpipe(pdev->udev, 0), \
172 pdev->vcinterface, \
176 usb_control_msg(pdev->udev, usb_rcvctrlpipe(pdev->udev, 0), \
180 pdev->vcinterface, \
221 static inline int set_video_mode_Nala(struct pwc_device *pdev, int size, int frames) in set_video_mode_Nala() argument
254 if (pEntry->compressed && pdev->decompressor == NULL) in set_video_mode_Nala()
258 ret = send_video_command(pdev->udev, pdev->vendpoint, buf, 3); in set_video_mode_Nala()
263 if (pEntry->compressed && pdev->decompressor != NULL) in set_video_mode_Nala()
264 pdev->decompressor->init(pdev->release, buf, pdev->decompress_data); in set_video_mode_Nala()
267 pdev->vframes = frames; in set_video_mode_Nala()
268 pdev->vsize = size; in set_video_mode_Nala()
269 pdev->valternate = pEntry->alternate; in set_video_mode_Nala()
270 pdev->image = pwc_image_sizes[size]; in set_video_mode_Nala()
271 pdev->frame_size = (pdev->image.x * pdev->image.y * 3) / 2; in set_video_mode_Nala()
273 if (pdev->release < 5) { /* 4 fold compression */ in set_video_mode_Nala()
274 pdev->vbandlength = 528; in set_video_mode_Nala()
275 pdev->frame_size /= 4; in set_video_mode_Nala()
278 pdev->vbandlength = 704; in set_video_mode_Nala()
279 pdev->frame_size /= 3; in set_video_mode_Nala()
283 pdev->vbandlength = 0; in set_video_mode_Nala()
288 static inline int set_video_mode_Timon(struct pwc_device *pdev, int size, int frames, int compressi… in set_video_mode_Timon() argument
304 if (pdev->decompressor == NULL) { in set_video_mode_Timon()
324 ret = send_video_command(pdev->udev, pdev->vendpoint, buf, 13); in set_video_mode_Timon()
329 pdev->decompressor->init(pdev->release, buf, pdev->decompress_data); in set_video_mode_Timon()
332 pdev->vframes = frames; in set_video_mode_Timon()
333 pdev->vsize = size; in set_video_mode_Timon()
334 pdev->vsnapshot = snapshot; in set_video_mode_Timon()
335 pdev->valternate = pChoose->alternate; in set_video_mode_Timon()
336 pdev->image = pwc_image_sizes[size]; in set_video_mode_Timon()
337 pdev->vbandlength = pChoose->bandlength; in set_video_mode_Timon()
339 pdev->frame_size = (pChoose->bandlength * pdev->image.y) / 4; in set_video_mode_Timon()
341 pdev->frame_size = (pdev->image.x * pdev->image.y * 12) / 8; in set_video_mode_Timon()
346 static inline int set_video_mode_Kiara(struct pwc_device *pdev, int size, int frames, int compressi… in set_video_mode_Kiara() argument
362 if (pdev->decompressor == NULL) { in set_video_mode_Kiara()
385 ret = send_video_command(pdev->udev, 4 /* pdev->vendpoint */, buf, 12); in set_video_mode_Kiara()
390 pdev->decompressor->init(pdev->release, buf, pdev->decompress_data); in set_video_mode_Kiara()
393 pdev->vframes = frames; in set_video_mode_Kiara()
394 pdev->vsize = size; in set_video_mode_Kiara()
395 pdev->vsnapshot = snapshot; in set_video_mode_Kiara()
396 pdev->valternate = pChoose->alternate; in set_video_mode_Kiara()
397 pdev->image = pwc_image_sizes[size]; in set_video_mode_Kiara()
398 pdev->vbandlength = pChoose->bandlength; in set_video_mode_Kiara()
400 pdev->frame_size = (pChoose->bandlength * pdev->image.y) / 4; in set_video_mode_Kiara()
402 pdev->frame_size = (pdev->image.x * pdev->image.y * 12) / 8; in set_video_mode_Kiara()
403 pdev->frame_size += (pdev->frame_header_size + pdev->frame_trailer_size); in set_video_mode_Kiara()
416 int pwc_set_video_mode(struct pwc_device *pdev, int width, int height, int frames, int compression,… in pwc_set_video_mode() argument
420 size = pwc_decode_size(pdev, width, height); in pwc_set_video_mode()
426 switch(pdev->type) { in pwc_set_video_mode()
429 ret = set_video_mode_Nala(pdev, size, frames); in pwc_set_video_mode()
435 ret = set_video_mode_Timon(pdev, size, frames, compression, snapshot); in pwc_set_video_mode()
441 ret = set_video_mode_Kiara(pdev, size, frames, compression, snapshot); in pwc_set_video_mode()
452 pdev->view.x = width; in pwc_set_video_mode()
453 pdev->view.y = height; in pwc_set_video_mode()
454 pwc_set_image_buffer_size(pdev); in pwc_set_video_mode()
460 void pwc_set_image_buffer_size(struct pwc_device *pdev) in pwc_set_image_buffer_size() argument
469 pdev->image.size = pdev->image.x * pdev->image.y * factor / 4; in pwc_set_image_buffer_size()
470 pdev->view.size = pdev->view.x * pdev->view.y * factor / 4; in pwc_set_image_buffer_size()
477 pdev->offset.x = ((pdev->view.x - pdev->image.x) / 2) & 0xFFFC; in pwc_set_image_buffer_size()
478 pdev->offset.y = ((pdev->view.y - pdev->image.y) / 2) & 0xFFFE; in pwc_set_image_buffer_size()
482 if (pdev->image_ptr[i] != NULL) in pwc_set_image_buffer_size()
483 memset(pdev->image_ptr[i], filler, pdev->view.size); in pwc_set_image_buffer_size()
491 int pwc_get_brightness(struct pwc_device *pdev) in pwc_get_brightness() argument
496 ret = usb_control_msg(pdev->udev, usb_rcvctrlpipe(pdev->udev, 0), in pwc_get_brightness()
500 pdev->vcinterface, in pwc_get_brightness()
507 int pwc_set_brightness(struct pwc_device *pdev, int value) in pwc_set_brightness() argument
516 return usb_control_msg(pdev->udev, usb_sndctrlpipe(pdev->udev, 0), in pwc_set_brightness()
520 pdev->vcinterface, in pwc_set_brightness()
526 int pwc_get_contrast(struct pwc_device *pdev) in pwc_get_contrast() argument
531 ret = usb_control_msg(pdev->udev, usb_rcvctrlpipe(pdev->udev, 0), in pwc_get_contrast()
535 pdev->vcinterface, in pwc_get_contrast()
542 int pwc_set_contrast(struct pwc_device *pdev, int value) in pwc_set_contrast() argument
551 return usb_control_msg(pdev->udev, usb_sndctrlpipe(pdev->udev, 0), in pwc_set_contrast()
555 pdev->vcinterface, in pwc_set_contrast()
561 int pwc_get_gamma(struct pwc_device *pdev) in pwc_get_gamma() argument
566 ret = usb_control_msg(pdev->udev, usb_rcvctrlpipe(pdev->udev, 0), in pwc_get_gamma()
570 pdev->vcinterface, in pwc_get_gamma()
577 int pwc_set_gamma(struct pwc_device *pdev, int value) in pwc_set_gamma() argument
586 return usb_control_msg(pdev->udev, usb_sndctrlpipe(pdev->udev, 0), in pwc_set_gamma()
590 pdev->vcinterface, in pwc_set_gamma()
597 int pwc_get_saturation(struct pwc_device *pdev) in pwc_get_saturation() argument
602 if (pdev->type < 675) in pwc_get_saturation()
604 ret = usb_control_msg(pdev->udev, usb_rcvctrlpipe(pdev->udev, 0), in pwc_get_saturation()
607 pdev->type < 730 ? SATURATION_MODE_FORMATTER2 : SATURATION_MODE_FORMATTER1, in pwc_get_saturation()
608 pdev->vcinterface, in pwc_get_saturation()
615 int pwc_set_saturation(struct pwc_device *pdev, int value) in pwc_set_saturation() argument
619 if (pdev->type < 675) in pwc_set_saturation()
627 return usb_control_msg(pdev->udev, usb_sndctrlpipe(pdev->udev, 0), in pwc_set_saturation()
630 pdev->type < 730 ? SATURATION_MODE_FORMATTER2 : SATURATION_MODE_FORMATTER1, in pwc_set_saturation()
631 pdev->vcinterface, in pwc_set_saturation()
637 static inline int pwc_set_agc(struct pwc_device *pdev, int mode, int value) in pwc_set_agc() argument
647 ret = usb_control_msg(pdev->udev, usb_sndctrlpipe(pdev->udev, 0), in pwc_set_agc()
651 pdev->vcinterface, in pwc_set_agc()
660 ret = usb_control_msg(pdev->udev, usb_sndctrlpipe(pdev->udev, 0), in pwc_set_agc()
664 pdev->vcinterface, in pwc_set_agc()
672 static inline int pwc_get_agc(struct pwc_device *pdev, int *value) in pwc_get_agc() argument
677 ret = usb_control_msg(pdev->udev, usb_rcvctrlpipe(pdev->udev, 0), in pwc_get_agc()
681 pdev->vcinterface, in pwc_get_agc()
687 ret = usb_control_msg(pdev->udev, usb_rcvctrlpipe(pdev->udev, 0), in pwc_get_agc()
691 pdev->vcinterface, in pwc_get_agc()
700 ret = usb_control_msg(pdev->udev, usb_rcvctrlpipe(pdev->udev, 0), in pwc_get_agc()
704 pdev->vcinterface, in pwc_get_agc()
717 static inline int pwc_set_shutter_speed(struct pwc_device *pdev, int mode, int value) in pwc_set_shutter_speed() argument
728 ret = usb_control_msg(pdev->udev, usb_sndctrlpipe(pdev->udev, 0), in pwc_set_shutter_speed()
732 pdev->vcinterface, in pwc_set_shutter_speed()
740 switch(pdev->type) { in pwc_set_shutter_speed()
758 ret = usb_control_msg(pdev->udev, usb_sndctrlpipe(pdev->udev, 0), in pwc_set_shutter_speed()
762 pdev->vcinterface, in pwc_set_shutter_speed()
771 int pwc_camera_power(struct pwc_device *pdev, int power) in pwc_camera_power() argument
775 if (pdev->type < 675 || (pdev->type < 730 && pdev->release < 6)) in pwc_camera_power()
782 return usb_control_msg(pdev->udev, usb_sndctrlpipe(pdev->udev, 0), in pwc_camera_power()
786 pdev->vcinterface, in pwc_camera_power()
794 static inline int pwc_restore_user(struct pwc_device *pdev) in pwc_restore_user() argument
796 return usb_control_msg(pdev->udev, usb_sndctrlpipe(pdev->udev, 0), in pwc_restore_user()
800 pdev->vcinterface, in pwc_restore_user()
804 static inline int pwc_save_user(struct pwc_device *pdev) in pwc_save_user() argument
806 return usb_control_msg(pdev->udev, usb_sndctrlpipe(pdev->udev, 0), in pwc_save_user()
810 pdev->vcinterface, in pwc_save_user()
814 static inline int pwc_restore_factory(struct pwc_device *pdev) in pwc_restore_factory() argument
816 return usb_control_msg(pdev->udev, usb_sndctrlpipe(pdev->udev, 0), in pwc_restore_factory()
820 pdev->vcinterface, in pwc_restore_factory()
836 static inline int pwc_set_awb(struct pwc_device *pdev, int mode) in pwc_set_awb() argument
849 ret = usb_control_msg(pdev->udev, usb_sndctrlpipe(pdev->udev, 0), in pwc_set_awb()
853 pdev->vcinterface, in pwc_set_awb()
861 static inline int pwc_get_awb(struct pwc_device *pdev) in pwc_get_awb() argument
866 ret = usb_control_msg(pdev->udev, usb_rcvctrlpipe(pdev->udev, 0), in pwc_get_awb()
870 pdev->vcinterface, in pwc_get_awb()
878 static inline int pwc_set_red_gain(struct pwc_device *pdev, int value) in pwc_set_red_gain() argument
890 return usb_control_msg(pdev->udev, usb_sndctrlpipe(pdev->udev, 0), in pwc_set_red_gain()
894 pdev->vcinterface, in pwc_set_red_gain()
898 static inline int pwc_get_red_gain(struct pwc_device *pdev) in pwc_get_red_gain() argument
903 ret = usb_control_msg(pdev->udev, usb_rcvctrlpipe(pdev->udev, 0), in pwc_get_red_gain()
907 pdev->vcinterface, in pwc_get_red_gain()
917 static inline int pwc_set_blue_gain(struct pwc_device *pdev, int value) in pwc_set_blue_gain() argument
929 return usb_control_msg(pdev->udev, usb_sndctrlpipe(pdev->udev, 0), in pwc_set_blue_gain()
933 pdev->vcinterface, in pwc_set_blue_gain()
937 static inline int pwc_get_blue_gain(struct pwc_device *pdev) in pwc_get_blue_gain() argument
942 ret = usb_control_msg(pdev->udev, usb_rcvctrlpipe(pdev->udev, 0), in pwc_get_blue_gain()
946 pdev->vcinterface, in pwc_get_blue_gain()
960 static inline int pwc_read_red_gain(struct pwc_device *pdev) in pwc_read_red_gain() argument
965 ret = usb_control_msg(pdev->udev, usb_rcvctrlpipe(pdev->udev, 0), in pwc_read_red_gain()
969 pdev->vcinterface, in pwc_read_red_gain()
978 static inline int pwc_read_blue_gain(struct pwc_device *pdev) in pwc_read_blue_gain() argument
983 ret = usb_control_msg(pdev->udev, usb_rcvctrlpipe(pdev->udev, 0), in pwc_read_blue_gain()
987 pdev->vcinterface, in pwc_read_blue_gain()
997 static inline int pwc_set_wb_speed(struct pwc_device *pdev, int speed) in pwc_set_wb_speed() argument
1003 return usb_control_msg(pdev->udev, usb_sndctrlpipe(pdev->udev, 0), in pwc_set_wb_speed()
1007 pdev->vcinterface, in pwc_set_wb_speed()
1011 static inline int pwc_get_wb_speed(struct pwc_device *pdev) in pwc_get_wb_speed() argument
1016 ret = usb_control_msg(pdev->udev, usb_rcvctrlpipe(pdev->udev, 0), in pwc_get_wb_speed()
1020 pdev->vcinterface, in pwc_get_wb_speed()
1028 static inline int pwc_set_wb_delay(struct pwc_device *pdev, int delay) in pwc_set_wb_delay() argument
1034 return usb_control_msg(pdev->udev, usb_sndctrlpipe(pdev->udev, 0), in pwc_set_wb_delay()
1038 pdev->vcinterface, in pwc_set_wb_delay()
1042 static inline int pwc_get_wb_delay(struct pwc_device *pdev) in pwc_get_wb_delay() argument
1047 ret = usb_control_msg(pdev->udev, usb_rcvctrlpipe(pdev->udev, 0), in pwc_get_wb_delay()
1051 pdev->vcinterface, in pwc_get_wb_delay()
1059 int pwc_set_leds(struct pwc_device *pdev, int on_value, int off_value) in pwc_set_leds() argument
1063 if (pdev->type < 730) in pwc_set_leds()
1082 int pwc_get_leds(struct pwc_device *pdev, int *on_value, int *off_value) in pwc_get_leds() argument
1087 if (pdev->type < 730) { in pwc_get_leds()
1101 static inline int pwc_set_contour(struct pwc_device *pdev, int contour) in pwc_set_contour() argument
1110 ret = usb_control_msg(pdev->udev, usb_sndctrlpipe(pdev->udev, 0), in pwc_set_contour()
1114 pdev->vcinterface, in pwc_set_contour()
1125 ret = usb_control_msg(pdev->udev, usb_sndctrlpipe(pdev->udev, 0), in pwc_set_contour()
1129 pdev->vcinterface, in pwc_set_contour()
1136 static inline int pwc_get_contour(struct pwc_device *pdev, int *contour) in pwc_get_contour() argument
1141 ret = usb_control_msg(pdev->udev, usb_rcvctrlpipe(pdev->udev, 0), in pwc_get_contour()
1145 pdev->vcinterface, in pwc_get_contour()
1152 ret = usb_control_msg(pdev->udev, usb_rcvctrlpipe(pdev->udev, 0), in pwc_get_contour()
1156 pdev->vcinterface, in pwc_get_contour()
1168 static inline int pwc_set_backlight(struct pwc_device *pdev, int backlight) in pwc_set_backlight() argument
1176 return usb_control_msg(pdev->udev, usb_sndctrlpipe(pdev->udev, 0), in pwc_set_backlight()
1180 pdev->vcinterface, in pwc_set_backlight()
1184 static inline int pwc_get_backlight(struct pwc_device *pdev) in pwc_get_backlight() argument
1189 ret = usb_control_msg(pdev->udev, usb_rcvctrlpipe(pdev->udev, 0), in pwc_get_backlight()
1193 pdev->vcinterface, in pwc_get_backlight()
1201 static inline int pwc_set_flicker(struct pwc_device *pdev, int flicker) in pwc_set_flicker() argument
1212 static inline int pwc_get_flicker(struct pwc_device *pdev) in pwc_get_flicker() argument
1224 static inline int pwc_set_dynamic_noise(struct pwc_device *pdev, int noise) in pwc_set_dynamic_noise() argument
1236 static inline int pwc_get_dynamic_noise(struct pwc_device *pdev) in pwc_get_dynamic_noise() argument
1248 int pwc_get_cmos_sensor(struct pwc_device *pdev) in pwc_get_cmos_sensor() argument
1253 if (pdev->type < 675) in pwc_get_cmos_sensor()
1255 else if (pdev->type < 730) in pwc_get_cmos_sensor()
1260 ret = usb_control_msg(pdev->udev, usb_rcvctrlpipe(pdev->udev, 0), in pwc_get_cmos_sensor()
1264 pdev->vcinterface, in pwc_get_cmos_sensor()
1268 if (pdev->type < 675) in pwc_get_cmos_sensor()
1278 int pwc_ioctl(struct pwc_device *pdev, unsigned int cmd, void *arg) in pwc_ioctl() argument
1285 if (pwc_restore_user(pdev)) in pwc_ioctl()
1292 if (pwc_save_user(pdev)) in pwc_ioctl()
1299 if (pwc_restore_factory(pdev)) in pwc_ioctl()
1314 … ret = pwc_try_video_mode(pdev, pdev->view.x, pdev->view.y, pdev->vframes, qual, pdev->vsnapshot); in pwc_ioctl()
1316 pdev->vcompression = qual; in pwc_ioctl()
1323 if (copy_to_user(arg, &pdev->vcompression, sizeof(int))) in pwc_ioctl()
1332 strcpy(probe.name, pdev->vdev.name); in pwc_ioctl()
1333 probe.type = pdev->type; in pwc_ioctl()
1346 if (pwc_set_agc(pdev, agc < 0 ? 1 : 0, agc)) in pwc_ioctl()
1356 if (pwc_get_agc(pdev, &agc)) in pwc_ioctl()
1371 ret = pwc_set_shutter_speed(pdev, shutter_speed < 0 ? 1 : 0, shutter_speed); in pwc_ioctl()
1382 ret = pwc_set_awb(pdev, wb.mode); in pwc_ioctl()
1384 pwc_set_red_gain(pdev, wb.manual_red); in pwc_ioctl()
1385 pwc_set_blue_gain(pdev, wb.manual_blue); in pwc_ioctl()
1396 wb.mode = pwc_get_awb(pdev); in pwc_ioctl()
1401 wb.manual_red = pwc_get_red_gain(pdev); in pwc_ioctl()
1402 wb.manual_blue = pwc_get_blue_gain(pdev); in pwc_ioctl()
1405 wb.read_red = pwc_read_red_gain(pdev); in pwc_ioctl()
1406 wb.read_blue = pwc_read_blue_gain(pdev); in pwc_ioctl()
1422 ret = pwc_set_wb_speed(pdev, wbs.control_speed); in pwc_ioctl()
1425 ret = pwc_set_wb_delay(pdev, wbs.control_delay); in pwc_ioctl()
1435 ret = pwc_get_wb_speed(pdev); in pwc_ioctl()
1439 ret = pwc_get_wb_delay(pdev); in pwc_ioctl()
1455 ret = pwc_set_leds(pdev, leds.led_on, leds.led_off); in pwc_ioctl()
1464 ret = pwc_get_leds(pdev, &leds.led_on, &leds.led_off); in pwc_ioctl()
1479 ret = pwc_set_contour(pdev, contour); in pwc_ioctl()
1487 ret = pwc_get_contour(pdev, &contour); in pwc_ioctl()
1503 ret = pwc_set_backlight(pdev, backlight); in pwc_ioctl()
1509 ret = pwc_get_backlight(pdev); in pwc_ioctl()
1524 ret = pwc_set_flicker(pdev, flicker); in pwc_ioctl()
1530 ret = pwc_get_flicker(pdev); in pwc_ioctl()
1545 ret = pwc_set_dynamic_noise(pdev, dynnoise); in pwc_ioctl()
1551 ret = pwc_get_dynamic_noise(pdev); in pwc_ioctl()
1563 size.width = pdev->image.x; in pwc_ioctl()
1564 size.height = pdev->image.y; in pwc_ioctl()