summaryrefslogtreecommitdiff
path: root/drivers/cam_req_mgr/cam_req_mgr_util.h
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/cam_req_mgr/cam_req_mgr_util.h')
-rw-r--r--drivers/cam_req_mgr/cam_req_mgr_util.h55
1 files changed, 50 insertions, 5 deletions
diff --git a/drivers/cam_req_mgr/cam_req_mgr_util.h b/drivers/cam_req_mgr/cam_req_mgr_util.h
index c0e339e..2f676ae 100644
--- a/drivers/cam_req_mgr/cam_req_mgr_util.h
+++ b/drivers/cam_req_mgr/cam_req_mgr_util.h
@@ -1,6 +1,7 @@
/* SPDX-License-Identifier: GPL-2.0-only */
/*
* Copyright (c) 2016-2019, The Linux Foundation. All rights reserved.
+ * Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved.
*/
#ifndef _CAM_REQ_MGR_UTIL_API_H_
@@ -9,6 +10,9 @@
#include <media/cam_req_mgr.h>
#include "cam_req_mgr_util_priv.h"
+/* Interval for cam_info_rate_limit_custom() */
+#define CAM_RATE_LIMIT_INTERVAL_5SEC 5
+
/**
* state of a handle(session/device)
* @HDL_FREE: free handle
@@ -21,12 +25,14 @@ enum hdl_state {
/**
* handle type
- * @HDL_TYPE_DEV: for device and link
+ * @HDL_TYPE_DEV: for device
* @HDL_TYPE_SESSION: for session
+ * @HDL_TYPE_LINK: for link
*/
enum hdl_type {
HDL_TYPE_DEV = 1,
- HDL_TYPE_SESSION
+ HDL_TYPE_SESSION,
+ HDL_TYPE_LINK
};
/**
@@ -99,8 +105,19 @@ int32_t cam_create_session_hdl(void *priv);
int32_t cam_create_device_hdl(struct cam_create_dev_hdl *hdl_data);
/**
- * cam_get_device_priv() - get private data of a handle
- * @dev_hdl: handle for a session/link/device
+ * cam_create_link_hdl() - create a link handle
+ * @hdl_data: session hdl, flags, ops and priv dara as input
+ *
+ * cam_req_mgr_core calls this function to get
+ * session and link handles
+ * KMD drivers calls this function to create
+ * a link handle. Returns a unique link handle
+ */
+int32_t cam_create_link_hdl(struct cam_create_dev_hdl *hdl_data);
+
+/**
+ * cam_get_device_priv() - get private data of a device handle
+ * @dev_hdl: handle for a device
*
* cam_req_mgr_core and KMD drivers use this function to
* get private data of a handle. Returns a private data
@@ -109,6 +126,26 @@ int32_t cam_create_device_hdl(struct cam_create_dev_hdl *hdl_data);
void *cam_get_device_priv(int32_t dev_hdl);
/**
+ * cam_get_session_priv() - get private data of a session handle
+ * @dev_hdl: handle for a session
+ *
+ * cam_req_mgr_core and KMD drivers use this function to
+ * get private data of a handle. Returns a private data
+ * structure pointer.
+ */
+struct cam_req_mgr_core_session *cam_get_session_priv(int32_t dev_hdl);
+
+/**
+ * cam_get_link_priv() - get private data of a link handle
+ * @dev_hdl: handle for a link
+ *
+ * cam_req_mgr_core and KMD drivers use this function to
+ * get private data of a handle. Returns a private data
+ * structure pointer.
+ */
+struct cam_req_mgr_core_link *cam_get_link_priv(int32_t dev_hdl);
+
+/**
* cam_get_device_ops() - get ops of a handle
* @dev_hdl: handle for a session/link/device
*
@@ -119,13 +156,21 @@ void *cam_get_device_ops(int32_t dev_hdl);
/**
* cam_destroy_device_hdl() - destroy device handle
- * @dev_hdl: handle for a link/device.
+ * @dev_hdl: handle for a device.
*
* Returns success/failure
*/
int32_t cam_destroy_device_hdl(int32_t dev_hdl);
/**
+ * cam_destroy_link_hdl() - destroy link handle
+ * @dev_hdl: handle for a link.
+ *
+ * Returns success/failure
+ */
+int32_t cam_destroy_link_hdl(int32_t dev_hdl);
+
+/**
* cam_destroy_session_hdl() - destroy device handle
* @dev_hdl: handle for a session
*