diff options
author | Jean-Francois Moine <moinejf@free.fr> | 2008-06-30 18:47:33 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@infradead.org> | 2008-07-20 06:14:55 -0400 |
commit | 50a871fed9c82f01baa40100cd2d262784220953 (patch) | |
tree | 8bc1ba94cd7c479cd553a68237442f57da6245c3 | |
parent | 6a7eba24e4f0ff725d33159f6265e3a79d53a833 (diff) |
V4L/DVB (8158): gspca: minor changes
main: V4L2_PIX_FMT_SPCA501 is compressed (thanks to Hans de Goede)
main: return 0 when no change on vidioc_s_fmt_cap (thanks to Hans de Goede)
pac207: cleanup
Signed-off-by: Jean-Francois Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
-rw-r--r-- | drivers/media/video/gspca/gspca.c | 7 | ||||
-rw-r--r-- | drivers/media/video/gspca/pac207.c | 10 |
2 files changed, 11 insertions, 6 deletions
diff --git a/drivers/media/video/gspca/gspca.c b/drivers/media/video/gspca/gspca.c index 5583c53e4863..07d765a7de6f 100644 --- a/drivers/media/video/gspca/gspca.c +++ b/drivers/media/video/gspca/gspca.c | |||
@@ -316,6 +316,7 @@ static int gspca_is_compressed(__u32 format) | |||
316 | switch (format) { | 316 | switch (format) { |
317 | case V4L2_PIX_FMT_MJPEG: | 317 | case V4L2_PIX_FMT_MJPEG: |
318 | case V4L2_PIX_FMT_JPEG: | 318 | case V4L2_PIX_FMT_JPEG: |
319 | case V4L2_PIX_FMT_SPCA561: | ||
319 | return 1; | 320 | return 1; |
320 | } | 321 | } |
321 | return 0; | 322 | return 0; |
@@ -369,12 +370,12 @@ static __u32 get_v4l2_depth(__u32 pixfmt) | |||
369 | case V4L2_PIX_FMT_YYUV: /* 'YYUV' */ | 370 | case V4L2_PIX_FMT_YYUV: /* 'YYUV' */ |
370 | return 16; | 371 | return 16; |
371 | case V4L2_PIX_FMT_YUV420: /* 'YU12' planar 4.2.0 */ | 372 | case V4L2_PIX_FMT_YUV420: /* 'YU12' planar 4.2.0 */ |
373 | case V4L2_PIX_FMT_SPCA501: /* 'S501' YUYV per line */ | ||
372 | return 12; | 374 | return 12; |
373 | case V4L2_PIX_FMT_MJPEG: | 375 | case V4L2_PIX_FMT_MJPEG: |
374 | case V4L2_PIX_FMT_JPEG: | 376 | case V4L2_PIX_FMT_JPEG: |
375 | case V4L2_PIX_FMT_SBGGR8: /* 'BA81' Bayer */ | 377 | case V4L2_PIX_FMT_SBGGR8: /* 'BA81' Bayer */ |
376 | case V4L2_PIX_FMT_SN9C10X: /* 'S910' SN9C10x compression */ | 378 | case V4L2_PIX_FMT_SN9C10X: /* 'S910' SN9C10x compression */ |
377 | case V4L2_PIX_FMT_SPCA501: /* 'S501' YUYV per line */ | ||
378 | case V4L2_PIX_FMT_SPCA561: /* 'S561' compressed BGGR bayer */ | 379 | case V4L2_PIX_FMT_SPCA561: /* 'S561' compressed BGGR bayer */ |
379 | return 8; | 380 | return 8; |
380 | } | 381 | } |
@@ -913,8 +914,10 @@ static int vidioc_s_fmt_cap(struct file *file, void *priv, | |||
913 | goto out; | 914 | goto out; |
914 | } | 915 | } |
915 | 916 | ||
916 | if (ret == gspca_dev->curr_mode) | 917 | if (ret == gspca_dev->curr_mode) { |
918 | ret = 0; | ||
917 | goto out; /* same mode */ | 919 | goto out; /* same mode */ |
920 | } | ||
918 | 921 | ||
919 | if (gspca_dev->streaming) { | 922 | if (gspca_dev->streaming) { |
920 | ret = -EBUSY; | 923 | ret = -EBUSY; |
diff --git a/drivers/media/video/gspca/pac207.c b/drivers/media/video/gspca/pac207.c index 72a5b89cd59d..008954e755f1 100644 --- a/drivers/media/video/gspca/pac207.c +++ b/drivers/media/video/gspca/pac207.c | |||
@@ -492,7 +492,7 @@ static void pac207_do_auto_gain(struct gspca_dev *gspca_dev) | |||
492 | } | 492 | } |
493 | 493 | ||
494 | static unsigned char *pac207_find_sof(struct gspca_dev *gspca_dev, | 494 | static unsigned char *pac207_find_sof(struct gspca_dev *gspca_dev, |
495 | unsigned char *m, int len) | 495 | unsigned char *m, int len) |
496 | { | 496 | { |
497 | struct sd *sd = (struct sd *) gspca_dev; | 497 | struct sd *sd = (struct sd *) gspca_dev; |
498 | int i; | 498 | int i; |
@@ -518,7 +518,9 @@ static unsigned char *pac207_find_sof(struct gspca_dev *gspca_dev, | |||
518 | } | 518 | } |
519 | 519 | ||
520 | static int pac207_decompress_row(struct gspca_dev *gspca_dev, | 520 | static int pac207_decompress_row(struct gspca_dev *gspca_dev, |
521 | struct gspca_frame *f, unsigned char *cdata, int len) | 521 | struct gspca_frame *f, |
522 | __u8 *cdata, | ||
523 | int len) | ||
522 | { | 524 | { |
523 | struct sd *sd = (struct sd *) gspca_dev; | 525 | struct sd *sd = (struct sd *) gspca_dev; |
524 | struct pac207_decoder_state *decoder_state = &sd->decoder_state; | 526 | struct pac207_decoder_state *decoder_state = &sd->decoder_state; |
@@ -667,10 +669,10 @@ static int pac207_decode_frame_data(struct gspca_dev *gspca_dev, | |||
667 | case LINE_HEADER2: | 669 | case LINE_HEADER2: |
668 | decoder_state->line_marker |= data[0]; | 670 | decoder_state->line_marker |= data[0]; |
669 | switch (decoder_state->line_marker) { | 671 | switch (decoder_state->line_marker) { |
670 | case 0x0FF0: | 672 | case 0x0ff0: |
671 | decoder_state->line_state = LINE_UNCOMPRESSED; | 673 | decoder_state->line_state = LINE_UNCOMPRESSED; |
672 | break; | 674 | break; |
673 | case 0x1EE1: | 675 | case 0x1ee1: |
674 | decoder_state->line_state = LINE_COMPRESSED; | 676 | decoder_state->line_state = LINE_COMPRESSED; |
675 | break; | 677 | break; |
676 | default: | 678 | default: |