~ubuntu-branches/ubuntu/quantal/linux-linaro-mx51/quantal

« back to all changes in this revision

Viewing changes to drivers/media/video/s2255drv.c

  • Committer: Package Import Robot
  • Author(s): John Rigby, John Rigby
  • Date: 2011-09-26 10:44:23 UTC
  • Revision ID: package-import@ubuntu.com-20110926104423-3o58a3c1bj7x00rs
Tags: 3.0.0-1007.9
[ John Rigby ]

Enable crypto modules and remove crypto-modules from
exclude-module files
LP: #826021

Show diffs side-by-side

added added

removed removed

Lines of Context:
394
394
/* start video number */
395
395
static int video_nr = -1;       /* /dev/videoN, -1 for autodetect */
396
396
 
 
397
/* Enable jpeg capture. */
 
398
static int jpeg_enable = 1;
 
399
 
397
400
module_param(debug, int, 0644);
398
401
MODULE_PARM_DESC(debug, "Debug level(0-100) default 0");
399
402
module_param(vid_limit, int, 0644);
400
403
MODULE_PARM_DESC(vid_limit, "video memory limit(Mb)");
401
404
module_param(video_nr, int, 0644);
402
405
MODULE_PARM_DESC(video_nr, "start video minor(-1 default autodetect)");
 
406
module_param(jpeg_enable, int, 0644);
 
407
MODULE_PARM_DESC(jpeg_enable, "Jpeg enable(1-on 0-off) default 1");
403
408
 
404
409
/* USB device table */
405
410
#define USB_SENSORAY_VID        0x1943
413
418
#define BUFFER_TIMEOUT msecs_to_jiffies(400)
414
419
 
415
420
/* image formats.  */
 
421
/* JPEG formats must be defined last to support jpeg_enable parameter */
416
422
static const struct s2255_fmt formats[] = {
417
423
        {
418
424
                .name = "4:2:2, planar, YUV422P",
429
435
                .fourcc = V4L2_PIX_FMT_UYVY,
430
436
                .depth = 16
431
437
        }, {
432
 
                .name = "JPG",
433
 
                .fourcc = V4L2_PIX_FMT_JPEG,
434
 
                .depth = 24
435
 
        }, {
436
438
                .name = "8bpp GREY",
437
439
                .fourcc = V4L2_PIX_FMT_GREY,
438
440
                .depth = 8
 
441
        }, {
 
442
                .name = "JPG",
 
443
                .fourcc = V4L2_PIX_FMT_JPEG,
 
444
                .depth = 24
 
445
        }, {
 
446
                .name = "MJPG",
 
447
                .fourcc = V4L2_PIX_FMT_MJPEG,
 
448
                .depth = 24
439
449
        }
440
450
};
441
451
 
610
620
        for (i = 0; i < ARRAY_SIZE(formats); i++) {
611
621
                if (-1 == formats[i].fourcc)
612
622
                        continue;
 
623
        if (!jpeg_enable && ((formats[i].fourcc == V4L2_PIX_FMT_JPEG) ||
 
624
                             (formats[i].fourcc == V4L2_PIX_FMT_MJPEG)))
 
625
            continue;
613
626
                if (formats[i].fourcc == fourcc)
614
627
                        return formats + i;
615
628
        }
653
666
                        memcpy(vbuf, tmpbuf, buf->vb.width * buf->vb.height);
654
667
                        break;
655
668
                case V4L2_PIX_FMT_JPEG:
 
669
                case V4L2_PIX_FMT_MJPEG:
656
670
                        buf->vb.size = jpgsize;
657
671
                        memcpy(vbuf, tmpbuf, buf->vb.size);
658
672
                        break;
856
870
 
857
871
        if (index >= ARRAY_SIZE(formats))
858
872
                return -EINVAL;
859
 
 
 
873
    if (!jpeg_enable && ((formats[index].fourcc == V4L2_PIX_FMT_JPEG) ||
 
874
                         (formats[index].fourcc == V4L2_PIX_FMT_MJPEG)))
 
875
        return -EINVAL;
860
876
        dprintk(4, "name %s\n", formats[index].name);
861
877
        strlcpy(f->description, formats[index].name, sizeof(f->description));
862
878
        f->pixelformat = formats[index].fourcc;
1037
1053
                mode.color |= COLOR_Y8;
1038
1054
                break;
1039
1055
        case V4L2_PIX_FMT_JPEG:
 
1056
        case V4L2_PIX_FMT_MJPEG:
1040
1057
                mode.color &= ~MASK_COLOR;
1041
1058
                mode.color |= COLOR_JPG;
1042
1059
                mode.color |= (channel->jc.quality << 8);
2382
2399
                          read_pipe_completion, pipe_info);
2383
2400
 
2384
2401
        if (pipe_info->state != 0) {
2385
 
                if (usb_submit_urb(pipe_info->stream_urb, GFP_KERNEL)) {
 
2402
                if (usb_submit_urb(pipe_info->stream_urb, GFP_ATOMIC)) {
2386
2403
                        dev_err(&dev->udev->dev, "error submitting urb\n");
2387
2404
                }
2388
2405
        } else {