long s5p_tv_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
{
	switch (cmd) {
	case VIDIOC_HDCP_ENABLE:
//		s5ptv_status.hdmi.hdcp_en = (unsigned int) arg; //. d: sichoi
		V4L2PRINTK("HDCP status is %s\n",
		       s5ptv_status.hdcp_en ? "enabled" : "disabled");

		return 0;

	case VIDIOC_HDCP_STATUS: {

		unsigned int *status = (unsigned int *)&arg;

		*status = 1;

		V4L2PRINTK("HPD status is %s\n",
		       s5ptv_status.hpd_status ? "plugged" : "unplugged");

		return 0;
	}

	case VIDIOC_HDCP_PROT_STATUS: {

		unsigned int *prot = (unsigned int *)&arg;

		*prot = 1;

//		V4L2PRINTK("hdcp prot status is %d\n", hdcp_protocol_status);

		return 0;
	}

	case VIDIOC_ENUMSTD: {

		struct v4l2_standard *p = (struct v4l2_standard *)arg;

		if (p->index >= S5P_TVOUT_MAX_STANDARDS) {
			V4L2PRINTK("exceeded S5P_TVOUT_MAX_STANDARDS\n");

			return -EINVAL;
		}

		memcpy(p, &s5p_tv_standards[p->index],
			sizeof(struct v4l2_standard));

		return 0;
	}

	default:
		break;
	}

	return video_ioctl2(file, cmd, arg);
}
示例#2
0
long cx18_v4l2_ioctl(struct file *filp, unsigned int cmd,
		    unsigned long arg)
{
	struct video_device *vfd = video_devdata(filp);
	struct cx18_open_id *id = (struct cx18_open_id *)filp->private_data;
	struct cx18 *cx = id->cx;
	long res;

	mutex_lock(&cx->serialize_lock);

	if (cx18_debug & CX18_DBGFLG_IOCTL)
		vfd->debug = V4L2_DEBUG_IOCTL | V4L2_DEBUG_IOCTL_ARG;
	res = video_ioctl2(filp, cmd, arg);
	vfd->debug = 0;
	mutex_unlock(&cx->serialize_lock);
	return res;
}
long video_ioctl3(struct file *file, unsigned int cmd, unsigned long arg)
{
	int ret = 0;
	struct fimc_is_video_ctx *video_ctx = file->private_data;

	if (mutex_lock_interruptible(&video_ctx->lock)) {
		err("mutex_lock_interruptible is fail");
		ret = -ERESTARTSYS;
		goto p_err;
	}

	ret = video_ioctl2(file, cmd, arg);

p_err:
	mutex_unlock(&video_ctx->lock);
	return ret;
}
long s5p_tv_v_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
{
	switch (cmd) {
	case VIDIOC_INIT_AUDIO:
//		s5ptv_status.hdmi.audio = (unsigned int) arg; //. d: sichoi

		if (arg) {
			s5p_hdmi_set_audio(true);

			if (s5ptv_status.tvout_output_enable)
				s5p_hdmi_audio_enable(true);
		} else {
			s5p_hdmi_set_audio(false);

			if (s5ptv_status.tvout_output_enable)
				s5p_hdmi_audio_enable(false);

		}

		return 0;

	case VIDIOC_AV_MUTE:
		if (arg) {
//			s5ptv_status.hdmi.audio = HDMI_AUDIO_NO; //. d: sichoi

			if (s5ptv_status.tvout_output_enable) {
				s5p_hdmi_audio_enable(false);
				s5p_hdmi_set_bluescreen(true);
			}

			s5p_hdmi_set_mute(true);
		} else {
//			s5ptv_status.hdmi.audio = HDMI_AUDIO_PCM; //. d: sichoi

			if (s5ptv_status.tvout_output_enable) {
				s5p_hdmi_audio_enable(true);
				s5p_hdmi_set_bluescreen(false);
			}

			s5p_hdmi_set_mute(false);
		}

		return 0;
	case VIDIOC_G_AVMUTE:
		return s5p_hdmi_get_mute();

	case VIDIOC_HDCP_ENABLE:
//		s5ptv_status.hdmi.hdcp_en = (unsigned int) arg; //. d: sichoi
		V4L2PRINTK("HDCP status is %s\n",
		       s5ptv_status.hdcp_en ? "enabled" : "disabled");

		return 0;

	case VIDIOC_HDCP_STATUS: {
		unsigned int *status = (unsigned int *)&arg;

		*status = 1;

		V4L2PRINTK("HPD status is %s\n",
		       s5ptv_status.hpd_status ? "plugged" : "unplugged");

		return 0;
	}

	case VIDIOC_HDCP_PROT_STATUS: {
		unsigned int *prot = (unsigned int *)&arg;

		*prot = 1;

//		V4L2PRINTK("hdcp prot status is %d\n", hdcp_protocol_status);

		return 0;
	}

	case VIDIOC_ENUMSTD: {
		struct v4l2_standard *p = (struct v4l2_standard *)arg;

		if (p->index >= S5P_TVOUT_MAX_STANDARDS) {
			V4L2PRINTK("exceeded S5P_TVOUT_MAX_STANDARDS\n");

			return -EINVAL;
		}

		memcpy(p, &s5p_tv_standards[p->index],
			sizeof(struct v4l2_standard));

		return 0;
	}

	default:
		break;
	}

	return video_ioctl2(file, cmd, arg);
}