• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /netgear-WNDR4500v2-V1.0.0.60_1.0.38/src/linux/linux-2.6/drivers/media/video/pwc/

Lines Matching refs:pdev

159 static void pwc_set_image_buffer_size(struct pwc_device *pdev);
165 usb_control_msg(pdev->udev, usb_sndctrlpipe(pdev->udev, 0), \
169 pdev->vcinterface, \
173 usb_control_msg(pdev->udev, usb_rcvctrlpipe(pdev->udev, 0), \
177 pdev->vcinterface, \
194 static int set_video_mode_Nala(struct pwc_device *pdev, int size, int frames)
228 ret = send_video_command(pdev->udev, pdev->vendpoint, buf, 3);
233 if (pEntry->compressed && pdev->vpalette != VIDEO_PALETTE_RAW)
234 pwc_dec1_init(pdev->type, pdev->release, buf, pdev->decompress_data);
236 pdev->cmd_len = 3;
237 memcpy(pdev->cmd_buf, buf, 3);
240 pdev->vframes = frames;
241 pdev->vsize = size;
242 pdev->valternate = pEntry->alternate;
243 pdev->image = pwc_image_sizes[size];
244 pdev->frame_size = (pdev->image.x * pdev->image.y * 3) / 2;
246 if (pdev->release < 5) { /* 4 fold compression */
247 pdev->vbandlength = 528;
248 pdev->frame_size /= 4;
251 pdev->vbandlength = 704;
252 pdev->frame_size /= 3;
256 pdev->vbandlength = 0;
261 static int set_video_mode_Timon(struct pwc_device *pdev, int size, int frames, int compression, int snapshot)
289 ret = send_video_command(pdev->udev, pdev->vendpoint, buf, 13);
293 if (pChoose->bandlength > 0 && pdev->vpalette != VIDEO_PALETTE_RAW)
294 pwc_dec23_init(pdev, pdev->type, buf);
296 pdev->cmd_len = 13;
297 memcpy(pdev->cmd_buf, buf, 13);
300 pdev->vframes = frames;
301 pdev->vsize = size;
302 pdev->vsnapshot = snapshot;
303 pdev->valternate = pChoose->alternate;
304 pdev->image = pwc_image_sizes[size];
305 pdev->vbandlength = pChoose->bandlength;
307 pdev->frame_size = (pChoose->bandlength * pdev->image.y) / 4;
309 pdev->frame_size = (pdev->image.x * pdev->image.y * 12) / 8;
314 static int set_video_mode_Kiara(struct pwc_device *pdev, int size, int frames, int compression, int snapshot)
328 if (size == PSZ_VGA && frames == 5 && snapshot && pdev->vpalette == VIDEO_PALETTE_RAW)
362 ret = send_video_command(pdev->udev, 4 /* pdev->vendpoint */, buf, 12);
366 if (pChoose->bandlength > 0 && pdev->vpalette != VIDEO_PALETTE_RAW)
367 pwc_dec23_init(pdev, pdev->type, buf);
369 pdev->cmd_len = 12;
370 memcpy(pdev->cmd_buf, buf, 12);
372 pdev->vframes = frames;
373 pdev->vsize = size;
374 pdev->vsnapshot = snapshot;
375 pdev->valternate = pChoose->alternate;
376 pdev->image = pwc_image_sizes[size];
377 pdev->vbandlength = pChoose->bandlength;
378 if (pdev->vbandlength > 0)
379 pdev->frame_size = (pdev->vbandlength * pdev->image.y) / 4;
381 pdev->frame_size = (pdev->image.x * pdev->image.y * 12) / 8;
383 pdev->frame_size,pdev->vframes,pdev->vsize,pdev->vsnapshot,pdev->vbandlength);
390 @pdev: device structure
397 int pwc_set_video_mode(struct pwc_device *pdev, int width, int height, int frames, int compression, int snapshot)
401 PWC_DEBUG_FLOW("set_video_mode(%dx%d @ %d, palette %d).\n", width, height, frames, pdev->vpalette);
402 size = pwc_decode_size(pdev, width, height);
409 if (DEVICE_USE_CODEC1(pdev->type)) {
410 ret = set_video_mode_Nala(pdev, size, frames);
412 } else if (DEVICE_USE_CODEC3(pdev->type)) {
413 ret = set_video_mode_Kiara(pdev, size, frames, compression, snapshot);
416 ret = set_video_mode_Timon(pdev, size, frames, compression, snapshot);
422 pdev->view.x = width;
423 pdev->view.y = height;
424 pdev->frame_total_size = pdev->frame_size + pdev->frame_header_size + pdev->frame_trailer_size;
425 pwc_set_image_buffer_size(pdev);
430 static unsigned int pwc_get_fps_Nala(struct pwc_device *pdev, unsigned int index, unsigned int size)
442 static unsigned int pwc_get_fps_Kiara(struct pwc_device *pdev, unsigned int index, unsigned int size)
454 static unsigned int pwc_get_fps_Timon(struct pwc_device *pdev, unsigned int index, unsigned int size)
466 unsigned int pwc_get_fps(struct pwc_device *pdev, unsigned int index, unsigned int size)
470 if (DEVICE_USE_CODEC1(pdev->type)) {
471 ret = pwc_get_fps_Nala(pdev, index, size);
473 } else if (DEVICE_USE_CODEC3(pdev->type)) {
474 ret = pwc_get_fps_Kiara(pdev, index, size);
477 ret = pwc_get_fps_Timon(pdev, index, size);
487 static void pwc_set_image_buffer_size(struct pwc_device *pdev)
492 switch(pdev->vpalette)
503 pdev->image.size = pdev->image.x * pdev->image.y * factor / 4;
504 pdev->view.size = pdev->view.x * pdev->view.y * factor / 4;
511 pdev->offset.x = ((pdev->view.x - pdev->image.x) / 2) & 0xFFFC;
512 pdev->offset.y = ((pdev->view.y - pdev->image.y) / 2) & 0xFFFE;
516 unsigned char *p = pdev->image_data + pdev->images[i].offset;
517 memset(p, BLACK_Y, pdev->view.x * pdev->view.y);
518 p += pdev->view.x * pdev->view.y;
519 memset(p, BLACK_U, pdev->view.x * pdev->view.y/4);
520 p += pdev->view.x * pdev->view.y/4;
521 memset(p, BLACK_V, pdev->view.x * pdev->view.y/4);
529 int pwc_get_brightness(struct pwc_device *pdev)
540 int pwc_set_brightness(struct pwc_device *pdev, int value)
554 int pwc_get_contrast(struct pwc_device *pdev)
565 int pwc_set_contrast(struct pwc_device *pdev, int value)
579 int pwc_get_gamma(struct pwc_device *pdev)
590 int pwc_set_gamma(struct pwc_device *pdev, int value)
606 int pwc_get_saturation(struct pwc_device *pdev, int *value)
611 if (pdev->type < 675)
613 if (pdev->type < 730)
625 int pwc_set_saturation(struct pwc_device *pdev, int value)
630 if (pdev->type < 675)
636 if (pdev->type < 730)
645 int pwc_set_agc(struct pwc_device *pdev, int mode, int value)
670 int pwc_get_agc(struct pwc_device *pdev, int *value)
700 int pwc_set_shutter_speed(struct pwc_device *pdev, int mode, int value)
719 if (DEVICE_USE_CODEC2(pdev->type)) {
724 } else if (DEVICE_USE_CODEC3(pdev->type)) {
736 int pwc_get_shutter_speed(struct pwc_device *pdev, int *value)
745 if (DEVICE_USE_CODEC2(pdev->type)) {
748 } else if (DEVICE_USE_CODEC3(pdev->type)) {
757 int pwc_camera_power(struct pwc_device *pdev, int power)
761 if (pdev->type < 675 || (pdev->type < 730 && pdev->release < 6))
775 int pwc_restore_user(struct pwc_device *pdev)
781 int pwc_save_user(struct pwc_device *pdev)
787 int pwc_restore_factory(struct pwc_device *pdev)
805 int pwc_set_awb(struct pwc_device *pdev, int mode)
825 int pwc_get_awb(struct pwc_device *pdev)
837 int pwc_set_red_gain(struct pwc_device *pdev, int value)
850 int pwc_get_red_gain(struct pwc_device *pdev, int *value)
863 int pwc_set_blue_gain(struct pwc_device *pdev, int value)
876 int pwc_get_blue_gain(struct pwc_device *pdev, int *value)
893 static int pwc_read_red_gain(struct pwc_device *pdev, int *value)
905 static int pwc_read_blue_gain(struct pwc_device *pdev, int *value)
918 static int pwc_set_wb_speed(struct pwc_device *pdev, int speed)
927 static int pwc_get_wb_speed(struct pwc_device *pdev, int *value)
940 static int pwc_set_wb_delay(struct pwc_device *pdev, int delay)
949 static int pwc_get_wb_delay(struct pwc_device *pdev, int *value)
962 int pwc_set_leds(struct pwc_device *pdev, int on_value, int off_value)
966 if (pdev->type < 730)
985 static int pwc_get_leds(struct pwc_device *pdev, int *on_value, int *off_value)
990 if (pdev->type < 730) {
1004 int pwc_set_contour(struct pwc_device *pdev, int contour)
1029 int pwc_get_contour(struct pwc_device *pdev, int *contour)
1051 int pwc_set_backlight(struct pwc_device *pdev, int backlight)
1062 int pwc_get_backlight(struct pwc_device *pdev, int *backlight)
1074 int pwc_set_colour_mode(struct pwc_device *pdev, int colour)
1085 int pwc_get_colour_mode(struct pwc_device *pdev, int *colour)
1098 int pwc_set_flicker(struct pwc_device *pdev, int flicker)
1109 int pwc_get_flicker(struct pwc_device *pdev, int *flicker)
1121 int pwc_set_dynamic_noise(struct pwc_device *pdev, int noise)
1133 int pwc_get_dynamic_noise(struct pwc_device *pdev, int *noise)
1145 static int _pwc_mpt_reset(struct pwc_device *pdev, int flags)
1153 int pwc_mpt_reset(struct pwc_device *pdev, int flags)
1156 ret = _pwc_mpt_reset(pdev, flags);
1158 pdev->pan_angle = 0;
1159 pdev->tilt_angle = 0;
1164 static int _pwc_mpt_set_angle(struct pwc_device *pdev, int pan, int tilt)
1182 int pwc_mpt_set_angle(struct pwc_device *pdev, int pan, int tilt)
1187 if (pan < pdev->angle_range.pan_min ||
1188 pan > pdev->angle_range.pan_max ||
1189 tilt < pdev->angle_range.tilt_min ||
1190 tilt > pdev->angle_range.tilt_max)
1194 pan -= pdev->pan_angle;
1195 tilt -= pdev->tilt_angle;
1200 ret = _pwc_mpt_set_angle(pdev, pan, tilt);
1202 pdev->pan_angle += pan;
1203 pdev->tilt_angle += tilt;
1210 static int pwc_mpt_get_status(struct pwc_device *pdev, struct pwc_mpt_status *status)
1225 int pwc_get_cmos_sensor(struct pwc_device *pdev, int *sensor)
1230 if (pdev->type < 675)
1232 else if (pdev->type < 730)
1240 if (pdev->type < 675)
1272 int pwc_ioctl(struct pwc_device *pdev, unsigned int cmd, void *arg)
1279 if (pwc_restore_user(pdev))
1286 if (pwc_save_user(pdev))
1293 if (pwc_restore_factory(pdev))
1306 ret = pwc_try_video_mode(pdev, pdev->view.x, pdev->view.y, pdev->vframes, ARGR(qual), pdev->vsnapshot);
1308 pdev->vcompression = ARGR(qual);
1316 ARGR(qual) = pdev->vcompression;
1325 strcpy(ARGR(probe).name, pdev->vdev->name);
1326 ARGR(probe).type = pdev->type;
1335 strcpy(ARGR(serial).serial, pdev->serial);
1345 if (pwc_set_agc(pdev, ARGR(agc) < 0 ? 1 : 0, ARGR(agc)))
1354 if (pwc_get_agc(pdev, ARGA(agc)))
1365 ret = pwc_set_shutter_speed(pdev, ARGR(shutter_speed) < 0 ? 1 : 0, ARGR(shutter_speed));
1374 ret = pwc_set_awb(pdev, ARGR(wb).mode);
1376 pwc_set_red_gain(pdev, ARGR(wb).manual_red);
1377 pwc_set_blue_gain(pdev, ARGR(wb).manual_blue);
1387 ARGR(wb).mode = pwc_get_awb(pdev);
1392 ret = pwc_get_red_gain(pdev, &ARGR(wb).manual_red);
1395 ret = pwc_get_blue_gain(pdev, &ARGR(wb).manual_blue);
1400 ret = pwc_read_red_gain(pdev, &ARGR(wb).read_red);
1403 ret = pwc_read_blue_gain(pdev, &ARGR(wb).read_blue);
1417 ret = pwc_set_wb_speed(pdev, ARGR(wbs).control_speed);
1420 ret = pwc_set_wb_delay(pdev, ARGR(wbs).control_delay);
1429 ret = pwc_get_wb_speed(pdev, &ARGR(wbs).control_speed);
1432 ret = pwc_get_wb_delay(pdev, &ARGR(wbs).control_delay);
1444 ret = pwc_set_leds(pdev, ARGR(leds).led_on, ARGR(leds).led_off);
1453 ret = pwc_get_leds(pdev, &ARGR(leds).led_on, &ARGR(leds).led_off);
1463 ret = pwc_set_contour(pdev, ARGR(contour));
1471 ret = pwc_get_contour(pdev, ARGA(contour));
1481 ret = pwc_set_backlight(pdev, ARGR(backlight));
1489 ret = pwc_get_backlight(pdev, ARGA(backlight));
1499 ret = pwc_set_flicker(pdev, ARGR(flicker));
1507 ret = pwc_get_flicker(pdev, ARGA(flicker));
1517 ret = pwc_set_dynamic_noise(pdev, ARGR(dynnoise));
1525 ret = pwc_get_dynamic_noise(pdev, ARGA(dynnoise));
1534 ARGR(size).width = pdev->image.x;
1535 ARGR(size).height = pdev->image.y;
1542 if (pdev->features & FEATURE_MOTOR_PANTILT)
1547 ret = pwc_mpt_reset(pdev, ARGR(flags));
1558 if (pdev->features & FEATURE_MOTOR_PANTILT)
1562 ARGR(range) = pdev->angle_range;
1576 if (pdev->features & FEATURE_MOTOR_PANTILT)
1591 new_pan = pdev->pan_angle + ARGR(angles).pan;
1592 new_tilt = pdev->tilt_angle + ARGR(angles).tilt;
1594 ret = pwc_mpt_set_angle(pdev, new_pan, new_tilt);
1606 if (pdev->features & FEATURE_MOTOR_PANTILT)
1611 ARGR(angles).pan = pdev->pan_angle;
1612 ARGR(angles).tilt = pdev->tilt_angle;
1624 if (pdev->features & FEATURE_MOTOR_PANTILT)
1628 ret = pwc_mpt_get_status(pdev, ARGA(status));
1642 ARGR(cmd).type = pdev->type;
1643 ARGR(cmd).release = pdev->release;
1644 ARGR(cmd).command_len = pdev->cmd_len;
1645 memcpy(&ARGR(cmd).command_buf, pdev->cmd_buf, pdev->cmd_len);
1646 ARGR(cmd).bandlength = pdev->vbandlength;
1647 ARGR(cmd).frame_size = pdev->frame_size;
1655 ARGR(table).len = pdev->cmd_len;
1656 memcpy(&ARGR(table).buffer, pdev->decompress_data, pdev->decompressor->table_size);