Loading drivers/media/platform/msm/ais/cam_cdm/cam_cdm_core_common.c +24 −2 Original line number Diff line number Diff line /* Copyright (c) 2017-2019, The Linux Foundation. All rights reserved. /* Copyright (c) 2017-2020, The Linux Foundation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and Loading Loading @@ -277,6 +277,19 @@ int cam_cdm_stream_ops_internal(void *hw_priv, struct cam_ahb_vote ahb_vote; struct cam_axi_vote axi_vote; if (core->id != CAM_CDM_VIRTUAL) { rc = cam_soc_util_enable_platform_resource( &cdm_hw->soc_info, true, CAM_SVS_VOTE, true); if (rc) { CAM_ERR(CAM_CDM, "Enable platform failed"); goto end; } } CAM_DBG(CAM_CDM, "Enable soc done"); ahb_vote.type = CAM_VOTE_ABSOLUTE; ahb_vote.vote.level = CAM_SVS_VOTE; axi_vote.compressed_bw = CAM_CPAS_DEFAULT_AXI_BW; Loading @@ -287,7 +300,7 @@ int cam_cdm_stream_ops_internal(void *hw_priv, &ahb_vote, &axi_vote); if (rc != 0) { CAM_ERR(CAM_CDM, "CPAS start failed"); goto end; goto disable_platform_resource; } CAM_DBG(CAM_CDM, "CDM init first time"); if (core->id == CAM_CDM_VIRTUAL) { Loading Loading @@ -367,6 +380,15 @@ int cam_cdm_stream_ops_internal(void *hw_priv, rc = -ENXIO; } } goto end; disable_platform_resource: if (core->id != CAM_CDM_VIRTUAL) { if (cam_soc_util_disable_platform_resource(&cdm_hw->soc_info, true, true)) CAM_ERR(CAM_CDM, "Disable platform resource failed"); } end: cam_cdm_put_client_refcount(client); mutex_unlock(&cdm_hw->hw_mutex); Loading drivers/media/platform/msm/ais/cam_cdm/cam_cdm_hw_core.c +17 −13 Original line number Diff line number Diff line /* Copyright (c) 2017-2019, The Linux Foundation. All rights reserved. /* Copyright (c) 2017-2020, The Linux Foundation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and Loading Loading @@ -794,15 +794,6 @@ int cam_hw_cdm_init(void *hw_priv, soc_info = &cdm_hw->soc_info; cdm_core = (struct cam_cdm *)cdm_hw->core_info; rc = cam_soc_util_enable_platform_resource(soc_info, true, CAM_SVS_VOTE, true); if (rc) { CAM_ERR(CAM_CDM, "Enable platform failed"); goto end; } CAM_DBG(CAM_CDM, "Enable soc done"); /* Before triggering the reset to HW, clear the reset complete */ atomic_set(&cdm_core->error, 0); atomic_set(&cdm_core->bl_done, 0); Loading Loading @@ -982,6 +973,15 @@ int cam_hw_cdm_probe(struct platform_device *pdev) cpas_parms.client_handle); cdm_core->cpas_handle = cpas_parms.client_handle; rc = cam_soc_util_enable_platform_resource(&cdm_hw->soc_info, true, CAM_SVS_VOTE, true); if (rc) { CAM_ERR(CAM_CDM, "Enable platform failed"); goto cpas_unregister; } CAM_DBG(CAM_CDM, "Enable soc done"); ahb_vote.type = CAM_VOTE_ABSOLUTE; ahb_vote.vote.level = CAM_SVS_VOTE; axi_vote.compressed_bw = CAM_CPAS_DEFAULT_AXI_BW; Loading @@ -990,7 +990,7 @@ int cam_hw_cdm_probe(struct platform_device *pdev) rc = cam_cpas_start(cdm_core->cpas_handle, &ahb_vote, &axi_vote); if (rc) { CAM_ERR(CAM_CDM, "CPAS start failed"); goto cpas_unregister; goto disable_platform_resource; } rc = cam_hw_cdm_init(cdm_hw, NULL, 0); Loading Loading @@ -1038,7 +1038,7 @@ int cam_hw_cdm_probe(struct platform_device *pdev) if (rc) { CAM_ERR(CAM_CDM, "CPAS stop failed"); cdm_hw->open_count--; goto cpas_unregister; goto disable_platform_resource; } rc = cam_cdm_intf_register_hw_cdm(cdm_hw_intf, Loading @@ -1046,7 +1046,7 @@ int cam_hw_cdm_probe(struct platform_device *pdev) if (rc) { CAM_ERR(CAM_CDM, "HW CDM Interface registration failed"); cdm_hw->open_count--; goto cpas_unregister; goto disable_platform_resource; } cdm_hw->open_count--; mutex_unlock(&cdm_hw->hw_mutex); Loading @@ -1063,6 +1063,10 @@ int cam_hw_cdm_probe(struct platform_device *pdev) cpas_stop: if (cam_cpas_stop(cdm_core->cpas_handle)) CAM_ERR(CAM_CDM, "CPAS stop failed"); disable_platform_resource: if (cam_soc_util_disable_platform_resource(&cdm_hw->soc_info, true, true)) CAM_ERR(CAM_CDM, "Disable platform resource failed"); cpas_unregister: if (cam_cpas_unregister_client(cdm_core->cpas_handle)) CAM_ERR(CAM_CDM, "CPAS unregister failed"); Loading drivers/media/platform/msm/ais/cam_fd/fd_hw_mgr/fd_hw/cam_fd_hw_soc.c +15 −14 Original line number Diff line number Diff line /* Copyright (c) 2017-2019, The Linux Foundation. All rights reserved. /* Copyright (c) 2017-2020, The Linux Foundation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and Loading Loading @@ -148,6 +148,13 @@ int cam_fd_soc_enable_resources(struct cam_hw_soc_info *soc_info) struct cam_axi_vote axi_vote; int rc; rc = cam_soc_util_enable_platform_resource(soc_info, true, CAM_SVS_VOTE, true); if (rc) { CAM_ERR(CAM_FD, "Error enable platform failed, rc=%d", rc); goto end; } ahb_vote.type = CAM_VOTE_ABSOLUTE; ahb_vote.vote.level = CAM_SVS_VOTE; axi_vote.compressed_bw = 7200000; Loading @@ -156,22 +163,16 @@ int cam_fd_soc_enable_resources(struct cam_hw_soc_info *soc_info) rc = cam_cpas_start(soc_private->cpas_handle, &ahb_vote, &axi_vote); if (rc) { CAM_ERR(CAM_FD, "Error in CPAS START, rc=%d", rc); return -EFAULT; } rc = cam_soc_util_enable_platform_resource(soc_info, true, CAM_SVS_VOTE, true); if (rc) { CAM_ERR(CAM_FD, "Error enable platform failed, rc=%d", rc); goto stop_cpas; rc = -EFAULT; goto disable_platform_resource; } goto end; return rc; stop_cpas: if (cam_cpas_stop(soc_private->cpas_handle)) CAM_ERR(CAM_FD, "Error in CPAS STOP"); disable_platform_resource: if (cam_soc_util_disable_platform_resource(soc_info, true, true)) CAM_ERR(CAM_FD, "Disable platform resource failed"); end: return rc; } Loading drivers/media/platform/msm/ais/cam_icp/icp_hw/a5_hw/a5_core.c +14 −10 Original line number Diff line number Diff line /* Copyright (c) 2017-2019, The Linux Foundation. All rights reserved. /* Copyright (c) 2017-2020, The Linux Foundation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and Loading Loading @@ -302,6 +302,12 @@ int cam_a5_init_hw(void *device_priv, return -EINVAL; } rc = cam_a5_enable_soc_resources(soc_info); if (rc) { CAM_ERR(CAM_ICP, "soc enable is failed: %d", rc); goto end; } cpas_vote.ahb_vote.type = CAM_VOTE_ABSOLUTE; cpas_vote.ahb_vote.vote.level = CAM_SVS_VOTE; cpas_vote.axi_vote.compressed_bw = CAM_ICP_A5_BW_BYTES_VOTE; Loading @@ -312,19 +318,17 @@ int cam_a5_init_hw(void *device_priv, &cpas_vote.ahb_vote, &cpas_vote.axi_vote); if (rc) { CAM_ERR(CAM_ICP, "cpass start failed: %d", rc); return rc; goto disable_soc_resources; } core_info->cpas_start = true; rc = cam_a5_enable_soc_resources(soc_info); if (rc) { CAM_ERR(CAM_ICP, "soc enable is failed: %d", rc); if (cam_cpas_stop(core_info->cpas_handle)) CAM_ERR(CAM_ICP, "cpas stop is failed"); else core_info->cpas_start = false; } goto end; disable_soc_resources: if (cam_a5_disable_soc_resources(soc_info)) CAM_ERR(CAM_ICP, "Disable soc resource failed"); end: return rc; } Loading drivers/media/platform/msm/ais/cam_icp/icp_hw/bps_hw/bps_core.c +17 −12 Original line number Diff line number Diff line /* Copyright (c) 2017-2019, The Linux Foundation. All rights reserved. /* Copyright (c) 2017-2020, The Linux Foundation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and Loading Loading @@ -77,6 +77,14 @@ int cam_bps_init_hw(void *device_priv, return -EINVAL; } rc = cam_bps_enable_soc_resources(soc_info); if (rc) { CAM_ERR(CAM_ICP, "soc enable is failed: %d", rc); goto end; } else { core_info->clk_enable = true; } cpas_vote.ahb_vote.type = CAM_VOTE_ABSOLUTE; cpas_vote.ahb_vote.vote.level = CAM_SVS_VOTE; cpas_vote.axi_vote.compressed_bw = CAM_CPAS_DEFAULT_AXI_BW; Loading @@ -86,21 +94,18 @@ int cam_bps_init_hw(void *device_priv, &cpas_vote.ahb_vote, &cpas_vote.axi_vote); if (rc) { CAM_ERR(CAM_ICP, "cpass start failed: %d", rc); return rc; goto disable_soc_resources; } core_info->cpas_start = true; rc = cam_bps_enable_soc_resources(soc_info); if (rc) { CAM_ERR(CAM_ICP, "soc enable is failed: %d", rc); if (cam_cpas_stop(core_info->cpas_handle)) CAM_ERR(CAM_ICP, "cpas stop is failed"); else core_info->cpas_start = false; } else { core_info->clk_enable = true; } goto end; disable_soc_resources: if (cam_bps_disable_soc_resources(soc_info, true)) CAM_ERR(CAM_ICP, "Disable soc resource failed"); core_info->clk_enable = false; end: return rc; } Loading Loading
drivers/media/platform/msm/ais/cam_cdm/cam_cdm_core_common.c +24 −2 Original line number Diff line number Diff line /* Copyright (c) 2017-2019, The Linux Foundation. All rights reserved. /* Copyright (c) 2017-2020, The Linux Foundation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and Loading Loading @@ -277,6 +277,19 @@ int cam_cdm_stream_ops_internal(void *hw_priv, struct cam_ahb_vote ahb_vote; struct cam_axi_vote axi_vote; if (core->id != CAM_CDM_VIRTUAL) { rc = cam_soc_util_enable_platform_resource( &cdm_hw->soc_info, true, CAM_SVS_VOTE, true); if (rc) { CAM_ERR(CAM_CDM, "Enable platform failed"); goto end; } } CAM_DBG(CAM_CDM, "Enable soc done"); ahb_vote.type = CAM_VOTE_ABSOLUTE; ahb_vote.vote.level = CAM_SVS_VOTE; axi_vote.compressed_bw = CAM_CPAS_DEFAULT_AXI_BW; Loading @@ -287,7 +300,7 @@ int cam_cdm_stream_ops_internal(void *hw_priv, &ahb_vote, &axi_vote); if (rc != 0) { CAM_ERR(CAM_CDM, "CPAS start failed"); goto end; goto disable_platform_resource; } CAM_DBG(CAM_CDM, "CDM init first time"); if (core->id == CAM_CDM_VIRTUAL) { Loading Loading @@ -367,6 +380,15 @@ int cam_cdm_stream_ops_internal(void *hw_priv, rc = -ENXIO; } } goto end; disable_platform_resource: if (core->id != CAM_CDM_VIRTUAL) { if (cam_soc_util_disable_platform_resource(&cdm_hw->soc_info, true, true)) CAM_ERR(CAM_CDM, "Disable platform resource failed"); } end: cam_cdm_put_client_refcount(client); mutex_unlock(&cdm_hw->hw_mutex); Loading
drivers/media/platform/msm/ais/cam_cdm/cam_cdm_hw_core.c +17 −13 Original line number Diff line number Diff line /* Copyright (c) 2017-2019, The Linux Foundation. All rights reserved. /* Copyright (c) 2017-2020, The Linux Foundation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and Loading Loading @@ -794,15 +794,6 @@ int cam_hw_cdm_init(void *hw_priv, soc_info = &cdm_hw->soc_info; cdm_core = (struct cam_cdm *)cdm_hw->core_info; rc = cam_soc_util_enable_platform_resource(soc_info, true, CAM_SVS_VOTE, true); if (rc) { CAM_ERR(CAM_CDM, "Enable platform failed"); goto end; } CAM_DBG(CAM_CDM, "Enable soc done"); /* Before triggering the reset to HW, clear the reset complete */ atomic_set(&cdm_core->error, 0); atomic_set(&cdm_core->bl_done, 0); Loading Loading @@ -982,6 +973,15 @@ int cam_hw_cdm_probe(struct platform_device *pdev) cpas_parms.client_handle); cdm_core->cpas_handle = cpas_parms.client_handle; rc = cam_soc_util_enable_platform_resource(&cdm_hw->soc_info, true, CAM_SVS_VOTE, true); if (rc) { CAM_ERR(CAM_CDM, "Enable platform failed"); goto cpas_unregister; } CAM_DBG(CAM_CDM, "Enable soc done"); ahb_vote.type = CAM_VOTE_ABSOLUTE; ahb_vote.vote.level = CAM_SVS_VOTE; axi_vote.compressed_bw = CAM_CPAS_DEFAULT_AXI_BW; Loading @@ -990,7 +990,7 @@ int cam_hw_cdm_probe(struct platform_device *pdev) rc = cam_cpas_start(cdm_core->cpas_handle, &ahb_vote, &axi_vote); if (rc) { CAM_ERR(CAM_CDM, "CPAS start failed"); goto cpas_unregister; goto disable_platform_resource; } rc = cam_hw_cdm_init(cdm_hw, NULL, 0); Loading Loading @@ -1038,7 +1038,7 @@ int cam_hw_cdm_probe(struct platform_device *pdev) if (rc) { CAM_ERR(CAM_CDM, "CPAS stop failed"); cdm_hw->open_count--; goto cpas_unregister; goto disable_platform_resource; } rc = cam_cdm_intf_register_hw_cdm(cdm_hw_intf, Loading @@ -1046,7 +1046,7 @@ int cam_hw_cdm_probe(struct platform_device *pdev) if (rc) { CAM_ERR(CAM_CDM, "HW CDM Interface registration failed"); cdm_hw->open_count--; goto cpas_unregister; goto disable_platform_resource; } cdm_hw->open_count--; mutex_unlock(&cdm_hw->hw_mutex); Loading @@ -1063,6 +1063,10 @@ int cam_hw_cdm_probe(struct platform_device *pdev) cpas_stop: if (cam_cpas_stop(cdm_core->cpas_handle)) CAM_ERR(CAM_CDM, "CPAS stop failed"); disable_platform_resource: if (cam_soc_util_disable_platform_resource(&cdm_hw->soc_info, true, true)) CAM_ERR(CAM_CDM, "Disable platform resource failed"); cpas_unregister: if (cam_cpas_unregister_client(cdm_core->cpas_handle)) CAM_ERR(CAM_CDM, "CPAS unregister failed"); Loading
drivers/media/platform/msm/ais/cam_fd/fd_hw_mgr/fd_hw/cam_fd_hw_soc.c +15 −14 Original line number Diff line number Diff line /* Copyright (c) 2017-2019, The Linux Foundation. All rights reserved. /* Copyright (c) 2017-2020, The Linux Foundation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and Loading Loading @@ -148,6 +148,13 @@ int cam_fd_soc_enable_resources(struct cam_hw_soc_info *soc_info) struct cam_axi_vote axi_vote; int rc; rc = cam_soc_util_enable_platform_resource(soc_info, true, CAM_SVS_VOTE, true); if (rc) { CAM_ERR(CAM_FD, "Error enable platform failed, rc=%d", rc); goto end; } ahb_vote.type = CAM_VOTE_ABSOLUTE; ahb_vote.vote.level = CAM_SVS_VOTE; axi_vote.compressed_bw = 7200000; Loading @@ -156,22 +163,16 @@ int cam_fd_soc_enable_resources(struct cam_hw_soc_info *soc_info) rc = cam_cpas_start(soc_private->cpas_handle, &ahb_vote, &axi_vote); if (rc) { CAM_ERR(CAM_FD, "Error in CPAS START, rc=%d", rc); return -EFAULT; } rc = cam_soc_util_enable_platform_resource(soc_info, true, CAM_SVS_VOTE, true); if (rc) { CAM_ERR(CAM_FD, "Error enable platform failed, rc=%d", rc); goto stop_cpas; rc = -EFAULT; goto disable_platform_resource; } goto end; return rc; stop_cpas: if (cam_cpas_stop(soc_private->cpas_handle)) CAM_ERR(CAM_FD, "Error in CPAS STOP"); disable_platform_resource: if (cam_soc_util_disable_platform_resource(soc_info, true, true)) CAM_ERR(CAM_FD, "Disable platform resource failed"); end: return rc; } Loading
drivers/media/platform/msm/ais/cam_icp/icp_hw/a5_hw/a5_core.c +14 −10 Original line number Diff line number Diff line /* Copyright (c) 2017-2019, The Linux Foundation. All rights reserved. /* Copyright (c) 2017-2020, The Linux Foundation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and Loading Loading @@ -302,6 +302,12 @@ int cam_a5_init_hw(void *device_priv, return -EINVAL; } rc = cam_a5_enable_soc_resources(soc_info); if (rc) { CAM_ERR(CAM_ICP, "soc enable is failed: %d", rc); goto end; } cpas_vote.ahb_vote.type = CAM_VOTE_ABSOLUTE; cpas_vote.ahb_vote.vote.level = CAM_SVS_VOTE; cpas_vote.axi_vote.compressed_bw = CAM_ICP_A5_BW_BYTES_VOTE; Loading @@ -312,19 +318,17 @@ int cam_a5_init_hw(void *device_priv, &cpas_vote.ahb_vote, &cpas_vote.axi_vote); if (rc) { CAM_ERR(CAM_ICP, "cpass start failed: %d", rc); return rc; goto disable_soc_resources; } core_info->cpas_start = true; rc = cam_a5_enable_soc_resources(soc_info); if (rc) { CAM_ERR(CAM_ICP, "soc enable is failed: %d", rc); if (cam_cpas_stop(core_info->cpas_handle)) CAM_ERR(CAM_ICP, "cpas stop is failed"); else core_info->cpas_start = false; } goto end; disable_soc_resources: if (cam_a5_disable_soc_resources(soc_info)) CAM_ERR(CAM_ICP, "Disable soc resource failed"); end: return rc; } Loading
drivers/media/platform/msm/ais/cam_icp/icp_hw/bps_hw/bps_core.c +17 −12 Original line number Diff line number Diff line /* Copyright (c) 2017-2019, The Linux Foundation. All rights reserved. /* Copyright (c) 2017-2020, The Linux Foundation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and Loading Loading @@ -77,6 +77,14 @@ int cam_bps_init_hw(void *device_priv, return -EINVAL; } rc = cam_bps_enable_soc_resources(soc_info); if (rc) { CAM_ERR(CAM_ICP, "soc enable is failed: %d", rc); goto end; } else { core_info->clk_enable = true; } cpas_vote.ahb_vote.type = CAM_VOTE_ABSOLUTE; cpas_vote.ahb_vote.vote.level = CAM_SVS_VOTE; cpas_vote.axi_vote.compressed_bw = CAM_CPAS_DEFAULT_AXI_BW; Loading @@ -86,21 +94,18 @@ int cam_bps_init_hw(void *device_priv, &cpas_vote.ahb_vote, &cpas_vote.axi_vote); if (rc) { CAM_ERR(CAM_ICP, "cpass start failed: %d", rc); return rc; goto disable_soc_resources; } core_info->cpas_start = true; rc = cam_bps_enable_soc_resources(soc_info); if (rc) { CAM_ERR(CAM_ICP, "soc enable is failed: %d", rc); if (cam_cpas_stop(core_info->cpas_handle)) CAM_ERR(CAM_ICP, "cpas stop is failed"); else core_info->cpas_start = false; } else { core_info->clk_enable = true; } goto end; disable_soc_resources: if (cam_bps_disable_soc_resources(soc_info, true)) CAM_ERR(CAM_ICP, "Disable soc resource failed"); core_info->clk_enable = false; end: return rc; } Loading