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

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

Merge 285756a2 on remote branch

Change-Id: Ib491c6b26b034cdc1ff03fef47d21919612d1b04
parents a3592d86 285756a2
Loading
Loading
Loading
Loading
+10 −3
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-2018, 2020, The Linux Foundation. All rights reserved.
 */

#include <linux/device.h>
@@ -68,16 +68,22 @@ static int cam_fd_dev_close(struct v4l2_subdev *sd,
	}

	mutex_lock(&fd_dev->lock);
	if (fd_dev->open_cnt <= 0) {
		mutex_unlock(&fd_dev->lock);
		return -EINVAL;
	}
	fd_dev->open_cnt--;
	CAM_DBG(CAM_FD, "FD Subdev open count %d", fd_dev->open_cnt);
	mutex_unlock(&fd_dev->lock);

	if (!node) {
		CAM_ERR(CAM_FD, "Node ptr is NULL");
		mutex_unlock(&fd_dev->lock);
		return -EINVAL;
	}

	if (fd_dev->open_cnt == 0)
		cam_node_shutdown(node);
	mutex_unlock(&fd_dev->lock);

	return 0;
}
@@ -131,6 +137,7 @@ static int cam_fd_dev_probe(struct platform_device *pdev)

	mutex_init(&g_fd_dev.lock);
	g_fd_dev.probe_done = true;
	g_fd_dev.open_cnt = 0;

	CAM_DBG(CAM_FD, "Camera FD probe complete");

+1 −0
Original line number Diff line number Diff line
@@ -7659,6 +7659,7 @@ int cam_ife_hw_mgr_init(struct cam_hw_mgr_intf *hw_mgr_intf, int *iommu_hdl)
	memset(&g_ife_hw_mgr, 0, sizeof(g_ife_hw_mgr));

	mutex_init(&g_ife_hw_mgr.ctx_mutex);
	spin_lock_init(&g_ife_hw_mgr.ctx_lock);

	if (CAM_IFE_HW_NUM_MAX != CAM_IFE_CSID_HW_NUM_MAX) {
		CAM_ERR(CAM_ISP, "CSID num is different then IFE num");
+3 −0
Original line number Diff line number Diff line
@@ -4584,16 +4584,19 @@ irqreturn_t cam_ife_csid_irq(int irq_num, void *data)
			CSID_CSI2_RX_ERROR_CPHY_PH_CRC) {
			CAM_ERR_RATE_LIMIT(CAM_ISP, "CSID:%d CPHY_PH_CRC",
				csid_hw->hw_intf->hw_idx);
			csid_hw->error_irq_count++;
		}
		if (irq_status[CAM_IFE_CSID_IRQ_REG_RX] &
			CSID_CSI2_RX_ERROR_CRC) {
			CAM_ERR_RATE_LIMIT(CAM_ISP, "CSID:%d ERROR_CRC",
				csid_hw->hw_intf->hw_idx);
			csid_hw->error_irq_count++;
		}
		if (irq_status[CAM_IFE_CSID_IRQ_REG_RX] &
			CSID_CSI2_RX_ERROR_ECC) {
			CAM_ERR_RATE_LIMIT(CAM_ISP, "CSID:%d ERROR_ECC",
				csid_hw->hw_intf->hw_idx);
			csid_hw->error_irq_count++;
		}
		if (irq_status[CAM_IFE_CSID_IRQ_REG_RX] &
			CSID_CSI2_RX_ERROR_MMAPPED_VC_DT) {
+31 −2
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-2018, 2020, The Linux Foundation. All rights reserved.
 */

#include "cam_actuator_dev.h"
@@ -72,6 +72,25 @@ static long cam_actuator_init_subdev_do_ioctl(struct v4l2_subdev *sd,
}
#endif

static int cam_actuator_subdev_open(struct v4l2_subdev *sd,
	struct v4l2_subdev_fh *fh)
{
	struct cam_actuator_ctrl_t *a_ctrl =
		v4l2_get_subdevdata(sd);

	if (!a_ctrl) {
		CAM_ERR(CAM_ACTUATOR, "a_ctrl ptr is NULL");
		return -EINVAL;
	}

	mutex_lock(&(a_ctrl->actuator_mutex));
	a_ctrl->open_cnt++;
	CAM_DBG(CAM_ACTUATOR, "actuator_dev open count %d", a_ctrl->open_cnt);
	mutex_unlock(&(a_ctrl->actuator_mutex));

	return 0;
}

static int cam_actuator_subdev_close(struct v4l2_subdev *sd,
	struct v4l2_subdev_fh *fh)
{
@@ -84,6 +103,13 @@ static int cam_actuator_subdev_close(struct v4l2_subdev *sd,
	}

	mutex_lock(&(a_ctrl->actuator_mutex));
	if (a_ctrl->open_cnt <= 0) {
		mutex_unlock(&(a_ctrl->actuator_mutex));
		return -EINVAL;
	}
	a_ctrl->open_cnt--;
	CAM_DBG(CAM_ACTUATOR, "actuator_dev open count %d", a_ctrl->open_cnt);
	if (a_ctrl->open_cnt == 0)
		cam_actuator_shutdown(a_ctrl);
	mutex_unlock(&(a_ctrl->actuator_mutex));

@@ -102,6 +128,7 @@ static struct v4l2_subdev_ops cam_actuator_subdev_ops = {
};

static const struct v4l2_subdev_internal_ops cam_actuator_internal_ops = {
	.open  = cam_actuator_subdev_open,
	.close = cam_actuator_subdev_close,
};

@@ -210,6 +237,7 @@ static int32_t cam_actuator_driver_i2c_probe(struct i2c_client *client,
		cam_actuator_apply_request;
	a_ctrl->last_flush_req = 0;
	a_ctrl->cam_act_state = CAM_ACTUATOR_INIT;
	a_ctrl->open_cnt = 0;

	return rc;

@@ -372,6 +400,7 @@ static int32_t cam_actuator_driver_platform_probe(

	platform_set_drvdata(pdev, a_ctrl);
	a_ctrl->cam_act_state = CAM_ACTUATOR_INIT;
	a_ctrl->open_cnt = 0;

	return rc;

+2 −1
Original line number Diff line number Diff line
/* SPDX-License-Identifier: GPL-2.0-only */
/*
 * Copyright (c) 2017-2019, The Linux Foundation. All rights reserved.
 * Copyright (c) 2017-2020, The Linux Foundation. All rights reserved.
 */


@@ -115,6 +115,7 @@ struct cam_actuator_ctrl_t {
	struct cam_actuator_query_cap act_info;
	struct intf_params bridge_intf;
	uint32_t last_flush_req;
	uint32_t open_cnt;
};

#endif /* _CAM_ACTUATOR_DEV_H_ */
Loading