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

Commit c9bd49a3 authored by Seemanta Dutta's avatar Seemanta Dutta Committed by TARKZiM
Browse files

msm: camera: Add support to return session id through g_ctrl ioctl



User space needs a mechanism to return the current session id. Use the
g_ctrl ioctl to return the session id.

Change-Id: I8404c8d627c771e0a2f4535d6f66b1b85288808a
Signed-off-by: default avatarSeemanta Dutta <seemanta@codeaurora.org>
parent 0c9888d5
Loading
Loading
Loading
Loading
+13 −7
Original line number Diff line number Diff line
/* Copyright (c) 2012-2014, The Linux Foundation. All rights reserved.
/* Copyright (c) 2012-2015, The Linux Foundation. All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 and
@@ -170,10 +170,15 @@ static int camera_v4l2_g_ctrl(struct file *filep, void *fh,
{
	int rc = 0;
	struct v4l2_event event;
	struct msm_video_device *pvdev = video_drvdata(filep);
	unsigned int session_id = pvdev->vdev->num;

	if (ctrl->id >= V4L2_CID_PRIVATE_BASE) {
		camera_pack_event(filep, MSM_CAMERA_GET_PARM, ctrl->id, -1,
			&event);
		if (ctrl->id == MSM_CAMERA_PRIV_G_SESSION_ID) {
			ctrl->value = session_id;
		} else {
			camera_pack_event(filep, MSM_CAMERA_GET_PARM,
					ctrl->id, -1, &event);

			rc = msm_post_event(&event, MSM_POST_EVT_TIMEOUT);
			if (rc < 0)
@@ -181,6 +186,7 @@ static int camera_v4l2_g_ctrl(struct file *filep, void *fh,

			rc = camera_check_event_status(&event);
		}
	}

	return rc;
}
+2 −0
Original line number Diff line number Diff line
@@ -113,6 +113,8 @@
#define MSM_CAMERA_PRIV_SHUTDOWN   (V4L2_CID_PRIVATE_BASE + 12)
#define MSM_CAMERA_PRIV_STREAM_INFO_SYNC \
	(V4L2_CID_PRIVATE_BASE + 13)
#define MSM_CAMERA_PRIV_G_SESSION_ID (V4L2_CID_PRIVATE_BASE + 14)
#define MSM_CAMERA_PRIV_CMD_MAX  20

/* data.status - success */
#define MSM_CAMERA_CMD_SUCESS      0x00000001