mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-09 05:39:54 -04:00
Merge "msm: camera: fd: skip halt and reset for session start" into camera-kernel.lnx.4.0
This commit is contained in:
commit
67f139bf4b
6 changed files with 26 additions and 8 deletions
|
|
@ -1,6 +1,6 @@
|
|||
// 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.
|
||||
*/
|
||||
|
||||
#include <linux/module.h>
|
||||
|
|
@ -1243,6 +1243,8 @@ static int cam_fd_mgr_hw_start(void *hw_mgr_priv, void *mgr_start_args)
|
|||
struct cam_fd_hw_mgr_ctx *hw_ctx;
|
||||
struct cam_fd_device *hw_device;
|
||||
struct cam_fd_hw_init_args hw_init_args;
|
||||
struct cam_hw_info *fd_hw;
|
||||
struct cam_fd_core *fd_core;
|
||||
|
||||
if (!hw_mgr_priv || !hw_mgr_start_args) {
|
||||
CAM_ERR(CAM_FD, "Invalid arguments %pK %pK",
|
||||
|
|
@ -1265,9 +1267,17 @@ static int cam_fd_mgr_hw_start(void *hw_mgr_priv, void *mgr_start_args)
|
|||
return rc;
|
||||
}
|
||||
|
||||
fd_hw = (struct cam_hw_info *)hw_device->hw_intf->hw_priv;
|
||||
fd_core = (struct cam_fd_core *)fd_hw->core_info;
|
||||
|
||||
if (hw_device->hw_intf->hw_ops.init) {
|
||||
hw_init_args.hw_ctx = hw_ctx;
|
||||
hw_init_args.ctx_hw_private = hw_ctx->ctx_hw_private;
|
||||
if (fd_core->hw_static_info->enable_errata_wa.skip_reset)
|
||||
hw_init_args.reset_required = false;
|
||||
else
|
||||
hw_init_args.reset_required = true;
|
||||
|
||||
rc = hw_device->hw_intf->hw_ops.init(
|
||||
hw_device->hw_intf->hw_priv, &hw_init_args,
|
||||
sizeof(hw_init_args));
|
||||
|
|
|
|||
|
|
@ -673,10 +673,12 @@ int cam_fd_hw_init(void *hw_priv, void *init_hw_args, uint32_t arg_size)
|
|||
fd_core->core_state = CAM_FD_CORE_STATE_IDLE;
|
||||
spin_unlock_irqrestore(&fd_core->spin_lock, flags);
|
||||
|
||||
rc = cam_fd_hw_reset(hw_priv, NULL, 0);
|
||||
if (rc) {
|
||||
CAM_ERR(CAM_FD, "Reset Failed, rc=%d", rc);
|
||||
goto disable_soc;
|
||||
if (init_args->reset_required) {
|
||||
rc = cam_fd_hw_reset(hw_priv, NULL, 0);
|
||||
if (rc) {
|
||||
CAM_ERR(CAM_FD, "Reset Failed, rc=%d", rc);
|
||||
goto disable_soc;
|
||||
}
|
||||
}
|
||||
|
||||
cam_fd_hw_util_enable_power_on_settings(fd_hw);
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
/* SPDX-License-Identifier: GPL-2.0-only */
|
||||
/*
|
||||
* Copyright (c) 2017-2018, The Linux Foundation. All rights reserved.
|
||||
* Copyright (c) 2017-2020, The Linux Foundation. All rights reserved.
|
||||
*/
|
||||
|
||||
#ifndef _CAM_FD_HW_CORE_H_
|
||||
|
|
@ -135,11 +135,13 @@ struct cam_fd_wrapper_regs {
|
|||
* @ro_mode_enable_always : Whether to enable ro mode always
|
||||
* @ro_mode_results_invalid : Whether results written directly into output
|
||||
* memory by HW are valid or not
|
||||
* @skip_reset : Whether to skip reset during init
|
||||
*/
|
||||
struct cam_fd_hw_errata_wa {
|
||||
bool single_irq_only;
|
||||
bool ro_mode_enable_always;
|
||||
bool ro_mode_results_invalid;
|
||||
bool skip_reset;
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -113,6 +113,7 @@ static int cam_fd_hw_dev_component_bind(struct device *dev,
|
|||
|
||||
memset(&init_args, 0x0, sizeof(init_args));
|
||||
memset(&deinit_args, 0x0, sizeof(deinit_args));
|
||||
init_args.reset_required = true;
|
||||
rc = cam_fd_hw_init(fd_hw, &init_args, sizeof(init_args));
|
||||
if (rc) {
|
||||
CAM_ERR(CAM_FD, "Failed to hw init, rc=%d", rc);
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
/* 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.
|
||||
*/
|
||||
|
||||
#ifndef _CAM_FD_HW_INTF_H_
|
||||
|
|
@ -158,10 +158,12 @@ struct cam_fd_hw_release_args {
|
|||
*
|
||||
* @hw_ctx : HW context for which init is requested
|
||||
* @ctx_hw_private : HW layer's private information specific to this hw context
|
||||
* @reset_required : Indicates if the reset is required during init or not
|
||||
*/
|
||||
struct cam_fd_hw_init_args {
|
||||
void *hw_ctx;
|
||||
void *ctx_hw_private;
|
||||
bool reset_required;
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
/* SPDX-License-Identifier: GPL-2.0-only */
|
||||
/*
|
||||
* Copyright (c) 2018, The Linux Foundation. All rights reserved.
|
||||
* Copyright (c) 2018-2020, The Linux Foundation. All rights reserved.
|
||||
*/
|
||||
|
||||
#ifndef _CAM_FD_HW_V501_H_
|
||||
|
|
@ -50,6 +50,7 @@ static struct cam_fd_hw_static_info cam_fd_wrapper200_core501_info = {
|
|||
.single_irq_only = true,
|
||||
.ro_mode_enable_always = true,
|
||||
.ro_mode_results_invalid = true,
|
||||
.skip_reset = true,
|
||||
},
|
||||
.irq_mask = CAM_FD_IRQ_TO_MASK(CAM_FD_IRQ_FRAME_DONE) |
|
||||
CAM_FD_IRQ_TO_MASK(CAM_FD_IRQ_HALT_DONE) |
|
||||
|
|
|
|||
Loading…
Reference in a new issue