Logo Search packages:      
Sourcecode: linux-fsl-imx51 version File versions  Download package

static int mxc_v4l2out_open ( struct file *  file  )  [static]

V4L2 interface - open function

Parameters:
file structure file *
Returns:
status 0 success, ENODEV invalid device instance, ENODEV timeout, ERESTARTSYS interrupted by user

Definition at line 1804 of file mxc_v4l2_output.c.

{
      struct video_device *dev = video_devdata(file);
      vout_data *vout = video_get_drvdata(dev);
      int err;

      if (!vout) {
            return -ENODEV;
      }

      down(&vout->busy_lock);

      err = -EINTR;
      if (signal_pending(current))
            goto oops;


      if (vout->open_count++ == 0) {
            init_waitqueue_head(&vout->v4l_bufq);

            init_timer(&vout->output_timer);
            vout->output_timer.function = mxc_v4l2out_timer_handler;
            vout->output_timer.data = (unsigned long)vout;

            vout->state = STATE_STREAM_OFF;
            vout->rotate = IPU_ROTATE_NONE;

            INIT_WORK(&vout->timer_work, timer_work_func);
      }

      file->private_data = dev;

      up(&vout->busy_lock);

      return 0;

      oops:
      up(&vout->busy_lock);
      return err;
}


Generated by  Doxygen 1.6.0   Back to index