Loading drivers/cam_isp/cam_isp_context.c +47 −1 Original line number Diff line number Diff line // SPDX-License-Identifier: GPL-2.0-only /* * Copyright (c) 2017-2020, The Linux Foundation. All rights reserved. * Copyright (c) 2017-2021, The Linux Foundation. All rights reserved. */ #include <linux/debugfs.h> Loading Loading @@ -3066,6 +3066,7 @@ static int __cam_isp_ctx_rdi_only_sof_in_bubble_applied( ctx_isp->frame_id, ctx->ctx_id); ctx->ctx_crm_intf->notify_err(¬ify); atomic_set(&ctx_isp->process_bubble, 1); } else { req_isp->bubble_report = 0; } Loading Loading @@ -3123,6 +3124,44 @@ static int __cam_isp_ctx_rdi_only_sof_in_bubble_state( ctx_isp->boot_timestamp = sof_event_data->boot_time; CAM_DBG(CAM_ISP, "frame id: %lld time stamp:0x%llx", ctx_isp->frame_id, ctx_isp->sof_timestamp_val); if (atomic_read(&ctx_isp->process_bubble)) { if (list_empty(&ctx->active_req_list)) { CAM_ERR(CAM_ISP, "No available active req in bubble"); atomic_set(&ctx_isp->process_bubble, 0); return -EINVAL; } if (ctx_isp->last_sof_timestamp == ctx_isp->sof_timestamp_val) { CAM_DBG(CAM_ISP, "Tasklet delay detected! Bubble frame: %lld check skipped, sof_timestamp: %lld, ctx_id: %d", ctx_isp->frame_id, ctx_isp->sof_timestamp_val, ctx->ctx_id); goto end; } req = list_first_entry(&ctx->active_req_list, struct cam_ctx_request, list); req_isp = (struct cam_isp_ctx_req *) req->req_priv; if (req_isp->bubble_detected) { req_isp->num_acked = 0; req_isp->bubble_detected = false; list_del_init(&req->list); list_add(&req->list, &ctx->pending_req_list); atomic_set(&ctx_isp->process_bubble, 0); ctx_isp->active_req_cnt--; CAM_DBG(CAM_REQ, "Move active req: %lld to pending list(cnt = %d) [bubble re-apply],ctx %u", req->request_id, ctx_isp->active_req_cnt, ctx->ctx_id); goto end; } } /* * Signal all active requests with error and move the all the active * requests to free list Loading @@ -3144,6 +3183,7 @@ static int __cam_isp_ctx_rdi_only_sof_in_bubble_state( ctx_isp->active_req_cnt--; } end: /* notify reqmgr with sof signal */ if (ctx->ctx_crm_intf && ctx->ctx_crm_intf->notify_trigger) { notify.link_hdl = ctx->link_hdl; Loading Loading @@ -3174,6 +3214,7 @@ static int __cam_isp_ctx_rdi_only_sof_in_bubble_state( __cam_isp_ctx_substate_val_to_type( ctx_isp->substate_activated)); ctx_isp->last_sof_timestamp = ctx_isp->sof_timestamp_val; return 0; } Loading Loading @@ -3426,6 +3467,7 @@ static int __cam_isp_ctx_release_hw_in_top_state(struct cam_context *ctx, ctx_isp->hw_acquired = false; ctx_isp->init_received = false; ctx_isp->req_info.last_bufdone_req_id = 0; ctx_isp->last_sof_timestamp = 0; atomic64_set(&ctx_isp->state_monitor_head, -1); Loading Loading @@ -3490,6 +3532,7 @@ static int __cam_isp_ctx_release_dev_in_top_state(struct cam_context *ctx, ctx_isp->init_received = false; ctx_isp->rdi_only_context = false; ctx_isp->req_info.last_bufdone_req_id = 0; ctx_isp->last_sof_timestamp = 0; atomic64_set(&ctx_isp->state_monitor_head, -1); for (i = 0; i < CAM_ISP_CTX_EVENT_MAX; i++) Loading Loading @@ -3830,6 +3873,7 @@ static int __cam_isp_ctx_acquire_dev_in_available(struct cam_context *ctx, ctx_isp->hw_acquired = true; ctx_isp->split_acquire = false; ctx->ctxt_to_hw_map = param.ctxt_to_hw_map; ctx_isp->last_sof_timestamp = 0; atomic64_set(&ctx_isp->state_monitor_head, -1); for (i = 0; i < CAM_ISP_CTX_EVENT_MAX; i++) Loading Loading @@ -3987,6 +4031,7 @@ static int __cam_isp_ctx_acquire_hw_v1(struct cam_context *ctx, ctx_isp->hw_ctx = param.ctxt_to_hw_map; ctx_isp->hw_acquired = true; ctx->ctxt_to_hw_map = param.ctxt_to_hw_map; ctx_isp->last_sof_timestamp = 0; atomic64_set(&ctx_isp->state_monitor_head, -1); Loading Loading @@ -4132,6 +4177,7 @@ static int __cam_isp_ctx_acquire_hw_v2(struct cam_context *ctx, ctx_isp->hw_ctx = param.ctxt_to_hw_map; ctx_isp->hw_acquired = true; ctx->ctxt_to_hw_map = param.ctxt_to_hw_map; ctx_isp->last_sof_timestamp = 0; trace_cam_context_state("ISP", ctx); CAM_DBG(CAM_ISP, Loading drivers/cam_isp/cam_isp_context.h +3 −1 Original line number Diff line number Diff line /* SPDX-License-Identifier: GPL-2.0-only */ /* * Copyright (c) 2017-2020, The Linux Foundation. All rights reserved. * Copyright (c) 2017-2021, The Linux Foundation. All rights reserved. */ #ifndef _CAM_ISP_CONTEXT_H_ Loading Loading @@ -232,6 +232,7 @@ struct cam_isp_context_event_record { * @req_isp: ISP private request object storage * @hw_ctx: HW object returned by the acquire device command * @sof_timestamp_val: Captured time stamp value at sof hw event * @last_sof_timestamp: Time stamp value for last SOF event * @boot_timestamp: Boot time stamp for a given req_id * @active_req_cnt: Counter for the active request * @reported_req_id: Last reported request id Loading Loading @@ -268,6 +269,7 @@ struct cam_isp_context { void *hw_ctx; uint64_t sof_timestamp_val; uint64_t last_sof_timestamp; uint64_t boot_timestamp; int32_t active_req_cnt; int64_t reported_req_id; Loading drivers/cam_sensor_module/cam_flash/cam_flash_core.c +79 −2 Original line number Diff line number Diff line Loading @@ -505,6 +505,8 @@ static int cam_flash_ops(struct cam_flash_ctrl *flash_ctrl, int cam_flash_off(struct cam_flash_ctrl *flash_ctrl) { int rc = 0; if (!flash_ctrl) { CAM_ERR(CAM_FLASH, "Flash control Null"); return -EINVAL; Loading @@ -515,6 +517,17 @@ int cam_flash_off(struct cam_flash_ctrl *flash_ctrl) (enum led_brightness)LED_SWITCH_OFF); flash_ctrl->flash_state = CAM_FLASH_STATE_START; if ((flash_ctrl->i2c_data.streamoff_settings.is_settings_valid) && (flash_ctrl->i2c_data.streamoff_settings.request_id == 0)) { flash_ctrl->apply_streamoff = true; rc = cam_flash_i2c_apply_setting(flash_ctrl, 0); if (rc < 0) { CAM_ERR(CAM_SENSOR, "cannot apply streamoff settings"); } } return 0; } Loading Loading @@ -717,7 +730,24 @@ int cam_flash_i2c_apply_setting(struct cam_flash_ctrl *fctrl, CAM_DBG(CAM_FLASH, "req_id=%llu", req_id); if (req_id == 0) { /* NonRealTime Init settings*/ if (fctrl->i2c_data.init_settings.is_settings_valid == true) { if (fctrl->apply_streamoff == true) { fctrl->apply_streamoff = false; i2c_set = &fctrl->i2c_data.streamoff_settings; list_for_each_entry(i2c_list, &(i2c_set->list_head), list) { rc = cam_sensor_util_i2c_apply_setting (&(fctrl->io_master_info), i2c_list); if (rc) { CAM_ERR(CAM_FLASH, "Failed to apply stream on settings: %d", rc); return rc; } break; } } else if (fctrl->i2c_data.init_settings.is_settings_valid == true) { list_for_each_entry(i2c_list, &(fctrl->i2c_data.init_settings.list_head), list) { Loading Loading @@ -1195,7 +1225,8 @@ int cam_flash_i2c_pkt_parser(struct cam_flash_ctrl *fctrl, void *arg) rc = fctrl->func_tbl.apply_setting(fctrl, 0); if (rc) { CAM_ERR(CAM_FLASH, "cannot apply settings rc = %d", rc); CAM_ERR(CAM_FLASH, "cannot apply settings rc = %d", rc); return rc; } Loading Loading @@ -1228,6 +1259,18 @@ int cam_flash_i2c_pkt_parser(struct cam_flash_ctrl *fctrl, void *arg) "Failed in parsing i2c packets"); return rc; } if ((fctrl->flash_state == CAM_FLASH_STATE_ACQUIRE) || (fctrl->flash_state == CAM_FLASH_STATE_CONFIG)) { fctrl->flash_state = CAM_FLASH_STATE_CONFIG; rc = fctrl->func_tbl.apply_setting(fctrl, 1); if (rc) { CAM_ERR(CAM_FLASH, "cannot apply fire settings rc = %d", rc); return rc; } return rc; } break; } case CAM_FLASH_PACKET_OPCODE_NON_REALTIME_SET_OPS: { Loading Loading @@ -1285,6 +1328,29 @@ int cam_flash_i2c_pkt_parser(struct cam_flash_ctrl *fctrl, void *arg) csl_packet->header.request_id); goto update_req_mgr; } case CAM_FLASH_PACKET_OPCODE_STREAM_OFF: { if (fctrl->streamoff_count > 0) return rc; CAM_DBG(CAM_FLASH, "Received Stream off Settings"); i2c_data = &(fctrl->i2c_data); fctrl->streamoff_count = fctrl->streamoff_count + 1; i2c_reg_settings = &i2c_data->streamoff_settings; i2c_reg_settings->request_id = 0; i2c_reg_settings->is_settings_valid = 1; offset = (uint32_t *)((uint8_t *)&csl_packet->payload + csl_packet->cmd_buf_offset); cmd_desc = (struct cam_cmd_buf_desc *)(offset); rc = cam_sensor_i2c_command_parser(&fctrl->io_master_info, i2c_reg_settings, cmd_desc, 1, NULL); if (rc) { CAM_ERR(CAM_FLASH, "Failed in parsing i2c Stream off packets"); return rc; } break; } default: CAM_ERR(CAM_FLASH, "Wrong Opcode : %d", (csl_packet->header.op_code & 0xFFFFFF)); Loading Loading @@ -1825,6 +1891,16 @@ int cam_flash_release_dev(struct cam_flash_ctrl *fctrl) { int rc = 0; if (fctrl->i2c_data.streamoff_settings.is_settings_valid == true) { fctrl->i2c_data.streamoff_settings.is_settings_valid = false; rc = delete_request(&fctrl->i2c_data.streamoff_settings); if (rc) { CAM_WARN(CAM_FLASH, "Failed to delete Stream off i2c_setting: %d", rc); } } if (fctrl->bridge_intf.device_hdl != 1) { rc = cam_destroy_device_hdl(fctrl->bridge_intf.device_hdl); if (rc) Loading @@ -1835,6 +1911,7 @@ int cam_flash_release_dev(struct cam_flash_ctrl *fctrl) fctrl->bridge_intf.link_hdl = -1; fctrl->bridge_intf.session_hdl = -1; fctrl->last_flush_req = 0; fctrl->streamoff_count = 0; } return rc; Loading drivers/cam_sensor_module/cam_flash/cam_flash_dev.c +5 −0 Original line number Diff line number Diff line Loading @@ -71,6 +71,7 @@ static int32_t cam_flash_driver_cmd(struct cam_flash_ctrl *fctrl, flash_acq_dev.device_handle; fctrl->bridge_intf.session_hdl = flash_acq_dev.session_handle; fctrl->apply_streamoff = false; rc = copy_to_user(u64_to_user_ptr(cmd->handle), &flash_acq_dev, Loading Loading @@ -123,6 +124,7 @@ static int32_t cam_flash_driver_cmd(struct cam_flash_ctrl *fctrl, if (fctrl->func_tbl.power_ops(fctrl, false)) CAM_WARN(CAM_FLASH, "Power Down Failed"); fctrl->streamoff_count = 0; fctrl->flash_state = CAM_FLASH_STATE_INIT; break; } Loading Loading @@ -162,6 +164,7 @@ static int32_t cam_flash_driver_cmd(struct cam_flash_ctrl *fctrl, goto release_mutex; } fctrl->apply_streamoff = false; fctrl->flash_state = CAM_FLASH_STATE_START; break; } Loading Loading @@ -490,6 +493,7 @@ static int32_t cam_flash_platform_probe(struct platform_device *pdev) INIT_LIST_HEAD(&(fctrl->i2c_data.init_settings.list_head)); INIT_LIST_HEAD(&(fctrl->i2c_data.config_settings.list_head)); INIT_LIST_HEAD(&(fctrl->i2c_data.streamoff_settings.list_head)); for (i = 0; i < MAX_PER_FRAME_ARRAY; i++) INIT_LIST_HEAD( &(fctrl->i2c_data.per_frame[i].list_head)); Loading Loading @@ -592,6 +596,7 @@ static int32_t cam_flash_i2c_driver_probe(struct i2c_client *client, INIT_LIST_HEAD(&(fctrl->i2c_data.init_settings.list_head)); INIT_LIST_HEAD(&(fctrl->i2c_data.config_settings.list_head)); INIT_LIST_HEAD(&(fctrl->i2c_data.streamoff_settings.list_head)); for (i = 0; i < MAX_PER_FRAME_ARRAY; i++) INIT_LIST_HEAD(&(fctrl->i2c_data.per_frame[i].list_head)); Loading drivers/cam_sensor_module/cam_flash/cam_flash_dev.h +5 −0 Original line number Diff line number Diff line Loading @@ -40,6 +40,7 @@ #define CAM_FLASH_PACKET_OPCODE_INIT 0 #define CAM_FLASH_PACKET_OPCODE_SET_OPS 1 #define CAM_FLASH_PACKET_OPCODE_NON_REALTIME_SET_OPS 2 #define CAM_FLASH_PACKET_OPCODE_STREAM_OFF 3 struct cam_flash_ctrl; Loading Loading @@ -182,6 +183,8 @@ struct cam_flash_func_tbl { * @io_master_info : Information about the communication master * @i2c_data : I2C register settings * @last_flush_req : last request to flush * @streamoff_count : Count to hold the number of times stream off called * @apply_streamoff : variable to store when to apply stream off */ struct cam_flash_ctrl { char device_name[CAM_CTX_DEV_NAME_MAX_LENGTH]; Loading Loading @@ -210,6 +213,8 @@ struct cam_flash_ctrl { struct camera_io_master io_master_info; struct i2c_data_settings i2c_data; uint32_t last_flush_req; uint32_t streamoff_count; int32_t apply_streamoff; }; int cam_flash_pmic_pkt_parser(struct cam_flash_ctrl *fctrl, void *arg); Loading Loading
drivers/cam_isp/cam_isp_context.c +47 −1 Original line number Diff line number Diff line // SPDX-License-Identifier: GPL-2.0-only /* * Copyright (c) 2017-2020, The Linux Foundation. All rights reserved. * Copyright (c) 2017-2021, The Linux Foundation. All rights reserved. */ #include <linux/debugfs.h> Loading Loading @@ -3066,6 +3066,7 @@ static int __cam_isp_ctx_rdi_only_sof_in_bubble_applied( ctx_isp->frame_id, ctx->ctx_id); ctx->ctx_crm_intf->notify_err(¬ify); atomic_set(&ctx_isp->process_bubble, 1); } else { req_isp->bubble_report = 0; } Loading Loading @@ -3123,6 +3124,44 @@ static int __cam_isp_ctx_rdi_only_sof_in_bubble_state( ctx_isp->boot_timestamp = sof_event_data->boot_time; CAM_DBG(CAM_ISP, "frame id: %lld time stamp:0x%llx", ctx_isp->frame_id, ctx_isp->sof_timestamp_val); if (atomic_read(&ctx_isp->process_bubble)) { if (list_empty(&ctx->active_req_list)) { CAM_ERR(CAM_ISP, "No available active req in bubble"); atomic_set(&ctx_isp->process_bubble, 0); return -EINVAL; } if (ctx_isp->last_sof_timestamp == ctx_isp->sof_timestamp_val) { CAM_DBG(CAM_ISP, "Tasklet delay detected! Bubble frame: %lld check skipped, sof_timestamp: %lld, ctx_id: %d", ctx_isp->frame_id, ctx_isp->sof_timestamp_val, ctx->ctx_id); goto end; } req = list_first_entry(&ctx->active_req_list, struct cam_ctx_request, list); req_isp = (struct cam_isp_ctx_req *) req->req_priv; if (req_isp->bubble_detected) { req_isp->num_acked = 0; req_isp->bubble_detected = false; list_del_init(&req->list); list_add(&req->list, &ctx->pending_req_list); atomic_set(&ctx_isp->process_bubble, 0); ctx_isp->active_req_cnt--; CAM_DBG(CAM_REQ, "Move active req: %lld to pending list(cnt = %d) [bubble re-apply],ctx %u", req->request_id, ctx_isp->active_req_cnt, ctx->ctx_id); goto end; } } /* * Signal all active requests with error and move the all the active * requests to free list Loading @@ -3144,6 +3183,7 @@ static int __cam_isp_ctx_rdi_only_sof_in_bubble_state( ctx_isp->active_req_cnt--; } end: /* notify reqmgr with sof signal */ if (ctx->ctx_crm_intf && ctx->ctx_crm_intf->notify_trigger) { notify.link_hdl = ctx->link_hdl; Loading Loading @@ -3174,6 +3214,7 @@ static int __cam_isp_ctx_rdi_only_sof_in_bubble_state( __cam_isp_ctx_substate_val_to_type( ctx_isp->substate_activated)); ctx_isp->last_sof_timestamp = ctx_isp->sof_timestamp_val; return 0; } Loading Loading @@ -3426,6 +3467,7 @@ static int __cam_isp_ctx_release_hw_in_top_state(struct cam_context *ctx, ctx_isp->hw_acquired = false; ctx_isp->init_received = false; ctx_isp->req_info.last_bufdone_req_id = 0; ctx_isp->last_sof_timestamp = 0; atomic64_set(&ctx_isp->state_monitor_head, -1); Loading Loading @@ -3490,6 +3532,7 @@ static int __cam_isp_ctx_release_dev_in_top_state(struct cam_context *ctx, ctx_isp->init_received = false; ctx_isp->rdi_only_context = false; ctx_isp->req_info.last_bufdone_req_id = 0; ctx_isp->last_sof_timestamp = 0; atomic64_set(&ctx_isp->state_monitor_head, -1); for (i = 0; i < CAM_ISP_CTX_EVENT_MAX; i++) Loading Loading @@ -3830,6 +3873,7 @@ static int __cam_isp_ctx_acquire_dev_in_available(struct cam_context *ctx, ctx_isp->hw_acquired = true; ctx_isp->split_acquire = false; ctx->ctxt_to_hw_map = param.ctxt_to_hw_map; ctx_isp->last_sof_timestamp = 0; atomic64_set(&ctx_isp->state_monitor_head, -1); for (i = 0; i < CAM_ISP_CTX_EVENT_MAX; i++) Loading Loading @@ -3987,6 +4031,7 @@ static int __cam_isp_ctx_acquire_hw_v1(struct cam_context *ctx, ctx_isp->hw_ctx = param.ctxt_to_hw_map; ctx_isp->hw_acquired = true; ctx->ctxt_to_hw_map = param.ctxt_to_hw_map; ctx_isp->last_sof_timestamp = 0; atomic64_set(&ctx_isp->state_monitor_head, -1); Loading Loading @@ -4132,6 +4177,7 @@ static int __cam_isp_ctx_acquire_hw_v2(struct cam_context *ctx, ctx_isp->hw_ctx = param.ctxt_to_hw_map; ctx_isp->hw_acquired = true; ctx->ctxt_to_hw_map = param.ctxt_to_hw_map; ctx_isp->last_sof_timestamp = 0; trace_cam_context_state("ISP", ctx); CAM_DBG(CAM_ISP, Loading
drivers/cam_isp/cam_isp_context.h +3 −1 Original line number Diff line number Diff line /* SPDX-License-Identifier: GPL-2.0-only */ /* * Copyright (c) 2017-2020, The Linux Foundation. All rights reserved. * Copyright (c) 2017-2021, The Linux Foundation. All rights reserved. */ #ifndef _CAM_ISP_CONTEXT_H_ Loading Loading @@ -232,6 +232,7 @@ struct cam_isp_context_event_record { * @req_isp: ISP private request object storage * @hw_ctx: HW object returned by the acquire device command * @sof_timestamp_val: Captured time stamp value at sof hw event * @last_sof_timestamp: Time stamp value for last SOF event * @boot_timestamp: Boot time stamp for a given req_id * @active_req_cnt: Counter for the active request * @reported_req_id: Last reported request id Loading Loading @@ -268,6 +269,7 @@ struct cam_isp_context { void *hw_ctx; uint64_t sof_timestamp_val; uint64_t last_sof_timestamp; uint64_t boot_timestamp; int32_t active_req_cnt; int64_t reported_req_id; Loading
drivers/cam_sensor_module/cam_flash/cam_flash_core.c +79 −2 Original line number Diff line number Diff line Loading @@ -505,6 +505,8 @@ static int cam_flash_ops(struct cam_flash_ctrl *flash_ctrl, int cam_flash_off(struct cam_flash_ctrl *flash_ctrl) { int rc = 0; if (!flash_ctrl) { CAM_ERR(CAM_FLASH, "Flash control Null"); return -EINVAL; Loading @@ -515,6 +517,17 @@ int cam_flash_off(struct cam_flash_ctrl *flash_ctrl) (enum led_brightness)LED_SWITCH_OFF); flash_ctrl->flash_state = CAM_FLASH_STATE_START; if ((flash_ctrl->i2c_data.streamoff_settings.is_settings_valid) && (flash_ctrl->i2c_data.streamoff_settings.request_id == 0)) { flash_ctrl->apply_streamoff = true; rc = cam_flash_i2c_apply_setting(flash_ctrl, 0); if (rc < 0) { CAM_ERR(CAM_SENSOR, "cannot apply streamoff settings"); } } return 0; } Loading Loading @@ -717,7 +730,24 @@ int cam_flash_i2c_apply_setting(struct cam_flash_ctrl *fctrl, CAM_DBG(CAM_FLASH, "req_id=%llu", req_id); if (req_id == 0) { /* NonRealTime Init settings*/ if (fctrl->i2c_data.init_settings.is_settings_valid == true) { if (fctrl->apply_streamoff == true) { fctrl->apply_streamoff = false; i2c_set = &fctrl->i2c_data.streamoff_settings; list_for_each_entry(i2c_list, &(i2c_set->list_head), list) { rc = cam_sensor_util_i2c_apply_setting (&(fctrl->io_master_info), i2c_list); if (rc) { CAM_ERR(CAM_FLASH, "Failed to apply stream on settings: %d", rc); return rc; } break; } } else if (fctrl->i2c_data.init_settings.is_settings_valid == true) { list_for_each_entry(i2c_list, &(fctrl->i2c_data.init_settings.list_head), list) { Loading Loading @@ -1195,7 +1225,8 @@ int cam_flash_i2c_pkt_parser(struct cam_flash_ctrl *fctrl, void *arg) rc = fctrl->func_tbl.apply_setting(fctrl, 0); if (rc) { CAM_ERR(CAM_FLASH, "cannot apply settings rc = %d", rc); CAM_ERR(CAM_FLASH, "cannot apply settings rc = %d", rc); return rc; } Loading Loading @@ -1228,6 +1259,18 @@ int cam_flash_i2c_pkt_parser(struct cam_flash_ctrl *fctrl, void *arg) "Failed in parsing i2c packets"); return rc; } if ((fctrl->flash_state == CAM_FLASH_STATE_ACQUIRE) || (fctrl->flash_state == CAM_FLASH_STATE_CONFIG)) { fctrl->flash_state = CAM_FLASH_STATE_CONFIG; rc = fctrl->func_tbl.apply_setting(fctrl, 1); if (rc) { CAM_ERR(CAM_FLASH, "cannot apply fire settings rc = %d", rc); return rc; } return rc; } break; } case CAM_FLASH_PACKET_OPCODE_NON_REALTIME_SET_OPS: { Loading Loading @@ -1285,6 +1328,29 @@ int cam_flash_i2c_pkt_parser(struct cam_flash_ctrl *fctrl, void *arg) csl_packet->header.request_id); goto update_req_mgr; } case CAM_FLASH_PACKET_OPCODE_STREAM_OFF: { if (fctrl->streamoff_count > 0) return rc; CAM_DBG(CAM_FLASH, "Received Stream off Settings"); i2c_data = &(fctrl->i2c_data); fctrl->streamoff_count = fctrl->streamoff_count + 1; i2c_reg_settings = &i2c_data->streamoff_settings; i2c_reg_settings->request_id = 0; i2c_reg_settings->is_settings_valid = 1; offset = (uint32_t *)((uint8_t *)&csl_packet->payload + csl_packet->cmd_buf_offset); cmd_desc = (struct cam_cmd_buf_desc *)(offset); rc = cam_sensor_i2c_command_parser(&fctrl->io_master_info, i2c_reg_settings, cmd_desc, 1, NULL); if (rc) { CAM_ERR(CAM_FLASH, "Failed in parsing i2c Stream off packets"); return rc; } break; } default: CAM_ERR(CAM_FLASH, "Wrong Opcode : %d", (csl_packet->header.op_code & 0xFFFFFF)); Loading Loading @@ -1825,6 +1891,16 @@ int cam_flash_release_dev(struct cam_flash_ctrl *fctrl) { int rc = 0; if (fctrl->i2c_data.streamoff_settings.is_settings_valid == true) { fctrl->i2c_data.streamoff_settings.is_settings_valid = false; rc = delete_request(&fctrl->i2c_data.streamoff_settings); if (rc) { CAM_WARN(CAM_FLASH, "Failed to delete Stream off i2c_setting: %d", rc); } } if (fctrl->bridge_intf.device_hdl != 1) { rc = cam_destroy_device_hdl(fctrl->bridge_intf.device_hdl); if (rc) Loading @@ -1835,6 +1911,7 @@ int cam_flash_release_dev(struct cam_flash_ctrl *fctrl) fctrl->bridge_intf.link_hdl = -1; fctrl->bridge_intf.session_hdl = -1; fctrl->last_flush_req = 0; fctrl->streamoff_count = 0; } return rc; Loading
drivers/cam_sensor_module/cam_flash/cam_flash_dev.c +5 −0 Original line number Diff line number Diff line Loading @@ -71,6 +71,7 @@ static int32_t cam_flash_driver_cmd(struct cam_flash_ctrl *fctrl, flash_acq_dev.device_handle; fctrl->bridge_intf.session_hdl = flash_acq_dev.session_handle; fctrl->apply_streamoff = false; rc = copy_to_user(u64_to_user_ptr(cmd->handle), &flash_acq_dev, Loading Loading @@ -123,6 +124,7 @@ static int32_t cam_flash_driver_cmd(struct cam_flash_ctrl *fctrl, if (fctrl->func_tbl.power_ops(fctrl, false)) CAM_WARN(CAM_FLASH, "Power Down Failed"); fctrl->streamoff_count = 0; fctrl->flash_state = CAM_FLASH_STATE_INIT; break; } Loading Loading @@ -162,6 +164,7 @@ static int32_t cam_flash_driver_cmd(struct cam_flash_ctrl *fctrl, goto release_mutex; } fctrl->apply_streamoff = false; fctrl->flash_state = CAM_FLASH_STATE_START; break; } Loading Loading @@ -490,6 +493,7 @@ static int32_t cam_flash_platform_probe(struct platform_device *pdev) INIT_LIST_HEAD(&(fctrl->i2c_data.init_settings.list_head)); INIT_LIST_HEAD(&(fctrl->i2c_data.config_settings.list_head)); INIT_LIST_HEAD(&(fctrl->i2c_data.streamoff_settings.list_head)); for (i = 0; i < MAX_PER_FRAME_ARRAY; i++) INIT_LIST_HEAD( &(fctrl->i2c_data.per_frame[i].list_head)); Loading Loading @@ -592,6 +596,7 @@ static int32_t cam_flash_i2c_driver_probe(struct i2c_client *client, INIT_LIST_HEAD(&(fctrl->i2c_data.init_settings.list_head)); INIT_LIST_HEAD(&(fctrl->i2c_data.config_settings.list_head)); INIT_LIST_HEAD(&(fctrl->i2c_data.streamoff_settings.list_head)); for (i = 0; i < MAX_PER_FRAME_ARRAY; i++) INIT_LIST_HEAD(&(fctrl->i2c_data.per_frame[i].list_head)); Loading
drivers/cam_sensor_module/cam_flash/cam_flash_dev.h +5 −0 Original line number Diff line number Diff line Loading @@ -40,6 +40,7 @@ #define CAM_FLASH_PACKET_OPCODE_INIT 0 #define CAM_FLASH_PACKET_OPCODE_SET_OPS 1 #define CAM_FLASH_PACKET_OPCODE_NON_REALTIME_SET_OPS 2 #define CAM_FLASH_PACKET_OPCODE_STREAM_OFF 3 struct cam_flash_ctrl; Loading Loading @@ -182,6 +183,8 @@ struct cam_flash_func_tbl { * @io_master_info : Information about the communication master * @i2c_data : I2C register settings * @last_flush_req : last request to flush * @streamoff_count : Count to hold the number of times stream off called * @apply_streamoff : variable to store when to apply stream off */ struct cam_flash_ctrl { char device_name[CAM_CTX_DEV_NAME_MAX_LENGTH]; Loading Loading @@ -210,6 +213,8 @@ struct cam_flash_ctrl { struct camera_io_master io_master_info; struct i2c_data_settings i2c_data; uint32_t last_flush_req; uint32_t streamoff_count; int32_t apply_streamoff; }; int cam_flash_pmic_pkt_parser(struct cam_flash_ctrl *fctrl, void *arg); Loading