|
@@ -9,14 +9,15 @@
|
|
|
#include <linux/module.h>
|
|
|
#include <linux/platform_device.h>
|
|
|
#include <linux/debugfs.h>
|
|
|
+#if IS_REACHABLE(CONFIG_MSM_GLOBAL_SYNX)
|
|
|
+#include <synx_api.h>
|
|
|
+#endif
|
|
|
+
|
|
|
#include "cam_sync_util.h"
|
|
|
#include "cam_debug_util.h"
|
|
|
#include "cam_common_util.h"
|
|
|
#include "camera_main.h"
|
|
|
|
|
|
-#ifdef CONFIG_MSM_GLOBAL_SYNX
|
|
|
-#include <synx_api.h>
|
|
|
-#endif
|
|
|
struct sync_device *sync_dev;
|
|
|
|
|
|
/*
|
|
@@ -948,7 +949,7 @@ static struct v4l2_file_operations cam_sync_v4l2_fops = {
|
|
|
#endif
|
|
|
};
|
|
|
|
|
|
-#if defined(CONFIG_MEDIA_CONTROLLER)
|
|
|
+#if IS_REACHABLE(CONFIG_MEDIA_CONTROLLER)
|
|
|
static int cam_sync_media_controller_init(struct sync_device *sync_dev,
|
|
|
struct platform_device *pdev)
|
|
|
{
|
|
@@ -1031,8 +1032,8 @@ static int cam_sync_create_debugfs(void)
|
|
|
return 0;
|
|
|
}
|
|
|
|
|
|
-#ifdef CONFIG_MSM_GLOBAL_SYNX
|
|
|
-static void cam_sync_register_synx_bind_ops(void)
|
|
|
+#if IS_REACHABLE(CONFIG_MSM_GLOBAL_SYNX)
|
|
|
+static int cam_sync_register_synx_bind_ops(void)
|
|
|
{
|
|
|
int rc = 0;
|
|
|
struct synx_register_params params;
|
|
@@ -1046,7 +1047,9 @@ static void cam_sync_register_synx_bind_ops(void)
|
|
|
|
|
|
rc = synx_register_ops(¶ms);
|
|
|
if (rc)
|
|
|
- CAM_ERR(CAM_SYNC, "synx registration fail with %d", rc);
|
|
|
+ CAM_ERR(CAM_SYNC, "synx registration fail with rc=%d", rc);
|
|
|
+
|
|
|
+ return rc;
|
|
|
}
|
|
|
#endif
|
|
|
|
|
@@ -1124,8 +1127,11 @@ static int cam_sync_component_bind(struct device *dev,
|
|
|
|
|
|
trigger_cb_without_switch = false;
|
|
|
cam_sync_create_debugfs();
|
|
|
-#ifdef CONFIG_MSM_GLOBAL_SYNX
|
|
|
- cam_sync_register_synx_bind_ops();
|
|
|
+#if IS_REACHABLE(CONFIG_MSM_GLOBAL_SYNX)
|
|
|
+ CAM_INFO(CAM_SYNC, "Registering with synx driver");
|
|
|
+ rc = cam_sync_register_synx_bind_ops();
|
|
|
+ if (rc)
|
|
|
+ goto v4l2_fail;
|
|
|
#endif
|
|
|
CAM_DBG(CAM_SYNC, "Component bound successfully");
|
|
|
return rc;
|