Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 233d0230 authored by Tejas Prajapati's avatar Tejas Prajapati Committed by Gerrit - the friendly Code Review server
Browse files

msm: camera: fd: skip halt and reset for session start



Halt and reset can be applied only at probe time and flush
time to clean up the MSF interface.

CRs-Fixed: 2593760
Change-Id: I8a19a5a5f4a3b25ef5fe9c18a1e754529418c53c
Signed-off-by: default avatarTejas Prajapati <tpraja@codeaurora.org>
parent 2ee39250
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -1244,6 +1244,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",
@@ -1266,9 +1268,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));
+6 −4
Original line number Diff line number Diff line
@@ -747,11 +747,13 @@ 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);

	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);

+3 −1
Original line number Diff line number Diff line
/* 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;
};

/**
+2 −1
Original line number Diff line number Diff line
// 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.
 */

#include <linux/platform_device.h>
@@ -110,6 +110,7 @@ static int cam_fd_hw_dev_probe(struct platform_device *pdev)

	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);
+2 −0
Original line number Diff line number Diff line
@@ -162,10 +162,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;
};

/**
Loading