Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7c485211 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "msm: camera2: cpp: Add support to enable turbo mode dynamically"

parents d7853b96 4e302b21
Loading
Loading
Loading
Loading
+34 −0
Original line number Diff line number Diff line
@@ -49,6 +49,9 @@

#define CPP_CMD_TIMEOUT_MS 300

#define MSM_CPP_NOMINAL_CLOCK 266670000
#define MSM_CPP_TURBO_CLOCK 320000000

struct msm_cpp_timer_data_t {
	struct cpp_device *cpp_dev;
	struct msm_cpp_frame_info_t *processed_frame;
@@ -1587,6 +1590,37 @@ long msm_cpp_subdev_ioctl(struct v4l2_subdev *sd,
		kfree(event_qcmd);
		break;
	}
	case VIDIOC_MSM_CPP_SET_CLOCK: {
		long clock_rate = 0;
		if (ioctl_ptr->len == 0) {
			pr_err("ioctl_ptr->len is 0\n");
			mutex_unlock(&cpp_dev->mutex);
			return -EINVAL;
		}

		if (ioctl_ptr->ioctl_ptr == NULL) {
			pr_err("ioctl_ptr->ioctl_ptr is NULL\n");
			mutex_unlock(&cpp_dev->mutex);
			return -EINVAL;
		}

		rc = (copy_from_user(&clock_rate,
			(void __user *)ioctl_ptr->ioctl_ptr,
			ioctl_ptr->len) ? -EFAULT : 0);
		if (rc) {
			ERR_COPY_FROM_USER();
			mutex_unlock(&cpp_dev->mutex);
			return -EINVAL;
		}

		if ((clock_rate == MSM_CPP_NOMINAL_CLOCK) ||
			(clock_rate == MSM_CPP_TURBO_CLOCK)) {
			CPP_DBG("clk:%ld\n", clock_rate);
			clk_set_rate(cpp_dev->cpp_clk[4], clock_rate);
		}

		break;
	}
	case MSM_SD_SHUTDOWN: {
		mutex_unlock(&cpp_dev->mutex);
		while (cpp_dev->cpp_open_cnt != 0)
+3 −0
Original line number Diff line number Diff line
@@ -228,6 +228,9 @@ struct msm_pproc_queue_buf_info {
#define VIDIOC_MSM_CPP_QUEUE_BUF \
	_IOWR('V', BASE_VIDIOC_PRIVATE + 14, struct msm_camera_v4l2_ioctl_t)

#define VIDIOC_MSM_CPP_SET_CLOCK \
	_IOWR('V', BASE_VIDIOC_PRIVATE + 16, struct msm_camera_v4l2_ioctl_t)

#define V4L2_EVENT_CPP_FRAME_DONE  (V4L2_EVENT_PRIVATE_START + 0)
#define V4L2_EVENT_VPE_FRAME_DONE  (V4L2_EVENT_PRIVATE_START + 1)