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

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

Merge 7e5fc94d on remote branch

Change-Id: Ib044d330908dffeb5472bdc7bed17b88727f2bd9
parents 77b65ed8 7e5fc94d
Loading
Loading
Loading
Loading
+11 −10
Original line number Diff line number Diff line
@@ -1304,7 +1304,7 @@ static int cam_cpas_hw_start(void *hw_priv, void *start_args,
	struct cam_ahb_vote remove_ahb;
	struct cam_axi_vote axi_vote = {0};
	enum cam_vote_level applied_level = CAM_SVS_VOTE;
	int rc, i = 0;
	int rc, ret = 0, i = 0;
	struct cam_cpas_private_soc *soc_private = NULL;
	bool invalid_start = true;

@@ -1458,25 +1458,26 @@ static int cam_cpas_hw_start(void *hw_priv, void *start_args,

remove_axi_vote:
	memset(&axi_vote, 0x0, sizeof(struct cam_axi_vote));
	rc = cam_cpas_util_create_vote_all_paths(cpas_client, &axi_vote);
	if (rc)
		CAM_ERR(CAM_CPAS, "Unable to create per path votes rc: %d", rc);
	ret = cam_cpas_util_create_vote_all_paths(cpas_client, &axi_vote);
	if (ret)
		CAM_ERR(CAM_CPAS, "Unable to create per path votes ret: %d",
			ret);

	cam_cpas_dump_axi_vote_info(cpas_client, "CPAS Start fail Vote",
		&axi_vote);

	rc = cam_cpas_util_apply_client_axi_vote(cpas_hw,
	ret = cam_cpas_util_apply_client_axi_vote(cpas_hw,
		cpas_client, &axi_vote);
	if (rc)
		CAM_ERR(CAM_CPAS, "Unable to remove axi votes rc: %d", rc);
	if (ret)
		CAM_ERR(CAM_CPAS, "Unable to remove axi votes ret: %d", ret);

remove_ahb_vote:
	remove_ahb.type = CAM_VOTE_ABSOLUTE;
	remove_ahb.vote.level = CAM_SUSPEND_VOTE;
	rc = cam_cpas_util_apply_client_ahb_vote(cpas_hw, cpas_client,
	ret = cam_cpas_util_apply_client_ahb_vote(cpas_hw, cpas_client,
		&remove_ahb, NULL);
	if (rc)
		CAM_ERR(CAM_CPAS, "Removing AHB vote failed, rc=%d", rc);
	if (ret)
		CAM_ERR(CAM_CPAS, "Removing AHB vote failed, ret: %d", ret);

error:
	mutex_unlock(&cpas_core->client_mutex[client_indx]);
+5 −1
Original line number Diff line number Diff line
@@ -7,7 +7,7 @@
#include <linux/slab.h>
#include <uapi/media/cam_isp.h>
#include <uapi/media/cam_defs.h>

#include <media/cam_req_mgr.h>
#include <dt-bindings/msm/msm-camera.h>

#include "cam_isp_hw_mgr_intf.h"
@@ -18,6 +18,7 @@
#include "cam_debug_util.h"
#include "cam_cpas_api.h"
#include "cam_tasklet_util.h"
#include "cam_subdev.h"

/* Timeout value in msec */
#define IFE_CSID_TIMEOUT                               1000
@@ -1720,6 +1721,9 @@ static void cam_ife_csid_halt_csi2(
		csid_reg->csi2_reg->csid_csi2_rx_cfg0_addr);
	cam_io_w_mb(0, soc_info->reg_map[0].mem_base +
		csid_reg->csi2_reg->csid_csi2_rx_cfg1_addr);
	cam_subdev_notify_message(CAM_CSIPHY_DEVICE_TYPE,
		CAM_SUBDEV_MESSAGE_IRQ_ERR,
		csid_hw->csi2_rx_cfg.phy_sel);
}

static int cam_ife_csid_init_config_pxl_path(
+12 −8
Original line number Diff line number Diff line
@@ -177,6 +177,7 @@ static int32_t cam_mem_get_slot(void)
	int32_t idx;

	mutex_lock(&tbl.m_lock);
	if (tbl.bitmap) {
		idx = find_first_zero_bit(tbl.bitmap, tbl.bits);
		if (idx >= CAM_MEM_BUFQ_MAX || idx <= 0) {
			mutex_unlock(&tbl.m_lock);
@@ -187,10 +188,13 @@ static int32_t cam_mem_get_slot(void)
		tbl.bufq[idx].active = true;
		mutex_init(&tbl.bufq[idx].q_lock);
		mutex_unlock(&tbl.m_lock);

		return idx;
	}

	mutex_unlock(&tbl.m_lock);
	return -EINVAL;
}

static void cam_mem_put_slot(int32_t idx)
{
	mutex_lock(&tbl.m_lock);
+19 −1
Original line number Diff line number Diff line
@@ -643,6 +643,24 @@ void cam_register_subdev_fops(struct v4l2_file_operations *fops)
}
EXPORT_SYMBOL(cam_register_subdev_fops);

void cam_subdev_notify_message(u32 subdev_type,
	enum cam_subdev_message_type_t message_type,
	uint32_t data)
{
	struct v4l2_subdev *sd = NULL;
	struct cam_subdev *csd = NULL;

	list_for_each_entry(sd, &g_dev.v4l2_dev->subdevs, list) {
		sd->entity.name = video_device_node_name(sd->devnode);
		if (sd->entity.function == subdev_type) {
			csd = container_of(sd, struct cam_subdev, sd);
			if (csd->msg_cb != NULL)
				csd->msg_cb(sd, message_type, data);
		}
	}
}
EXPORT_SYMBOL(cam_subdev_notify_message);

int cam_register_subdev(struct cam_subdev *csd)
{
	struct v4l2_subdev *sd;
@@ -671,7 +689,7 @@ int cam_register_subdev(struct cam_subdev *csd)
	sd = &csd->sd;
	v4l2_subdev_init(sd, csd->ops);
	sd->internal_ops = csd->internal_ops;
	snprintf(sd->name, ARRAY_SIZE(sd->name), csd->name);
	snprintf(sd->name, V4L2_SUBDEV_NAME_SIZE, "%s", csd->name);
	v4l2_set_subdevdata(sd, csd->token);

	sd->flags = csd->sd_flags;
+24 −1
Original line number Diff line number Diff line
/* SPDX-License-Identifier: GPL-2.0-only */
/*
 * Copyright (c) 2017-2018, The Linux Foundation. All rights reserved.
 * Copyright (c) 2017-2020, The Linux Foundation. All rights reserved.
 */

#ifndef _CAM_SUBDEV_H_
@@ -16,6 +16,10 @@

#define CAM_SUBDEVICE_EVENT_MAX 30

enum cam_subdev_message_type_t {
	CAM_SUBDEV_MESSAGE_IRQ_ERR = 0x1
};

/**
 * struct cam_subdev - describes a camera sub-device
 *
@@ -34,6 +38,7 @@
 * @ent_function:          Media entity function type. Can be:
 *                             %CAM_IFE_DEVICE_TYPE - identifies as IFE device.
 *                             %CAM_ICP_DEVICE_TYPE - identifies as ICP device.
 * @msg_cb:                Pointer to the callback function to dump PHY status.
 *
 * Each instance of a subdev driver should create this struct, either
 * stand-alone or embedded in a larger struct. This structure should be
@@ -49,8 +54,26 @@ struct cam_subdev {
	u32                                    sd_flags;
	void                                  *token;
	u32                                    ent_function;
	void                                  (*msg_cb)(
				struct v4l2_subdev *sd,
				enum cam_subdev_message_type_t msg_type,
				uint32_t data);
};

/**
  * cam_subdev_notify_message()
  *
  * @brief:  Notify message to a subdevs of specific type
  *
  * @subdev_type:           Subdev type
  * @message_type:          message type
  * @data:                  data to be delivered.
  *
  */
void cam_subdev_notify_message(u32 subdev_type,
	enum cam_subdev_message_type_t message_type,
	uint32_t data);

/**
 * cam_subdev_probe()
 *
Loading