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

Commit b31418ba authored by VijayaKumar T M's avatar VijayaKumar T M Committed by Suman Mukherjee
Browse files

msm: ispif: Adding csid version check



Check the csid version check before enabling camera
clocks to avoid device crash.

CRs-Fixed: 2189721
Change-Id: I1028bd776b6722190d0d981c3b63a9d60386152b
Signed-off-by: default avatarVijayaKumar T M <vtmuni@codeaurora.org>
Signed-off-by: default avatarSuman Mukherjee <sumam@codeaurora.org>
parent 0e827fea
Loading
Loading
Loading
Loading
+14 −3
Original line number Diff line number Diff line
/* Copyright (c) 2013-2017, The Linux Foundation. All rights reserved.
/* Copyright (c) 2013-2018, 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
@@ -43,6 +43,8 @@
#define ISPIF_TIMEOUT_SLEEP_US                1000
#define ISPIF_TIMEOUT_ALL_US               1000000

#define CSID_VERSION_V37                      0x30070000

#undef CDBG
#ifdef CONFIG_MSMB_CAMERA_DEBUG
#define CDBG(fmt, args...) pr_debug(fmt, ##args)
@@ -123,6 +125,11 @@ static int msm_ispif_reset_hw(struct ispif_device *ispif)

	ispif->clk_idx = 0;

	if (ispif->csid_version != CSID_VERSION_V37) {
		pr_err("%s:%d  error returning\n", __func__, __LINE__);
		return -EINVAL;
	}

	rc = msm_cam_clk_enable(&ispif->pdev->dev,
		ispif_8974_reset_clk_info, reset_clk,
		ARRAY_SIZE(ispif_8974_reset_clk_info), 1);
@@ -1255,8 +1262,12 @@ static int msm_ispif_init(struct ispif_device *ispif,
		goto error_ahb;
	}

	msm_ispif_reset_hw(ispif);

	rc = msm_ispif_reset_hw(ispif);
	if (rc < 0) {
		pr_err("%s:%d  msm_ispif_reset_hw failed\n", __func__,
			 __LINE__);
		goto error_ahb;
	}
	rc = msm_ispif_reset(ispif);
	if (rc == 0) {
		ispif->ispif_state = ISPIF_POWER_UP;