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

Commit 7a6a2fab authored by Linux Build Service Account's avatar Linux Build Service Account
Browse files

Merge 168408b4 on remote branch

Change-Id: If87405acbc0633a49b33ede10e9ba33a350526f7
parents 2cb99861 168408b4
Loading
Loading
Loading
Loading
+7 −8
Original line number Diff line number Diff line
@@ -586,13 +586,9 @@ int cam_hw_cdm_wait_for_bl_fifo(
				pending_bl);
			break;
		}
		if (bl_count < (available_bl_slots - 1)) {
			CAM_DBG(CAM_CDM,
				"BL slot available_cnt=%d requested=%d",
				(available_bl_slots - 1), bl_count);
				rc = available_bl_slots - 1;
				break;
		} else if (0 == (available_bl_slots - 1)) {
		if (0 == (available_bl_slots - 1)) {
			reinit_completion(&core->bl_fifo[fifo_idx].bl_complete);

			rc = cam_hw_cdm_enable_bl_done_irq(cdm_hw,
				true, fifo_idx);
			if (rc) {
@@ -619,7 +615,10 @@ int cam_hw_cdm_wait_for_bl_fifo(
			rc = 1;
			CAM_DBG(CAM_CDM, "CDM HW is ready for data");
		} else {
			rc = (bl_count - (available_bl_slots - 1));
			CAM_DBG(CAM_CDM,
				"BL slot available_cnt=%d requested=%d",
				(available_bl_slots - 1), bl_count);
			rc = available_bl_slots - 1;
			break;
		}
	} while (1);
+25 −0
Original line number Diff line number Diff line
@@ -311,6 +311,31 @@ int cam_context_dump_pf_info(struct cam_context *ctx,
	return rc;
}

int cam_context_handle_message(struct cam_context *ctx,
	uint32_t msg_type, uint32_t *data)
{
	int rc = 0;

	if (!ctx->state_machine) {
		CAM_ERR(CAM_CORE, "Context is not ready");
		return -EINVAL;
	}

	if ((ctx->state > CAM_CTX_AVAILABLE) &&
		(ctx->state < CAM_CTX_STATE_MAX)) {
		if (ctx->state_machine[ctx->state].msg_cb_ops) {
			rc = ctx->state_machine[ctx->state].msg_cb_ops(
				ctx, msg_type, data);
		} else {
			CAM_WARN(CAM_CORE,
				"No message handler for ctx %d, state %d msg_type :%d",
				ctx->dev_hdl, ctx->state, msg_type);
		}
	}

	return rc;
}

int cam_context_handle_acquire_dev(struct cam_context *ctx,
	struct cam_acquire_dev_cmd *cmd)
{
+21 −5
Original line number Diff line number Diff line
@@ -158,6 +158,8 @@ struct cam_ctx_crm_ops {
 * @pagefault_ops:         Function to be called on page fault
 * @dumpinfo_ops:          Function to be invoked for dumping any
 *                         context info
 * @msg_cb_ops:            Function to be called on any message from
 *                         other subdev notifications
 *
 */
struct cam_ctx_ops {
@@ -166,6 +168,7 @@ struct cam_ctx_ops {
	cam_hw_event_cb_func          irq_ops;
	cam_hw_pagefault_cb_func      pagefault_ops;
	cam_ctx_info_dump_cb_func     dumpinfo_ops;
	cam_ctx_message_cb_func       msg_cb_ops;
};

/**
@@ -367,6 +370,19 @@ int cam_context_handle_crm_dump_req(struct cam_context *ctx,
int cam_context_dump_pf_info(struct cam_context *ctx,
	struct cam_smmu_pf_info *pf_info);

/**
 * cam_context_handle_message()
 *
 * @brief:        Handle message callback command
 *
 * @ctx:          Object pointer for cam_context
 * @msg_type:     message type sent from other subdev
 * @data:         data from other subdev
 *
 */
int cam_context_handle_message(struct cam_context *ctx,
	uint32_t msg_type, uint32_t *data);

/**
 * cam_context_handle_acquire_dev()
 *
+3 −0
Original line number Diff line number Diff line
@@ -53,6 +53,9 @@ typedef int (*cam_hw_pagefault_cb_func)(void *context,
typedef int (*cam_ctx_info_dump_cb_func)(void *context,
	enum cam_context_dump_id dump_id);

/* message callback function type */
typedef int (*cam_ctx_message_cb_func)(void *context,
	uint32_t message_type, uint32_t *data);
/**
 * struct cam_hw_update_entry - Entry for hardware config
 *
+26 −0
Original line number Diff line number Diff line
@@ -1544,6 +1544,7 @@ static int cam_cpas_hw_stop(void *hw_priv, void *stop_args,
	struct cam_cpas_private_soc *soc_private = NULL;
	int rc = 0;
	long result;
	int retry_camnoc_idle = 0;

	if (!hw_priv || !stop_args) {
		CAM_ERR(CAM_CPAS, "Invalid arguments %pK %pK",
@@ -1597,6 +1598,18 @@ static int cam_cpas_hw_stop(void *hw_priv, void *stop_args,
			}
		}

		if (cpas_core->internal_ops.qchannel_handshake) {
			rc = cpas_core->internal_ops.qchannel_handshake(
				cpas_hw, false);
			if (rc) {
				CAM_ERR(CAM_CPAS,
					"failed in qchannel_handshake rc=%d",
					rc);
				retry_camnoc_idle = 1;
				/* Do not return error, passthrough */
			}
		}

		rc = cam_cpas_soc_disable_irq(&cpas_hw->soc_info);
		if (rc) {
			CAM_ERR(CAM_CPAS, "disable_irq failed, rc=%d", rc);
@@ -1612,6 +1625,19 @@ static int cam_cpas_hw_stop(void *hw_priv, void *stop_args,
				atomic_read(&cpas_core->irq_count));
		}

		/* try again incase camnoc is still not idle */
		if (cpas_core->internal_ops.qchannel_handshake &&
			retry_camnoc_idle) {
			rc = cpas_core->internal_ops.qchannel_handshake(
				cpas_hw, false);
			if (rc) {
				CAM_ERR(CAM_CPAS,
					"failed in qchannel_handshake rc=%d",
					rc);
				/* Do not return error, passthrough */
			}
		}

		rc = cam_cpas_soc_disable_resources(&cpas_hw->soc_info,
			true, false);
		if (rc) {
Loading