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: Jigarkumar Zala <jzala@codeaurora.org>
This commit is contained in:
Jigarkumar Zala
2019-07-05 13:10:11 -07:00
کامیت شده توسط Gerrit - the friendly Code Review server
والد a0129f5975
کامیت f1135e91b9
2فایلهای تغییر یافته به همراه26 افزوده شده و 1 حذف شده

مشاهده پرونده

@@ -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: