Преглед на файлове

msm: eva: Rename hfi related devices

To avoid confusion in code reading and prepare for
future compatibility changes.

Change-Id: I43d61e18d2e2d75d1fd46ceb2e763511329ee32d
Signed-off-by: George Shen <[email protected]>
George Shen преди 1 година
родител
ревизия
b293b5b713

+ 5 - 5
msm/eva/cvp.c

@@ -379,13 +379,13 @@ static int msm_probe_cvp_device(struct platform_device *pdev)
 	/* VM manager shall be started before HFI init */
 	vm_manager.vm_ops->vm_start(core);
 
-	core->device = cvp_hfi_initialize(core->hfi_type,
+	core->dev_ops = cvp_hfi_initialize(core->hfi_type,
 				&core->resources, &cvp_handle_cmd_response);
-	if (IS_ERR_OR_NULL(core->device)) {
+	if (IS_ERR_OR_NULL(core->dev_ops)) {
 		mutex_lock(&cvp_driver->lock);
 		mutex_unlock(&cvp_driver->lock);
 
-		rc = PTR_ERR(core->device) ?: -EBADHANDLE;
+		rc = PTR_ERR(core->dev_ops) ?: -EBADHANDLE;
 		if (rc != -EPROBE_DEFER)
 			dprintk(CVP_ERR, "Failed to create HFI device\n");
 		else
@@ -435,7 +435,7 @@ static int msm_probe_cvp_device(struct platform_device *pdev)
 	return rc;
 
 err_fail_sub_device_probe:
-	cvp_hfi_deinitialize(core->hfi_type, core->device);
+	cvp_hfi_deinitialize(core->hfi_type, core->dev_ops);
 	debugfs_remove_recursive(cvp_driver->debugfs_root);
 err_hfi_initialize:
 err_cores_exceeded:
@@ -510,7 +510,7 @@ static int msm_cvp_remove(struct platform_device *pdev)
 		return -EINVAL;
 	}
 
-	cvp_hfi_deinitialize(core->hfi_type, core->device);
+	cvp_hfi_deinitialize(core->hfi_type, core->dev_ops);
 	msm_cvp_free_platform_resources(&core->resources);
 	sysfs_remove_group(&pdev->dev.kobj, &msm_cvp_core_attr_group);
 	dev_set_drvdata(&pdev->dev, NULL);

+ 14 - 13
msm/eva/cvp_core_hfi.c

@@ -1,6 +1,7 @@
 // SPDX-License-Identifier: GPL-2.0-only
 /*
  * Copyright (c) 2018-2021, The Linux Foundation. All rights reserved.
+ * Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved.
  */
 
 #include <linux/slab.h>
@@ -8,20 +9,20 @@
 #include "cvp_hfi_api.h"
 #include "cvp_core_hfi.h"
 
-struct cvp_hfi_device *cvp_hfi_initialize(enum msm_cvp_hfi_type hfi_type,
+struct cvp_hfi_ops *cvp_hfi_initialize(enum msm_cvp_hfi_type hfi_type,
 		struct msm_cvp_platform_resources *res,
 		hfi_cmd_response_callback callback)
 {
-	struct cvp_hfi_device *hdev = NULL;
+	struct cvp_hfi_ops *ops_tbl = NULL;
 	int rc = 0;
 
-	hdev = kzalloc(sizeof(struct cvp_hfi_device), GFP_KERNEL);
-	if (!hdev) {
-		dprintk(CVP_ERR, "%s: failed to allocate hdev\n", __func__);
+	ops_tbl = kzalloc(sizeof(struct cvp_hfi_ops), GFP_KERNEL);
+	if (!ops_tbl) {
+		dprintk(CVP_ERR, "%s: failed to allocate ops_tbl\n", __func__);
 		return NULL;
 	}
 
-	rc = cvp_iris_hfi_initialize(hdev, res, callback);
+	rc = cvp_iris_hfi_initialize(ops_tbl, res, callback);
 
 	if (rc) {
 		if (rc != -EPROBE_DEFER)
@@ -30,23 +31,23 @@ struct cvp_hfi_device *cvp_hfi_initialize(enum msm_cvp_hfi_type hfi_type,
 		goto err_hfi_init;
 	}
 
-	return hdev;
+	return ops_tbl;
 
 err_hfi_init:
-	kfree(hdev);
+	kfree(ops_tbl);
 	return ERR_PTR(rc);
 }
 
 void cvp_hfi_deinitialize(enum msm_cvp_hfi_type hfi_type,
-			struct cvp_hfi_device *hdev)
+			struct cvp_hfi_ops *ops_tbl)
 {
-	if (!hdev) {
-		dprintk(CVP_ERR, "%s invalid device %pK", __func__, hdev);
+	if (!ops_tbl) {
+		dprintk(CVP_ERR, "%s invalid device %pK", __func__, ops_tbl);
 		return;
 	}
 
-	cvp_iris_hfi_delete_device(hdev->hfi_device_data);
+	cvp_iris_hfi_delete_device(ops_tbl->hfi_device_data);
 
-	kfree(hdev);
+	kfree(ops_tbl);
 }
 

+ 5 - 5
msm/eva/cvp_core_hfi.h

@@ -196,8 +196,8 @@ struct cvp_iface_q_info {
 	iris_hfi_for_each_thing_reverse(__device, __sinfo, subcache)
 
 #define call_iris_op(d, op, args...)			\
-	(((d) && (d)->vpu_ops && (d)->vpu_ops->op) ? \
-	((d)->vpu_ops->op(args)):0)
+	(((d) && (d)->hal_ops && (d)->hal_ops->op) ? \
+	((d)->hal_ops->op(args)):0)
 
 struct cvp_hal_data {
 	u32 irq;
@@ -226,7 +226,7 @@ enum reset_state {
 
 struct iris_hfi_device;
 
-struct iris_hfi_vpu_ops {
+struct cvp_hal_ops {
 	void (*interrupt_init)(struct iris_hfi_device *ptr);
 	void (*setup_dsp_uc_memmap)(struct iris_hfi_device *device);
 	void (*clock_config_on_enable)(struct iris_hfi_device *device);
@@ -276,7 +276,7 @@ struct iris_hfi_device {
 	struct pm_qos_request qos;
 	unsigned int skip_pc_count;
 	struct msm_cvp_capability *sys_init_capabilities;
-	struct iris_hfi_vpu_ops *vpu_ops;
+	struct cvp_hal_ops *hal_ops;
 };
 
 irqreturn_t cvp_hfi_isr(int irq, void *dev);
@@ -284,7 +284,7 @@ irqreturn_t iris_hfi_core_work_handler(int irq, void *data);
 irqreturn_t iris_hfi_isr_wd(int irq, void *dev);
 void cvp_iris_hfi_delete_device(void *device);
 
-int cvp_iris_hfi_initialize(struct cvp_hfi_device *hdev,
+int cvp_iris_hfi_initialize(struct cvp_hfi_ops *hdev,
 		struct msm_cvp_platform_resources *res,
 		hfi_cmd_response_callback callback);
 

+ 43 - 43
msm/eva/cvp_hfi.c

@@ -115,7 +115,7 @@ static int __reset_control_release(struct iris_hfi_device *device, const char *n
 static bool __is_ctl_power_on(struct iris_hfi_device *device);
 
 
-static struct iris_hfi_vpu_ops iris2_ops = {
+static struct cvp_hal_ops hal_ops = {
 	.interrupt_init = interrupt_init_iris2,
 	.setup_dsp_uc_memmap = setup_dsp_uc_memmap_vpu5,
 	.clock_config_on_enable = clock_config_on_enable_vpu5,
@@ -179,7 +179,7 @@ int get_hfi_version(void)
 	struct iris_hfi_device *hfi;
 
 	core = cvp_driver->cvp_core;
-	hfi = (struct iris_hfi_device *)core->device->hfi_device_data;
+	hfi = (struct iris_hfi_device *)core->dev_ops->hfi_device_data;
 
 	return hfi->version;
 }
@@ -192,7 +192,7 @@ unsigned int get_msg_size(struct cvp_hfi_msg_session_hdr *hdr)
 
 	core = cvp_driver->cvp_core;
 	if (core)
-		device = core->device->hfi_device_data;
+		device = core->dev_ops->hfi_device_data;
 	else
 		return 0;
 
@@ -2994,7 +2994,7 @@ static void iris_hfi_pm_handler(struct work_struct *work)
 
 	core = cvp_driver->cvp_core;
 	if (core)
-		device = core->device->hfi_device_data;
+		device = core->dev_ops->hfi_device_data;
 	else
 		return;
 
@@ -3492,7 +3492,7 @@ irqreturn_t iris_hfi_core_work_handler(int irq, void *data)
 
 	core = cvp_driver->cvp_core;
 	if (core)
-		device = core->device->hfi_device_data;
+		device = core->dev_ops->hfi_device_data;
 	else
 		return IRQ_HANDLED;
 
@@ -3572,7 +3572,7 @@ static void iris_hfi_wd_work_handler(struct work_struct *work)
 	enum hal_command_response cmd = HAL_SYS_WATCHDOG_TIMEOUT;
 	core = cvp_driver->cvp_core;
 	if (core)
-		device = core->device->hfi_device_data;
+		device = core->dev_ops->hfi_device_data;
 	else
 		return;
 	if (msm_cvp_hw_wd_recovery) {
@@ -5318,7 +5318,7 @@ static int __initialize_packetization(struct iris_hfi_device *device)
 
 void __init_cvp_ops(struct iris_hfi_device *device)
 {
-	device->vpu_ops = &iris2_ops;
+	device->hal_ops = &hal_ops;
 }
 
 static struct iris_hfi_device *__add_device(struct msm_cvp_platform_resources *res,
@@ -5413,7 +5413,7 @@ void cvp_iris_hfi_delete_device(void *device)
 
 	core = cvp_driver->cvp_core;
 	if (core)
-		dev = core->device->hfi_device_data;
+		dev = core->dev_ops->hfi_device_data;
 
 	if (!dev)
 		return;
@@ -5450,55 +5450,55 @@ static int iris_hfi_validate_session(void *sess, const char *func)
 	return rc;
 }
 
-static void iris_init_hfi_callbacks(struct cvp_hfi_device *hdev)
-{
-	hdev->core_init = iris_hfi_core_init;
-	hdev->core_release = iris_hfi_core_release;
-	hdev->core_trigger_ssr = iris_hfi_core_trigger_ssr;
-	hdev->session_init = iris_hfi_session_init;
-	hdev->session_end = iris_hfi_session_end;
-	hdev->session_start = iris_hfi_session_start;
-	hdev->session_stop = iris_hfi_session_stop;
-	hdev->session_abort = iris_hfi_session_abort;
-	hdev->session_clean = iris_hfi_session_clean;
-	hdev->session_set_buffers = iris_hfi_session_set_buffers;
-	hdev->session_release_buffers = iris_hfi_session_release_buffers;
-	hdev->session_send = iris_hfi_session_send;
-	hdev->session_flush = iris_hfi_session_flush;
-	hdev->scale_clocks = iris_hfi_scale_clocks;
-	hdev->vote_bus = iris_hfi_vote_buses;
-	hdev->get_fw_info = iris_hfi_get_fw_info;
-	hdev->get_core_capabilities = iris_hfi_get_core_capabilities;
-	hdev->suspend = iris_hfi_suspend;
-	hdev->resume = iris_hfi_resume;
-	hdev->flush_debug_queue = iris_hfi_flush_debug_queue;
-	hdev->noc_error_info = iris_hfi_noc_error_info;
-	hdev->validate_session = iris_hfi_validate_session;
-	hdev->pm_qos_update = iris_pm_qos_update;
-	hdev->debug_hook = iris_debug_hook;
-}
-
-int cvp_iris_hfi_initialize(struct cvp_hfi_device *hdev,
+static void iris_init_hfi_callbacks(struct cvp_hfi_ops *ops_tbl)
+{
+	ops_tbl->core_init = iris_hfi_core_init;
+	ops_tbl->core_release = iris_hfi_core_release;
+	ops_tbl->core_trigger_ssr = iris_hfi_core_trigger_ssr;
+	ops_tbl->session_init = iris_hfi_session_init;
+	ops_tbl->session_end = iris_hfi_session_end;
+	ops_tbl->session_start = iris_hfi_session_start;
+	ops_tbl->session_stop = iris_hfi_session_stop;
+	ops_tbl->session_abort = iris_hfi_session_abort;
+	ops_tbl->session_clean = iris_hfi_session_clean;
+	ops_tbl->session_set_buffers = iris_hfi_session_set_buffers;
+	ops_tbl->session_release_buffers = iris_hfi_session_release_buffers;
+	ops_tbl->session_send = iris_hfi_session_send;
+	ops_tbl->session_flush = iris_hfi_session_flush;
+	ops_tbl->scale_clocks = iris_hfi_scale_clocks;
+	ops_tbl->vote_bus = iris_hfi_vote_buses;
+	ops_tbl->get_fw_info = iris_hfi_get_fw_info;
+	ops_tbl->get_core_capabilities = iris_hfi_get_core_capabilities;
+	ops_tbl->suspend = iris_hfi_suspend;
+	ops_tbl->resume = iris_hfi_resume;
+	ops_tbl->flush_debug_queue = iris_hfi_flush_debug_queue;
+	ops_tbl->noc_error_info = iris_hfi_noc_error_info;
+	ops_tbl->validate_session = iris_hfi_validate_session;
+	ops_tbl->pm_qos_update = iris_pm_qos_update;
+	ops_tbl->debug_hook = iris_debug_hook;
+}
+
+int cvp_iris_hfi_initialize(struct cvp_hfi_ops *ops_tbl,
 		struct msm_cvp_platform_resources *res,
 		hfi_cmd_response_callback callback)
 {
 	int rc = 0;
 
-	if (!hdev || !res || !callback) {
+	if (!ops_tbl || !res || !callback) {
 		dprintk(CVP_ERR, "Invalid params: %pK %pK %pK\n",
-			hdev, res, callback);
+			ops_tbl, res, callback);
 		rc = -EINVAL;
 		goto err_iris_hfi_init;
 	}
 
-	hdev->hfi_device_data = __get_device(res, callback);
+	ops_tbl->hfi_device_data = __get_device(res, callback);
 
-	if (IS_ERR_OR_NULL(hdev->hfi_device_data)) {
-		rc = PTR_ERR(hdev->hfi_device_data) ?: -EINVAL;
+	if (IS_ERR_OR_NULL(ops_tbl->hfi_device_data)) {
+		rc = PTR_ERR(ops_tbl->hfi_device_data) ?: -EINVAL;
 		goto err_iris_hfi_init;
 	}
 
-	iris_init_hfi_callbacks(hdev);
+	iris_init_hfi_callbacks(ops_tbl);
 
 err_iris_hfi_init:
 	return rc;

+ 4 - 4
msm/eva/cvp_hfi_api.h

@@ -249,7 +249,7 @@ struct msm_cvp_hfi_defs {
 	bool force_kernel_fence;
 };
 
-struct cvp_hfi_device {
+struct cvp_hfi_ops {
 	void *hfi_device_data;
 	/*Add function pointers for all the hfi functions below*/
 	int (*core_init)(void *device);
@@ -297,11 +297,11 @@ enum cvp_status hfi_process_session_init_done_prop_read(
 	struct cvp_hfi_msg_sys_session_init_done_packet *pkt,
 	struct cvp_hal_session_init_done *session_init_done);
 
-struct cvp_hfi_device *cvp_hfi_initialize(enum msm_cvp_hfi_type hfi_type,
+struct cvp_hfi_ops *cvp_hfi_initialize(enum msm_cvp_hfi_type hfi_type,
 		struct msm_cvp_platform_resources *res,
 		hfi_cmd_response_callback callback);
 void cvp_hfi_deinitialize(enum msm_cvp_hfi_type hfi_type,
-			struct cvp_hfi_device *hdev);
+			struct cvp_hfi_ops *hdev);
 
 int get_pkt_index(struct cvp_hal_session_cmd_pkt *hdr);
 int get_pkt_fenceoverride(struct cvp_hal_session_cmd_pkt* hdr);
@@ -313,5 +313,5 @@ unsigned int get_msg_errorcode(void *msg);
 int get_msg_opconfigs(void *msg, unsigned int *session_id,
 		unsigned int *error_type, unsigned int *config_id);
 extern const struct msm_cvp_hfi_defs cvp_hfi_defs[MAX_PKT_IDX];
-void print_hfi_queue_info(struct cvp_hfi_device *hdev);
+void print_hfi_queue_info(struct cvp_hfi_ops *hdev);
 #endif /*__CVP_HFI_API_H__ */

+ 1 - 1
msm/eva/cvp_power.c

@@ -145,7 +145,7 @@ static int adjust_bw_freqs(unsigned int max_bw, unsigned int min_bw)
 
 	core = cvp_driver->cvp_core;
 
-	hdev = core->device->hfi_device_data;
+	hdev = core->dev_ops->hfi_device_data;
 	tbl = core->resources.allowed_clks_tbl;
 	tbl_size = core->resources.allowed_clks_tbl_size;
 	cvp_min_rate = tbl[0].clock_rate;

+ 8 - 8
msm/eva/cvp_smem.c

@@ -574,16 +574,16 @@ int msm_cvp_map_ipcc_regs(u32 *iova)
 {
 	struct context_bank_info *cb;
 	struct msm_cvp_core *core;
-	struct cvp_hfi_device *hfi_ops;
+	struct cvp_hfi_ops *ops_tbl;
 	struct iris_hfi_device *dev = NULL;
 	phys_addr_t paddr;
 	u32 size;
 
 	core = cvp_driver->cvp_core;
 	if (core) {
-		hfi_ops = core->device;
-		if (hfi_ops)
-			dev = hfi_ops->hfi_device_data;
+		ops_tbl = core->dev_ops;
+		if (ops_tbl)
+			dev = ops_tbl->hfi_device_data;
 	}
 
 	if (!dev)
@@ -612,15 +612,15 @@ int msm_cvp_unmap_ipcc_regs(u32 iova)
 {
 	struct context_bank_info *cb;
 	struct msm_cvp_core *core;
-	struct cvp_hfi_device *hfi_ops;
+	struct cvp_hfi_ops *ops_tbl;
 	struct iris_hfi_device *dev = NULL;
 	u32 size;
 
 	core = cvp_driver->cvp_core;
 	if (core) {
-		hfi_ops = core->device;
-		if (hfi_ops)
-			dev = hfi_ops->hfi_device_data;
+		ops_tbl = core->dev_ops;
+		if (ops_tbl)
+			dev = ops_tbl->hfi_device_data;
 	}
 
 	if (!dev)

+ 24 - 23
msm/eva/msm_cvp.c

@@ -95,8 +95,9 @@ static int cvp_wait_process_message(struct msm_cvp_inst *inst,
 	if (wait_event_timeout(sq->wq,
 		cvp_msg_pending(sq, &msg, ktid), timeout) == 0) {
 		dprintk(CVP_WARN, "session queue wait timeout\n");
-		if (inst && inst->core && inst->core->device && inst->state != MSM_CVP_CORE_INVALID)
-			print_hfi_queue_info(inst->core->device);
+		if (inst && inst->core && inst->core->dev_ops &&
+				inst->state != MSM_CVP_CORE_INVALID)
+			print_hfi_queue_info(inst->core->dev_ops);
 		rc = -ETIMEDOUT;
 		goto exit;
 	}
@@ -301,7 +302,7 @@ static int cvp_fence_proc(struct msm_cvp_inst *inst,
 	unsigned long timeout;
 	u64 ktid;
 	int synx_state = SYNX_STATE_SIGNALED_SUCCESS;
-	struct cvp_hfi_device *hdev;
+	struct cvp_hfi_ops *ops_tbl;
 	struct cvp_session_queue *sq;
 	u32 hfi_err = HFI_ERR_NONE;
 	struct cvp_hfi_msg_session_hdr_ext hdr;
@@ -311,7 +312,7 @@ static int cvp_fence_proc(struct msm_cvp_inst *inst,
 	if (!inst || !inst->core)
 		return -EINVAL;
 
-	hdev = inst->core->device;
+	ops_tbl = inst->core->dev_ops;
 	sq = &inst->session_queue_fence;
 	ktid = pkt->client_data.kdata;
 
@@ -322,7 +323,7 @@ static int cvp_fence_proc(struct msm_cvp_inst *inst,
 		goto exit;
 	}
 
-	rc = call_hfi_op(hdev, session_send, (void *)inst->session,
+	rc = call_hfi_op(ops_tbl, session_send, (void *)inst->session,
 			(struct eva_kmd_hfi_packet *)pkt);
 	if (rc) {
 		dprintk(CVP_ERR, "%s %s: Failed in call_hfi_op %d, %x\n",
@@ -405,7 +406,7 @@ static int cvp_fence_thread(void *data)
 	dprintk(CVP_SYNX, "Enter %s\n", current->comm);
 
 	inst = (struct msm_cvp_inst *)data;
-	if (!inst || !inst->core || !inst->core->device) {
+	if (!inst || !inst->core || !inst->core->dev_ops) {
 		dprintk(CVP_ERR, "%s invalid inst %pK\n", current->comm, inst);
 		rc = -EINVAL;
 		goto exit;
@@ -634,12 +635,12 @@ static int cvp_enqueue_pkt(struct msm_cvp_inst* inst,
 	unsigned int in_offset,
 	unsigned int in_buf_num)
 {
-	struct cvp_hfi_device *hdev;
+	struct cvp_hfi_ops *ops_tbl;
 	struct cvp_hfi_cmd_session_hdr *cmd_hdr;
 	int pkt_type, rc = 0;
 	enum buf_map_type map_type;
 
-	hdev = inst->core->device;
+	ops_tbl = inst->core->dev_ops;
 
 	pkt_type = in_pkt->pkt_data[1];
 	map_type = cvp_find_map_type(pkt_type);
@@ -666,7 +667,7 @@ static int cvp_enqueue_pkt(struct msm_cvp_inst* inst,
 
 	rc = cvp_populate_fences(in_pkt, in_offset, in_buf_num, inst);
 	if (rc == 0) {
-		rc = call_hfi_op(hdev, session_send, (void*)inst->session,
+		rc = call_hfi_op(ops_tbl, session_send, (void *)inst->session,
 			in_pkt);
 		if (rc) {
 			dprintk(CVP_ERR,"%s: Failed in call_hfi_op %d, %x\n",
@@ -838,7 +839,7 @@ int msm_cvp_session_start(struct msm_cvp_inst *inst,
 		struct eva_kmd_arg *arg)
 {
 	struct cvp_session_queue *sq;
-	struct cvp_hfi_device *hdev;
+	struct cvp_hfi_ops *ops_tbl;
 	int rc;
 	enum queue_state old_state;
 
@@ -860,13 +861,13 @@ int msm_cvp_session_start(struct msm_cvp_inst *inst,
 	sq->state = QUEUE_START;
 	spin_unlock(&sq->lock);
 
-	hdev = inst->core->device;
+	ops_tbl = inst->core->dev_ops;
 	if (inst->prop.type == HFI_SESSION_FD
 		|| inst->prop.type == HFI_SESSION_DMM) {
 		spin_lock(&inst->core->resources.pm_qos.lock);
 		inst->core->resources.pm_qos.off_vote_cnt++;
 		spin_unlock(&inst->core->resources.pm_qos.lock);
-		call_hfi_op(hdev, pm_qos_update, hdev->hfi_device_data);
+		call_hfi_op(ops_tbl, pm_qos_update, ops_tbl->hfi_device_data);
 	}
 	/*
 	 * cvp_fence_thread_start will increment reference to instance.
@@ -878,7 +879,7 @@ int msm_cvp_session_start(struct msm_cvp_inst *inst,
 		goto restore_state;
 
 	/* Send SESSION_START command */
-	rc = call_hfi_op(hdev, session_start, (void *)inst->session);
+	rc = call_hfi_op(ops_tbl, session_start, (void *)inst->session);
 	if (rc) {
 		dprintk(CVP_WARN, "%s: session start failed rc %d\n",
 				__func__, rc);
@@ -914,7 +915,7 @@ int msm_cvp_session_stop(struct msm_cvp_inst *inst,
 	struct cvp_session_queue *sq;
 	struct eva_kmd_session_control *sc = NULL;
 	struct msm_cvp_inst *s;
-	struct cvp_hfi_device *hdev;
+	struct cvp_hfi_ops *ops_tbl;
 	int rc;
 
 	if (!inst || !inst->core) {
@@ -947,9 +948,9 @@ int msm_cvp_session_stop(struct msm_cvp_inst *inst,
 			"sess", inst, hash32_ptr(inst->session));
 	spin_unlock(&sq->lock);
 
-	hdev = inst->core->device;
+	ops_tbl = inst->core->dev_ops;
 	/* Send SESSION_STOP command */
-	rc = call_hfi_op(hdev, session_stop, (void *)inst->session);
+	rc = call_hfi_op(ops_tbl, session_stop, (void *)inst->session);
 	if (rc) {
 		dprintk(CVP_WARN, "%s: session stop failed rc %d\n",
 				__func__, rc);
@@ -1037,18 +1038,18 @@ static int msm_cvp_get_sysprop(struct msm_cvp_inst *inst,
 		struct eva_kmd_arg *arg)
 {
 	struct eva_kmd_sys_properties *props = &arg->data.sys_properties;
-	struct cvp_hfi_device *hdev;
+	struct cvp_hfi_ops *ops_tbl;
 	struct iris_hfi_device *hfi;
 	struct cvp_session_prop *session_prop;
 	int i, rc = 0;
 
-	if (!inst || !inst->core || !inst->core->device) {
+	if (!inst || !inst->core || !inst->core->dev_ops) {
 		dprintk(CVP_ERR, "%s: invalid params\n", __func__);
 		return -EINVAL;
 	}
 
-	hdev = inst->core->device;
-	hfi = hdev->hfi_device_data;
+	ops_tbl = inst->core->dev_ops;
+	hfi = ops_tbl->hfi_device_data;
 
 	if (props->prop_num > MAX_KMD_PROP_NUM_PER_PACKET) {
 		dprintk(CVP_ERR, "Too many properties %d to get\n",
@@ -1452,7 +1453,7 @@ static int cvp_flush_all(struct msm_cvp_inst *inst)
 	int rc = 0;
 	struct msm_cvp_inst *s;
 	struct cvp_fence_queue *q;
-	struct cvp_hfi_device *hdev;
+	struct cvp_hfi_ops *ops_tbl;
 
 	if (!inst || !inst->core) {
 		dprintk(CVP_ERR, "%s: invalid params\n", __func__);
@@ -1466,7 +1467,7 @@ static int cvp_flush_all(struct msm_cvp_inst *inst)
 	dprintk(CVP_SESS, "session %llx (%#x)flush all starts\n",
 			inst, hash32_ptr(inst->session));
 	q = &inst->fence_cmd_queue;
-	hdev = inst->core->device;
+	ops_tbl = inst->core->dev_ops;
 
 	cvp_clean_fence_queue(inst, SYNX_STATE_SIGNALED_CANCEL);
 
@@ -1474,7 +1475,7 @@ static int cvp_flush_all(struct msm_cvp_inst *inst)
 			__func__, hash32_ptr(inst->session));
 
 	/* Send flush to FW */
-	rc = call_hfi_op(hdev, session_flush, (void *)inst->session);
+	rc = call_hfi_op(ops_tbl, session_flush, (void *)inst->session);
 	if (rc) {
 		dprintk(CVP_WARN, "%s: continue flush without fw. rc %d\n",
 		__func__, rc);

+ 7 - 7
msm/eva/msm_cvp_buf.c

@@ -2195,7 +2195,7 @@ int cvp_release_arp_buffers(struct msm_cvp_inst *inst)
 	struct cvp_internal_buf *buf;
 	int rc = 0;
 	struct msm_cvp_core *core;
-	struct cvp_hfi_device *hdev;
+	struct cvp_hfi_ops *ops_tbl;
 
 	if (!inst) {
 		dprintk(CVP_ERR, "Invalid instance pointer = %pK\n", inst);
@@ -2207,9 +2207,9 @@ int cvp_release_arp_buffers(struct msm_cvp_inst *inst)
 		dprintk(CVP_ERR, "Invalid core pointer = %pK\n", core);
 		return -EINVAL;
 	}
-	hdev = core->device;
-	if (!hdev) {
-		dprintk(CVP_ERR, "Invalid device pointer = %pK\n", hdev);
+	ops_tbl = core->dev_ops;
+	if (!ops_tbl) {
+		dprintk(CVP_ERR, "Invalid device pointer = %pK\n", ops_tbl);
 		return -EINVAL;
 	}
 
@@ -2218,7 +2218,7 @@ int cvp_release_arp_buffers(struct msm_cvp_inst *inst)
 	mutex_lock(&inst->persistbufs.lock);
 	/* Workaround for FW: release buffer means release all */
 	if (inst->state > MSM_CVP_CORE_INIT_DONE && inst->state <= MSM_CVP_CLOSE_DONE) {
-		rc = call_hfi_op(hdev, session_release_buffers,
+		rc = call_hfi_op(ops_tbl, session_release_buffers,
 				(void *)inst->session);
 		if (!rc) {
 			mutex_unlock(&inst->persistbufs.lock);
@@ -2370,7 +2370,7 @@ int cvp_release_dsp_buffers(struct msm_cvp_inst *inst,
 int msm_cvp_register_buffer(struct msm_cvp_inst *inst,
 		struct eva_kmd_buffer *buf)
 {
-	struct cvp_hfi_device *hdev;
+	struct cvp_hfi_ops *ops_tbl;
 	struct cvp_hal_session *session;
 	struct msm_cvp_inst *s;
 	int rc = 0;
@@ -2390,7 +2390,7 @@ int msm_cvp_register_buffer(struct msm_cvp_inst *inst,
 		rc = -EINVAL;
 		goto exit;
 	}
-	hdev = inst->core->device;
+	ops_tbl = inst->core->dev_ops;
 	print_client_buffer(CVP_HFI, "register", inst, buf);
 
 	if (buf->index)

+ 9 - 9
msm/eva/msm_cvp_clocks.c

@@ -81,17 +81,17 @@ int msm_cvp_mmrm_notifier_cb(
 
 int msm_cvp_set_clocks(struct msm_cvp_core *core)
 {
-	struct cvp_hfi_device *hdev;
+	struct cvp_hfi_ops *ops_tbl;
 	int rc;
 
-	if (!core || !core->device) {
+	if (!core || !core->dev_ops) {
 		dprintk(CVP_ERR, "%s Invalid args: %pK\n", __func__, core);
 		return -EINVAL;
 	}
 
-	hdev = core->device;
-	rc = call_hfi_op(hdev, scale_clocks,
-		hdev->hfi_device_data, core->curr_freq);
+	ops_tbl = core->dev_ops;
+	rc = call_hfi_op(ops_tbl, scale_clocks,
+		ops_tbl->hfi_device_data, core->curr_freq);
 	return rc;
 }
 
@@ -461,16 +461,16 @@ void msm_cvp_deinit_clocks(struct iris_hfi_device *device)
 
 int msm_cvp_set_bw(struct msm_cvp_core *core, struct bus_info *bus, unsigned long bw)
 {
-	struct cvp_hfi_device *hdev;
+	struct cvp_hfi_ops *ops_tbl;
 	int rc;
 
-	if (!core || !core->device) {
+	if (!core || !core->dev_ops) {
 		dprintk(CVP_ERR, "%s Invalid args: %pK\n", __func__, core);
 		return -EINVAL;
 	}
 
-	hdev = core->device;
-	rc = call_hfi_op(hdev, vote_bus, hdev->hfi_device_data, bus, bw);
+	ops_tbl = core->dev_ops;
+	rc = call_hfi_op(ops_tbl, vote_bus, ops_tbl->hfi_device_data, bus, bw);
 	return rc;
 
 }

+ 67 - 67
msm/eva/msm_cvp_common.c

@@ -64,12 +64,12 @@ static void dump_hfi_queue(struct iris_hfi_device *device)
 	mutex_unlock(&device->lock);
 }
 
-void print_hfi_queue_info(struct cvp_hfi_device *hdev)
+void print_hfi_queue_info(struct cvp_hfi_ops *ops_tbl)
 {
-       if(hdev && hdev->hfi_device_data){
-		call_hfi_op(hdev, flush_debug_queue, hdev->hfi_device_data);
-		dump_hfi_queue(hdev->hfi_device_data);
-       }
+	if (ops_tbl && ops_tbl->hfi_device_data) {
+		call_hfi_op(ops_tbl, flush_debug_queue, ops_tbl->hfi_device_data);
+		dump_hfi_queue(ops_tbl->hfi_device_data);
+	}
 }
 
 static void handle_sys_init_done(enum hal_command_response cmd, void *data)
@@ -191,7 +191,7 @@ struct msm_cvp_inst *cvp_get_inst_validate(struct msm_cvp_core *core,
 		void *session_id)
 {
 	int rc = 0;
-	struct cvp_hfi_device *hdev;
+	struct cvp_hfi_ops *ops_tbl;
 	struct msm_cvp_inst *s;
 
 	s = cvp_get_inst(core, session_id);
@@ -200,8 +200,8 @@ struct msm_cvp_inst *cvp_get_inst_validate(struct msm_cvp_core *core,
 		return NULL;
 	}
 
-	hdev = s->core->device;
-	rc = call_hfi_op(hdev, validate_session, s->session, __func__);
+	ops_tbl = s->core->dev_ops;
+	rc = call_hfi_op(ops_tbl, validate_session, s->session, __func__);
 	if (rc) {
 		cvp_put_inst(s);
 		s = NULL;
@@ -350,13 +350,13 @@ int wait_for_sess_signal_receipt(struct msm_cvp_inst *inst,
 	enum hal_command_response cmd)
 {
 	int rc = 0;
-	struct cvp_hfi_device *hdev;
+	struct cvp_hfi_ops *ops_tbl;
 
 	if (!IS_HAL_SESSION_CMD(cmd)) {
 		dprintk(CVP_ERR, "Invalid inst cmd response: %d\n", cmd);
 		return -EINVAL;
 	}
-	hdev = (struct cvp_hfi_device *)(inst->core->device);
+	ops_tbl = (struct cvp_hfi_ops *)(inst->core->dev_ops);
 	rc = wait_for_completion_timeout(
 		&inst->completions[SESSION_MSG_INDEX(cmd)],
 		msecs_to_jiffies(
@@ -365,7 +365,7 @@ int wait_for_sess_signal_receipt(struct msm_cvp_inst *inst,
 		dprintk(CVP_WARN, "Wait interrupted or timed out: %d\n",
 				SESSION_MSG_INDEX(cmd));
 		if (inst->state != MSM_CVP_CORE_INVALID)
-			print_hfi_queue_info(hdev);
+			print_hfi_queue_info(ops_tbl);
 		rc = -ETIMEDOUT;
 	} else if (inst->state == MSM_CVP_CORE_INVALID) {
 		rc = -ECONNRESET;
@@ -519,7 +519,7 @@ static void handle_session_ctrl(enum hal_command_response cmd, void *data)
 static void handle_session_error(enum hal_command_response cmd, void *data)
 {
 	struct msm_cvp_cb_cmd_done *response = data;
-	struct cvp_hfi_device *hdev = NULL;
+	struct cvp_hfi_ops *ops_tbl = NULL;
 	struct msm_cvp_inst *inst = NULL;
 	//unsigned long flags = 0;
 	//int i;
@@ -537,7 +537,7 @@ static void handle_session_error(enum hal_command_response cmd, void *data)
 		return;
 	}
 
-	hdev = inst->core->device;
+	ops_tbl = inst->core->dev_ops;
 	dprintk(CVP_ERR, "Sess error 0x%x received for inst %pK sess %x\n",
 		response->status, inst, hash32_ptr(inst->session));
 	cvp_print_inst(CVP_WARN, inst);
@@ -562,7 +562,7 @@ void handle_sys_error(enum hal_command_response cmd, void *data)
 {
 	struct msm_cvp_cb_cmd_done *response = data;
 	struct msm_cvp_core *core = NULL;
-	struct cvp_hfi_device *hdev = NULL;
+	struct cvp_hfi_ops *ops_tbl = NULL;
 	struct iris_hfi_device *hfi_device;
 	struct msm_cvp_inst *inst = NULL;
 	int i, rc = 0;
@@ -581,7 +581,7 @@ void handle_sys_error(enum hal_command_response cmd, void *data)
 				"Got SYS_ERR but unable to identify core\n");
 		return;
 	}
-	hdev = core->device;
+	ops_tbl = core->dev_ops;
 
 	mutex_lock(&core->lock);
 	core->ssr_count++;
@@ -598,12 +598,12 @@ void handle_sys_error(enum hal_command_response cmd, void *data)
 	dprintk(CVP_WARN, "SYS_ERROR from core %pK cmd %x total: %d\n",
 			core, cmd, core->ssr_count);
 	mutex_lock(&core->clk_lock);
-	hfi_device = hdev->hfi_device_data;
+	hfi_device = ops_tbl->hfi_device_data;
 	if (hfi_device->error == CVP_ERR_NOC_ERROR) {
 		dprintk(CVP_WARN, "Got NOC error");
 		msm_cvp_noc_error_info(core);
 	}
-	call_hfi_op(hdev, flush_debug_queue, hdev->hfi_device_data);
+	call_hfi_op(ops_tbl, flush_debug_queue, ops_tbl->hfi_device_data);
 	list_for_each_entry(inst, &core->instances, list) {
 		cvp_print_inst(CVP_WARN, inst);
 		if (inst->state != MSM_CVP_CORE_INVALID) {
@@ -628,7 +628,7 @@ void handle_sys_error(enum hal_command_response cmd, void *data)
 	msm_cvp_handle_hw_error(core);
 
 	dprintk(CVP_CORE, "Calling core_release\n");
-	rc = call_hfi_op(hdev, core_release, hdev->hfi_device_data);
+	rc = call_hfi_op(ops_tbl, core_release, ops_tbl->hfi_device_data);
 	if (rc) {
 		dprintk(CVP_ERR, "core_release failed\n");
 		core->state = cur_state;
@@ -646,9 +646,9 @@ void handle_sys_error(enum hal_command_response cmd, void *data)
 void msm_cvp_comm_session_clean(struct msm_cvp_inst *inst)
 {
 	int rc = 0;
-	struct cvp_hfi_device *hdev = NULL;
+	struct cvp_hfi_ops *ops_tbl = NULL;
 
-	if (!inst || !inst->core || !inst->core->device) {
+	if (!inst || !inst->core || !inst->core->dev_ops) {
 		dprintk(CVP_ERR, "%s invalid params\n", __func__);
 		return;
 	}
@@ -658,10 +658,10 @@ void msm_cvp_comm_session_clean(struct msm_cvp_inst *inst)
 		return;
 	}
 
-	hdev = inst->core->device;
+	ops_tbl = inst->core->dev_ops;
 	mutex_lock(&inst->lock);
 	dprintk(CVP_SESS, "%s: inst %pK\n", __func__, inst);
-	rc = call_hfi_op(hdev, session_clean,
+	rc = call_hfi_op(ops_tbl, session_clean,
 			(void *)inst->session);
 	if (rc) {
 		dprintk(CVP_ERR,
@@ -772,16 +772,16 @@ static inline enum msm_cvp_thermal_level msm_comm_cvp_thermal_level(int level)
 static int msm_comm_session_abort(struct msm_cvp_inst *inst)
 {
 	int rc = 0, abort_completion = 0;
-	struct cvp_hfi_device *hdev;
+	struct cvp_hfi_ops *ops_tbl;
 
 
-	if (!inst || !inst->core || !inst->core->device) {
+	if (!inst || !inst->core || !inst->core->dev_ops) {
 		dprintk(CVP_ERR, "%s invalid params\n", __func__);
 		return -EINVAL;
 	}
 
-	hdev = inst->core->device;
-	print_hfi_queue_info(hdev);
+	ops_tbl = inst->core->dev_ops;
+	print_hfi_queue_info(ops_tbl);
 	if (1)
 		return 0;
 
@@ -790,7 +790,7 @@ static int msm_comm_session_abort(struct msm_cvp_inst *inst)
 
 	dprintk(CVP_WARN, "%s: inst %pK session %x\n", __func__,
 		inst, hash32_ptr(inst->session));
-	rc = call_hfi_op(hdev, session_abort, (void *)inst->session);
+	rc = call_hfi_op(ops_tbl, session_abort, (void *)inst->session);
 	if (rc) {
 		dprintk(CVP_ERR,
 			"%s session_abort failed rc: %d\n", __func__, rc);
@@ -803,7 +803,7 @@ static int msm_comm_session_abort(struct msm_cvp_inst *inst)
 	if (!rc) {
 		dprintk(CVP_ERR, "%s: inst %pK session %x abort timed out\n",
 				__func__, inst, hash32_ptr(inst->session));
-		print_hfi_queue_info(hdev);
+		print_hfi_queue_info(ops_tbl);
 		msm_cvp_comm_generate_sys_error(inst);
 		rc = -EBUSY;
 	} else {
@@ -821,7 +821,7 @@ void msm_cvp_comm_handle_thermal_event(void)
 int msm_cvp_comm_check_core_init(struct msm_cvp_core *core)
 {
 	int rc = 0;
-	struct cvp_hfi_device *hdev;
+	struct cvp_hfi_ops *ops_tbl;
 
 	mutex_lock(&core->lock);
 	if (core->state >= CVP_CORE_INIT_DONE) {
@@ -836,8 +836,8 @@ int msm_cvp_comm_check_core_init(struct msm_cvp_core *core)
 	if (!rc) {
 		dprintk(CVP_ERR, "%s: Wait interrupted or timed out: %d\n",
 				__func__, SYS_MSG_INDEX(HAL_SYS_INIT_DONE));
-		hdev = core->device;
-		print_hfi_queue_info(hdev);
+		ops_tbl = core->dev_ops;
+		print_hfi_queue_info(ops_tbl);
 		rc = -EIO;
 		goto exit;
 	} else {
@@ -867,14 +867,14 @@ static int msm_comm_init_core_done(struct msm_cvp_inst *inst)
 static int msm_comm_init_core(struct msm_cvp_inst *inst)
 {
 	int rc = 0;
-	struct cvp_hfi_device *hdev;
+	struct cvp_hfi_ops *ops_tbl;
 	struct msm_cvp_core *core;
 
-	if (!inst || !inst->core || !inst->core->device)
+	if (!inst || !inst->core || !inst->core->dev_ops)
 		return -EINVAL;
 
 	core = inst->core;
-	hdev = core->device;
+	ops_tbl = core->dev_ops;
 	mutex_lock(&core->lock);
 	if (core->state >= CVP_CORE_INIT) {
 		dprintk(CVP_CORE, "CVP core: is already in state: %d\n",
@@ -897,7 +897,7 @@ static int msm_comm_init_core(struct msm_cvp_inst *inst)
 			__func__);
 	}
 	dprintk(CVP_CORE, "%s: core %pK\n", __func__, core);
-	rc = call_hfi_op(hdev, core_init, hdev->hfi_device_data);
+	rc = call_hfi_op(ops_tbl, core_init, ops_tbl->hfi_device_data);
 	if (rc) {
 		dprintk(CVP_ERR, "Failed to init core\n");
 		goto fail_core_init;
@@ -923,15 +923,15 @@ fail_cap_alloc:
 int msm_cvp_deinit_core(struct msm_cvp_inst *inst)
 {
 	struct msm_cvp_core *core;
-	struct cvp_hfi_device *hdev;
+	struct cvp_hfi_ops *ops_tbl;
 
-	if (!inst || !inst->core || !inst->core->device) {
+	if (!inst || !inst->core || !inst->core->dev_ops) {
 		dprintk(CVP_ERR, "%s invalid parameters\n", __func__);
 		return -EINVAL;
 	}
 
 	core = inst->core;
-	hdev = core->device;
+	ops_tbl = core->dev_ops;
 
 	mutex_lock(&core->lock);
 	change_cvp_inst_state(inst, MSM_CVP_CORE_UNINIT);
@@ -959,13 +959,13 @@ static int msm_comm_session_init(int flipped_state,
 	struct msm_cvp_inst *inst)
 {
 	int rc = 0;
-	struct cvp_hfi_device *hdev;
+	struct cvp_hfi_ops *ops_tbl;
 
-	if (!inst || !inst->core || !inst->core->device) {
+	if (!inst || !inst->core || !inst->core->dev_ops) {
 		dprintk(CVP_ERR, "%s invalid parameters\n", __func__);
 		return -EINVAL;
 	}
-	hdev = inst->core->device;
+	ops_tbl = inst->core->dev_ops;
 
 	if (IS_ALREADY_IN_STATE(flipped_state, MSM_CVP_OPEN)) {
 		dprintk(CVP_INFO, "inst: %pK is already in state: %d\n",
@@ -974,13 +974,13 @@ static int msm_comm_session_init(int flipped_state,
 	}
 
 	dprintk(CVP_SESS, "%s: inst %pK\n", __func__, inst);
-	rc = call_hfi_op(hdev, session_init, hdev->hfi_device_data,
+	rc = call_hfi_op(ops_tbl, session_init, ops_tbl->hfi_device_data,
 			inst, &inst->session);
 
 	if (rc || !inst->session) {
 		dprintk(CVP_ERR,
 			"Failed to call session init for: %pK, %pK, %d\n",
-			inst->core->device, inst, inst->session_type);
+			inst->core->dev_ops, inst, inst->session_type);
 		rc = -EINVAL;
 		goto exit;
 	}
@@ -994,9 +994,9 @@ static int msm_comm_session_close(int flipped_state,
 			struct msm_cvp_inst *inst)
 {
 	int rc = 0;
-	struct cvp_hfi_device *hdev;
+	struct cvp_hfi_ops *ops_tbl;
 
-	if (!inst || !inst->core || !inst->core->device) {
+	if (!inst || !inst->core || !inst->core->dev_ops) {
 		dprintk(CVP_ERR, "%s invalid params\n", __func__);
 		return -EINVAL;
 	}
@@ -1006,9 +1006,9 @@ static int msm_comm_session_close(int flipped_state,
 						inst, inst->state);
 		goto exit;
 	}
-	hdev = inst->core->device;
+	ops_tbl = inst->core->dev_ops;
 	dprintk(CVP_SESS, "%s: inst %pK\n", __func__, inst);
-	rc = call_hfi_op(hdev, session_end, (void *) inst->session);
+	rc = call_hfi_op(ops_tbl, session_end, (void *) inst->session);
 	if (rc) {
 		dprintk(CVP_ERR,
 			"Failed to send close\n");
@@ -1021,7 +1021,7 @@ exit:
 
 int msm_cvp_comm_suspend(void)
 {
-	struct cvp_hfi_device *hdev;
+	struct cvp_hfi_ops *ops_tbl;
 	struct msm_cvp_core *core;
 	int rc = 0;
 
@@ -1032,13 +1032,13 @@ int msm_cvp_comm_suspend(void)
 		return -EINVAL;
 	}
 
-	hdev = (struct cvp_hfi_device *)core->device;
-	if (!hdev) {
+	ops_tbl = (struct cvp_hfi_ops *)core->dev_ops;
+	if (!ops_tbl) {
 		dprintk(CVP_ERR, "%s Invalid device handle\n", __func__);
 		return -EINVAL;
 	}
 
-	rc = call_hfi_op(hdev, suspend, hdev->hfi_device_data);
+	rc = call_hfi_op(ops_tbl, suspend, ops_tbl->hfi_device_data);
 
 	return rc;
 }
@@ -1163,10 +1163,10 @@ int msm_cvp_comm_try_state(struct msm_cvp_inst *inst, int state)
 
 int msm_cvp_noc_error_info(struct msm_cvp_core *core)
 {
-	struct cvp_hfi_device *hdev;
+	struct cvp_hfi_ops *ops_tbl;
 	static u32 last_fault_count = 0;
 
-	if (!core || !core->device) {
+	if (!core || !core->dev_ops) {
 		dprintk(CVP_WARN, "%s: Invalid parameters: %pK\n",
 			__func__, core);
 		return -EINVAL;
@@ -1180,8 +1180,8 @@ int msm_cvp_noc_error_info(struct msm_cvp_core *core)
 	dprintk(CVP_ERR, "cvp ssr count %d %d %d\n", core->ssr_count,
 			core->resources.max_ssr_allowed,
 			core->smmu_fault_count);
-	hdev = core->device;
-	call_hfi_op(hdev, noc_error_info, hdev->hfi_device_data);
+	ops_tbl = core->dev_ops;
+	call_hfi_op(ops_tbl, noc_error_info, ops_tbl->hfi_device_data);
 
 	if (core->smmu_fault_count >= core->resources.max_ssr_allowed)
 		BUG_ON(!core->resources.non_fatal_pagefaults);
@@ -1205,17 +1205,17 @@ void msm_cvp_ssr_handler(struct work_struct *work)
 {
 	int rc;
 	struct msm_cvp_core *core;
-	struct cvp_hfi_device *hdev;
+	struct cvp_hfi_ops *ops_tbl;
 
 	if (!work)
 		return;
 
 	core = container_of(work, struct msm_cvp_core, ssr_work);
-	if (!core || !core->device) {
+	if (!core || !core->dev_ops) {
 		dprintk(CVP_ERR, "%s: Invalid params\n", __func__);
 		return;
 	}
-	hdev = core->device;
+	ops_tbl = core->dev_ops;
 
 	if (core->ssr_type == SSR_SESSION_ABORT) {
 		struct msm_cvp_inst *inst = NULL, *s;
@@ -1232,7 +1232,7 @@ void msm_cvp_ssr_handler(struct work_struct *work)
 			s = cvp_get_inst_validate(inst->core, inst);
 			if (!s)
 				return;
-			print_hfi_queue_info(hdev);
+			print_hfi_queue_info(ops_tbl);
 			cvp_put_inst(s);
 		} else {
 			dprintk(CVP_WARN, "No active CVP session to abort\n");
@@ -1253,8 +1253,8 @@ send_again:
 		 * user SSR as non-fatal.
 		 */
 		core->trigger_ssr = true;
-		rc = call_hfi_op(hdev, core_trigger_ssr,
-				hdev->hfi_device_data, core->ssr_type);
+		rc = call_hfi_op(ops_tbl, core_trigger_ssr,
+				ops_tbl->hfi_device_data, core->ssr_type);
 		if (rc) {
 			if (rc == -EAGAIN) {
 				core->trigger_ssr = false;
@@ -1295,7 +1295,7 @@ int msm_cvp_comm_kill_session(struct msm_cvp_inst *inst)
 	int rc = 0;
 	unsigned long flags = 0;
 
-	if (!inst || !inst->core || !inst->core->device) {
+	if (!inst || !inst->core || !inst->core->dev_ops) {
 		dprintk(CVP_ERR, "%s: invalid input parameters\n", __func__);
 		return -EINVAL;
 	} else if (!inst->session) {
@@ -1329,24 +1329,24 @@ int msm_cvp_comm_kill_session(struct msm_cvp_inst *inst)
 static int set_internal_buf_on_fw(struct msm_cvp_inst *inst,
 				struct msm_cvp_smem *handle)
 {
-	struct cvp_hfi_device *hdev;
+	struct cvp_hfi_ops *ops_tbl;
 	int rc = 0;
 	u32 iova;
 	u32 size;
 
-	if (!inst || !inst->core || !inst->core->device || !handle) {
+	if (!inst || !inst->core || !inst->core->dev_ops || !handle) {
 		dprintk(CVP_ERR, "%s - invalid params\n", __func__);
 		return -EINVAL;
 	}
 
-	hdev = inst->core->device;
+	ops_tbl = inst->core->dev_ops;
 
 	iova = handle->device_addr;
 	size = handle->size;
 
 	dprintk(CVP_SESS, "%s: allocated ARP buffer : %x\n", __func__, iova);
 
-	rc = call_hfi_op(hdev, session_set_buffers,
+	rc = call_hfi_op(ops_tbl, session_set_buffers,
 			(void *) inst->session, iova, size);
 	if (rc) {
 		dprintk(CVP_ERR, "cvp_session_set_buffers failed\n");
@@ -1361,7 +1361,7 @@ int cvp_comm_set_arp_buffers(struct msm_cvp_inst *inst)
 	int rc = 0;
 	struct cvp_internal_buf *buf;
 
-	if (!inst || !inst->core || !inst->core->device) {
+	if (!inst || !inst->core || !inst->core->dev_ops) {
 		dprintk(CVP_ERR, "%s invalid parameters\n", __func__);
 		return -EINVAL;
 	}

+ 5 - 5
msm/eva/msm_cvp_core.c

@@ -292,7 +292,7 @@ static int msm_cvp_cleanup_instance(struct msm_cvp_inst *inst)
 	int rc, max_retries;
 	struct msm_cvp_frame *frame;
 	struct cvp_session_queue *sq, *sqf;
-	struct cvp_hfi_device *hdev;
+	struct cvp_hfi_ops *ops_tbl;
 	struct msm_cvp_inst *tmp;
 
 	if (!inst) {
@@ -361,8 +361,8 @@ stop_session:
 	}
 	if (!empty) {
 		/* STOP SESSION to avoid SMMU fault after releasing ARP */
-		hdev = inst->core->device;
-		rc = call_hfi_op(hdev, session_stop, (void *)inst->session);
+		ops_tbl = inst->core->dev_ops;
+		rc = call_hfi_op(ops_tbl, session_stop, (void *)inst->session);
 		if (rc) {
 			dprintk(CVP_WARN, "%s: cannot stop session rc %d\n",
 				__func__, rc);
@@ -392,8 +392,8 @@ release_arp:
 				__func__,
 				inst->core->resources.pm_qos.off_vote_cnt);
 		spin_unlock(&inst->core->resources.pm_qos.lock);
-		hdev = inst->core->device;
-		call_hfi_op(hdev, pm_qos_update, hdev->hfi_device_data);
+		ops_tbl = inst->core->dev_ops;
+		call_hfi_op(ops_tbl, pm_qos_update, ops_tbl->hfi_device_data);
 	}
 	return 0;
 }

+ 19 - 19
msm/eva/msm_cvp_debug.c

@@ -69,13 +69,13 @@ static ssize_t core_info_read(struct file *file, char __user *buf,
 		size_t count, loff_t *ppos)
 {
 	struct msm_cvp_core *core = file->private_data;
-	struct cvp_hfi_device *hdev;
+	struct cvp_hfi_ops *ops_tbl;
 	struct cvp_hal_fw_info fw_info = { {0} };
 	char *dbuf, *cur, *end;
 	int i = 0, rc = 0;
 	ssize_t len = 0;
 
-	if (!core || !core->device) {
+	if (!core || !core->dev_ops) {
 		dprintk(CVP_ERR, "Invalid params, core: %pK\n", core);
 		return 0;
 	}
@@ -87,13 +87,13 @@ static ssize_t core_info_read(struct file *file, char __user *buf,
 	}
 	cur = dbuf;
 	end = cur + MAX_DBG_BUF_SIZE;
-	hdev = core->device;
+	ops_tbl = core->dev_ops;
 
 	cur += write_str(cur, end - cur, "===============================\n");
 	cur += write_str(cur, end - cur, "CORE %d: %pK\n", 0, core);
 	cur += write_str(cur, end - cur, "===============================\n");
 	cur += write_str(cur, end - cur, "Core state: %d\n", core->state);
-	rc = call_hfi_op(hdev, get_fw_info, hdev->hfi_device_data, &fw_info);
+	rc = call_hfi_op(ops_tbl, get_fw_info, ops_tbl->hfi_device_data, &fw_info);
 	if (rc) {
 		dprintk(CVP_WARN, "Failed to read FW info\n");
 		goto err_fw_info;
@@ -177,18 +177,18 @@ static const struct file_operations ssr_fops = {
 
 static int cvp_power_get(void *data, u64 *val)
 {
-	struct cvp_hfi_device *hfi_ops;
+	struct cvp_hfi_ops *ops_tbl;
 	struct msm_cvp_core *core;
 	struct iris_hfi_device *hfi_device;
 
 	core = cvp_driver->cvp_core;
 	if (!core)
 		return 0;
-	hfi_ops = core->device;
-	if (!hfi_ops)
+	ops_tbl = core->dev_ops;
+	if (!ops_tbl)
 		return 0;
 
-	hfi_device = hfi_ops->hfi_device_data;
+	hfi_device = ops_tbl->hfi_device_data;
 	if (!hfi_device)
 		return 0;
 
@@ -201,7 +201,7 @@ static int cvp_power_get(void *data, u64 *val)
 
 static int cvp_power_set(void *data, u64 val)
 {
-	struct cvp_hfi_device *hfi_ops;
+	struct cvp_hfi_ops *ops_tbl;
 	struct msm_cvp_core *core;
 	struct iris_hfi_device *hfi_device;
 	int rc = 0;
@@ -210,11 +210,11 @@ static int cvp_power_set(void *data, u64 val)
 	if (!core)
 		return -EINVAL;
 
-	hfi_ops = core->device;
-	if (!hfi_ops)
+	ops_tbl = core->dev_ops;
+	if (!ops_tbl)
 		return -EINVAL;
 
-	hfi_device = hfi_ops->hfi_device_data;
+	hfi_device = ops_tbl->hfi_device_data;
 	if (!hfi_device)
 		return -EINVAL;
 
@@ -230,7 +230,7 @@ static int cvp_power_set(void *data, u64 val)
 		return -EINVAL;
 
 	if (val > 0) {
-		rc = call_hfi_op(hfi_ops, resume, hfi_ops->hfi_device_data);
+		rc = call_hfi_op(ops_tbl, resume, ops_tbl->hfi_device_data);
 		if (rc)
 			dprintk(CVP_ERR, "debugfs fail to power on cvp\n");
 	}
@@ -284,20 +284,20 @@ failed_create_dir:
 static int _clk_rate_set(void *data, u64 val)
 {
 	struct msm_cvp_core *core;
-	struct cvp_hfi_device *dev;
+	struct cvp_hfi_ops *ops_tbl;
 	struct allowed_clock_rates_table *tbl = NULL;
 	unsigned int tbl_size, i;
 
 	core = cvp_driver->cvp_core;
-	dev = core->device;
+	ops_tbl = core->dev_ops;
 	tbl = core->resources.allowed_clks_tbl;
 	tbl_size = core->resources.allowed_clks_tbl_size;
 
 	if (val == 0) {
-		struct iris_hfi_device *hdev = dev->hfi_device_data;
+		struct iris_hfi_device *hdev = ops_tbl->hfi_device_data;
 
 		msm_cvp_clock_voting = 0;
-		call_hfi_op(dev, scale_clocks, hdev, hdev->clk_freq);
+		call_hfi_op(ops_tbl, scale_clocks, hdev, hdev->clk_freq);
 		return 0;
 	}
 
@@ -313,7 +313,7 @@ static int _clk_rate_set(void *data, u64 val)
 	dprintk(CVP_WARN, "Override cvp_clk_rate with %d\n",
 			msm_cvp_clock_voting);
 
-	call_hfi_op(dev, scale_clocks, dev->hfi_device_data,
+	call_hfi_op(ops_tbl, scale_clocks, ops_tbl->hfi_device_data,
 		msm_cvp_clock_voting);
 
 	return 0;
@@ -325,7 +325,7 @@ static int _clk_rate_get(void *data, u64 *val)
 	struct iris_hfi_device *hdev;
 
 	core = cvp_driver->cvp_core;
-	hdev = core->device->hfi_device_data;
+	hdev = core->dev_ops->hfi_device_data;
 	if (msm_cvp_clock_voting)
 		*val = msm_cvp_clock_voting;
 	else

+ 17 - 17
msm/eva/msm_cvp_dsp.c

@@ -222,7 +222,7 @@ static int delete_dsp_session(struct msm_cvp_inst *inst,
 	struct list_head *ptr_dsp_buf = NULL, *next_dsp_buf = NULL;
 	struct cvp_internal_buf *buf = NULL;
 	struct task_struct *task = NULL;
-	struct cvp_hfi_device *hdev;
+	struct cvp_hfi_ops *ops_tbl;
 	int rc;
 
 	if (!inst)
@@ -280,8 +280,8 @@ static int delete_dsp_session(struct msm_cvp_inst *inst,
 			inst->core->resources.pm_qos.off_vote_cnt);
 	spin_unlock(&inst->core->resources.pm_qos.lock);
 
-	hdev = inst->core->device;
-	call_hfi_op(hdev, pm_qos_update, hdev->hfi_device_data);
+	ops_tbl = inst->core->dev_ops;
+	call_hfi_op(ops_tbl, pm_qos_update, ops_tbl->hfi_device_data);
 
 	rc = msm_cvp_close(inst);
 	if (rc)
@@ -833,8 +833,8 @@ static int __reinit_dsp(void)
 	struct iris_hfi_device *device;
 
 	core = cvp_driver->cvp_core;
-	if (core && core->device)
-		device = core->device->hfi_device_data;
+	if (core && core->dev_ops)
+		device = core->dev_ops->hfi_device_data;
 	else
 		return -EINVAL;
 
@@ -1306,8 +1306,8 @@ void cvp_dsp_send_hfi_queue(void)
 	int rc;
 
 	core = cvp_driver->cvp_core;
-	if (core && core->device)
-		device = core->device->hfi_device_data;
+	if (core && core->dev_ops)
+		device = core->dev_ops->hfi_device_data;
 	else
 		return;
 
@@ -1458,7 +1458,7 @@ void __dsp_cvp_sess_create(struct cvp_dsp_cmd_msg *cmd)
 	struct cvp_dsp_fastrpc_driver_entry *frpc_node = NULL;
 	struct pid *pid_s = NULL;
 	struct task_struct *task = NULL;
-	struct cvp_hfi_device *hdev;
+	struct cvp_hfi_ops *ops_tbl;
 	struct fastrpc_device *frpc_device;
 
 	cmd->ret = 0;
@@ -1555,8 +1555,8 @@ void __dsp_cvp_sess_create(struct cvp_dsp_cmd_msg *cmd)
 	spin_lock(&inst->core->resources.pm_qos.lock);
 	inst->core->resources.pm_qos.off_vote_cnt++;
 	spin_unlock(&inst->core->resources.pm_qos.lock);
-	hdev = inst->core->device;
-	call_hfi_op(hdev, pm_qos_update, hdev->hfi_device_data);
+	ops_tbl = inst->core->dev_ops;
+	call_hfi_op(ops_tbl, pm_qos_update, ops_tbl->hfi_device_data);
 
 	return;
 
@@ -1580,7 +1580,7 @@ void __dsp_cvp_sess_delete(struct cvp_dsp_cmd_msg *cmd)
 	struct cvp_dsp2cpu_cmd *dsp2cpu_cmd = &me->pending_dsp2cpu_cmd;
 	struct cvp_dsp_fastrpc_driver_entry *frpc_node = NULL;
 	struct task_struct *task = NULL;
-	struct cvp_hfi_device *hdev;
+	struct cvp_hfi_ops *ops_tbl;
 
 	cmd->ret = 0;
 
@@ -1620,8 +1620,8 @@ void __dsp_cvp_sess_delete(struct cvp_dsp_cmd_msg *cmd)
 			inst->core->resources.pm_qos.off_vote_cnt);
 	spin_unlock(&inst->core->resources.pm_qos.lock);
 
-	hdev = inst->core->device;
-	call_hfi_op(hdev, pm_qos_update, hdev->hfi_device_data);
+	ops_tbl = inst->core->dev_ops;
+	call_hfi_op(ops_tbl, pm_qos_update, ops_tbl->hfi_device_data);
 
 	rc = msm_cvp_close(inst);
 	if (rc) {
@@ -2075,7 +2075,7 @@ static int cvp_dsp_thread(void *data)
 	int rc = 0, old_state;
 	struct cvp_dsp_apps *me = &gfa_cv;
 	struct cvp_dsp_cmd_msg cmd;
-	struct cvp_hfi_device *hdev;
+	struct cvp_hfi_ops *ops_tbl;
 	struct msm_cvp_core *core;
 
 	core = cvp_driver->cvp_core;
@@ -2085,8 +2085,8 @@ static int cvp_dsp_thread(void *data)
 		goto exit;
 	}
 
-	hdev = (struct cvp_hfi_device *)core->device;
-	if (!hdev) {
+	ops_tbl = (struct cvp_hfi_ops *)core->dev_ops;
+	if (!ops_tbl) {
 		dprintk(CVP_ERR, "%s Invalid device handle\n", __func__);
 		rc = -EINVAL;
 		goto exit;
@@ -2129,7 +2129,7 @@ wait_dsp:
 			mutex_lock(&me->tx_lock);
 			old_state = me->state;
 			me->state = DSP_READY;
-			rc = call_hfi_op(hdev, resume, hdev->hfi_device_data);
+			rc = call_hfi_op(ops_tbl, resume, ops_tbl->hfi_device_data);
 			if (rc) {
 				dprintk(CVP_WARN, "%s Failed to resume cvp\n",
 						__func__);

+ 1 - 1
msm/eva/msm_cvp_internal.h

@@ -320,7 +320,7 @@ struct msm_cvp_core {
 	struct cdev cdev;
 	struct class *class;
 	struct device *dev;
-	struct cvp_hfi_device *device;
+	struct cvp_hfi_ops *dev_ops;
 	struct msm_cvp_platform_data *platform_data;
 	struct msm_cvp_synx_ops *synx_ftbl;
 	struct list_head instances;

+ 2 - 2
msm/eva/msm_cvp_res_parse.c

@@ -1061,10 +1061,10 @@ int msm_cvp_smmu_fault_handler(struct iommu_domain *domain,
 		cvp_print_inst(CVP_ERR, inst);
 		msm_cvp_print_inst_bufs(inst, log);
 	}
-	hdev = core->device->hfi_device_data;
+	hdev = core->dev_ops->hfi_device_data;
 	if (hdev) {
 		hdev->error = CVP_ERR_NOC_ERROR;
-		call_hfi_op(core->device, debug_hook, hdev);
+		call_hfi_op(core->dev_ops, debug_hook, hdev);
 	}
 	mutex_unlock(&core->lock);
 	/*