Loading drivers/cam_fd/cam_fd_dev.c +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> Loading Loading @@ -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; } Loading Loading @@ -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"); Loading drivers/cam_isp/isp_hw_mgr/cam_ife_hw_mgr.c +1 −0 Original line number Diff line number Diff line Loading @@ -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"); Loading drivers/cam_isp/isp_hw_mgr/isp_hw/ife_csid_hw/cam_ife_csid_core.c +3 −0 Original line number Diff line number Diff line Loading @@ -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) { Loading drivers/cam_sensor_module/cam_actuator/cam_actuator_dev.c +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" Loading Loading @@ -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) { Loading @@ -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)); Loading @@ -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, }; Loading Loading @@ -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; Loading Loading @@ -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; Loading drivers/cam_sensor_module/cam_actuator/cam_actuator_dev.h +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. */ Loading Loading @@ -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
drivers/cam_fd/cam_fd_dev.c +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> Loading Loading @@ -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; } Loading Loading @@ -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"); Loading
drivers/cam_isp/isp_hw_mgr/cam_ife_hw_mgr.c +1 −0 Original line number Diff line number Diff line Loading @@ -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"); Loading
drivers/cam_isp/isp_hw_mgr/isp_hw/ife_csid_hw/cam_ife_csid_core.c +3 −0 Original line number Diff line number Diff line Loading @@ -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) { Loading
drivers/cam_sensor_module/cam_actuator/cam_actuator_dev.c +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" Loading Loading @@ -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) { Loading @@ -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)); Loading @@ -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, }; Loading Loading @@ -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; Loading Loading @@ -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; Loading
drivers/cam_sensor_module/cam_actuator/cam_actuator_dev.h +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. */ Loading Loading @@ -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_ */