Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit befa379e authored by Jeyaprakash Soundrapandian's avatar Jeyaprakash Soundrapandian Committed by Gerrit - the friendly Code Review server
Browse files

Merge "msm: camera: icp: Cleanup firmware download routine" into dev/msm-4.9-camx

parents 85d6d6ae d8905f49
Loading
Loading
Loading
Loading
+12 −19
Original line number Diff line number Diff line
@@ -138,18 +138,15 @@ static void cam_context_sync_callback(int32_t sync_obj, int status, void *data)
int32_t cam_context_release_dev_to_hw(struct cam_context *ctx,
	struct cam_release_dev_cmd *cmd)
{
	int rc = 0;
	int i;
	struct cam_hw_release_args arg;
	struct cam_ctx_request *req;

	if (!ctx->hw_mgr_intf) {
	if ((!ctx->hw_mgr_intf) || (!ctx->hw_mgr_intf->hw_release)) {
		pr_err("HW interface is not ready\n");
		rc = -EINVAL;
		goto end;
		return -EINVAL;
	}

	if (ctx->ctxt_to_hw_map) {
	arg.ctxt_to_hw_map = ctx->ctxt_to_hw_map;
	if ((list_empty(&ctx->active_req_list)) &&
		(list_empty(&ctx->pending_req_list)))
@@ -157,10 +154,8 @@ int32_t cam_context_release_dev_to_hw(struct cam_context *ctx,
	else
		arg.active_req = true;

		ctx->hw_mgr_intf->hw_release(ctx->hw_mgr_intf->hw_mgr_priv,
			&arg);
	ctx->hw_mgr_intf->hw_release(ctx->hw_mgr_intf->hw_mgr_priv, &arg);
	ctx->ctxt_to_hw_map = NULL;
	}

	ctx->session_hdl = 0;
	ctx->dev_hdl = 0;
@@ -180,7 +175,6 @@ int32_t cam_context_release_dev_to_hw(struct cam_context *ctx,
		list_add_tail(&req->list, &ctx->free_req_list);
	}

	/* flush the pending queue */
	while (!list_empty(&ctx->pending_req_list)) {
		req = list_first_entry(&ctx->pending_req_list,
			struct cam_ctx_request, list);
@@ -199,8 +193,7 @@ int32_t cam_context_release_dev_to_hw(struct cam_context *ctx,
		list_add_tail(&req->list, &ctx->free_req_list);
	}

end:
	return rc;
	return 0;
}

int32_t cam_context_prepare_dev_to_hw(struct cam_context *ctx,
+7 −0
Original line number Diff line number Diff line
@@ -98,6 +98,13 @@ void hfi_send_system_cmd(uint32_t type, uint64_t data, uint32_t size);
 * @icp_base: icp base address
 */
void cam_hfi_enable_cpu(void __iomem *icp_base);

/**
 * cam_hfi_disable_cpu() - disable A5 CPU
 * @icp_base: icp base address
 */
void cam_hfi_disable_cpu(void __iomem *icp_base);

/**
 * cam_hfi_deinit() - cleanup HFI
 */
+1 −0
Original line number Diff line number Diff line
@@ -49,6 +49,7 @@
#define ICP_CSR_EN_CLKGATE_WFI                  (1 << 12)
#define ICP_CSR_EDBGRQ                          (1 << 14)
#define ICP_CSR_DBGSWENABLE                     (1 << 22)
#define ICP_CSR_A5_STATUS_WFI                   (1 << 7)

/* start of Queue table and queues */
#define MAX_ICP_HFI_QUEUES                      4
+13 −0
Original line number Diff line number Diff line
@@ -302,6 +302,19 @@ int hfi_get_hw_caps(void *query_buf)
	return 0;
}

void cam_hfi_disable_cpu(void __iomem *icp_base)
{
	uint32_t data;
	uint32_t val;

	data = cam_io_r(icp_base + HFI_REG_A5_CSR_A5_STATUS);
	/* Add waiting logic in case it is not idle */
	if (data & ICP_CSR_A5_STATUS_WFI) {
		val = cam_io_r(icp_base + HFI_REG_A5_CSR_A5_CONTROL);
		val &= ~(ICP_FLAG_CSR_A5_EN | ICP_FLAG_CSR_WAKE_UP_EN);
		cam_io_w(val, icp_base + HFI_REG_A5_CSR_A5_CONTROL);
	}
}

void cam_hfi_enable_cpu(void __iomem *icp_base)
{
+286 −302

File changed.

Preview size limit exceeded, changes collapsed.