Loading drivers/cam_core/cam_subdev.c +2 −0 Original line number Diff line number Diff line Loading @@ -55,8 +55,10 @@ static long cam_subdev_ioctl(struct v4l2_subdev *sd, unsigned int cmd, switch (cmd) { case VIDIOC_CAM_CONTROL: cam_req_mgr_rwsem_read_op(CAM_SUBDEV_LOCK); rc = cam_node_handle_ioctl(node, (struct cam_control *) arg); cam_req_mgr_rwsem_read_op(CAM_SUBDEV_UNLOCK); break; case CAM_SD_SHUTDOWN: if (!cam_req_mgr_is_shutdown()) { Loading drivers/cam_fd/cam_fd_dev.c +5 −0 Original line number Diff line number Diff line Loading @@ -44,8 +44,11 @@ static int cam_fd_dev_open(struct v4l2_subdev *sd, { struct cam_fd_dev *fd_dev = &g_fd_dev; cam_req_mgr_rwsem_read_op(CAM_SUBDEV_LOCK); if (!fd_dev->probe_done) { CAM_ERR(CAM_FD, "FD Dev not initialized, fd_dev=%pK", fd_dev); cam_req_mgr_rwsem_read_op(CAM_SUBDEV_UNLOCK); return -ENODEV; } Loading @@ -54,6 +57,8 @@ static int cam_fd_dev_open(struct v4l2_subdev *sd, CAM_DBG(CAM_FD, "FD Subdev open count %d", fd_dev->open_cnt); mutex_unlock(&fd_dev->lock); cam_req_mgr_rwsem_read_op(CAM_SUBDEV_UNLOCK); return 0; } Loading drivers/cam_icp/cam_icp_subdev.c +3 −10 Original line number Diff line number Diff line Loading @@ -20,7 +20,6 @@ #include <media/cam_req_mgr.h> #include <media/cam_defs.h> #include <media/cam_icp.h> #include "cam_mem_mgr.h" #include "cam_req_mgr_dev.h" #include "cam_subdev.h" #include "cam_node.h" Loading Loading @@ -74,6 +73,8 @@ static int cam_icp_subdev_open(struct v4l2_subdev *sd, struct cam_node *node = v4l2_get_subdevdata(sd); int rc = 0; cam_req_mgr_rwsem_read_op(CAM_SUBDEV_LOCK); mutex_lock(&g_icp_dev.icp_lock); if (g_icp_dev.open_cnt >= 1) { CAM_ERR(CAM_ICP, "ICP subdev is already opened"); Loading @@ -87,23 +88,16 @@ static int cam_icp_subdev_open(struct v4l2_subdev *sd, goto end; } rc = cam_mem_mgr_init(); if (rc) { CAM_ERR(CAM_CRM, "mem mgr init failed"); goto end; } hw_mgr_intf = &node->hw_mgr_intf; rc = hw_mgr_intf->hw_open(hw_mgr_intf->hw_mgr_priv, NULL); if (rc < 0) { CAM_ERR(CAM_ICP, "FW download failed"); cam_mem_mgr_deinit(); goto end; } g_icp_dev.open_cnt++; end: mutex_unlock(&g_icp_dev.icp_lock); cam_req_mgr_rwsem_read_op(CAM_SUBDEV_UNLOCK); return rc; } Loading Loading @@ -139,7 +133,6 @@ int cam_icp_subdev_close_internal(struct v4l2_subdev *sd, goto end; } cam_mem_mgr_deinit(); end: mutex_unlock(&g_icp_dev.icp_lock); return rc; Loading drivers/cam_isp/cam_isp_dev.c +4 −0 Original line number Diff line number Diff line Loading @@ -64,10 +64,14 @@ static const struct of_device_id cam_isp_dt_match[] = { static int cam_isp_subdev_open(struct v4l2_subdev *sd, struct v4l2_subdev_fh *fh) { cam_req_mgr_rwsem_read_op(CAM_SUBDEV_LOCK); mutex_lock(&g_isp_dev.isp_mutex); g_isp_dev.open_cnt++; mutex_unlock(&g_isp_dev.isp_mutex); cam_req_mgr_rwsem_read_op(CAM_SUBDEV_UNLOCK); return 0; } Loading drivers/cam_jpeg/cam_jpeg_dev.c +3 −0 Original line number Diff line number Diff line Loading @@ -48,11 +48,14 @@ static const struct of_device_id cam_jpeg_dt_match[] = { static int cam_jpeg_subdev_open(struct v4l2_subdev *sd, struct v4l2_subdev_fh *fh) { cam_req_mgr_rwsem_read_op(CAM_SUBDEV_LOCK); mutex_lock(&g_jpeg_dev.jpeg_mutex); g_jpeg_dev.open_cnt++; mutex_unlock(&g_jpeg_dev.jpeg_mutex); cam_req_mgr_rwsem_read_op(CAM_SUBDEV_UNLOCK); return 0; } Loading Loading
drivers/cam_core/cam_subdev.c +2 −0 Original line number Diff line number Diff line Loading @@ -55,8 +55,10 @@ static long cam_subdev_ioctl(struct v4l2_subdev *sd, unsigned int cmd, switch (cmd) { case VIDIOC_CAM_CONTROL: cam_req_mgr_rwsem_read_op(CAM_SUBDEV_LOCK); rc = cam_node_handle_ioctl(node, (struct cam_control *) arg); cam_req_mgr_rwsem_read_op(CAM_SUBDEV_UNLOCK); break; case CAM_SD_SHUTDOWN: if (!cam_req_mgr_is_shutdown()) { Loading
drivers/cam_fd/cam_fd_dev.c +5 −0 Original line number Diff line number Diff line Loading @@ -44,8 +44,11 @@ static int cam_fd_dev_open(struct v4l2_subdev *sd, { struct cam_fd_dev *fd_dev = &g_fd_dev; cam_req_mgr_rwsem_read_op(CAM_SUBDEV_LOCK); if (!fd_dev->probe_done) { CAM_ERR(CAM_FD, "FD Dev not initialized, fd_dev=%pK", fd_dev); cam_req_mgr_rwsem_read_op(CAM_SUBDEV_UNLOCK); return -ENODEV; } Loading @@ -54,6 +57,8 @@ static int cam_fd_dev_open(struct v4l2_subdev *sd, CAM_DBG(CAM_FD, "FD Subdev open count %d", fd_dev->open_cnt); mutex_unlock(&fd_dev->lock); cam_req_mgr_rwsem_read_op(CAM_SUBDEV_UNLOCK); return 0; } Loading
drivers/cam_icp/cam_icp_subdev.c +3 −10 Original line number Diff line number Diff line Loading @@ -20,7 +20,6 @@ #include <media/cam_req_mgr.h> #include <media/cam_defs.h> #include <media/cam_icp.h> #include "cam_mem_mgr.h" #include "cam_req_mgr_dev.h" #include "cam_subdev.h" #include "cam_node.h" Loading Loading @@ -74,6 +73,8 @@ static int cam_icp_subdev_open(struct v4l2_subdev *sd, struct cam_node *node = v4l2_get_subdevdata(sd); int rc = 0; cam_req_mgr_rwsem_read_op(CAM_SUBDEV_LOCK); mutex_lock(&g_icp_dev.icp_lock); if (g_icp_dev.open_cnt >= 1) { CAM_ERR(CAM_ICP, "ICP subdev is already opened"); Loading @@ -87,23 +88,16 @@ static int cam_icp_subdev_open(struct v4l2_subdev *sd, goto end; } rc = cam_mem_mgr_init(); if (rc) { CAM_ERR(CAM_CRM, "mem mgr init failed"); goto end; } hw_mgr_intf = &node->hw_mgr_intf; rc = hw_mgr_intf->hw_open(hw_mgr_intf->hw_mgr_priv, NULL); if (rc < 0) { CAM_ERR(CAM_ICP, "FW download failed"); cam_mem_mgr_deinit(); goto end; } g_icp_dev.open_cnt++; end: mutex_unlock(&g_icp_dev.icp_lock); cam_req_mgr_rwsem_read_op(CAM_SUBDEV_UNLOCK); return rc; } Loading Loading @@ -139,7 +133,6 @@ int cam_icp_subdev_close_internal(struct v4l2_subdev *sd, goto end; } cam_mem_mgr_deinit(); end: mutex_unlock(&g_icp_dev.icp_lock); return rc; Loading
drivers/cam_isp/cam_isp_dev.c +4 −0 Original line number Diff line number Diff line Loading @@ -64,10 +64,14 @@ static const struct of_device_id cam_isp_dt_match[] = { static int cam_isp_subdev_open(struct v4l2_subdev *sd, struct v4l2_subdev_fh *fh) { cam_req_mgr_rwsem_read_op(CAM_SUBDEV_LOCK); mutex_lock(&g_isp_dev.isp_mutex); g_isp_dev.open_cnt++; mutex_unlock(&g_isp_dev.isp_mutex); cam_req_mgr_rwsem_read_op(CAM_SUBDEV_UNLOCK); return 0; } Loading
drivers/cam_jpeg/cam_jpeg_dev.c +3 −0 Original line number Diff line number Diff line Loading @@ -48,11 +48,14 @@ static const struct of_device_id cam_jpeg_dt_match[] = { static int cam_jpeg_subdev_open(struct v4l2_subdev *sd, struct v4l2_subdev_fh *fh) { cam_req_mgr_rwsem_read_op(CAM_SUBDEV_LOCK); mutex_lock(&g_jpeg_dev.jpeg_mutex); g_jpeg_dev.open_cnt++; mutex_unlock(&g_jpeg_dev.jpeg_mutex); cam_req_mgr_rwsem_read_op(CAM_SUBDEV_UNLOCK); return 0; } Loading