aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHans de Goede <hdegoede@redhat.com>2011-12-31 08:52:02 -0500
committerMauro Carvalho Chehab <mchehab@redhat.com>2012-01-06 07:45:47 -0500
commitdc8a7e83aaf8bb1bcf7163bda8926a6dd29c409b (patch)
treea6f304a0d6a6d4c3883d3bc0865a68eaede3692d
parent115f418bfa7575fbd1422d7fd274a2425260beb2 (diff)
[media] pwc: Remove dead snapshot code
The in kernel version of the pwc driver has never supported snapshot mode, and now that we no longer support the pixfmt.priv abuse there also no longer is a way for userspace to request it, rendering all the code in question dead (never called), so remove it. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
-rw-r--r--drivers/media/video/pwc/pwc-ctrl.c64
-rw-r--r--drivers/media/video/pwc/pwc-dec23.c275
-rw-r--r--drivers/media/video/pwc/pwc-dec23.h3
-rw-r--r--drivers/media/video/pwc/pwc-if.c5
-rw-r--r--drivers/media/video/pwc/pwc-uncompress.c8
-rw-r--r--drivers/media/video/pwc/pwc-v4l.c2
-rw-r--r--drivers/media/video/pwc/pwc.h6
7 files changed, 57 insertions, 306 deletions
diff --git a/drivers/media/video/pwc/pwc-ctrl.c b/drivers/media/video/pwc/pwc-ctrl.c
index 5eddfab920ea..2cf77001804d 100644
--- a/drivers/media/video/pwc/pwc-ctrl.c
+++ b/drivers/media/video/pwc/pwc-ctrl.c
@@ -220,7 +220,6 @@ static int set_video_mode_Nala(struct pwc_device *pdev, int size, int frames)
220 220
221 /* Set various parameters */ 221 /* Set various parameters */
222 pdev->vframes = frames; 222 pdev->vframes = frames;
223 pdev->vsize = size;
224 pdev->valternate = pEntry->alternate; 223 pdev->valternate = pEntry->alternate;
225 pdev->image = pwc_image_sizes[size]; 224 pdev->image = pwc_image_sizes[size];
226 pdev->frame_size = (pdev->image.x * pdev->image.y * 3) / 2; 225 pdev->frame_size = (pdev->image.x * pdev->image.y * 3) / 2;
@@ -240,7 +239,8 @@ static int set_video_mode_Nala(struct pwc_device *pdev, int size, int frames)
240} 239}
241 240
242 241
243static int set_video_mode_Timon(struct pwc_device *pdev, int size, int frames, int compression, int snapshot) 242static int set_video_mode_Timon(struct pwc_device *pdev, int size, int frames,
243 int compression)
244{ 244{
245 unsigned char buf[13]; 245 unsigned char buf[13];
246 const struct Timon_table_entry *pChoose; 246 const struct Timon_table_entry *pChoose;
@@ -266,8 +266,6 @@ static int set_video_mode_Timon(struct pwc_device *pdev, int size, int frames, i
266 return -ENOENT; /* Not supported. */ 266 return -ENOENT; /* Not supported. */
267 267
268 memcpy(buf, pChoose->mode, 13); 268 memcpy(buf, pChoose->mode, 13);
269 if (snapshot)
270 buf[0] |= 0x80;
271 ret = send_video_command(pdev, pdev->vendpoint, buf, 13); 269 ret = send_video_command(pdev, pdev->vendpoint, buf, 13);
272 if (ret < 0) 270 if (ret < 0)
273 return ret; 271 return ret;
@@ -283,8 +281,6 @@ static int set_video_mode_Timon(struct pwc_device *pdev, int size, int frames, i
283 281
284 /* Set various parameters */ 282 /* Set various parameters */
285 pdev->vframes = frames; 283 pdev->vframes = frames;
286 pdev->vsize = size;
287 pdev->vsnapshot = snapshot;
288 pdev->valternate = pChoose->alternate; 284 pdev->valternate = pChoose->alternate;
289 pdev->image = pwc_image_sizes[size]; 285 pdev->image = pwc_image_sizes[size];
290 pdev->vbandlength = pChoose->bandlength; 286 pdev->vbandlength = pChoose->bandlength;
@@ -296,12 +292,12 @@ static int set_video_mode_Timon(struct pwc_device *pdev, int size, int frames, i
296} 292}
297 293
298 294
299static int set_video_mode_Kiara(struct pwc_device *pdev, int size, int frames, int compression, int snapshot) 295static int set_video_mode_Kiara(struct pwc_device *pdev, int size, int frames,
296 int compression)
300{ 297{
301 const struct Kiara_table_entry *pChoose = NULL; 298 const struct Kiara_table_entry *pChoose = NULL;
302 int fps, ret; 299 int fps, ret;
303 unsigned char buf[12]; 300 unsigned char buf[12];
304 struct Kiara_table_entry RawEntry = {6, 773, 1272, {0xAD, 0xF4, 0x10, 0x27, 0xB6, 0x24, 0x96, 0x02, 0x30, 0x05, 0x03, 0x80}};
305 301
306 if (size >= PSZ_MAX || frames < 5 || frames > 30 || compression < 0 || compression > 3) 302 if (size >= PSZ_MAX || frames < 5 || frames > 30 || compression < 0 || compression > 3)
307 return -EINVAL; 303 return -EINVAL;
@@ -309,29 +305,15 @@ static int set_video_mode_Kiara(struct pwc_device *pdev, int size, int frames, i
309 return -EINVAL; 305 return -EINVAL;
310 fps = (frames / 5) - 1; 306 fps = (frames / 5) - 1;
311 307
312 /* special case: VGA @ 5 fps and snapshot is raw bayer mode */ 308 /* Find a supported framerate with progressively higher compression
313 if (size == PSZ_VGA && frames == 5 && snapshot && pdev->pixfmt != V4L2_PIX_FMT_YUV420) 309 ratios if the preferred ratio is not available.
314 { 310 Skip this step when using RAW modes.
315 /* Only available in case the raw palette is selected or 311 */
316 we have the decompressor available. This mode is 312 while (compression <= 3) {
317 only available in compressed form 313 pChoose = &Kiara_table[size][fps][compression];
318 */ 314 if (pChoose->alternate != 0)
319 PWC_DEBUG_SIZE("Choosing VGA/5 BAYER mode.\n"); 315 break;
320 pChoose = &RawEntry; 316 compression++;
321 }
322 else
323 {
324 /* Find a supported framerate with progressively higher compression ratios
325 if the preferred ratio is not available.
326 Skip this step when using RAW modes.
327 */
328 snapshot = 0;
329 while (compression <= 3) {
330 pChoose = &Kiara_table[size][fps][compression];
331 if (pChoose->alternate != 0)
332 break;
333 compression++;
334 }
335 } 317 }
336 if (pChoose == NULL || pChoose->alternate == 0) 318 if (pChoose == NULL || pChoose->alternate == 0)
337 return -ENOENT; /* Not supported. */ 319 return -ENOENT; /* Not supported. */
@@ -340,8 +322,6 @@ static int set_video_mode_Kiara(struct pwc_device *pdev, int size, int frames, i
340 322
341 /* usb_control_msg won't take staticly allocated arrays as argument?? */ 323 /* usb_control_msg won't take staticly allocated arrays as argument?? */
342 memcpy(buf, pChoose->mode, 12); 324 memcpy(buf, pChoose->mode, 12);
343 if (snapshot)
344 buf[0] |= 0x80;
345 325
346 /* Firmware bug: video endpoint is 5, but commands are sent to endpoint 4 */ 326 /* Firmware bug: video endpoint is 5, but commands are sent to endpoint 4 */
347 ret = send_video_command(pdev, 4 /* pdev->vendpoint */, buf, 12); 327 ret = send_video_command(pdev, 4 /* pdev->vendpoint */, buf, 12);
@@ -358,8 +338,6 @@ static int set_video_mode_Kiara(struct pwc_device *pdev, int size, int frames, i
358 memcpy(pdev->cmd_buf, buf, 12); 338 memcpy(pdev->cmd_buf, buf, 12);
359 /* All set and go */ 339 /* All set and go */
360 pdev->vframes = frames; 340 pdev->vframes = frames;
361 pdev->vsize = size;
362 pdev->vsnapshot = snapshot;
363 pdev->valternate = pChoose->alternate; 341 pdev->valternate = pChoose->alternate;
364 pdev->image = pwc_image_sizes[size]; 342 pdev->image = pwc_image_sizes[size];
365 pdev->vbandlength = pChoose->bandlength; 343 pdev->vbandlength = pChoose->bandlength;
@@ -367,8 +345,8 @@ static int set_video_mode_Kiara(struct pwc_device *pdev, int size, int frames, i
367 pdev->frame_size = (pdev->vbandlength * pdev->image.y) / 4; 345 pdev->frame_size = (pdev->vbandlength * pdev->image.y) / 4;
368 else 346 else
369 pdev->frame_size = (pdev->image.x * pdev->image.y * 12) / 8; 347 pdev->frame_size = (pdev->image.x * pdev->image.y * 12) / 8;
370 PWC_TRACE("frame_size=%d, vframes=%d, vsize=%d, vsnapshot=%d, vbandlength=%d\n", 348 PWC_TRACE("frame_size=%d, vframes=%d, vsize=%d, vbandlength=%d\n",
371 pdev->frame_size,pdev->vframes,pdev->vsize,pdev->vsnapshot,pdev->vbandlength); 349 pdev->frame_size, pdev->vframes, size, pdev->vbandlength);
372 return 0; 350 return 0;
373} 351}
374 352
@@ -380,9 +358,9 @@ static int set_video_mode_Kiara(struct pwc_device *pdev, int size, int frames, i
380 @height: viewport height 358 @height: viewport height
381 @frame: framerate, in fps 359 @frame: framerate, in fps
382 @compression: preferred compression ratio 360 @compression: preferred compression ratio
383 @snapshot: snapshot mode or streaming
384 */ 361 */
385int pwc_set_video_mode(struct pwc_device *pdev, int width, int height, int frames, int compression, int snapshot) 362int pwc_set_video_mode(struct pwc_device *pdev, int width, int height,
363 int frames, int compression)
386{ 364{
387 int ret, size; 365 int ret, size;
388 366
@@ -398,10 +376,10 @@ int pwc_set_video_mode(struct pwc_device *pdev, int width, int height, int frame
398 ret = set_video_mode_Nala(pdev, size, frames); 376 ret = set_video_mode_Nala(pdev, size, frames);
399 377
400 } else if (DEVICE_USE_CODEC3(pdev->type)) { 378 } else if (DEVICE_USE_CODEC3(pdev->type)) {
401 ret = set_video_mode_Kiara(pdev, size, frames, compression, snapshot); 379 ret = set_video_mode_Kiara(pdev, size, frames, compression);
402 380
403 } else { 381 } else {
404 ret = set_video_mode_Timon(pdev, size, frames, compression, snapshot); 382 ret = set_video_mode_Timon(pdev, size, frames, compression);
405 } 383 }
406 if (ret < 0) { 384 if (ret < 0) {
407 PWC_ERROR("Failed to set video mode %s@%d fps; return code = %d\n", size2name[size], frames, ret); 385 PWC_ERROR("Failed to set video mode %s@%d fps; return code = %d\n", size2name[size], frames, ret);
@@ -852,7 +830,9 @@ long pwc_ioctl(struct pwc_device *pdev, unsigned int cmd, void *arg)
852 if (ARGR(qual) < 0 || ARGR(qual) > 3) 830 if (ARGR(qual) < 0 || ARGR(qual) > 3)
853 ret = -EINVAL; 831 ret = -EINVAL;
854 else 832 else
855 ret = pwc_set_video_mode(pdev, pdev->view.x, pdev->view.y, pdev->vframes, ARGR(qual), pdev->vsnapshot); 833 ret = pwc_set_video_mode(pdev,
834 pdev->view.x, pdev->view.y,
835 pdev->vframes, ARGR(qual));
856leave: 836leave:
857 mutex_unlock(&pdev->udevlock); 837 mutex_unlock(&pdev->udevlock);
858 break; 838 break;
diff --git a/drivers/media/video/pwc/pwc-dec23.c b/drivers/media/video/pwc/pwc-dec23.c
index 740bf6b9e8e9..bce3d9bfd035 100644
--- a/drivers/media/video/pwc/pwc-dec23.c
+++ b/drivers/media/video/pwc/pwc-dec23.c
@@ -51,13 +51,6 @@
51# define USE_LOOKUP_TABLE_TO_CLAMP 1 51# define USE_LOOKUP_TABLE_TO_CLAMP 1
52#endif 52#endif
53 53
54/*
55 * ENABLE_BAYER_DECODER
56 * 0: bayer decoder is not build (save some space)
57 * 1: bayer decoder is build and can be used
58 */
59#define ENABLE_BAYER_DECODER 0
60
61static void build_subblock_pattern(struct pwc_dec23_private *pdec) 54static void build_subblock_pattern(struct pwc_dec23_private *pdec)
62{ 55{
63 static const unsigned int initial_values[12] = { 56 static const unsigned int initial_values[12] = {
@@ -469,123 +462,6 @@ static void copy_image_block_CrCb(const int *src, unsigned char *dst, unsigned i
469#endif 462#endif
470} 463}
471 464
472#if ENABLE_BAYER_DECODER
473/*
474 * Format: 8x2 pixels
475 * . G . G . G . G . G . G . G
476 * . . . . . . . . . . . . . .
477 * . G . G . G . G . G . G . G
478 * . . . . . . . . . . . . . .
479 * or
480 * . . . . . . . . . . . . . .
481 * G . G . G . G . G . G . G .
482 * . . . . . . . . . . . . . .
483 * G . G . G . G . G . G . G .
484*/
485static void copy_image_block_Green(const int *src, unsigned char *dst, unsigned int bytes_per_line, unsigned int scalebits)
486{
487#if UNROLL_LOOP_FOR_COPY
488 /* Unroll all loops */
489 const unsigned char *cm = pwc_crop_table+MAX_OUTER_CROP_VALUE;
490 unsigned char *d = dst;
491 const int *c = src;
492
493 d[0] = cm[c[0] >> scalebits];
494 d[2] = cm[c[1] >> scalebits];
495 d[4] = cm[c[2] >> scalebits];
496 d[6] = cm[c[3] >> scalebits];
497 d[8] = cm[c[4] >> scalebits];
498 d[10] = cm[c[5] >> scalebits];
499 d[12] = cm[c[6] >> scalebits];
500 d[14] = cm[c[7] >> scalebits];
501
502 d = dst + bytes_per_line;
503 d[0] = cm[c[8] >> scalebits];
504 d[2] = cm[c[9] >> scalebits];
505 d[4] = cm[c[10] >> scalebits];
506 d[6] = cm[c[11] >> scalebits];
507 d[8] = cm[c[12] >> scalebits];
508 d[10] = cm[c[13] >> scalebits];
509 d[12] = cm[c[14] >> scalebits];
510 d[14] = cm[c[15] >> scalebits];
511#else
512 int i;
513 unsigned char *d;
514 const int *c = src;
515
516 d = dst;
517 for (i = 0; i < 8; i++, c++)
518 d[i*2] = CLAMP((*c) >> scalebits);
519
520 d = dst + bytes_per_line;
521 for (i = 0; i < 8; i++, c++)
522 d[i*2] = CLAMP((*c) >> scalebits);
523#endif
524}
525#endif
526
527#if ENABLE_BAYER_DECODER
528/*
529 * Format: 4x4 pixels
530 * R . R . R . R
531 * . B . B . B .
532 * R . R . R . R
533 * . B . B . B .
534 */
535static void copy_image_block_RedBlue(const int *src, unsigned char *dst, unsigned int bytes_per_line, unsigned int scalebits)
536{
537#if UNROLL_LOOP_FOR_COPY
538 /* Unroll all loops */
539 const unsigned char *cm = pwc_crop_table+MAX_OUTER_CROP_VALUE;
540 unsigned char *d = dst;
541 const int *c = src;
542
543 d[0] = cm[c[0] >> scalebits];
544 d[2] = cm[c[1] >> scalebits];
545 d[4] = cm[c[2] >> scalebits];
546 d[6] = cm[c[3] >> scalebits];
547
548 d = dst + bytes_per_line;
549 d[1] = cm[c[4] >> scalebits];
550 d[3] = cm[c[5] >> scalebits];
551 d[5] = cm[c[6] >> scalebits];
552 d[7] = cm[c[7] >> scalebits];
553
554 d = dst + bytes_per_line*2;
555 d[0] = cm[c[8] >> scalebits];
556 d[2] = cm[c[9] >> scalebits];
557 d[4] = cm[c[10] >> scalebits];
558 d[6] = cm[c[11] >> scalebits];
559
560 d = dst + bytes_per_line*3;
561 d[1] = cm[c[12] >> scalebits];
562 d[3] = cm[c[13] >> scalebits];
563 d[5] = cm[c[14] >> scalebits];
564 d[7] = cm[c[15] >> scalebits];
565#else
566 int i;
567 unsigned char *d;
568 const int *c = src;
569
570 d = dst;
571 for (i = 0; i < 4; i++, c++)
572 d[i*2] = CLAMP((*c) >> scalebits);
573
574 d = dst + bytes_per_line;
575 for (i = 0; i < 4; i++, c++)
576 d[i*2+1] = CLAMP((*c) >> scalebits);
577
578 d = dst + bytes_per_line*2;
579 for (i = 0; i < 4; i++, c++)
580 d[i*2] = CLAMP((*c) >> scalebits);
581
582 d = dst + bytes_per_line*3;
583 for (i = 0; i < 4; i++, c++)
584 d[i*2+1] = CLAMP((*c) >> scalebits);
585#endif
586}
587#endif
588
589/* 465/*
590 * To manage the stream, we keep bits in a 32 bits register. 466 * To manage the stream, we keep bits in a 32 bits register.
591 * fill_nbits(n): fill the reservoir with at least n bits 467 * fill_nbits(n): fill the reservoir with at least n bits
@@ -777,71 +653,6 @@ static void DecompressBand23(struct pwc_dec23_private *pdec,
777 653
778} 654}
779 655
780#if ENABLE_BAYER_DECODER
781/*
782 * Size need to be a multiple of 8 in width
783 *
784 * Return a block of four line encoded like this:
785 *
786 * G R G R G R G R G R G R G R G R
787 * B G B G B G B G B G B G B G B G
788 * G R G R G R G R G R G R G R G R
789 * B G B G B G B G B G B G B G B G
790 *
791 */
792static void DecompressBandBayer(struct pwc_dec23_private *pdec,
793 const unsigned char *rawyuv,
794 unsigned char *rgbbayer,
795 unsigned int compressed_image_width,
796 unsigned int real_image_width)
797{
798 int compression_index, nblocks;
799 const unsigned char *ptable0004;
800 const unsigned char *ptable8004;
801 unsigned char *dest;
802
803 pdec->reservoir = 0;
804 pdec->nbits_in_reservoir = 0;
805 pdec->stream = rawyuv + 1; /* The first byte of the stream is skipped */
806
807 get_nbits(pdec, 4, compression_index);
808
809 /* pass 1: uncompress RB component */
810 nblocks = compressed_image_width / 4;
811
812 ptable0004 = pdec->table_0004_pass1[compression_index];
813 ptable8004 = pdec->table_8004_pass1[compression_index];
814 dest = rgbbayer;
815
816 /* Each block decode a square of 4x4 */
817 while (nblocks) {
818 decode_block(pdec, ptable0004, ptable8004);
819 copy_image_block_RedBlue(pdec->temp_colors, rgbbayer, real_image_width, pdec->scalebits);
820 dest += 8;
821 nblocks--;
822 }
823
824 /* pass 2: uncompress G component */
825 nblocks = compressed_image_width / 8;
826
827 ptable0004 = pdec->table_0004_pass2[compression_index];
828 ptable8004 = pdec->table_8004_pass2[compression_index];
829
830 /* Each block decode a square of 4x4 */
831 while (nblocks) {
832 decode_block(pdec, ptable0004, ptable8004);
833 copy_image_block_Green(pdec->temp_colors, rgbbayer+1, real_image_width, pdec->scalebits);
834
835 decode_block(pdec, ptable0004, ptable8004);
836 copy_image_block_Green(pdec->temp_colors, rgbbayer+real_image_width, real_image_width, pdec->scalebits);
837
838 rgbbayer += 16;
839 nblocks -= 2;
840 }
841}
842#endif
843
844
845/** 656/**
846 * 657 *
847 * Uncompress a pwc23 buffer. 658 * Uncompress a pwc23 buffer.
@@ -852,76 +663,44 @@ static void DecompressBandBayer(struct pwc_dec23_private *pdec,
852 * 663 *
853 * src: raw data 664 * src: raw data
854 * dst: image output 665 * dst: image output
855 * flags: PWCX_FLAG_PLANAR or PWCX_FLAG_BAYER
856 */ 666 */
857void pwc_dec23_decompress(const struct pwc_device *pwc, 667void pwc_dec23_decompress(const struct pwc_device *pwc,
858 const void *src, 668 const void *src,
859 void *dst, 669 void *dst)
860 int flags)
861{ 670{
862 int bandlines_left, stride, bytes_per_block; 671 int bandlines_left, stride, bytes_per_block;
863 struct pwc_dec23_private *pdec = pwc->decompress_data; 672 struct pwc_dec23_private *pdec = pwc->decompress_data;
864 673
674 /* YUV420P image format */
675 unsigned char *pout_planar_y;
676 unsigned char *pout_planar_u;
677 unsigned char *pout_planar_v;
678 unsigned int plane_size;
679
865 mutex_lock(&pdec->lock); 680 mutex_lock(&pdec->lock);
866 681
867 bandlines_left = pwc->image.y / 4; 682 bandlines_left = pwc->image.y / 4;
868 bytes_per_block = pwc->view.x * 4; 683 bytes_per_block = pwc->view.x * 4;
869 684 plane_size = pwc->view.x * pwc->view.y;
870 if (flags & PWCX_FLAG_BAYER) { 685
871#if ENABLE_BAYER_DECODER 686 /* offset in Y plane */
872 /* RGB Bayer format */ 687 stride = pwc->view.x * pwc->offset.y;
873 unsigned char *rgbout; 688 pout_planar_y = dst + stride + pwc->offset.x;
874 689
875 stride = pwc->view.x * pwc->offset.y; 690 /* offsets in U/V planes */
876 rgbout = dst + stride + pwc->offset.x; 691 stride = (pwc->view.x * pwc->offset.y) / 4 + pwc->offset.x / 2;
877 692 pout_planar_u = dst + plane_size + stride;
878 693 pout_planar_v = dst + plane_size + plane_size / 4 + stride;
879 while (bandlines_left--) { 694
880 695 while (bandlines_left--) {
881 DecompressBandBayer(pwc->decompress_data, 696 DecompressBand23(pwc->decompress_data,
882 src, 697 src,
883 rgbout, 698 pout_planar_y, pout_planar_u, pout_planar_v,
884 pwc->image.x, pwc->view.x); 699 pwc->image.x, pwc->view.x);
885 700 src += pwc->vbandlength;
886 src += pwc->vbandlength; 701 pout_planar_y += bytes_per_block;
887 rgbout += bytes_per_block; 702 pout_planar_u += pwc->view.x;
888 703 pout_planar_v += pwc->view.x;
889 }
890#else
891 memset(dst, 0, pwc->view.x * pwc->view.y);
892#endif
893
894 } else {
895 /* YUV420P image format */
896 unsigned char *pout_planar_y;
897 unsigned char *pout_planar_u;
898 unsigned char *pout_planar_v;
899 unsigned int plane_size;
900
901 plane_size = pwc->view.x * pwc->view.y;
902
903 /* offset in Y plane */
904 stride = pwc->view.x * pwc->offset.y;
905 pout_planar_y = dst + stride + pwc->offset.x;
906
907 /* offsets in U/V planes */
908 stride = (pwc->view.x * pwc->offset.y) / 4 + pwc->offset.x / 2;
909 pout_planar_u = dst + plane_size + stride;
910 pout_planar_v = dst + plane_size + plane_size / 4 + stride;
911
912 while (bandlines_left--) {
913
914 DecompressBand23(pwc->decompress_data,
915 src,
916 pout_planar_y, pout_planar_u, pout_planar_v,
917 pwc->image.x, pwc->view.x);
918 src += pwc->vbandlength;
919 pout_planar_y += bytes_per_block;
920 pout_planar_u += pwc->view.x;
921 pout_planar_v += pwc->view.x;
922
923 }
924 } 704 }
925
926 mutex_unlock(&pdec->lock); 705 mutex_unlock(&pdec->lock);
927} 706}
diff --git a/drivers/media/video/pwc/pwc-dec23.h b/drivers/media/video/pwc/pwc-dec23.h
index 9cba74dafa4b..d64a3c281af6 100644
--- a/drivers/media/video/pwc/pwc-dec23.h
+++ b/drivers/media/video/pwc/pwc-dec23.h
@@ -54,6 +54,5 @@ struct pwc_dec23_private
54int pwc_dec23_init(struct pwc_device *pwc, int type, unsigned char *cmd); 54int pwc_dec23_init(struct pwc_device *pwc, int type, unsigned char *cmd);
55void pwc_dec23_decompress(const struct pwc_device *pwc, 55void pwc_dec23_decompress(const struct pwc_device *pwc,
56 const void *src, 56 const void *src,
57 void *dst, 57 void *dst);
58 int flags);
59#endif 58#endif
diff --git a/drivers/media/video/pwc/pwc-if.c b/drivers/media/video/pwc/pwc-if.c
index 777e9c4972ef..a66f60cb8c3b 100644
--- a/drivers/media/video/pwc/pwc-if.c
+++ b/drivers/media/video/pwc/pwc-if.c
@@ -743,8 +743,7 @@ static int start_streaming(struct vb2_queue *vq, unsigned int count)
743 if (pdev->power_save) { 743 if (pdev->power_save) {
744 /* Restore video mode */ 744 /* Restore video mode */
745 pwc_set_video_mode(pdev, pdev->view.x, pdev->view.y, 745 pwc_set_video_mode(pdev, pdev->view.x, pdev->view.y,
746 pdev->vframes, pdev->vcompression, 746 pdev->vframes, pdev->vcompression);
747 pdev->vsnapshot);
748 } 747 }
749 pwc_set_leds(pdev, led_on, led_off); 748 pwc_set_leds(pdev, led_on, led_off);
750 749
@@ -1131,7 +1130,7 @@ static int usb_pwc_probe(struct usb_interface *intf, const struct usb_device_id
1131 1130
1132 /* Setup intial videomode */ 1131 /* Setup intial videomode */
1133 rc = pwc_set_video_mode(pdev, pdev->view_max.x, pdev->view_max.y, 1132 rc = pwc_set_video_mode(pdev, pdev->view_max.x, pdev->view_max.y,
1134 pdev->vframes, pdev->vcompression, 0); 1133 pdev->vframes, pdev->vcompression);
1135 if (rc) 1134 if (rc)
1136 goto err_free_mem; 1135 goto err_free_mem;
1137 1136
diff --git a/drivers/media/video/pwc/pwc-uncompress.c b/drivers/media/video/pwc/pwc-uncompress.c
index 51265092bd31..e55b568cbf3d 100644
--- a/drivers/media/video/pwc/pwc-uncompress.c
+++ b/drivers/media/video/pwc/pwc-uncompress.c
@@ -111,12 +111,6 @@ int pwc_decompress(struct pwc_device *pdev, struct pwc_frame_buf *fbuf)
111 * the decompressor routines will write the data in planar format 111 * the decompressor routines will write the data in planar format
112 * immediately. 112 * immediately.
113 */ 113 */
114 if (pdev->vsize == PSZ_VGA && pdev->vframes == 5 && pdev->vsnapshot) {
115 PWC_ERROR("Mode Bayer is not supported for now\n");
116 /* flags |= PWCX_FLAG_BAYER; */
117 return -ENXIO; /* No such device or address: missing decompressor */
118 }
119
120 if (DEVICE_USE_CODEC1(pdev->type)) { 114 if (DEVICE_USE_CODEC1(pdev->type)) {
121 115
122 /* TODO & FIXME */ 116 /* TODO & FIXME */
@@ -124,7 +118,7 @@ int pwc_decompress(struct pwc_device *pdev, struct pwc_frame_buf *fbuf)
124 return -ENXIO; /* No such device or address: missing decompressor */ 118 return -ENXIO; /* No such device or address: missing decompressor */
125 119
126 } else { 120 } else {
127 pwc_dec23_decompress(pdev, yuv, image, PWCX_FLAG_PLANAR); 121 pwc_dec23_decompress(pdev, yuv, image);
128 } 122 }
129 return 0; 123 return 0;
130} 124}
diff --git a/drivers/media/video/pwc/pwc-v4l.c b/drivers/media/video/pwc/pwc-v4l.c
index 8b862b6916f6..c4dc820b9dd7 100644
--- a/drivers/media/video/pwc/pwc-v4l.c
+++ b/drivers/media/video/pwc/pwc-v4l.c
@@ -513,7 +513,7 @@ static int pwc_s_fmt_vid_cap(struct file *file, void *fh, struct v4l2_format *f)
513 f->fmt.pix.width, 513 f->fmt.pix.width,
514 f->fmt.pix.height, 514 f->fmt.pix.height,
515 pdev->vframes, 515 pdev->vframes,
516 pdev->vcompression, 0); 516 pdev->vcompression);
517 517
518 PWC_DEBUG_IOCTL("pwc_set_video_mode(), return=%d\n", ret); 518 PWC_DEBUG_IOCTL("pwc_set_video_mode(), return=%d\n", ret);
519 519
diff --git a/drivers/media/video/pwc/pwc.h b/drivers/media/video/pwc/pwc.h
index e3adec857fcf..ae0b7bf12e07 100644
--- a/drivers/media/video/pwc/pwc.h
+++ b/drivers/media/video/pwc/pwc.h
@@ -219,7 +219,7 @@ struct pwc_device
219 int vendpoint; /* video isoc endpoint */ 219 int vendpoint; /* video isoc endpoint */
220 int vcinterface; /* video control interface */ 220 int vcinterface; /* video control interface */
221 int valternate; /* alternate interface needed */ 221 int valternate; /* alternate interface needed */
222 int vframes, vsize; /* frames-per-second & size (see PSZ_*) */ 222 int vframes; /* frames-per-second */
223 int pixfmt; /* pixelformat: V4L2_PIX_FMT_YUV420 or _PWCX */ 223 int pixfmt; /* pixelformat: V4L2_PIX_FMT_YUV420 or _PWCX */
224 int vframe_count; /* received frames */ 224 int vframe_count; /* received frames */
225 int vmax_packet_size; /* USB maxpacket size */ 225 int vmax_packet_size; /* USB maxpacket size */
@@ -227,7 +227,6 @@ struct pwc_device
227 int visoc_errors; /* number of contiguous ISOC errors */ 227 int visoc_errors; /* number of contiguous ISOC errors */
228 int vcompression; /* desired compression factor */ 228 int vcompression; /* desired compression factor */
229 int vbandlength; /* compressed band length; 0 is uncompressed */ 229 int vbandlength; /* compressed band length; 0 is uncompressed */
230 char vsnapshot; /* snapshot mode */
231 char vsync; /* used by isoc handler */ 230 char vsync; /* used by isoc handler */
232 char vmirror; /* for ToUCaM series */ 231 char vmirror; /* for ToUCaM series */
233 char power_save; /* Do powersaving for this cam */ 232 char power_save; /* Do powersaving for this cam */
@@ -355,7 +354,8 @@ void pwc_construct(struct pwc_device *pdev);
355 354
356/** Functions in pwc-ctrl.c */ 355/** Functions in pwc-ctrl.c */
357/* Request a certain video mode. Returns < 0 if not possible */ 356/* Request a certain video mode. Returns < 0 if not possible */
358extern int pwc_set_video_mode(struct pwc_device *pdev, int width, int height, int frames, int compression, int snapshot); 357extern int pwc_set_video_mode(struct pwc_device *pdev, int width, int height,
358 int frames, int compression);
359extern unsigned int pwc_get_fps(struct pwc_device *pdev, unsigned int index, unsigned int size); 359extern unsigned int pwc_get_fps(struct pwc_device *pdev, unsigned int index, unsigned int size);
360extern int pwc_mpt_reset(struct pwc_device *pdev, int flags); 360extern int pwc_mpt_reset(struct pwc_device *pdev, int flags);
361extern int pwc_mpt_set_angle(struct pwc_device *pdev, int pan, int tilt); 361extern int pwc_mpt_set_angle(struct pwc_device *pdev, int pan, int tilt);