Loading drivers/cam_cdm/cam_cdm_core_common.c +13 −9 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/delay.h> Loading Loading @@ -180,10 +180,12 @@ void cam_cdm_notify_clients(struct cam_hw_info *cdm_hw, (struct cam_cdm_bl_cb_request_entry *)data; client_idx = CAM_CDM_GET_CLIENT_IDX(node->client_hdl); mutex_lock(&cdm_hw->hw_mutex); client = core->clients[client_idx]; if ((!client) || (client->handle != node->client_hdl)) { CAM_ERR(CAM_CDM, "Invalid client %pK hdl=%x", client, node->client_hdl); mutex_unlock(&cdm_hw->hw_mutex); return; } cam_cdm_get_client_refcount(client); Loading @@ -202,6 +204,7 @@ void cam_cdm_notify_clients(struct cam_hw_info *cdm_hw, } mutex_unlock(&client->lock); cam_cdm_put_client_refcount(client); mutex_unlock(&cdm_hw->hw_mutex); return; } else if (status == CAM_CDM_CB_STATUS_HW_RESET_DONE || status == CAM_CDM_CB_STATUS_HW_FLUSH || Loading Loading @@ -239,6 +242,7 @@ void cam_cdm_notify_clients(struct cam_hw_info *cdm_hw, for (i = 0; i < CAM_PER_CDM_MAX_REGISTERED_CLIENTS; i++) { if (core->clients[i] != NULL) { mutex_lock(&cdm_hw->hw_mutex); client = core->clients[i]; cam_cdm_get_client_refcount(client); mutex_lock(&client->lock); Loading @@ -261,6 +265,7 @@ void cam_cdm_notify_clients(struct cam_hw_info *cdm_hw, } mutex_unlock(&client->lock); cam_cdm_put_client_refcount(client); mutex_unlock(&cdm_hw->hw_mutex); } } } Loading Loading @@ -320,35 +325,34 @@ int cam_cdm_stream_ops_internal(void *hw_priv, return -EINVAL; core = (struct cam_cdm *)cdm_hw->core_info; mutex_lock(&cdm_hw->hw_mutex); client_idx = CAM_CDM_GET_CLIENT_IDX(*handle); client = core->clients[client_idx]; if (!client) { CAM_ERR(CAM_CDM, "Invalid client %pK hdl=%x", client, *handle); mutex_unlock(&cdm_hw->hw_mutex); return -EINVAL; } cam_cdm_get_client_refcount(client); if (*handle != client->handle) { CAM_ERR(CAM_CDM, "client id given handle=%x invalid", *handle); cam_cdm_put_client_refcount(client); return -EINVAL; rc = -EINVAL; goto end; } if (operation == true) { if (true == client->stream_on) { CAM_ERR(CAM_CDM, "Invalid CDM client is already streamed ON"); cam_cdm_put_client_refcount(client); return rc; goto end; } } else { if (client->stream_on == false) { CAM_ERR(CAM_CDM, "Invalid CDM client is already streamed Off"); cam_cdm_put_client_refcount(client); return rc; goto end; } } mutex_lock(&cdm_hw->hw_mutex); if (operation == true) { if (!cdm_hw->open_count) { struct cam_ahb_vote ahb_vote; Loading drivers/cam_isp/cam_isp_context.c +1 −1 Original line number Diff line number Diff line Loading @@ -6098,7 +6098,7 @@ static int cam_isp_context_dump_requests(void *data, static int cam_isp_context_handle_message(void *context, uint32_t msg_type, uint32_t *data) { int rc = 0; int rc = -EINVAL; struct cam_hw_cmd_args hw_cmd_args; struct cam_isp_hw_cmd_args isp_hw_cmd_args; struct cam_context *ctx = (struct cam_context *)context; Loading drivers/cam_isp/isp_hw_mgr/cam_tfe_hw_mgr.c +28 −8 Original line number Diff line number Diff line Loading @@ -319,9 +319,10 @@ static int cam_tfe_hw_mgr_get_clock_rate( continue; hw_intf = isp_hw_res->hw_res[i]->hw_intf; if (hw_intf && hw_intf->hw_ops.process_cmd) { CAM_DBG(CAM_ISP, "hw type %d hw index:%d", hw_intf->hw_type, hw_intf->hw_idx); if (hw_intf && hw_intf->hw_ops.process_cmd) { rc = hw_intf->hw_ops.process_cmd( hw_intf->hw_priv, CAM_ISP_HW_CMD_GET_CLOCK_RATE, Loading @@ -343,7 +344,7 @@ static int cam_tfe_hw_mgr_update_clock_rate( uint32_t *updated_clock_rate) { int i; int rc = 0; int rc = -EINVAL; struct cam_hw_intf *hw_intf; for (i = 0; i < CAM_ISP_HW_SPLIT_MAX; i++) { Loading @@ -351,29 +352,33 @@ static int cam_tfe_hw_mgr_update_clock_rate( continue; hw_intf = isp_hw_res->hw_res[i]->hw_intf; if (hw_intf && hw_intf->hw_ops.process_cmd) { CAM_DBG(CAM_ISP, "hw type %d hw index:%d", hw_intf->hw_type, hw_intf->hw_idx); if (hw_intf && hw_intf->hw_ops.process_cmd) { rc = hw_intf->hw_ops.process_cmd( hw_intf->hw_priv, CAM_ISP_HW_CMD_DYNAMIC_CLOCK_UPDATE, set_clock_rate, sizeof(uint32_t)); if (rc) { CAM_ERR(CAM_ISP, "Failed to get Clock rate"); CAM_ERR(CAM_ISP, "Failed to set Clock rate"); return rc; } } if (hw_intf && hw_intf->hw_ops.process_cmd) { CAM_DBG(CAM_ISP, "hw type %d hw index:%d", hw_intf->hw_type, hw_intf->hw_idx); rc = hw_intf->hw_ops.process_cmd( hw_intf->hw_priv, CAM_ISP_HW_CMD_GET_CLOCK_RATE, updated_clock_rate, sizeof(uint32_t)); if (rc) { CAM_ERR(CAM_ISP, "Failed to get Clock rate"); CAM_ERR(CAM_ISP, "Failed to get updated clock rate"); return rc; } } Loading Loading @@ -3247,6 +3252,17 @@ static int cam_tfe_mgr_start_hw(void *hw_mgr_priv, void *start_hw_args) if (ctx->init_done && start_isp->start_only) goto start_only; /* set tpg debug information for top tpg */ for (i = 0; i < CAM_TOP_TPG_HW_NUM_MAX; i++) { if (g_tfe_hw_mgr.tpg_devices[i]) { rc = g_tfe_hw_mgr.tpg_devices[i]->hw_ops.process_cmd( g_tfe_hw_mgr.tpg_devices[i]->hw_priv, CAM_ISP_HW_CMD_TPG_SET_PATTERN, &g_tfe_hw_mgr.debug_cfg.set_tpg_pattern, sizeof(g_tfe_hw_mgr.debug_cfg.set_tpg_pattern)); } } list_for_each_entry(hw_mgr_res, &ctx->res_list_tfe_csid, list) { for (i = 0; i < CAM_ISP_HW_SPLIT_MAX; i++) { if (!hw_mgr_res->hw_res[i]) Loading Loading @@ -5808,6 +5824,7 @@ static int cam_tfe_hw_mgr_debug_register(void) int rc = 0; struct dentry *dbgfileptr = NULL; g_tfe_hw_mgr.debug_cfg.set_tpg_pattern = CAM_TOP_TPG_DEFAULT_PATTERN; dbgfileptr = debugfs_create_dir("camera_tfe", NULL); if (!dbgfileptr) { CAM_ERR(CAM_ISP, "DebugFS could not create directory!"); Loading @@ -5828,6 +5845,9 @@ static int cam_tfe_hw_mgr_debug_register(void) dbgfileptr = debugfs_create_u32("enable_csid_recovery", 0644, g_tfe_hw_mgr.debug_cfg.dentry, &g_tfe_hw_mgr.debug_cfg.enable_csid_recovery); dbgfileptr = debugfs_create_u32("set_tpg_pattern", 0644, g_tfe_hw_mgr.debug_cfg.dentry, &g_tfe_hw_mgr.debug_cfg.set_tpg_pattern); dbgfileptr = debugfs_create_file("tfe_camif_debug", 0644, g_tfe_hw_mgr.debug_cfg.dentry, NULL, &cam_tfe_camif_debug); dbgfileptr = debugfs_create_u32("per_req_reg_dump", 0644, Loading drivers/cam_isp/isp_hw_mgr/cam_tfe_hw_mgr.h +3 −1 Original line number Diff line number Diff line /* SPDX-License-Identifier: GPL-2.0-only */ /* * Copyright (c) 2019-2020, The Linux Foundation. All rights reserved. * Copyright (c) 2020-2021, The Linux Foundation. All rights reserved. */ #ifndef _CAM_TFE_HW_MGR_H_ Loading Loading @@ -30,6 +30,7 @@ * @enable_recovery: enable recovery * @enable_csid_recovery: enable csid recovery * @camif_debug: enable sensor diagnosis status * @set_tpg_pattern: tpg pattern information * @enable_reg_dump: enable reg dump on error; * @per_req_reg_dump: Enable per request reg dump * Loading @@ -40,6 +41,7 @@ struct cam_tfe_hw_mgr_debug { uint32_t enable_recovery; uint32_t enable_csid_recovery; uint32_t camif_debug; uint32_t set_tpg_pattern; uint32_t enable_reg_dump; uint32_t per_req_reg_dump; }; Loading drivers/cam_isp/isp_hw_mgr/isp_hw/ife_csid_hw/cam_ife_csid_core.c +2 −1 Original line number Diff line number Diff line Loading @@ -1589,12 +1589,13 @@ static int cam_ife_csid_disable_hw(struct cam_ife_csid_hw *csid_hw) cam_io_w_mb(0, soc_info->reg_map[0].mem_base + csid_reg->cmn_reg->csid_top_irq_mask_addr); cam_tasklet_stop(csid_hw->tasklet); rc = cam_ife_csid_disable_soc_resources(soc_info); if (rc) CAM_ERR(CAM_ISP, "CSID:%d Disable CSID SOC failed", csid_hw->hw_intf->hw_idx); cam_tasklet_stop(csid_hw->tasklet); spin_lock_irqsave(&csid_hw->lock_state, flags); csid_hw->device_enabled = 0; spin_unlock_irqrestore(&csid_hw->lock_state, flags); Loading Loading
drivers/cam_cdm/cam_cdm_core_common.c +13 −9 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/delay.h> Loading Loading @@ -180,10 +180,12 @@ void cam_cdm_notify_clients(struct cam_hw_info *cdm_hw, (struct cam_cdm_bl_cb_request_entry *)data; client_idx = CAM_CDM_GET_CLIENT_IDX(node->client_hdl); mutex_lock(&cdm_hw->hw_mutex); client = core->clients[client_idx]; if ((!client) || (client->handle != node->client_hdl)) { CAM_ERR(CAM_CDM, "Invalid client %pK hdl=%x", client, node->client_hdl); mutex_unlock(&cdm_hw->hw_mutex); return; } cam_cdm_get_client_refcount(client); Loading @@ -202,6 +204,7 @@ void cam_cdm_notify_clients(struct cam_hw_info *cdm_hw, } mutex_unlock(&client->lock); cam_cdm_put_client_refcount(client); mutex_unlock(&cdm_hw->hw_mutex); return; } else if (status == CAM_CDM_CB_STATUS_HW_RESET_DONE || status == CAM_CDM_CB_STATUS_HW_FLUSH || Loading Loading @@ -239,6 +242,7 @@ void cam_cdm_notify_clients(struct cam_hw_info *cdm_hw, for (i = 0; i < CAM_PER_CDM_MAX_REGISTERED_CLIENTS; i++) { if (core->clients[i] != NULL) { mutex_lock(&cdm_hw->hw_mutex); client = core->clients[i]; cam_cdm_get_client_refcount(client); mutex_lock(&client->lock); Loading @@ -261,6 +265,7 @@ void cam_cdm_notify_clients(struct cam_hw_info *cdm_hw, } mutex_unlock(&client->lock); cam_cdm_put_client_refcount(client); mutex_unlock(&cdm_hw->hw_mutex); } } } Loading Loading @@ -320,35 +325,34 @@ int cam_cdm_stream_ops_internal(void *hw_priv, return -EINVAL; core = (struct cam_cdm *)cdm_hw->core_info; mutex_lock(&cdm_hw->hw_mutex); client_idx = CAM_CDM_GET_CLIENT_IDX(*handle); client = core->clients[client_idx]; if (!client) { CAM_ERR(CAM_CDM, "Invalid client %pK hdl=%x", client, *handle); mutex_unlock(&cdm_hw->hw_mutex); return -EINVAL; } cam_cdm_get_client_refcount(client); if (*handle != client->handle) { CAM_ERR(CAM_CDM, "client id given handle=%x invalid", *handle); cam_cdm_put_client_refcount(client); return -EINVAL; rc = -EINVAL; goto end; } if (operation == true) { if (true == client->stream_on) { CAM_ERR(CAM_CDM, "Invalid CDM client is already streamed ON"); cam_cdm_put_client_refcount(client); return rc; goto end; } } else { if (client->stream_on == false) { CAM_ERR(CAM_CDM, "Invalid CDM client is already streamed Off"); cam_cdm_put_client_refcount(client); return rc; goto end; } } mutex_lock(&cdm_hw->hw_mutex); if (operation == true) { if (!cdm_hw->open_count) { struct cam_ahb_vote ahb_vote; Loading
drivers/cam_isp/cam_isp_context.c +1 −1 Original line number Diff line number Diff line Loading @@ -6098,7 +6098,7 @@ static int cam_isp_context_dump_requests(void *data, static int cam_isp_context_handle_message(void *context, uint32_t msg_type, uint32_t *data) { int rc = 0; int rc = -EINVAL; struct cam_hw_cmd_args hw_cmd_args; struct cam_isp_hw_cmd_args isp_hw_cmd_args; struct cam_context *ctx = (struct cam_context *)context; Loading
drivers/cam_isp/isp_hw_mgr/cam_tfe_hw_mgr.c +28 −8 Original line number Diff line number Diff line Loading @@ -319,9 +319,10 @@ static int cam_tfe_hw_mgr_get_clock_rate( continue; hw_intf = isp_hw_res->hw_res[i]->hw_intf; if (hw_intf && hw_intf->hw_ops.process_cmd) { CAM_DBG(CAM_ISP, "hw type %d hw index:%d", hw_intf->hw_type, hw_intf->hw_idx); if (hw_intf && hw_intf->hw_ops.process_cmd) { rc = hw_intf->hw_ops.process_cmd( hw_intf->hw_priv, CAM_ISP_HW_CMD_GET_CLOCK_RATE, Loading @@ -343,7 +344,7 @@ static int cam_tfe_hw_mgr_update_clock_rate( uint32_t *updated_clock_rate) { int i; int rc = 0; int rc = -EINVAL; struct cam_hw_intf *hw_intf; for (i = 0; i < CAM_ISP_HW_SPLIT_MAX; i++) { Loading @@ -351,29 +352,33 @@ static int cam_tfe_hw_mgr_update_clock_rate( continue; hw_intf = isp_hw_res->hw_res[i]->hw_intf; if (hw_intf && hw_intf->hw_ops.process_cmd) { CAM_DBG(CAM_ISP, "hw type %d hw index:%d", hw_intf->hw_type, hw_intf->hw_idx); if (hw_intf && hw_intf->hw_ops.process_cmd) { rc = hw_intf->hw_ops.process_cmd( hw_intf->hw_priv, CAM_ISP_HW_CMD_DYNAMIC_CLOCK_UPDATE, set_clock_rate, sizeof(uint32_t)); if (rc) { CAM_ERR(CAM_ISP, "Failed to get Clock rate"); CAM_ERR(CAM_ISP, "Failed to set Clock rate"); return rc; } } if (hw_intf && hw_intf->hw_ops.process_cmd) { CAM_DBG(CAM_ISP, "hw type %d hw index:%d", hw_intf->hw_type, hw_intf->hw_idx); rc = hw_intf->hw_ops.process_cmd( hw_intf->hw_priv, CAM_ISP_HW_CMD_GET_CLOCK_RATE, updated_clock_rate, sizeof(uint32_t)); if (rc) { CAM_ERR(CAM_ISP, "Failed to get Clock rate"); CAM_ERR(CAM_ISP, "Failed to get updated clock rate"); return rc; } } Loading Loading @@ -3247,6 +3252,17 @@ static int cam_tfe_mgr_start_hw(void *hw_mgr_priv, void *start_hw_args) if (ctx->init_done && start_isp->start_only) goto start_only; /* set tpg debug information for top tpg */ for (i = 0; i < CAM_TOP_TPG_HW_NUM_MAX; i++) { if (g_tfe_hw_mgr.tpg_devices[i]) { rc = g_tfe_hw_mgr.tpg_devices[i]->hw_ops.process_cmd( g_tfe_hw_mgr.tpg_devices[i]->hw_priv, CAM_ISP_HW_CMD_TPG_SET_PATTERN, &g_tfe_hw_mgr.debug_cfg.set_tpg_pattern, sizeof(g_tfe_hw_mgr.debug_cfg.set_tpg_pattern)); } } list_for_each_entry(hw_mgr_res, &ctx->res_list_tfe_csid, list) { for (i = 0; i < CAM_ISP_HW_SPLIT_MAX; i++) { if (!hw_mgr_res->hw_res[i]) Loading Loading @@ -5808,6 +5824,7 @@ static int cam_tfe_hw_mgr_debug_register(void) int rc = 0; struct dentry *dbgfileptr = NULL; g_tfe_hw_mgr.debug_cfg.set_tpg_pattern = CAM_TOP_TPG_DEFAULT_PATTERN; dbgfileptr = debugfs_create_dir("camera_tfe", NULL); if (!dbgfileptr) { CAM_ERR(CAM_ISP, "DebugFS could not create directory!"); Loading @@ -5828,6 +5845,9 @@ static int cam_tfe_hw_mgr_debug_register(void) dbgfileptr = debugfs_create_u32("enable_csid_recovery", 0644, g_tfe_hw_mgr.debug_cfg.dentry, &g_tfe_hw_mgr.debug_cfg.enable_csid_recovery); dbgfileptr = debugfs_create_u32("set_tpg_pattern", 0644, g_tfe_hw_mgr.debug_cfg.dentry, &g_tfe_hw_mgr.debug_cfg.set_tpg_pattern); dbgfileptr = debugfs_create_file("tfe_camif_debug", 0644, g_tfe_hw_mgr.debug_cfg.dentry, NULL, &cam_tfe_camif_debug); dbgfileptr = debugfs_create_u32("per_req_reg_dump", 0644, Loading
drivers/cam_isp/isp_hw_mgr/cam_tfe_hw_mgr.h +3 −1 Original line number Diff line number Diff line /* SPDX-License-Identifier: GPL-2.0-only */ /* * Copyright (c) 2019-2020, The Linux Foundation. All rights reserved. * Copyright (c) 2020-2021, The Linux Foundation. All rights reserved. */ #ifndef _CAM_TFE_HW_MGR_H_ Loading Loading @@ -30,6 +30,7 @@ * @enable_recovery: enable recovery * @enable_csid_recovery: enable csid recovery * @camif_debug: enable sensor diagnosis status * @set_tpg_pattern: tpg pattern information * @enable_reg_dump: enable reg dump on error; * @per_req_reg_dump: Enable per request reg dump * Loading @@ -40,6 +41,7 @@ struct cam_tfe_hw_mgr_debug { uint32_t enable_recovery; uint32_t enable_csid_recovery; uint32_t camif_debug; uint32_t set_tpg_pattern; uint32_t enable_reg_dump; uint32_t per_req_reg_dump; }; Loading
drivers/cam_isp/isp_hw_mgr/isp_hw/ife_csid_hw/cam_ife_csid_core.c +2 −1 Original line number Diff line number Diff line Loading @@ -1589,12 +1589,13 @@ static int cam_ife_csid_disable_hw(struct cam_ife_csid_hw *csid_hw) cam_io_w_mb(0, soc_info->reg_map[0].mem_base + csid_reg->cmn_reg->csid_top_irq_mask_addr); cam_tasklet_stop(csid_hw->tasklet); rc = cam_ife_csid_disable_soc_resources(soc_info); if (rc) CAM_ERR(CAM_ISP, "CSID:%d Disable CSID SOC failed", csid_hw->hw_intf->hw_idx); cam_tasklet_stop(csid_hw->tasklet); spin_lock_irqsave(&csid_hw->lock_state, flags); csid_hw->device_enabled = 0; spin_unlock_irqrestore(&csid_hw->lock_state, flags); Loading