]> err.no Git - linux-2.6/blobdiff - drivers/media/video/cafe_ccic.c
V4L/DVB (8428): videodev: rename 'dev' to 'parent'
[linux-2.6] / drivers / media / video / cafe_ccic.c
index b63cab33692072a6163463211aaace9fb29619e1..ebcc8ad6271f14d5d95adeef071f0f53964e80bf 100644 (file)
@@ -3,6 +3,9 @@
  * multifunction chip.  Currently works with the Omnivision OV7670
  * sensor.
  *
+ * The data sheet for this device can be found at:
+ *    http://www.marvell.com/products/pcconn/88ALP01.jsp
+ *
  * Copyright 2006 One Laptop Per Child Association, Inc.
  * Copyright 2006-7 Jonathan Corbet <corbet@lwn.net>
  *
@@ -62,7 +65,7 @@ MODULE_SUPPORTED_DEVICE("Video");
  */
 
 #define MAX_DMA_BUFS 3
-static int alloc_bufs_at_read = 0;
+static int alloc_bufs_at_read;
 module_param(alloc_bufs_at_read, bool, 0444);
 MODULE_PARM_DESC(alloc_bufs_at_read,
                "Non-zero value causes DMA buffers to be allocated when the "
@@ -96,7 +99,7 @@ MODULE_PARM_DESC(max_buffers,
                "will be allowed to allocate.  These buffers are big and live "
                "in vmalloc space.");
 
-static int flip = 0;
+static int flip;
 module_param(flip, bool, 0444);
 MODULE_PARM_DESC(flip,
                "If set, the sensor will be instructed to flip the image "
@@ -1590,7 +1593,7 @@ static struct v4l2_pix_format cafe_def_pix_format = {
        .sizeimage      = VGA_WIDTH*VGA_HEIGHT*2,
 };
 
-static int cafe_vidioc_enum_fmt_cap(struct file *filp,
+static int cafe_vidioc_enum_fmt_vid_cap(struct file *filp,
                void *priv, struct v4l2_fmtdesc *fmt)
 {
        struct cafe_camera *cam = priv;
@@ -1605,7 +1608,7 @@ static int cafe_vidioc_enum_fmt_cap(struct file *filp,
 }
 
 
-static int cafe_vidioc_try_fmt_cap (struct file *filp, void *priv,
+static int cafe_vidioc_try_fmt_vid_cap(struct file *filp, void *priv,
                struct v4l2_format *fmt)
 {
        struct cafe_camera *cam = priv;
@@ -1617,7 +1620,7 @@ static int cafe_vidioc_try_fmt_cap (struct file *filp, void *priv,
        return ret;
 }
 
-static int cafe_vidioc_s_fmt_cap(struct file *filp, void *priv,
+static int cafe_vidioc_s_fmt_vid_cap(struct file *filp, void *priv,
                struct v4l2_format *fmt)
 {
        struct cafe_camera *cam = priv;
@@ -1632,7 +1635,7 @@ static int cafe_vidioc_s_fmt_cap(struct file *filp, void *priv,
        /*
         * See if the formatting works in principle.
         */
-       ret = cafe_vidioc_try_fmt_cap(filp, priv, fmt);
+       ret = cafe_vidioc_try_fmt_vid_cap(filp, priv, fmt);
        if (ret)
                return ret;
        /*
@@ -1667,7 +1670,7 @@ static int cafe_vidioc_s_fmt_cap(struct file *filp, void *priv,
  * The V4l2 spec wants us to be smarter, and actually get this from
  * the camera (and not mess with it at open time).  Someday.
  */
-static int cafe_vidioc_g_fmt_cap(struct file *filp, void *priv,
+static int cafe_vidioc_g_fmt_vid_cap(struct file *filp, void *priv,
                struct v4l2_format *f)
 {
        struct cafe_camera *cam = priv;
@@ -1777,10 +1780,10 @@ static struct video_device cafe_v4l_template = {
        .release = cafe_v4l_dev_release,
 
        .vidioc_querycap        = cafe_vidioc_querycap,
-       .vidioc_enum_fmt_cap    = cafe_vidioc_enum_fmt_cap,
-       .vidioc_try_fmt_cap     = cafe_vidioc_try_fmt_cap,
-       .vidioc_s_fmt_cap       = cafe_vidioc_s_fmt_cap,
-       .vidioc_g_fmt_cap       = cafe_vidioc_g_fmt_cap,
+       .vidioc_enum_fmt_vid_cap = cafe_vidioc_enum_fmt_vid_cap,
+       .vidioc_try_fmt_vid_cap = cafe_vidioc_try_fmt_vid_cap,
+       .vidioc_s_fmt_vid_cap   = cafe_vidioc_s_fmt_vid_cap,
+       .vidioc_g_fmt_vid_cap   = cafe_vidioc_g_fmt_vid_cap,
        .vidioc_enum_input      = cafe_vidioc_enum_input,
        .vidioc_g_input         = cafe_vidioc_g_input,
        .vidioc_s_input         = cafe_vidioc_s_input,
@@ -2154,7 +2157,7 @@ static int cafe_pci_probe(struct pci_dev *pdev,
        cam->v4ldev = cafe_v4l_template;
        cam->v4ldev.debug = 0;
 //     cam->v4ldev.debug = V4L2_DEBUG_IOCTL_ARG;
-       cam->v4ldev.dev = &pdev->dev;
+       cam->v4ldev.parent = &pdev->dev;
        ret = video_register_device(&cam->v4ldev, VFL_TYPE_GRABBER, -1);
        if (ret)
                goto out_smbus;
@@ -2232,13 +2235,16 @@ static int cafe_pci_suspend(struct pci_dev *pdev, pm_message_t state)
 {
        struct cafe_camera *cam = cafe_find_by_pdev(pdev);
        int ret;
+       enum cafe_state cstate;
 
        ret = pci_save_state(pdev);
        if (ret)
                return ret;
+       cstate = cam->state; /* HACK - stop_dma sets to idle */
        cafe_ctlr_stop_dma(cam);
        cafe_ctlr_power_down(cam);
        pci_disable_device(pdev);
+       cam->state = cstate;
        return 0;
 }