static int s3c_fimc_v4l2_streamoff(struct file *filp, void *fh,
                                   enum v4l2_buf_type i)
{
    struct s3c_fimc_control *ctrl = (struct s3c_fimc_control *) fh;
    struct s3c_fimc_out_frame *frame = &ctrl->out_frame;

    if (i != V4L2_BUF_TYPE_VIDEO_CAPTURE)
        return -EINVAL;

    FSET_STOP(ctrl);
    FCLR_USAGE(ctrl);
    FCLR_IRQ(ctrl);

    s3c_fimc_stop_dma(ctrl);
    s3c_fimc_free_output_memory(frame);
    s3c_fimc_set_output_address(ctrl);

    frame->hq = 0;
    frame->jpeg.enabled = 0;
    frame->jpeg.thumb = 0;
    frame->jpeg.thumb_res = 0;
    frame->jpeg.main_size = 0;
    frame->jpeg.thumb_size = 0;

    return 0;
}
Esempio n. 2
0
void s3c_stream_off(struct nx_vip_control *ctrl)
{
    FSET_STOP(ctrl);
	UNMASK_USAGE(ctrl);
	UNMASK_IRQ(ctrl);

	ctrl->streamon = 0;

	nx_vip_stop_vip(ctrl);
}
Esempio n. 3
0
static u32 s3c_fimc_poll(struct file *filp, poll_table *wait)
{
	struct s3c_fimc_control *ctrl = filp->private_data;
	u32 mask = 0;

	poll_wait(filp, &ctrl->waitq, wait);

	if (IS_IRQ_HANDLING(ctrl))
		mask = POLLIN | POLLRDNORM;

	FSET_STOP(ctrl);

	return mask;
}
Esempio n. 4
0
static
ssize_t s3c_fimc_read(struct file *filp, char *buf, size_t count, loff_t *pos)
{
	struct s3c_fimc_control *ctrl = filp->private_data;
	size_t end;

	if (IS_CAPTURE(ctrl)) {
		if (wait_event_interruptible(ctrl->waitq, IS_IRQ_HANDLING(ctrl)))
				return -ERESTARTSYS;

		FSET_STOP(ctrl);
	}
	//printk("[CAM]ctrl->out_frame.buf_size=%d,count=%d.\n",ctrl->out_frame.buf_size,count);

	end = min_t(size_t, ctrl->out_frame.buf_size, count);

	if (copy_to_user(buf, s3c_fimc_get_current_frame(ctrl), end))
		return -EFAULT;

	return end;
}