Преглед изворни кода

msm: camera: common: hfi presil api change for eva

Added client id param to presil hfi apis.

CRs-Fixed: 2932495
Change-Id: Ibd7d97a882e27782de902ee133faaa422a66e4cd
Signed-off-by: Suraj Dongre <[email protected]>
Suraj Dongre пре 3 година
родитељ
комит
9a9c865019

+ 4 - 2
drivers/cam_icp/hfi.c

@@ -1070,7 +1070,8 @@ int hfi_write_cmd(void *cmd_ptr)
 
 	mutex_lock(&hfi_cmd_q_mutex);
 
-	presil_rc = cam_presil_hfi_write_cmd(cmd_ptr, (*(uint32_t *)cmd_ptr));
+	presil_rc = cam_presil_hfi_write_cmd(cmd_ptr, (*(uint32_t *)cmd_ptr),
+		CAM_PRESIL_CLIENT_ID_CAMERA);
 
 	if ((presil_rc != CAM_PRESIL_SUCCESS) && (presil_rc != CAM_PRESIL_BLOCKED)) {
 		CAM_ERR(CAM_HFI, "failed presil rc %d", presil_rc);
@@ -1103,7 +1104,8 @@ int hfi_read_message(uint32_t *pmsg, uint8_t q_id,
 	memset(pmsg, 0x0, sizeof(uint32_t) * 256 /* ICP_MSG_BUF_SIZE */);
 	*words_read = 0;
 
-	presil_rc = cam_presil_hfi_read_message(pmsg, q_id, words_read);
+	presil_rc = cam_presil_hfi_read_message(pmsg, q_id, words_read,
+		CAM_PRESIL_CLIENT_ID_CAMERA);
 
 	if ((presil_rc != CAM_PRESIL_SUCCESS) && (presil_rc != CAM_PRESIL_BLOCKED)) {
 		CAM_ERR(CAM_HFI, "failed presil rc %d", presil_rc);

+ 9 - 5
drivers/cam_presil/inc/cam_presil_hw_access.h

@@ -8,6 +8,9 @@
 
 #include <linux/interrupt.h>
 
+#define CAM_PRESIL_CLIENT_ID_CAMERA 0x1
+#define CAM_PRESIL_CLIENT_ID_EVA    0x2
+
 /* presil events to carry shared values from HW-KMD to PC-HOST CSim Wrapper */
 #define CAM_PRESIL_EVENT_HFI_REG_BASE                             0x600
 #define CAM_PRESIL_EVENT_HFI_REG(n) (CAM_PRESIL_EVENT_HFI_REG_BASE + (n * 4))
@@ -177,12 +180,13 @@ int cam_presil_readl_poll_timeout(void __iomem *mem_address, uint32_t val,
  *
  * @brief   :  Write HFI command to presil hw.
  *
- * @addr    :  Pointer to HFI command
- * @cmdlen  :  Length
+ * @addr       :  Pointer to HFI command
+ * @cmdlen     :  Length
+ * @client_id  :  client Id of caller
  *
  * @return:  Success or Failure
  */
-int cam_presil_hfi_write_cmd(void *addr, uint32_t cmdlen);
+int cam_presil_hfi_write_cmd(void *addr, uint32_t cmdlen, uint32_t client_id);
 
 /*
  *  cam_presil_hfi_read_message()
@@ -192,12 +196,12 @@ int cam_presil_hfi_write_cmd(void *addr, uint32_t cmdlen);
  * @pmsg          :  Pointer to HFI message buffer
  * @q_id          :  Length
  * @words_read    :  Response message
- * @interval_msec :  Interval between tries
+ * @client_id     :  client Id of caller
  *
  * @return:  Success or Failure
  */
 int cam_presil_hfi_read_message(uint32_t *pmsg, uint8_t q_id,
-	uint32_t *words_read);
+	uint32_t *words_read, uint32_t client_id);
 
 /**
  * @brief : API to check if camera driver running in presil

+ 2 - 2
drivers/cam_presil/stub/cam_presil_hw_access_stub.c

@@ -50,13 +50,13 @@ int cam_presil_readl_poll_timeout(void __iomem *mem_address, uint32_t val,
 	return CAM_PRESIL_SUCCESS;
 }
 
-int cam_presil_hfi_write_cmd(void *hfi_cmd, uint32_t cmdlen)
+int cam_presil_hfi_write_cmd(void *hfi_cmd, uint32_t cmdlen, uint32_t client_id)
 {
 	return CAM_PRESIL_SUCCESS;
 }
 
 int cam_presil_hfi_read_message(uint32_t *pmsg, uint8_t q_id,
-	uint32_t *words_read)
+	uint32_t *words_read, uint32_t client_id)
 {
 	return CAM_PRESIL_SUCCESS;
 }