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

Commit b0d26198 authored by Jigarkumar Zala's avatar Jigarkumar Zala Committed by Gerrit - the friendly Code Review server
Browse files

msm: camara: sync: Add callback registration logic for synx



Synx driver is dependent on camera driver for registering callback
functions of sync driver. This change invert the logic, and camera
driver will register the callback functions for synx driver at the
time of sync driver probe.

Change-Id: I2dbee15ba4c7a9dde336a4bb1f2a4dddcd90348b
Signed-off-by: default avatarJigarkumar Zala <jzala@codeaurora.org>
Signed-off-by: default avatarSumukh Hallymysore Ravindra <shallymy@codeaurora.org>
parent 6b7d0258
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
# SPDX-License-Identifier: GPL-2.0-only

obj-$(CONFIG_SPECTRA_CAMERA) += camera/
#
# Makefile for the qti specific video device drivers
# based on V4L2.
@@ -8,3 +7,4 @@ obj-$(CONFIG_SPECTRA_CAMERA) += camera/
obj-$(CONFIG_MSM_CVP_V4L2) += cvp/
obj-$(CONFIG_MSM_NPU) += npu/
obj-$(CONFIG_MSM_GLOBAL_SYNX) += synx/
obj-$(CONFIG_SPECTRA_CAMERA) += camera/
+1 −0
Original line number Diff line number Diff line
# SPDX-License-Identifier: GPL-2.0-only

ccflags-y += -Idrivers/media/platform/msm/camera/cam_utils
ccflags-$(CONFIG_MSM_GLOBAL_SYNX) += -Idrivers/media/platform/msm/synx
ccflags-y += -I$(src)

obj-$(CONFIG_SPECTRA_CAMERA) += cam_sync.o cam_sync_util.o
+25 −1
Original line number Diff line number Diff line
@@ -13,6 +13,9 @@
#include "cam_debug_util.h"
#include "cam_common_util.h"

#ifdef CONFIG_MSM_GLOBAL_SYNX
#include <synx_api.h>
#endif
struct sync_device *sync_dev;

/*
@@ -956,6 +959,25 @@ static int cam_sync_create_debugfs(void)
	return 0;
}

#ifdef CONFIG_MSM_GLOBAL_SYNX
static void cam_sync_register_synx_bind_ops(void)
{
	int rc = 0;
	struct synx_register_params params;

	params.name = CAM_SYNC_NAME;
	params.type = SYNX_TYPE_CSL;
	params.ops.register_callback = cam_sync_register_callback;
	params.ops.deregister_callback = cam_sync_deregister_callback;
	params.ops.enable_signaling = cam_sync_get_obj_ref;
	params.ops.signal = cam_sync_signal;

	rc = synx_register_ops(&params);
	if (rc)
		CAM_ERR(CAM_SYNC, "synx registration fail with %d", rc);
}
#endif

static int cam_sync_probe(struct platform_device *pdev)
{
	int rc;
@@ -1023,7 +1045,9 @@ static int cam_sync_probe(struct platform_device *pdev)

	trigger_cb_without_switch = false;
	cam_sync_create_debugfs();

#ifdef CONFIG_MSM_GLOBAL_SYNX
	cam_sync_register_synx_bind_ops();
#endif
	return rc;

v4l2_fail: