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

Commit 949e6ed1 authored by Hariram Purushothaman's avatar Hariram Purushothaman
Browse files

msm: camera: Adopt camera drivers to use generic api to get v4l2 fops



Adopt all camera drivers to use generic api to get v4l2 fops
instead of directly referring the global variable in v4l2
framework.

Change-Id: I2c73c4d5354bb1ee571b265c2668c36617b66f9a
Signed-off-by: default avatarHariram Purushothaman <hariramp@codeaurora.org>
parent eb31701d
Loading
Loading
Loading
Loading
+6 −6
Original line number Diff line number Diff line
@@ -587,12 +587,12 @@ int vfe_hw_probe(struct platform_device *pdev)
		pr_err("%s: msm_sd_register error = %d\n", __func__, rc);
		goto probe_fail3;
	}

	msm_isp_v4l2_fops.owner = v4l2_subdev_fops.owner;
	msm_isp_v4l2_fops.open = v4l2_subdev_fops.open;
	msm_isp_v4l2_fops.release = v4l2_subdev_fops.release;
	msm_isp_v4l2_fops.poll = v4l2_subdev_fops.poll;

	msm_cam_copy_v4l2_subdev_fops(&msm_isp_v4l2_fops);
	msm_isp_v4l2_fops.unlocked_ioctl = msm_isp_v4l2_fops_ioctl;
#ifdef CONFIG_COMPAT
	msm_isp_v4l2_fops.compat_ioctl32 =
		msm_isp_v4l2_fops_ioctl;
#endif
	vfe_dev->subdev.sd.devnode->fops = &msm_isp_v4l2_fops;

	vfe_dev->buf_mgr = &vfe_buf_mgr;
+3 −5
Original line number Diff line number Diff line
@@ -1680,11 +1680,9 @@ static int ispif_probe(struct platform_device *pdev)
		pr_err("%s: msm_sd_register error = %d\n", __func__, rc);
		goto error;
	}
	msm_ispif_v4l2_subdev_fops.owner = v4l2_subdev_fops.owner;
	msm_ispif_v4l2_subdev_fops.open = v4l2_subdev_fops.open;
	msm_ispif_v4l2_subdev_fops.unlocked_ioctl = msm_ispif_subdev_fops_ioctl;
	msm_ispif_v4l2_subdev_fops.release = v4l2_subdev_fops.release;
	msm_ispif_v4l2_subdev_fops.poll = v4l2_subdev_fops.poll;
	msm_cam_copy_v4l2_subdev_fops(&msm_ispif_v4l2_subdev_fops);
	msm_ispif_v4l2_subdev_fops.unlocked_ioctl =
		msm_ispif_subdev_fops_ioctl;
#ifdef CONFIG_COMPAT
	msm_ispif_v4l2_subdev_fops.compat_ioctl32 = msm_ispif_subdev_fops_ioctl;
#endif
+14 −2
Original line number Diff line number Diff line
@@ -176,6 +176,18 @@ static void msm_enqueue(struct msm_queue_head *qhead,
	spin_unlock_irqrestore(&qhead->lock, flags);
}

void msm_cam_copy_v4l2_subdev_fops(struct v4l2_file_operations *d1)
{
	*d1 = v4l2_subdev_fops;
}
EXPORT_SYMBOL(msm_cam_copy_v4l2_subdev_fops);

static const struct v4l2_file_operations *msm_cam_get_v4l2_subdev_fops_ptr(
	void)
{
	return &v4l2_subdev_fops;
}

/* index = session id */
static inline int __msm_queue_find_session(void *d1, void *d2)
{
@@ -292,7 +304,7 @@ static inline int __msm_sd_register_subdev(struct v4l2_subdev *sd)
	video_set_drvdata(vdev, sd);
	strlcpy(vdev->name, sd->name, sizeof(vdev->name));
	vdev->v4l2_dev = msm_v4l2_dev;
	vdev->fops = &v4l2_subdev_fops;
	vdev->fops = msm_cam_get_v4l2_subdev_fops_ptr();
	vdev->release = msm_sd_unregister_subdev;
	rc = __video_register_device(vdev, VFL_TYPE_SUBDEV, -1, 1,
		  sd->owner);
@@ -1068,7 +1080,7 @@ static const struct file_operations logsync_fops = {

static int msm_probe(struct platform_device *pdev)
{
	struct msm_video_device *pvdev;
	struct msm_video_device *pvdev = NULL;
	static struct dentry *cam_debugfs_root;
	int rc = 0;

+1 −6
Original line number Diff line number Diff line
@@ -609,13 +609,8 @@ static int32_t __init msm_buf_mngr_init(void)
	/* Sub-dev */
	v4l2_subdev_init(&msm_buf_mngr_dev->subdev.sd,
		&msm_buf_mngr_subdev_ops);

	msm_buf_v4l2_subdev_fops.owner = v4l2_subdev_fops.owner;
	msm_buf_v4l2_subdev_fops.open = v4l2_subdev_fops.open;
	msm_cam_copy_v4l2_subdev_fops(&msm_buf_v4l2_subdev_fops);
	msm_buf_v4l2_subdev_fops.unlocked_ioctl = msm_buf_subdev_fops_ioctl;
	msm_buf_v4l2_subdev_fops.release = v4l2_subdev_fops.release;
	msm_buf_v4l2_subdev_fops.poll = v4l2_subdev_fops.poll;

#ifdef CONFIG_COMPAT
	msm_buf_v4l2_subdev_fops.compat_ioctl32 =
			msm_bmgr_subdev_fops_compat_ioctl;
+1 −0
Original line number Diff line number Diff line
@@ -85,5 +85,6 @@ int msm_sd_unregister(struct msm_sd_subdev *sd);
struct v4l2_subdev *msm_sd_get_subdev(struct v4l2_subdev *sd,
	const char *get_name);
void msm_sd_put_subdev(struct v4l2_subdev *sd, struct v4l2_subdev *put);
void msm_cam_copy_v4l2_subdev_fops(struct v4l2_file_operations *d1);

#endif /*_MSM_SD_H */
Loading